Diffstat (limited to 'core/applets/screenshotapplet') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/applets/screenshotapplet/screenshot.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/core/applets/screenshotapplet/screenshot.cpp b/core/applets/screenshotapplet/screenshot.cpp index d70b57c..20e8554 100644 --- a/core/applets/screenshotapplet/screenshot.cpp +++ b/core/applets/screenshotapplet/screenshot.cpp | |||
@@ -14,6 +14,8 @@ | |||
14 | 14 | ||
15 | #include "screenshot.h" | 15 | #include "screenshot.h" |
16 | #include <qapplication.h> | 16 | #include <qapplication.h> |
17 | #include <stdlib.h> | ||
18 | |||
17 | 19 | ||
18 | #include <qpe/resource.h> | 20 | #include <qpe/resource.h> |
19 | #include <qpe/qpeapplication.h> | 21 | #include <qpe/qpeapplication.h> |
@@ -23,7 +25,7 @@ | |||
23 | #include <qpe/applnk.h> | 25 | #include <qpe/applnk.h> |
24 | #include <qpe/config.h> | 26 | #include <qpe/config.h> |
25 | 27 | ||
26 | 28 | #include <qdir.h> | |
27 | #include <qfileinfo.h> | 29 | #include <qfileinfo.h> |
28 | #include <qpoint.h> | 30 | #include <qpoint.h> |
29 | #include <qpushbutton.h> | 31 | #include <qpushbutton.h> |
@@ -127,7 +129,13 @@ void ScreenshotControl::savePixmap() | |||
127 | QString fileName = "sc_"+TimeString::dateString( QDateTime::currentDateTime(),false,true); | 129 | QString fileName = "sc_"+TimeString::dateString( QDateTime::currentDateTime(),false,true); |
128 | fileName.replace(QRegExp("'"),""); fileName.replace(QRegExp(" "),"_"); fileName.replace(QRegExp(":"),"."); fileName.replace(QRegExp(","),""); | 130 | fileName.replace(QRegExp("'"),""); fileName.replace(QRegExp(" "),"_"); fileName.replace(QRegExp(":"),"."); fileName.replace(QRegExp(","),""); |
129 | 131 | ||
130 | fileName="/home/root/Documents/image/png/"+fileName+".png"; | 132 | QString dirName = QDir::homeDirPath()+"/Documents/image/png/"; |
133 | if( !QDir( dirName).exists() ) { | ||
134 | qDebug("making dir "+dirName); | ||
135 | QString msg = "mkdir -p "+dirName; | ||
136 | system(msg.latin1()); | ||
137 | } | ||
138 | fileName=dirName+fileName+".png"; | ||
131 | lnk.setFile(fileName); //sets File property | 139 | lnk.setFile(fileName); //sets File property |
132 | snapshot.save( fileName,"PNG"); | 140 | snapshot.save( fileName,"PNG"); |
133 | qDebug("saving file "+fileName); | 141 | qDebug("saving file "+fileName); |