Buxfix - crased on delete last symbol in Filename format

This commit is contained in:
Yuriy Puchkov
2020-07-13 16:27:04 +03:00
parent 01dc8671ee
commit 3ff33f036e
5 changed files with 13 additions and 7 deletions

View File

@@ -32,9 +32,13 @@ QString FileNameHandler::parsedPattern() {
QString FileNameHandler::parseFilename(const QString &name) {
QString res = name;
// remove trailing characters '%' in the pattern
if (name.isEmpty()) {
res = QLatin1String("%F_%H-%M");
}
while(res.endsWith('%')) {
res.chop(1);
}
std::time_t t = std::time(NULL);
char *tempData = QStringTocharArr(res);