1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Added copyright notices to platform.*

Changed u_int** to uint**
This commit is contained in:
novist 2014-11-26 20:27:20 +02:00
parent 13dd4304c1
commit 8e4f69aa79
3 changed files with 38 additions and 6 deletions

View File

@ -1,3 +1,19 @@
/*
Copyright (C) 2014 by Project Tox <https://tox.im>
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 "platform.h"
#include <QDebug> #include <QDebug>
#if defined(Q_OS_WIN32) #if defined(Q_OS_WIN32)
@ -9,13 +25,13 @@
#include <X11/extensions/scrnsaver.h> #include <X11/extensions/scrnsaver.h>
#endif #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 // 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: // Detecting global inactivity, like Skype, is possible but not via Qt:
// http://stackoverflow.com/a/21905027/1497645 // http://stackoverflow.com/a/21905027/1497645
// https://hg.pidgin.im/pidgin/main/file/13e4ae613a6a/pidgin/gtkidle.c // 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) #if defined(Q_OS_WIN32)
LASTINPUTINFO info = { 0 }; LASTINPUTINFO info = { 0 };
@ -24,7 +40,7 @@ u_int32_t Platform::getIdleTime()
#elif defined(__APPLE__) && defined(__MACH__) #elif defined(__APPLE__) && defined(__MACH__)
static io_service_t service = NULL; static io_service_t service = NULL;
CFTypeRef property; CFTypeRef property;
u_int64_t idleTime_ns = 0; uint64_t idleTime_ns = 0;
if (!service) if (!service)
{ {

View File

@ -1,13 +1,29 @@
/*
Copyright (C) 2014 by Project Tox <https://tox.im>
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 #ifndef PLATFORM_H
#define PLATFORM_H #define PLATFORM_H
#include <sys/types.h> #include <cstdint>
/* Platform-dependent code */ /* Platform-dependent code */
namespace Platform namespace Platform
{ {
u_int32_t getIdleTime(); uint32_t getIdleTime();
} }
#endif // PLATFORM_H #endif // PLATFORM_H

View File

@ -1080,7 +1080,7 @@ bool Widget::event(QEvent * e)
void Widget::onUserAwayCheck() 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(ui->statusButton->property("status").toString() == "online")
{ {
if(autoAwayTime) if(autoAwayTime)