aboutsummaryrefslogtreecommitdiffstats
path: root/attachments.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'attachments.cpp')
-rw-r--r--attachments.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/attachments.cpp b/attachments.cpp
index f9d95aa..7480429 100644
--- a/attachments.cpp
+++ b/attachments.cpp
@@ -135,12 +135,12 @@ void Attachments::saveByteArrayToFile(QByteArray outBuffer, QString filename)
*/
void Attachments::openFile() {
- QString tmpPath = qApp->applicationDirPath() + "/attachments/";
+ QString attachmentDir = qApp->applicationDirPath() + "/attachments/";
//QDir p = QDir(qApp->applicationDirPath() + "/attachments/");
- //if(!p.exists()) {
- // qDebug() << "creating " << p;
- // p.mkpath("/attachments/");
- //}
+ if(!QDir(attachmentDir).exists()) {
+ qDebug() << "creating " << attachmentDir;
+ QDir().mkpath(attachmentDir);
+ }
QModelIndexList indexes = tableView->selectionModel()->selection().indexes();
MimePart mp = table->getMimePart(indexes.at(0).row());
@@ -152,7 +152,7 @@ void Attachments::openFile() {
qDebug() << "file: " << filename;
filename.chop(1);
filename.remove(0, 1);
- filename.prepend(tmpPath);
+ filename.prepend(attachmentDir);
qDebug() << "file: " << filename;
QByteArray outBuffer = QByteArray::fromBase64(mp.body);