From 1aa8a43e1e89f693a1603b5b0f8ec36315b8291c Mon Sep 17 00:00:00 2001 From: PKEv Date: Tue, 26 May 2015 01:33:10 +0300 Subject: [PATCH] Creat dir for screenshots #1696 --- src/widget/form/chatform.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/widget/form/chatform.cpp b/src/widget/form/chatform.cpp index f527e4b4b..958843e1b 100644 --- a/src/widget/form/chatform.cpp +++ b/src/widget/form/chatform.cpp @@ -873,11 +873,12 @@ void ChatForm::doScreenshot() ScreenshotGrabber* screenshotGrabber = new ScreenshotGrabber(this); connect(screenshotGrabber, &ScreenshotGrabber::screenshotTaken, this, &ChatForm::onScreenshotTaken); screenshotGrabber->showGrabber(); + // Create dir for screenshots + QDir(Settings::getSettingsDirPath()).mkdir("screenshots"); } void ChatForm::onScreenshotTaken(const QPixmap &pixmap) { - QTemporaryFile file("qTox-Screenshot-XXXXXXXX.png"); - + QTemporaryFile file(QDir(Settings::getSettingsDirPath() + QDir::separator() + "screenshots" + QDir::separator()).filePath("qTox-Screenshot-XXXXXXXX.png")); if (!file.open()) { QMessageBox::warning(this, tr("Failed to open temporary file", "Temporary file for screenshot"), @@ -893,8 +894,7 @@ void ChatForm::onScreenshotTaken(const QPixmap &pixmap) { file.close(); QFileInfo fi(file); - emit sendFile(f->getFriendID(), fi.fileName(), fi.filePath(), filesize); - + emit sendFile(f->getFriendID(), fi.fileName(), fi.filePath(), filesize); } void ChatForm::onLoadHistory()