1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Creat dir for screenshots #1696

This commit is contained in:
PKEv 2015-05-26 01:33:10 +03:00
parent fdd34718fb
commit 1aa8a43e1e

View File

@ -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"),
@ -894,7 +895,6 @@ void ChatForm::onScreenshotTaken(const QPixmap &pixmap) {
QFileInfo fi(file);
emit sendFile(f->getFriendID(), fi.fileName(), fi.filePath(), filesize);
}
void ChatForm::onLoadHistory()