From c9e0f1742a44d3dd7ab283d3ad9c66890ece78e0 Mon Sep 17 00:00:00 2001 From: nils Date: Sat, 28 Aug 2010 10:35:42 +0000 Subject: create attachments dir if not existing git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@369 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- attachments.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'attachments.cpp') 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); -- cgit v1.2.3