Get themes contained in a given file
| 1018 | |
| 1019 | // Get themes contained in a given file |
| 1020 | void Global::getThemeNamesFromFile(QFile &file, QStringList &values) { |
| 1021 | if (!file.exists()) |
| 1022 | return; |
| 1023 | if(!file.open(QIODevice::ReadOnly)) |
| 1024 | return; |
| 1025 | |
| 1026 | QTextStream in(&file); |
| 1027 | while(!in.atEnd()) { |
| 1028 | QString line = in.readLine().simplified(); |
| 1029 | if (line.startsWith("[")) { |
| 1030 | QString name = line.mid(1); |
| 1031 | name.chop(1); |
| 1032 | if (name.simplified() != "") { |
| 1033 | if (!values.contains(name, Qt::CaseInsensitive)) { |
| 1034 | values.append(name); |
| 1035 | } |
| 1036 | } |
| 1037 | } |
| 1038 | } |
| 1039 | |
| 1040 | file.close(); |
| 1041 | } |
| 1042 | |
| 1043 | |
| 1044 | // Get the full path of a resource in a theme file |
no test coverage detected