diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/dialogs/VersionSelectDialog.cpp | 2 | ||||
-rw-r--r-- | gui/groupview/GroupView.cpp | 12 | ||||
-rw-r--r-- | gui/pages/ModFolderPage.cpp | 1 | ||||
-rw-r--r-- | gui/pages/ScreenshotsPage.cpp | 61 | ||||
-rw-r--r-- | gui/pages/VersionPage.cpp | 1 |
5 files changed, 7 insertions, 70 deletions
diff --git a/gui/dialogs/VersionSelectDialog.cpp b/gui/dialogs/VersionSelectDialog.cpp index fd8b569d..2745eccc 100644 --- a/gui/dialogs/VersionSelectDialog.cpp +++ b/gui/dialogs/VersionSelectDialog.cpp @@ -18,8 +18,6 @@ #include <QHeaderView> -#include <QDebug> - #include <gui/dialogs/ProgressDialog.h> #include "gui/Platform.h" diff --git a/gui/groupview/GroupView.cpp b/gui/groupview/GroupView.cpp index 7094b34c..69a06fd3 100644 --- a/gui/groupview/GroupView.cpp +++ b/gui/groupview/GroupView.cpp @@ -3,7 +3,6 @@ #include <QPainter> #include <QApplication> #include <QtMath> -#include <QDebug> #include <QMouseEvent> #include <QListView> #include <QPersistentModelIndex> @@ -12,6 +11,7 @@ #include <QScrollBar> #include "Group.h" +#include "logger/QsLog.h" template <typename T> bool listsIntersect(const QList<T> &l1, const QList<T> t2) { @@ -917,10 +917,10 @@ QModelIndex GroupView::moveCursor(QAbstractItemView::CursorAction cursorAction, auto current = currentIndex(); if(!current.isValid()) { - qDebug() << "model row: invalid"; + QLOG_DEBUG() << "model row: invalid"; return current; } - qDebug() << "model row: " << current.row(); + QLOG_DEBUG() << "model row: " << current.row(); auto cat = category(current); int i = m_groups.indexOf(cat); if(i >= 0) @@ -934,11 +934,11 @@ QModelIndex GroupView::moveCursor(QAbstractItemView::CursorAction cursorAction, break; beginning_row += group->numRows(); } - qDebug() << "category: " << real_group->text; + QLOG_DEBUG() << "category: " << real_group->text; QPair<int, int> pos = categoryInternalPosition(current); int row = beginning_row + pos.second; - qDebug() << "row: " << row; - qDebug() << "column: " << pos.first; + QLOG_DEBUG() << "row: " << row; + QLOG_DEBUG() << "column: " << pos.first; } return current; } diff --git a/gui/pages/ModFolderPage.cpp b/gui/pages/ModFolderPage.cpp index 2035e57a..7e0eea52 100644 --- a/gui/pages/ModFolderPage.cpp +++ b/gui/pages/ModFolderPage.cpp @@ -18,7 +18,6 @@ #include <pathutils.h> #include <QFileDialog> #include <QMessageBox> -#include <QDebug> #include <QEvent> #include <QKeyEvent> #include <QDesktopServices> diff --git a/gui/pages/ScreenshotsPage.cpp b/gui/pages/ScreenshotsPage.cpp index f3ec0c1d..466b3c19 100644 --- a/gui/pages/ScreenshotsPage.cpp +++ b/gui/pages/ScreenshotsPage.cpp @@ -21,66 +21,7 @@ #include "logic/screenshots/ImgurAlbumCreation.h" #include "logic/tasks/SequentialTask.h" -template <typename K, typename V> -class RWStorage -{ -public: - void add(K key, V value) - { - QWriteLocker l(&lock); - cache[key] = value; - stale_entries.remove(key); - } - V get(K key) - { - QReadLocker l(&lock); - if(cache.contains(key)) - { - return cache[key]; - } - else return V(); - } - bool get(K key, V& value) - { - QReadLocker l(&lock); - if(cache.contains(key)) - { - value = cache[key]; - return true; - } - else return false; - } - bool has(K key) - { - QReadLocker l(&lock); - return cache.contains(key); - } - bool stale(K key) - { - QReadLocker l(&lock); - if(!cache.contains(key)) - return true; - return stale_entries.contains(key); - } - void setStale(K key) - { - QReadLocker l(&lock); - if(cache.contains(key)) - { - stale_entries.insert(key); - } - } - void clear() - { - QWriteLocker l(&lock); - cache.clear(); - } -private: - QReadWriteLock lock; - QMap<K, V> cache; - QSet<K> stale_entries; -}; - +#include "logic/RWStorage.h" typedef RWStorage<QString, QIcon> SharedIconCache; typedef std::shared_ptr<SharedIconCache> SharedIconCachePtr; diff --git a/gui/pages/VersionPage.cpp b/gui/pages/VersionPage.cpp index d3df5b46..ec83ef87 100644 --- a/gui/pages/VersionPage.cpp +++ b/gui/pages/VersionPage.cpp @@ -18,7 +18,6 @@ #include <pathutils.h> #include <QFileDialog> #include <QMessageBox> -#include <QDebug> #include <QEvent> #include <QKeyEvent> |