diff --git a/src/platform.cpp b/src/platform.cpp index cbdd79240..ed3cea9e3 100644 --- a/src/platform.cpp +++ b/src/platform.cpp @@ -1,3 +1,19 @@ +/* + Copyright (C) 2014 by Project Tox + + This file is part of qTox, a Qt-based graphical interface for Tox. + + This program is libre software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the COPYING file for more details. +*/ + #include "platform.h" #include #if defined(Q_OS_WIN32) @@ -9,13 +25,13 @@ #include #endif -u_int32_t Platform::getIdleTime() +uint32_t Platform::getIdleTime() { // http://qt-project.org/faq/answer/how_can_i_detect_a_period_of_no_user_interaction // Detecting global inactivity, like Skype, is possible but not via Qt: // http://stackoverflow.com/a/21905027/1497645 // https://hg.pidgin.im/pidgin/main/file/13e4ae613a6a/pidgin/gtkidle.c - u_int32_t idleTime = 0; + uint32_t idleTime = 0; #if defined(Q_OS_WIN32) LASTINPUTINFO info = { 0 }; @@ -24,7 +40,7 @@ u_int32_t Platform::getIdleTime() #elif defined(__APPLE__) && defined(__MACH__) static io_service_t service = NULL; CFTypeRef property; - u_int64_t idleTime_ns = 0; + uint64_t idleTime_ns = 0; if (!service) { diff --git a/src/platform.h b/src/platform.h index d943582f0..b1be2d945 100644 --- a/src/platform.h +++ b/src/platform.h @@ -1,13 +1,29 @@ +/* + Copyright (C) 2014 by Project Tox + + This file is part of qTox, a Qt-based graphical interface for Tox. + + This program is libre software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the COPYING file for more details. +*/ + #ifndef PLATFORM_H #define PLATFORM_H -#include +#include /* Platform-dependent code */ namespace Platform { - u_int32_t getIdleTime(); + uint32_t getIdleTime(); } #endif // PLATFORM_H diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index cb2ea4703..b7d0bfdf3 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -1080,7 +1080,7 @@ bool Widget::event(QEvent * e) void Widget::onUserAwayCheck() { - u_int32_t autoAwayTime = Settings::getInstance().getAutoAwayTime() * 60 * 1000; + uint32_t autoAwayTime = Settings::getInstance().getAutoAwayTime() * 60 * 1000; if(ui->statusButton->property("status").toString() == "online") { if(autoAwayTime)