| 51 | } |
| 52 | |
| 53 | QString toFilterString(const QMap<QString,QString>& filters, bool addAllSupported, bool addAll) |
| 54 | { |
| 55 | QStringList entries; |
| 56 | |
| 57 | if (addAllSupported) { |
| 58 | entries << QCoreApplication::translate("toFilterString", "All supported files (%1)") |
| 59 | .arg(filters.values().join(" ")); |
| 60 | } |
| 61 | |
| 62 | if (addAll) { |
| 63 | entries << QCoreApplication::translate("toFilterString", "All files (%1)").arg("*.*"); |
| 64 | } |
| 65 | |
| 66 | // We're using the description of the filters as the map keys, the file |
| 67 | // name patterns are our values. The generated filter string list will |
| 68 | // thus be sorted alphabetically over the descriptions. |
| 69 | for (const auto& k: filters.keys()) { |
| 70 | entries << QString("%1 (%2)").arg(k).arg(filters.value(k)); |
| 71 | } |
| 72 | |
| 73 | return entries.join(";;"); |
| 74 | } |
| 75 | |
| 76 | QString getDataDir() |
| 77 | { |
no test coverage detected