From 7f3d33ab7e02ab34efb2e0db9a7a912c66de7eef Mon Sep 17 00:00:00 2001 From: Arno Date: Wed, 3 Jan 2018 12:14:37 +0100 Subject: Check Present attribute on cached data Well, we cannot cache the Present attribute, because it can change without our knowledge, when a movie file has been archived in the meantime. Leave it in CachedFileData for now, but check it when we found a cache entry. While working on this, I realized that the Origin attribute is pretty much useless, at least in its current form. countMd5() already checks the origin table, and everything else was guesswork on the filename. Also, it was an extra, quite expensive SQL-Query for every video file, so remove it. --- filewidget.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'filewidget.h') diff --git a/filewidget.h b/filewidget.h index 0d66d9d..131f187 100644 --- a/filewidget.h +++ b/filewidget.h @@ -30,7 +30,7 @@ class QStandardItem; class FileWidget : public QWidget { Q_OBJECT public: - enum FileAttrs { NotPresent = 0, Present = 1, NoVideo = 2, ParentDir = 3, Directory = 4, Origin = 5 }; + enum FileAttrs { NotPresent = 0, Present = 1, NoVideo = 2, ParentDir = 3, Directory = 4 }; enum CustomRoles { AttrsRole = Qt::UserRole + 1, FullPathRole = Qt::UserRole + 2, DurationRole = Qt::UserRole + 3, MD5SumRole = Qt::UserRole + 4, SecondsRole = Qt::UserRole + 5, SizeRole = Qt::UserRole + 6 }; enum { ColumnCount = 7 }; enum Columns { IconColumn = 0, NameColumn = 1, CopiedColumn = 2, MimeColumn = 3, DurationColumn = 4, SizeColumn = 5, Md5Column = 6 }; @@ -83,7 +83,6 @@ class FileWidget : public QWidget { void createActions(); void fileData(const QString &fullPath, const QString &md5); int md5Count(const QString &md5); - bool haveOrigin(const QString filename); void readHeaderData(); void writeHeaderData(); void readSettings(); @@ -103,7 +102,6 @@ class FileWidget : public QWidget { QSqlDatabase mDb; QSqlQuery mQOrigin; QSqlQuery mQFiles; - QSqlQuery mQSimilar; QMimeData *mMimeData; QAction *mSelDirA; QAction *mRefreshA; -- cgit v1.2.3-70-g09d2