servicemenuinstaller: Remove file if it already exists

This is the case when you update an entry.
This commit is contained in:
Alexander Lohnau 2020-12-02 22:20:29 +01:00 committed by Elvis Angelaccio
parent 476fe42624
commit a4a7b5e8af

View file

@ -290,6 +290,9 @@ bool cmdInstall(const QString &archive, QString &errorText)
if (archive.endsWith(QLatin1String(".desktop"))) {
// Append basename to destination directory
const auto dest = QDir(serviceDir).absoluteFilePath(QFileInfo(archive).fileName());
if (QFileInfo::exists(dest)) {
QFile::remove(dest);
}
qInfo() << "Single-File Service-Menu" << archive << dest;
QFile source(archive);