From 953133e99e1175a544df05a95073de4bc6b74f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Wed, 4 Mar 2015 15:31:57 +0000 Subject: [PATCH] added date/time to attachment file names, so the images are sorted correctly --- src/commands.hxx | 14 ++++++++++---- src/testgui.ui | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/commands.hxx b/src/commands.hxx index e11b595..3d1c965 100644 --- a/src/commands.hxx +++ b/src/commands.hxx @@ -215,9 +215,12 @@ class Screenshot: public Command { throw DirectoryCannotBeCreated(target); QCoreApplication::processEvents(); QString filename(target+QDir::separator()+ - QString("%1-%2-%3.html") + QString("%4-%1-%2-%3.html") .arg(base) - .arg(line, 4, 10, QChar('0')).arg(name)); + .arg(line, 4, 10, QChar('0')) + .arg(name) + .arg(QDateTime::currentDateTime() + .toString("yyyyMMddHHmmss"))); QFile file(filename); if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) throw CannotWriteSouceHTML(filename); @@ -240,9 +243,12 @@ class Screenshot: public Command { throw DirectoryCannotBeCreated(target); QCoreApplication::processEvents(); QString filename(target+QDir::separator()+ - QString("%1-%2-%3.png") + QString("%4-%1-%2-%3.png") .arg(base) - .arg(line, 4, 10, QChar('0')).arg(name)); + .arg(line, 4, 10, QChar('0')) + .arg(name) + .arg(QDateTime::currentDateTime() + .toString("yyyyMMddHHmmss"))); if (!image.save(filename)) throw CannotWriteScreenshot(filename); return QDir(filename).absolutePath(); } diff --git a/src/testgui.ui b/src/testgui.ui index e9219e6..8383ce6 100644 --- a/src/testgui.ui +++ b/src/testgui.ui @@ -41,7 +41,7 @@ - http://web9t.int.swisssign.net/joomla + https://