- Timestamp:
- Mar 1, 2022 1:16:46 AM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemLocal.cpp
r94006 r94009 258 258 { 259 259 /* This is used in tool-tip generation: */ 260 #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) 261 const QString strDateTime = m_lastStateChange.date() == QDate::currentDate() 262 ? QLocale::system().toString(m_lastStateChange.time(), QLocale::ShortFormat) 263 : QLocale::system().toString(m_lastStateChange, QLocale::ShortFormat); 264 #else 260 265 const QString strDateTime = (m_lastStateChange.date() == QDate::currentDate()) 261 266 ? m_lastStateChange.time().toString(Qt::LocalDate) 262 267 : m_lastStateChange.toString(Qt::LocalDate); 268 #endif 263 269 264 270 /* If machine is accessible: */ -
trunk/src/VBox/Frontends/VirtualBox/src/networking/UIUpdateDefs.cpp
r93982 r94009 18 18 /* Qt includes: */ 19 19 #include <QCoreApplication> 20 #include <QLocale> 20 21 #include <QStringList> 21 22 … … 116 117 QString VBoxUpdateData::date() const 117 118 { 118 return isNoNeedToCheck() ? QCoreApplication::translate("UIUpdateManager", "Never") : m_date.toString(Qt::LocaleDate); 119 return isNoNeedToCheck() ? QCoreApplication::translate("UIUpdateManager", "Never") 120 : QLocale::system().toString(m_date, QLocale::ShortFormat); 119 121 } 120 122 -
trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotPane.cpp
r94006 r94009 361 361 if (then.daysTo(now) > 30) 362 362 { 363 strAge = then.toString(Qt::LocalDate);363 strAge = QLocale::system().toString(then, QLocale::ShortFormat); 364 364 enmAgeFormat = SnapshotAgeFormat_Max; 365 365 } … … 367 367 { 368 368 strAge = tr("%1 (%2 ago)", "date time (how long ago)") 369 .arg(then.toString(Qt::LocalDate), UITranslator::daysToString(then.secsTo(now) / 60 / 60 / 24)); 369 .arg(QLocale::system().toString(then, QLocale::ShortFormat), 370 UITranslator::daysToString(then.secsTo(now) / 60 / 60 / 24)); 370 371 enmAgeFormat = SnapshotAgeFormat_InDays; 371 372 } … … 373 374 { 374 375 strAge = tr("%1 (%2 ago)", "date time (how long ago)") 375 .arg(then.toString(Qt::LocalDate), UITranslator::hoursToString(then.secsTo(now) / 60 / 60)); 376 .arg(QLocale::system().toString(then, QLocale::ShortFormat), 377 UITranslator::hoursToString(then.secsTo(now) / 60 / 60)); 376 378 enmAgeFormat = SnapshotAgeFormat_InHours; 377 379 } … … 379 381 { 380 382 strAge = tr("%1 (%2 ago)", "date time (how long ago)") 381 .arg(then.toString(Qt::LocalDate), UITranslator::minutesToString(then.secsTo(now) / 60)); 383 .arg(QLocale::system().toString(then, QLocale::ShortFormat), 384 UITranslator::minutesToString(then.secsTo(now) / 60)); 382 385 enmAgeFormat = SnapshotAgeFormat_InMinutes; 383 386 } … … 385 388 { 386 389 strAge = tr("%1 (%2 ago)", "date time (how long ago)") 387 .arg(then.toString(Qt::LocalDate), UITranslator::secondsToString(then.secsTo(now))); 390 .arg(QLocale::system().toString(then, QLocale::ShortFormat), 391 UITranslator::secondsToString(then.secsTo(now))); 388 392 enmAgeFormat = SnapshotAgeFormat_InSeconds; 389 393 } … … 404 408 /* Compose date time: */ 405 409 QString strDateTime = fDateTimeToday 406 ? m_timestamp.time().toString(Qt::LocalDate)407 : m_timestamp.toString(Qt::LocalDate);410 ? QLocale::system().toString(m_timestamp.time(), QLocale::ShortFormat) 411 : QLocale::system().toString(m_timestamp, QLocale::ShortFormat); 408 412 409 413 /* Prepare details: */
Note:
See TracChangeset
for help on using the changeset viewer.