- Timestamp:
- Oct 1, 2018 11:19:13 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.cpp
r74466 r74546 536 536 QString UIToolsModel::typeToString(UIToolsType enmType) 537 537 { 538 switch (enmType) 539 { 540 /* Global classes: */ 541 case UIToolsType_Media: return "Media"; 542 case UIToolsType_Network: return "Network"; 543 /* Machine classes: */ 544 case UIToolsType_Details: return "Details"; 545 case UIToolsType_Snapshots: return "Snapshots"; 546 case UIToolsType_Logs: return "Logs"; 547 default: break; 548 } 549 return QString(); 538 QMap<UIToolsType, QString> values; 539 /* Global classes: */ 540 values[UIToolsType_Media] = "Media"; 541 values[UIToolsType_Network] = "Network"; 542 /* Machine classes: */ 543 values[UIToolsType_Details] = "Details"; 544 values[UIToolsType_Snapshots] = "Snapshots"; 545 values[UIToolsType_Logs] = "Logs"; 546 /* Return value, null-string by default: */ 547 return values.value(enmType, QString()); 550 548 } 551 549 … … 553 551 UIToolsType UIToolsModel::typeFromString(const QString &strType) 554 552 { 553 QMap<QString, UIToolsType> values; 555 554 /* Global classes: */ 556 if (strType == "Media") returnUIToolsType_Media;557 else if (strType == "Network") returnUIToolsType_Network;555 values["Media"] = UIToolsType_Media; 556 values["Network"] = UIToolsType_Network; 558 557 /* Machine classes: */ 559 else if (strType == "Details") return UIToolsType_Details; 560 else if (strType == "Snapshots") return UIToolsType_Snapshots; 561 else if (strType == "Logs") return UIToolsType_Logs; 562 return UIToolsType_Invalid; 558 values["Details"] = UIToolsType_Details; 559 values["Snapshots"] = UIToolsType_Snapshots; 560 values["Logs"] = UIToolsType_Logs; 561 /* Return value, UIToolsType_Invalid by default: */ 562 return values.value(strType, UIToolsType_Invalid); 563 563 } 564 564
Note:
See TracChangeset
for help on using the changeset viewer.