MCPcopy Create free account
hub / github.com/IENT/YUView / itemMemoryAddFormat

Function itemMemoryAddFormat

YUViewLib/src/handler/ItemMemoryHandler.cpp:104–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104void 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
134QString itemMemoryGetFormat(QString filePath)
135{

Callers 1

Calls 5

getAllValidItemsFunction · 0.85
writeNewItemListFunction · 0.85
toStringMethod · 0.80
appendMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected