Changeset 61191 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- May 25, 2016 2:21:50 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r60599 r61191 2080 2080 QString UIExtraDataManager::extraDataString(const QString &strKey, const QString &strID /* = GlobalID */) 2081 2081 { 2082 /* Hot-load machine extra-data map if necessary: */ 2083 if (strID != GlobalID && !m_data.contains(strID)) 2084 hotloadMachineExtraDataMap(strID); 2085 2086 // TODO: Check if we can avoid copying here.. 2087 /* Make a read-only copy of the corresponding map: */ 2088 const ExtraDataMap data = m_data.value(strID); 2089 2090 /* QString() if value was not set: */ 2091 if (!data.contains(strKey)) 2082 /* Get the value. Return 'QString()' if not found: */ 2083 const QString strValue = extraDataStringUnion(strKey, strID); 2084 if (strValue.isNull()) 2092 2085 return QString(); 2093 2086 2094 2087 /* Returns corresponding value: */ 2095 return data[strKey];2088 return strValue; 2096 2089 } 2097 2090 … … 2188 2181 QStringList UIExtraDataManager::extraDataStringList(const QString &strKey, const QString &strID /* = GlobalID */) 2189 2182 { 2190 /* Hot-load machine extra-data map if necessary: */ 2191 if (strID != GlobalID && !m_data.contains(strID)) 2192 hotloadMachineExtraDataMap(strID); 2193 2194 /* Read-only access corresponding map: */ 2195 const ExtraDataMap data = m_data.value(strID); 2196 2197 /* QStringList() if machine value was not set: */ 2198 if (!data.contains(strKey)) 2183 /* Get the value. Return 'QStringList()' if not found: */ 2184 const QString strValue = extraDataStringUnion(strKey, strID); 2185 if (strValue.isNull()) 2199 2186 return QStringList(); 2200 2187 2201 2188 /* Few old extra-data string-lists were separated with 'semicolon' symbol. 2202 2189 * All new separated by 'comma'. We have to take that into account. */ 2203 return data[strKey].split(QRegExp("[;,]"), QString::SkipEmptyParts);2190 return strValue.split(QRegExp("[;,]"), QString::SkipEmptyParts); 2204 2191 } 2205 2192
Note:
See TracChangeset
for help on using the changeset viewer.