Skip to content

Commit

Permalink
Fix inconsistent main icon detection, closes #496 (#498)
Browse files Browse the repository at this point in the history
Co-authored-by: probonopd <[email protected]>
  • Loading branch information
kefir500 and probonopd authored Dec 15, 2022
1 parent 5fa79fa commit deebf70
Showing 1 changed file with 6 additions and 36 deletions.
42 changes: 6 additions & 36 deletions tools/linuxdeployqt/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,42 +425,12 @@ int main(int argc, char **argv)
if(candidates.length() == 1){
iconToBeUsed = candidates.at(0); // The only choice
} else if(candidates.length() > 1){
foreach(QString current, candidates) {
if(current.contains("256")){
iconToBeUsed = current;
continue;
}
if(current.contains("128")){
iconToBeUsed = current;
continue;
}
if(current.contains("svg")){
iconToBeUsed = current;
continue;
}
if(current.contains("svgz")){
iconToBeUsed = current;
continue;
}
if(current.contains("512")){
iconToBeUsed = current;
continue;
}
if(current.contains("1024")){
iconToBeUsed = current;
continue;
}
if(current.contains("64")){
iconToBeUsed = current;
continue;
}
if(current.contains("48")){
iconToBeUsed = current;
continue;
}
if(current.contains("xpm")){
iconToBeUsed = current;
continue;
const QStringList iconPriorities{"256", "128", "svg", "svgz", "512", "1024", "64", "48", "xpm"};
foreach (const QString &iconPriority, iconPriorities) {
const auto filteredCandidates = candidates.filter(iconPriority);
if (!filteredCandidates.isEmpty()) {
iconToBeUsed = filteredCandidates.first();
break;
}
}
}
Expand Down

0 comments on commit deebf70

Please sign in to comment.