diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-07-06 11:15:15 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-07-06 11:15:15 +0200 |
commit | cc499488dbab9167870e6088f9a1793f95894c79 (patch) | |
tree | d6efb25086f4c2c6cb3c0a3dc8ad5a5a80985286 /gui/pages | |
parent | a218d7b7f6a9e30671be72b756104302637eb33d (diff) | |
download | MultiMC-cc499488dbab9167870e6088f9a1793f95894c79.tar MultiMC-cc499488dbab9167870e6088f9a1793f95894c79.tar.gz MultiMC-cc499488dbab9167870e6088f9a1793f95894c79.tar.lz MultiMC-cc499488dbab9167870e6088f9a1793f95894c79.tar.xz MultiMC-cc499488dbab9167870e6088f9a1793f95894c79.zip |
Fix liteloader, some cleanups.
Diffstat (limited to 'gui/pages')
-rw-r--r-- | gui/pages/ModFolderPage.cpp | 1 | ||||
-rw-r--r-- | gui/pages/ScreenshotsPage.cpp | 61 | ||||
-rw-r--r-- | gui/pages/VersionPage.cpp | 1 |
3 files changed, 1 insertions, 62 deletions
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> |