summaryrefslogtreecommitdiffstats
path: root/logic/lists
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2014-02-24 10:34:51 +0100
committerJan Dalheimer <jan@dalheimer.de>2014-02-24 10:34:51 +0100
commita8811a27f78698f1ab2acad47e90f3b16274e221 (patch)
tree4986fed4712433484597e4a63a022ee5c989c337 /logic/lists
parent226c1bdae5ec615381965b6731f6496dffa3299e (diff)
downloadMultiMC-a8811a27f78698f1ab2acad47e90f3b16274e221.tar
MultiMC-a8811a27f78698f1ab2acad47e90f3b16274e221.tar.gz
MultiMC-a8811a27f78698f1ab2acad47e90f3b16274e221.tar.lz
MultiMC-a8811a27f78698f1ab2acad47e90f3b16274e221.tar.xz
MultiMC-a8811a27f78698f1ab2acad47e90f3b16274e221.zip
Working screenshot upload
Diffstat (limited to 'logic/lists')
-rw-r--r--logic/lists/ScreenshotList.cpp7
-rw-r--r--logic/lists/ScreenshotList.h4
2 files changed, 6 insertions, 5 deletions
diff --git a/logic/lists/ScreenshotList.cpp b/logic/lists/ScreenshotList.cpp
index 0565d0a4..6969549c 100644
--- a/logic/lists/ScreenshotList.cpp
+++ b/logic/lists/ScreenshotList.cpp
@@ -1,4 +1,5 @@
#include "ScreenshotList.h"
+
#include <QDir>
#include <QIcon>
@@ -22,9 +23,9 @@ QVariant ScreenshotList::data(const QModelIndex &index, int role) const
case Qt::DecorationRole:
return QIcon(m_screenshots.at(index.row())->file);
case Qt::DisplayRole:
- return m_screenshots.at(index.row())->timestamp;
+ return m_screenshots.at(index.row())->timestamp.toString("yyyy-MM-dd HH:mm:ss");
case Qt::ToolTipRole:
- return m_screenshots.at(index.row())->timestamp;
+ return m_screenshots.at(index.row())->timestamp.toString("yyyy-MM-dd HH:mm:ss");
case Qt::TextAlignmentRole:
return (int)(Qt::AlignHCenter | Qt::AlignVCenter);
default:
@@ -68,7 +69,7 @@ void ScreenshotLoadTask::executeTask()
for (auto file : dir.entryList())
{
ScreenShot *shot = new ScreenShot();
- shot->timestamp = file.left(file.length() - 4);
+ shot->timestamp = QDateTime::fromString(file, "yyyy-MM-dd_HH.mm.ss.png");
shot->file = dir.absoluteFilePath(file);
m_results.append(shot);
}
diff --git a/logic/lists/ScreenshotList.h b/logic/lists/ScreenshotList.h
index 08c968f1..dee74807 100644
--- a/logic/lists/ScreenshotList.h
+++ b/logic/lists/ScreenshotList.h
@@ -7,10 +7,10 @@
class ScreenShot
{
public:
- QString timestamp;
+ QDateTime timestamp;
QString file;
QString url;
- int imgurIndex;
+ QString imgurIndex;
};
class ScreenshotList : public QAbstractListModel