2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Use crl::time/now instead of TimeMs/getms.

This commit is contained in:
John Preston
2019-02-19 10:57:53 +04:00
parent d208236994
commit fe618bd652
310 changed files with 1133 additions and 1141 deletions

View File

@@ -323,7 +323,7 @@ void MainWindow::workmodeUpdated(DBIWorkMode mode) {
void MainWindow::psUpdateIndicator() {
#ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
_psUpdateIndicatorTimer.stop();
_psLastIndicatorUpdate = getms();
_psLastIndicatorUpdate = crl::now();
QFileInfo iconFile(_trayIconImageFile());
if (iconFile.exists()) {
QByteArray path = QFile::encodeName(iconFile.absoluteFilePath()), name = QFile::encodeName(iconFile.fileName());
@@ -363,7 +363,7 @@ void MainWindow::updateIconCounters() {
if (noQtTrayIcon) {
#ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
if (useAppIndicator) {
if (getms() > _psLastIndicatorUpdate + 1000) {
if (crl::now() > _psLastIndicatorUpdate + 1000) {
psUpdateIndicator();
} else if (!_psUpdateIndicatorTimer.isActive()) {
_psUpdateIndicatorTimer.start(100);

View File

@@ -59,7 +59,7 @@ private:
int _psCheckStatusIconLeft = 100;
QTimer _psUpdateIndicatorTimer;
TimeMs _psLastIndicatorUpdate = 0;
crl::time _psLastIndicatorUpdate = 0;
};

View File

@@ -135,7 +135,7 @@ auto _monitorLastGot = 0LL;
} // namespace
QRect psDesktopRect() {
auto tnow = getms();
auto tnow = crl::now();
if (tnow > _monitorLastGot + 1000LL || tnow < _monitorLastGot) {
_monitorLastGot = tnow;
_monitorRect = QApplication::desktop()->availableGeometry(App::wnd());
@@ -200,15 +200,15 @@ auto _lastUserAction = 0LL;
} // namespace
void psUserActionDone() {
_lastUserAction = getms(true);
_lastUserAction = crl::now();
}
bool psIdleSupported() {
return false;
}
TimeMs psIdleTime() {
return getms(true) - _lastUserAction;
crl::time psIdleTime() {
return crl::now() - _lastUserAction;
}
void psActivateProcess(uint64 pid) {

View File

@@ -51,7 +51,7 @@ void psDeleteDir(const QString &dir);
void psUserActionDone();
bool psIdleSupported();
TimeMs psIdleTime();
crl::time psIdleTime();
QStringList psInitLogs();
void psClearInitLogs();