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 @@ -16,2 +16,4 @@ #include <qapplication.h> +#include <stdlib.h> + @@ -25,3 +27,3 @@ - +#include <qdir.h> #include <qfileinfo.h> @@ -129,3 +131,9 @@ void ScreenshotControl::savePixmap() - fileName="/home/root/Documents/image/png/"+fileName+".png"; + QString dirName = QDir::homeDirPath()+"/Documents/image/png/"; + if( !QDir( dirName).exists() ) { + qDebug("making dir "+dirName); + QString msg = "mkdir -p "+dirName; + system(msg.latin1()); + } + fileName=dirName+fileName+".png"; lnk.setFile(fileName); //sets File property |