Add delayed capture support

Adding this option required to modify the dbus API, with this changed I've improved the logic which saves the captures.
This commit is contained in:
lupoDharkael
2017-07-25 00:05:31 +02:00
parent 8d76deaa5a
commit 8870fd1ed4
13 changed files with 141 additions and 168 deletions

View File

@@ -58,14 +58,14 @@ QString FileNameHandler::getAbsoluteSavePath() {
if (savePath.isEmpty() || !QDir(savePath).exists() || !QFileInfo(savePath).isWritable()) {
changed = true;
savePath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
if (savePath.isEmpty()) {
savePath = QDir::currentPath();
}
}
if(changed) {
config.setSavePath(savePath);
}
QString tempName = "/"+ FileNameHandler().getParsedPattern();
// first add slash if needed
QString tempName = savePath.endsWith("/") ? "" : "/";
// add the parsed pattern in a correct format for the filesystem
tempName += FileNameHandler().getParsedPattern().replace("/", "");
// find unused name adding _n where n is a number
QFileInfo checkFile(savePath + tempName + ".png");
if (checkFile.exists()) {