Changeset 63893 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Sep 19, 2016 4:01:45 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 110765
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotPane.cpp
r63852 r63893 501 501 * Class UISnapshotPane implementation. * 502 502 *********************************************************************************************************************************/ 503 504 /* static */ 505 UISnapshotItem *UISnapshotPane::toSnapshotItem(QTreeWidgetItem *pItem) 506 { 507 /* Make sure alive UISnapshotItem passed: */ 508 if (!pItem || pItem->type() != UISnapshotItem::ItemType) 509 return 0; 510 511 /* Return casted UISnapshotItem then: */ 512 return static_cast<UISnapshotItem*>(pItem); 513 } 514 515 /* static */ 516 const UISnapshotItem *UISnapshotPane::toSnapshotItem(const QTreeWidgetItem *pItem) 517 { 518 /* Make sure alive UISnapshotItem passed: */ 519 if (!pItem || pItem->type() != UISnapshotItem::ItemType) 520 return 0; 521 522 /* Return casted UISnapshotItem then: */ 523 return static_cast<const UISnapshotItem*>(pItem); 524 } 503 525 504 526 UISnapshotPane::UISnapshotPane(QWidget *pParent) … … 627 649 void UISnapshotPane::retranslateUi() 628 650 { 651 /* Translate snapshot tree: */ 652 m_pSnapshotTree->setToolTip(tr("Contains snapshot tree of current virtual machine")); 653 629 654 /* Translate actions names: */ 630 655 m_pActionTakeSnapshot->setText(tr("Take &Snapshot")); … … 1269 1294 } 1270 1295 1271 /* static */1272 UISnapshotItem *UISnapshotPane::toSnapshotItem(QTreeWidgetItem *pItem)1273 {1274 /* Make sure alive UISnapshotItem passed: */1275 if (!pItem || pItem->type() != UISnapshotItem::ItemType)1276 return 0;1277 1278 /* Return casted UISnapshotItem then: */1279 return static_cast<UISnapshotItem*>(pItem);1280 }1281 1282 /* static */1283 const UISnapshotItem *UISnapshotPane::toSnapshotItem(const QTreeWidgetItem *pItem)1284 {1285 /* Make sure alive UISnapshotItem passed: */1286 if (!pItem || pItem->type() != UISnapshotItem::ItemType)1287 return 0;1288 1289 /* Return casted UISnapshotItem then: */1290 return static_cast<const UISnapshotItem*>(pItem);1291 }1292 1293 1296 #include "UISnapshotPane.moc" 1294 1297 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotPane.h
r63852 r63893 54 54 55 55 public: 56 57 /** Casts QTreeWidgetItem to UISnapshotItem if possible. */ 58 static UISnapshotItem *toSnapshotItem(QTreeWidgetItem *pItem); 59 /** Casts const QTreeWidgetItem to const UISnapshotItem if possible. */ 60 static const UISnapshotItem *toSnapshotItem(const QTreeWidgetItem *pItem); 56 61 57 62 /** Constructs snapshot pane passing @a pParent to the base-class. */ … … 142 147 SnapshotAgeFormat traverseSnapshotAge(QTreeWidgetItem *pItem) const; 143 148 144 /** Casts QTreeWidgetItem to UISnapshotItem if possible. */145 static UISnapshotItem *toSnapshotItem(QTreeWidgetItem *pItem);146 /** Casts const QTreeWidgetItem to const UISnapshotItem if possible. */147 static const UISnapshotItem *toSnapshotItem(const QTreeWidgetItem *pItem);148 149 149 /** Holds the machine COM wrapper. */ 150 150 CMachine m_comMachine;
Note:
See TracChangeset
for help on using the changeset viewer.