| 102 | } |
| 103 | |
| 104 | void itemMemoryAddFormat(QString filePath, QString format) |
| 105 | { |
| 106 | auto validItems = getAllValidItems(); |
| 107 | |
| 108 | bool itemUpdated = false; |
| 109 | for (int i = 0; i < validItems.size(); i++) |
| 110 | { |
| 111 | if (validItems[i].filePath == filePath) |
| 112 | { |
| 113 | validItems[i].itemChangedLast = QDateTime::currentDateTime(); |
| 114 | validItems[i].format = format; |
| 115 | itemUpdated = true; |
| 116 | DEBUG_MEMORY("itemMemoryAddFormat Modified item " << validItems[i].toString()); |
| 117 | break; |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | if (!itemUpdated) |
| 122 | { |
| 123 | ItemData newItem; |
| 124 | newItem.filePath = filePath; |
| 125 | newItem.itemChangedLast = QDateTime::currentDateTime(); |
| 126 | newItem.format = format; |
| 127 | validItems.append(newItem); |
| 128 | DEBUG_MEMORY("itemMemoryAddFormat Added new item " << newItem.toString()); |
| 129 | } |
| 130 | |
| 131 | writeNewItemList(validItems); |
| 132 | } |
| 133 | |
| 134 | QString itemMemoryGetFormat(QString filePath) |
| 135 | { |
no test coverage detected