Browse Source

Fix inconsistent main icon detection, closes #496 (#498)

Co-authored-by: probonopd <probonopd@users.noreply.github.com>
master
Alexander Gorishnyak 2 years ago
committed by GitHub
parent
commit
deebf70ea6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 42
      tools/linuxdeployqt/main.cpp

42
tools/linuxdeployqt/main.cpp

@ -425,42 +425,12 @@ int main(int argc, char **argv)
if(candidates.length() == 1){ if(candidates.length() == 1){
iconToBeUsed = candidates.at(0); // The only choice iconToBeUsed = candidates.at(0); // The only choice
} else if(candidates.length() > 1){ } else if(candidates.length() > 1){
foreach(QString current, candidates) { const QStringList iconPriorities{"256", "128", "svg", "svgz", "512", "1024", "64", "48", "xpm"};
if(current.contains("256")){ foreach (const QString &iconPriority, iconPriorities) {
iconToBeUsed = current; const auto filteredCandidates = candidates.filter(iconPriority);
continue; if (!filteredCandidates.isEmpty()) {
} iconToBeUsed = filteredCandidates.first();
if(current.contains("128")){ break;
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;
} }
} }
} }

Loading…
Cancel
Save