Changeset 4092 in vbox
- Timestamp:
- Aug 8, 2007 3:07:07 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 23540
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r4090 r4092 38 38 #include <qtimer.h> 39 39 #include <qeventloop.h> 40 #include <qregexp.h> 40 41 41 42 #include <VBox/VBoxGuest.h> … … 2139 2140 dlg.pmIcon->setPixmap (vboxGlobal().vmGuestOSTypeIcon (typeId)); 2140 2141 2141 dlg.leName->setText (tr ("Snapshot %1").arg (cmachine.GetSnapshotCount() + 1)); 2142 /* search for the max available filter index */ 2143 int maxSnapShotIndex = 0; 2144 QString snapShotName = tr ("Snapshot %1"); 2145 QRegExp regExp (QString ("^") + snapShotName.arg ("([0-9]+)") + QString ("$")); 2146 CSnapshot index = cmachine.GetSnapshot (QUuid()); 2147 while (!index.isNull()) 2148 { 2149 /* Check the current snapshot name */ 2150 QString name = index.GetName(); 2151 int pos = regExp.search (name); 2152 if (pos != -1) 2153 maxSnapShotIndex = regExp.cap (1).toInt() > maxSnapShotIndex ? 2154 regExp.cap (1).toInt() : maxSnapShotIndex; 2155 /* Traversing to the next child */ 2156 index = index.GetChildren().GetItemAt (0); 2157 } 2158 dlg.leName->setText (snapShotName.arg (maxSnapShotIndex + 1)); 2142 2159 2143 2160 if (dlg.exec() == QDialog::Accepted)
Note:
See TracChangeset
for help on using the changeset viewer.