Improved Search Dialog (Patch from AsamK)

-don't add friend sources count to anonymous count each time a result for the same file is received!, this could lead to enormously large sources numbers
  -don't readd search in summary list if it was already removed by the user
  -don't clear the filter when new search results are added
  -when using the file name filter only show result from the current search, not also from previous searches
  -fixed adding only file types which were searched for, for this I created a new hidden column in summary list to store the file type
  -fixed sorting by file size/age, pad string with '0' instead of ' ' Search feature: a quirk I've found
  -decrease gui hanging:
     -when adding search results temporarily disable sorting
     -only add 250 instead of 500 items in one go
     -don't call selectSearchResults() for each item added to the result list; instead call hideOrShowSearchResult() which only sets the hidden status of the added item, not the complete list
     -replace std::string with QString, removes unnecessary conversions


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5093 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2012-04-12 19:30:41 +00:00
parent a1f6f0ad8c
commit 2f749e2bf5
2 changed files with 158 additions and 216 deletions

View file

@ -80,24 +80,24 @@ private slots:
void advancedSearch(Expression*);
void selectSearchResults(int index = -1);
void hideOrShowSearchResult(QTreeWidgetItem* resultItem, QString currentSearchId = QString(), int fileTypeIndex = -1);
void sendLinkTo();
void onComboIndexChanged(int index);
void selectFileType(int index);
void filterColumnChanged();
void filterItems(const QString &text);
void filterItems();
private:
/** render the results to the tree widget display */
void initSearchResult(const std::string& txt,qulonglong searchId, bool advanced) ;
void resultsToTree(std::string,qulonglong searchId, const std::list<DirDetails>&);
void insertFile(const std::string& txt,qulonglong searchId, const FileDetail& file, int searchType = ANONYMOUS_SEARCH) ;
void insertDirectory(const std::string &txt, qulonglong searchId, const DirDetails &dir, QTreeWidgetItem *item);
void insertDirectory(const std::string &txt, qulonglong searchId, const DirDetails &dir);
void setIconAndType(QTreeWidgetItem *item, const QString& filename);
void downloadDirectory(const QTreeWidgetItem *item, const QString &base);
void getSourceFriendsForHash(const std::string& hash,std::list<std::string>& srcIds);
void initSearchResult(const QString& txt,qulonglong searchId, int fileType, bool advanced) ;
void resultsToTree(const QString& txt,qulonglong searchId, const std::list<DirDetails>&);
void insertFile(qulonglong searchId,const FileDetail &file, int searchType = ANONYMOUS_SEARCH) ;
void insertDirectory(const QString &txt, qulonglong searchId, const DirDetails &dir, QTreeWidgetItem *item);
void insertDirectory(const QString &txt, qulonglong searchId, const DirDetails &dir);
void setIconAndType(QTreeWidgetItem *item, const QString& filename);
void downloadDirectory(const QTreeWidgetItem *item, const QString &base);
void getSourceFriendsForHash(const std::string& hash,std::list<std::string>& srcIds);
/** the advanced search dialog instance */
AdvancedSearchDialog * advSearchDialog;