From 6ecd0f1ead9262a7de83f6e58c4ba2e9fcaef0eb Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 31 Mar 2018 09:06:08 +0200 Subject: Search database during FSWidget::gatherData First, look for md5 in files and files_origin. Then look for the complete filename in files, and finally for the filename without suffix in files_origin. If we have a match, note it in the new column "Presence". Matches from files are displayed green, matches from files_orgin blue. This implementation tries to execute as few QSqlQueries as possible by using goto for performance. We only want to know if the file is somewhere present, so skip the remaining queries once we have a match. --- fswidget.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fswidget.h') diff --git a/fswidget.h b/fswidget.h index e711b09..0683602 100644 --- a/fswidget.h +++ b/fswidget.h @@ -2,6 +2,7 @@ #define FSWIDGET_H #include +#include class QComboBox; class QTreeView; @@ -22,6 +23,7 @@ class FSWidget : public QWidget { void insertItem(QComboBox *cb, const QString &text); void removeItem(QComboBox *cb); void gatherData(const QString &curDir); + int queryCount(QSqlQuery &q, const QString &arg) const; private: void setupWidget(); -- cgit v1.2.3-70-g09d2