summaryrefslogtreecommitdiffstats
path: root/fswidget.h
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2018-03-31 09:06:08 +0200
committerArno <arno@disconnect.de>2018-03-31 09:06:08 +0200
commit6ecd0f1ead9262a7de83f6e58c4ba2e9fcaef0eb (patch)
treeb9c176be4fc87813da3627ff19f0c8008141b1aa /fswidget.h
parentcb9e431e305c9417fe4efa38263871464f71d62e (diff)
downloadSheMov-6ecd0f1ead9262a7de83f6e58c4ba2e9fcaef0eb.tar.gz
SheMov-6ecd0f1ead9262a7de83f6e58c4ba2e9fcaef0eb.tar.bz2
SheMov-6ecd0f1ead9262a7de83f6e58c4ba2e9fcaef0eb.zip
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.
Diffstat (limited to 'fswidget.h')
-rw-r--r--fswidget.h2
1 files changed, 2 insertions, 0 deletions
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 <QWidget>
+#include <QSqlQuery>
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();