aboutsummaryrefslogtreecommitdiffstats
path: root/attachments.cpp
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2010-08-28 10:35:42 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2010-08-28 10:35:42 +0000
commitc9e0f1742a44d3dd7ab283d3ad9c66890ece78e0 (patch)
tree43a9ad94a0ecbfd34b3da8b9c55d97682cc28277 /attachments.cpp
parentcorrected typo in settings-dialog and updated german language file (diff)
downloadgpg4usb-c9e0f1742a44d3dd7ab283d3ad9c66890ece78e0.tar.gz
gpg4usb-c9e0f1742a44d3dd7ab283d3ad9c66890ece78e0.zip
create attachments dir if not existing
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@369 34ebc366-c3a9-4b3c-9f84-69acf7962910
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);