Feature: user can set commands fo opening shared files with some external applications. First revision. TODO: test on Windows, add additional functionality(see trac)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1119 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
beardog_uk 2009-04-07 08:08:03 +00:00
parent ab43d876c8
commit 22c2974466
13 changed files with 1171 additions and 226 deletions

View file

@ -231,6 +231,14 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
}
}*/
#endif
if (role == RemoteDirModel::FileNameRole)
{
FileInfo finfo;
rsFiles->FileDetails(details.hash, 0, finfo);
return QString::fromStdString(finfo.path) ;
}
if (role == Qt::DecorationRole)
{
@ -1043,6 +1051,31 @@ QStringList RemoteDirModel::mimeTypes () const
return list;
}
//============================================================================
bool
RemoteDirModel::isDir ( const QModelIndex & index ) const
{
//if (RemoteMode) // only local files can be opened
// return ;
void *ref = index.internalPointer();
if (!ref)
return false;
DirDetails details;
uint32_t flags = DIR_FLAGS_DETAILS;
if (RemoteMode)
flags |= DIR_FLAGS_REMOTE;
else
flags |= DIR_FLAGS_LOCAL;
if (!rsFiles->RequestDirDetails(ref, details, flags))
{
return false;//not good, but....
}
return (details.type == DIR_TYPE_DIR) ;
}