From 6e8bdab10fca2e887c0606b4bea1baea2ecc8c20 Mon Sep 17 00:00:00 2001 From: probonopd Date: Tue, 28 Mar 2017 07:32:14 +0200 Subject: [PATCH] Only copy to .DirIcon if it does not exist yet --- linuxdeployqt/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/linuxdeployqt/main.cpp b/linuxdeployqt/main.cpp index 2bc7251..0d203ae 100644 --- a/linuxdeployqt/main.cpp +++ b/linuxdeployqt/main.cpp @@ -285,26 +285,26 @@ int main(int argc, char **argv) QString preExistingToplevelIcon = ""; if(QFileInfo(appDirPath + "/" + desktopIconEntry + ".xpm").exists() == true){ preExistingToplevelIcon = appDirPath + "/" + desktopIconEntry + ".xpm"; - QFile::copy(preExistingToplevelIcon, appDirPath + "/.DirIcon"); + if(QFileInfo(appDirPath + "/.DirIcon").exists() == false) QFile::copy(preExistingToplevelIcon, appDirPath + "/.DirIcon"); } if(QFileInfo(appDirPath + "/" + desktopIconEntry + ".svgz").exists() == true){ preExistingToplevelIcon = appDirPath + "/" + desktopIconEntry + ".svgz"; - QFile::copy(preExistingToplevelIcon, appDirPath + "/.DirIcon"); + if(QFileInfo(appDirPath + "/.DirIcon").exists() == false) if(QFileInfo(appDirPath + "/.DirIcon").exists() == false) QFile::copy(preExistingToplevelIcon, appDirPath + "/.DirIcon"); } if(QFileInfo(appDirPath + "/" + desktopIconEntry + ".svg").exists() == true){ preExistingToplevelIcon = appDirPath + "/" + desktopIconEntry + ".svg"; - QFile::copy(preExistingToplevelIcon, appDirPath + "/.DirIcon"); + if(QFileInfo(appDirPath + "/.DirIcon").exists() == false) QFile::copy(preExistingToplevelIcon, appDirPath + "/.DirIcon"); } if(QFileInfo(appDirPath + "/" + desktopIconEntry + ".png").exists() == true){ preExistingToplevelIcon = appDirPath + "/" + desktopIconEntry + ".png"; - QFile::copy(preExistingToplevelIcon, appDirPath + "/.DirIcon"); + if(QFileInfo(appDirPath + "/.DirIcon").exists() == false) QFile::copy(preExistingToplevelIcon, appDirPath + "/.DirIcon"); } if(preExistingToplevelIcon != ""){ qDebug() << "preExistingToplevelIcon:" << preExistingToplevelIcon; } else { qDebug() << "iconToBeUsed:" << iconToBeUsed; - QString targetIconPath = appDirPath + "/" + QFileInfo(iconToBeUsed).fileName(); + QString targetIconPath = appDirPath + "/" + QFileInfo(iconToBeUsed).fileName(); if (QFile::copy(iconToBeUsed, targetIconPath)){ qDebug() << "Copied" << iconToBeUsed << "to" << targetIconPath; QFile::copy(targetIconPath, appDirPath + "/.DirIcon");