MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / findBestIconIn

Function findBestIconIn

launcher/icons/IconUtils.cpp:21–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19namespace IconUtils{
20
21QString findBestIconIn(const QString &folder, const QString & iconKey) {
22 int best_found = validIconExtensions.size();
23 QString best_filename;
24
25 QDirIterator it(folder, QDir::NoDotAndDotDot | QDir::Files, QDirIterator::NoIteratorFlags);
26 while (it.hasNext()) {
27 it.next();
28 auto fileInfo = it.fileInfo();
29
30 if(fileInfo.completeBaseName() != iconKey)
31 continue;
32
33 auto extension = fileInfo.suffix();
34
35 for(int i = 0; i < best_found; i++) {
36 if(extension == validIconExtensions[i]) {
37 best_found = i;
38 qDebug() << i << " : " << fileInfo.fileName();
39 best_filename = fileInfo.fileName();
40 }
41 }
42 }
43 return FS::PathCombine(folder, best_filename);
44}
45
46QString getIconFilter() {
47 QString out;

Callers 1

processMultiMCMethod · 0.85

Calls 3

PathCombineFunction · 0.85
nextMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected