summaryrefslogtreecommitdiffstats
path: root/logic/lists/ScreenshotList.cpp
diff options
context:
space:
mode:
authorrobotbrain <robotbrainify@gmail.com>2014-02-23 19:45:59 -0500
committerrobotbrain <robotbrainify@gmail.com>2014-02-23 19:48:00 -0500
commit5e33da258c3b5159dba854eb4792d0852a1ca363 (patch)
tree62f8819b0974c415e883d43eefb0ffb2fff73702 /logic/lists/ScreenshotList.cpp
parent4a77524b059c12165e20b38de6c0d4ed08e56419 (diff)
downloadMultiMC-5e33da258c3b5159dba854eb4792d0852a1ca363.tar
MultiMC-5e33da258c3b5159dba854eb4792d0852a1ca363.tar.gz
MultiMC-5e33da258c3b5159dba854eb4792d0852a1ca363.tar.lz
MultiMC-5e33da258c3b5159dba854eb4792d0852a1ca363.tar.xz
MultiMC-5e33da258c3b5159dba854eb4792d0852a1ca363.zip
Close to finished. Need to fix the upload part. Viewing works (in grayscale)
Diffstat (limited to 'logic/lists/ScreenshotList.cpp')
-rw-r--r--logic/lists/ScreenshotList.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/logic/lists/ScreenshotList.cpp b/logic/lists/ScreenshotList.cpp
index ff37a092..e955f121 100644
--- a/logic/lists/ScreenshotList.cpp
+++ b/logic/lists/ScreenshotList.cpp
@@ -1,6 +1,6 @@
#include "ScreenshotList.h"
#include "QDir"
-#include "QPixmap"
+#include "QIcon"
ScreenshotList::ScreenshotList(BaseInstance *instance, QObject *parent)
: QAbstractListModel(parent), m_instance(instance)
@@ -20,11 +20,7 @@ QVariant ScreenshotList::data(const QModelIndex &index, int role) const
switch (role)
{
case Qt::DecorationRole:
- {
- QPixmap map;
- map.loadFromData(m_screenshots.at(index.row())->file);
- return map;
- }
+ return QIcon(m_screenshots.at(index.row())->file);
case Qt::DisplayRole:
return m_screenshots.at(index.row())->timestamp;
case Qt::ToolTipRole:
@@ -43,7 +39,7 @@ QVariant ScreenshotList::headerData(int section, Qt::Orientation orientation, in
Qt::ItemFlags ScreenshotList::flags(const QModelIndex &index) const
{
- return Qt::NoItemFlags;
+ return Qt::ItemIsSelectable;
}
Task *ScreenshotList::load()
@@ -73,7 +69,7 @@ void ScreenshotLoadTask::executeTask()
{
ScreenShot *shot = new ScreenShot();
shot->timestamp = file.left(file.length() - 4);
- shot->file = QFile(file).readAll();
+ shot->file = dir.absoluteFilePath(file);
m_results.append(shot);
}
m_list->loadShots(m_results);