mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
Added error messages to file rename.
This commit is contained in:
parent
0894d30358
commit
b7a170c718
1 changed files with 15 additions and 1 deletions
|
@ -345,7 +345,21 @@ void Test::createTest() {
|
|||
QString newFilename = "ExpectedImage_" + QString::number(i-1).rightJustified(5, '0') + ".jpg";
|
||||
QString fullNewFileName = pathToImageDirectory + "/" + newFilename;
|
||||
|
||||
imageDirectory.rename(fullCurrentFilename, newFilename);
|
||||
if (!imageDirectory.rename(fullCurrentFilename, newFilename)) {
|
||||
if (!QFile::exists(fullCurrentFilename)) {
|
||||
messageBox.critical(0, "Error", "Could not rename file: " + fullCurrentFilename + " to: " + newFilename + "\n"
|
||||
+ fullCurrentFilename + " not found"
|
||||
+ "\nTest creation aborted"
|
||||
);
|
||||
exit(-1);
|
||||
}
|
||||
else {
|
||||
messageBox.critical(0, "Error", "Could not rename file: " + fullCurrentFilename + " to: " + newFilename + "\n"
|
||||
+ "unknown error" + "\nTest creation aborted"
|
||||
);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue