ported branch v0.5.0 commits 2623, 2624, 2626, 2633, 2634, 2643, 2644, 2646, 2651 and 2654 to trunk

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2660 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-03-28 20:46:45 +00:00
parent 12536efd16
commit 08065b4298
22 changed files with 264 additions and 299 deletions

View file

@ -1025,7 +1025,8 @@ void RemoteDirModel::openSelected(QModelIndexList qmil, bool openFolder)
std::list<DirDetails>::iterator it;
getFileInfoFromIndexList(qmil, files_info);
for (it = files_info.begin(); it != files_info.end(); it++) {
for (it = files_info.begin(); it != files_info.end(); it++)
{
if ((*it).type & DIR_TYPE_PERSON) continue;
std::string fullpath, name;
@ -1039,25 +1040,19 @@ void RemoteDirModel::openSelected(QModelIndexList qmil, bool openFolder)
name = fullpath;
}
if (!openFolder) {
if ((*it).type & DIR_TYPE_FILE) {
QDesktopServices::openUrl(QUrl::fromLocalFile(name.c_str()));
}
} else {
if (dirs_to_open.end() == std::find(dirs_to_open.begin(), dirs_to_open.end(), fullpath)) {
dirs_to_open.push_back(fullpath);
}
}
std::cerr << "Opennign this file: " << name << std::endl ;
QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromUtf8(name.c_str(),name.length())));
}
if (openFolder) {
std::list<std::string>::iterator dit;
for (dit = dirs_to_open.begin(); dit != dirs_to_open.end(); dit++)
{
std::cerr << "Opennign this folder: " << (*dit).c_str() << std::endl ;
QDesktopServices::openUrl(QUrl::fromLocalFile((*dit).c_str()));
}
}
// if (openFolder) {
// std::list<std::string>::iterator dit;
// for (dit = dirs_to_open.begin(); dit != dirs_to_open.end(); dit++)
// {
// std::cerr << "Opennign this folder: " << (*dit).c_str() << std::endl ;
// QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromUtf8((*dit).c_str())));
// }
// }
#ifdef RDM_DEBUG
std::cerr << "::::::::::::Done RemoteDirModel::openSelected()" << std::endl;