Add better save path verification

This commit is contained in:
lupoDharkael
2017-05-15 02:43:32 +02:00
parent 70fe8f1967
commit fe8a0dd991

View File

@@ -55,10 +55,11 @@ QString Screenshot::graphicalSave(const QRect &selection) const {
QSettings settings;
QString savePath = settings.value("savePath").toString();
if (savePath.isEmpty()) {
if (savePath.isEmpty() || !QDir(savePath).exists()) {
savePath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
if (savePath.isEmpty())
if (savePath.isEmpty()) {
savePath = QDir::currentPath();
}
}
// find unused name adding _n where n is a number
QString tempName = QObject::tr("/screenshot");