| 43 | } |
| 44 | |
| 45 | static OrderList readListFile(const QString &m_list_file) |
| 46 | { |
| 47 | OrderList itemList; |
| 48 | if (m_list_file.isNull() || m_list_file.isEmpty()) |
| 49 | return itemList; |
| 50 | |
| 51 | QFile textFile(m_list_file); |
| 52 | if (!textFile.open(QIODevice::ReadOnly | QIODevice::Text)) |
| 53 | return OrderList(); |
| 54 | |
| 55 | QTextStream textStream; |
| 56 | textStream.setAutoDetectUnicode(true); |
| 57 | textStream.setDevice(&textFile); |
| 58 | while (true) |
| 59 | { |
| 60 | QString line = textStream.readLine(); |
| 61 | if (line.isNull() || line.isEmpty()) |
| 62 | break; |
| 63 | else |
| 64 | { |
| 65 | OrderItem it; |
| 66 | it.enabled = !line.endsWith(".disabled"); |
| 67 | if (!it.enabled) |
| 68 | { |
| 69 | line.chop(9); |
| 70 | } |
| 71 | it.id = line; |
| 72 | itemList.append(it); |
| 73 | } |
| 74 | } |
| 75 | textFile.close(); |
| 76 | return itemList; |
| 77 | } |
| 78 | |
| 79 | bool LegacyModList::update() |
| 80 | { |