Browse Source

Also generate .DirIcon

master
probonopd 8 years ago
parent
commit
e7c13e99ad
  1. 8
      linuxdeployqt/main.cpp

8
linuxdeployqt/main.cpp

@ -278,19 +278,24 @@ int main(int argc, char **argv)
/* Copy in place */ /* Copy in place */
if(iconToBeUsed != ""){ if(iconToBeUsed != ""){
/* Check if there is already an icon and only if there is not, copy it to the AppDir */ /* Check if there is already an icon and only if there is not, copy it to the AppDir.
* As per the ROX AppDir spec, also copying to .DirIcon. */
QString preExistingToplevelIcon = ""; QString preExistingToplevelIcon = "";
if(QFileInfo(appDirPath + "/" + desktopIconEntry + ".xpm").exists() == true){ if(QFileInfo(appDirPath + "/" + desktopIconEntry + ".xpm").exists() == true){
preExistingToplevelIcon = appDirPath + "/" + desktopIconEntry + ".xpm"; preExistingToplevelIcon = appDirPath + "/" + desktopIconEntry + ".xpm";
QFile::copy(preExistingToplevelIcon, appDirPath + "/.DirIcon");
} }
if(QFileInfo(appDirPath + "/" + desktopIconEntry + ".svgz").exists() == true){ if(QFileInfo(appDirPath + "/" + desktopIconEntry + ".svgz").exists() == true){
preExistingToplevelIcon = appDirPath + "/" + desktopIconEntry + ".svgz"; preExistingToplevelIcon = appDirPath + "/" + desktopIconEntry + ".svgz";
QFile::copy(preExistingToplevelIcon, appDirPath + "/.DirIcon");
} }
if(QFileInfo(appDirPath + "/" + desktopIconEntry + ".svg").exists() == true){ if(QFileInfo(appDirPath + "/" + desktopIconEntry + ".svg").exists() == true){
preExistingToplevelIcon = appDirPath + "/" + desktopIconEntry + ".svg"; preExistingToplevelIcon = appDirPath + "/" + desktopIconEntry + ".svg";
QFile::copy(preExistingToplevelIcon, appDirPath + "/.DirIcon");
} }
if(QFileInfo(appDirPath + "/" + desktopIconEntry + ".png").exists() == true){ if(QFileInfo(appDirPath + "/" + desktopIconEntry + ".png").exists() == true){
preExistingToplevelIcon = appDirPath + "/" + desktopIconEntry + ".png"; preExistingToplevelIcon = appDirPath + "/" + desktopIconEntry + ".png";
QFile::copy(preExistingToplevelIcon, appDirPath + "/.DirIcon");
} }
if(preExistingToplevelIcon != ""){ if(preExistingToplevelIcon != ""){
@ -300,6 +305,7 @@ int main(int argc, char **argv)
QString targetIconPath = appDirPath + "/" + QFileInfo(iconToBeUsed).fileName(); QString targetIconPath = appDirPath + "/" + QFileInfo(iconToBeUsed).fileName();
if (QFile::copy(iconToBeUsed, targetIconPath)){ if (QFile::copy(iconToBeUsed, targetIconPath)){
qDebug() << "Copied" << iconToBeUsed << "to" << targetIconPath; qDebug() << "Copied" << iconToBeUsed << "to" << targetIconPath;
QFile::copy(targetIconPath, appDirPath + "/.DirIcon");
} else { } else {
LogError() << "Could not copy" << iconToBeUsed << "to" << targetIconPath << "\n"; LogError() << "Could not copy" << iconToBeUsed << "to" << targetIconPath << "\n";
exit(1); exit(1);

Loading…
Cancel
Save