Commit 4ff4bf78 authored by Olli Werwolff's avatar Olli Werwolff
Browse files

Fixes: duplicate check when adding resources using the resource editor fixed

Task:     -
RevBy:    -
AutoTest: -
Details:  If the user wants to add a resource which is not located in the directory/a subdirectory of the qrc-file, he is asked what should be done. If he chose to copy the file to another directory, the check, if this directory is valid ((sub-)directory of the qrc-file) was missing. Added it.
parent 745739d2
......@@ -234,6 +234,11 @@ void QrcEditor::resolveLocationIssues(QStringList &files)
const QString copyName = QFileDialog::getSaveFileName(this, tr("Choose copy location"),
suggestion.absoluteFilePath());
if (!copyName.isEmpty()) {
QString relPath = dir.relativeFilePath(copyName);
if (relPath.startsWith(dotdotSlash)) { // directory is still invalid
i--; // Compensate i++ and try again
continue;
}
if (QFile::exists(copyName)) {
if (!QFile::remove(copyName)) {
QMessageBox::critical(this, tr("Overwrite failed"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment