From 0b9b3e349630604909d8aadada1ae9398d154ab3 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Mon, 24 Oct 2022 16:39:53 +0200 Subject: [PATCH] Create screenshots folder if it doesn't exist --- src/clipboard.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/clipboard.cpp b/src/clipboard.cpp index 1d4756136..8383af798 100644 --- a/src/clipboard.cpp +++ b/src/clipboard.cpp @@ -33,6 +33,9 @@ QImage Clipboard::image() const QString Clipboard::saveImage(QString localPath) const { + if (!QDir().exists(QStringLiteral("%1/screenshots").arg(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)))) { + QDir().mkdir(QStringLiteral("%1/screenshots").arg(QStandardPaths::writableLocation(QStandardPaths::CacheLocation))); + } if (localPath.isEmpty()) { localPath = QStringLiteral("file://%1/screenshots/%2.png") .arg(QStandardPaths::writableLocation(QStandardPaths::CacheLocation),