diff --git a/retroshare-gui/src/gui/RemoteDirModel.cpp b/retroshare-gui/src/gui/RemoteDirModel.cpp index 59e908cb4..5ee6dc1e5 100644 --- a/retroshare-gui/src/gui/RemoteDirModel.cpp +++ b/retroshare-gui/src/gui/RemoteDirModel.cpp @@ -1010,16 +1010,6 @@ void RetroshareDirModel::postMods() beginResetModel(); #endif -// QModelIndexList piList = persistentIndexList(); -// QModelIndexList empty; -// for (int i = 0; i < piList.size(); ++i) { -// empty.append(QModelIndex()); -// } -// changePersistentIndexList(piList, empty); - - /* Clear caches */ - //mCache.clear(); - #ifdef RDM_DEBUG std::cerr << "RetroshareDirModel::postMods()" << std::endl; #endif @@ -1059,30 +1049,6 @@ bool RetroshareDirModel::requestDirDetails(void *ref, bool remote,DirDetails& d) return false ; } -// const QMap::const_iterator it = mCache.constFind(ref); -// if (it != mCache.constEnd()) { -// /* Details found in cache */ -// return &it.value(); -// } -// -//#warning this is terrible! A vector in a std::map will keep being copied and create a lot of CPU overload. Use a pointer instead. -// /* Get details from the lib */ -// -// if (rsFiles->RequestDirDetails(ref, details, flags)) { -// /* Convert std::list to std::vector for fast access with index */ -// std::list::const_iterator childIt; -// for (childIt = details.children.begin(); childIt != details.children.end(); ++childIt) { -// details.childrenVector.push_back(*childIt); -// } -// -// /* Add to cache, must cast to none const */ -// const QMap::iterator it1 = ((QMap*) &mCache)->insert(ref, details); -// return &it1.value(); -// } -// -// /* No details found */ -// return NULL; -//} void RetroshareDirModel::createCollectionFile(QWidget *parent, const QModelIndexList &list) { diff --git a/retroshare-gui/src/gui/RemoteDirModel.h b/retroshare-gui/src/gui/RemoteDirModel.h index 2e8a9ef0d..5fd61b820 100644 --- a/retroshare-gui/src/gui/RemoteDirModel.h +++ b/retroshare-gui/src/gui/RemoteDirModel.h @@ -146,7 +146,6 @@ class RetroshareDirModel : public QAbstractItemModel }; bool RemoteMode; - QMap mCache; mutable int nIndex; mutable std::vector indexSet; diff --git a/retroshare-gui/src/gui/SharedFilesDialog.cpp b/retroshare-gui/src/gui/SharedFilesDialog.cpp index fb68cba3d..379645da3 100644 --- a/retroshare-gui/src/gui/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/SharedFilesDialog.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -583,6 +584,8 @@ void SharedFilesDialog::copyLink (const QModelIndexList& lst, bool remote) QList urls ; + bool has_unhashed_files = false; + for (int i = 0, n = dirVec.size(); i < n; ++i) { const DirDetails& details = dirVec[i]; @@ -600,6 +603,12 @@ void SharedFilesDialog::copyLink (const QModelIndexList& lst, bool remote) if (!rsFiles->RequestDirDetails(dirStub.ref, details, flags) || details.type != DIR_TYPE_FILE) continue; + if(details.hash.isNull()) + { + has_unhashed_files = true; + continue; + } + RetroShareLink link; if (link.createFile(QString::fromUtf8(details.name.c_str()), details.count, details.hash.toStdString().c_str())) { urls.push_back(link) ; @@ -608,6 +617,11 @@ void SharedFilesDialog::copyLink (const QModelIndexList& lst, bool remote) } else { + if(details.hash.isNull()) + { + has_unhashed_files = true; + continue; + } RetroShareLink link; if (link.createFile(QString::fromUtf8(details.name.c_str()), details.count, details.hash.toStdString().c_str())) { urls.push_back(link) ; @@ -615,6 +629,9 @@ void SharedFilesDialog::copyLink (const QModelIndexList& lst, bool remote) } } RSLinkClipboard::copyLinks(urls) ; + + if(has_unhashed_files) + QMessageBox::warning(NULL,tr("Some files have been omitted"),tr("Some files have been ommitted because their hash is not available yet.")) ; } void SharedFilesDialog::copyLink() diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index 30c4412fa..b97ddaac8 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -277,7 +277,7 @@ void ChatLobbyDialog::voteParticipant() return ; } - RsReputations::Opinion op(act->data().toUInt()) ; + RsReputations::Opinion op = RsReputations::Opinion(act->data().toUInt()) ; for (item = selectedItems.begin(); item != selectedItems.end(); ++item) {