summaryrefslogtreecommitdiffstats
path: root/logic/lists/ScreenshotList.cpp
diff options
context:
space:
mode:
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);