From d87cf99d8fb786ba102b7ac86e96c0dad9a12523 Mon Sep 17 00:00:00 2001 From: dubslow Date: Wed, 12 Nov 2014 17:17:16 -0600 Subject: [PATCH] minor tweaks to autoaway, one new debug message --- src/misc/settings.cpp | 2 +- src/widget/widget.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/misc/settings.cpp b/src/misc/settings.cpp index 3c2deece4..d9c746a76 100644 --- a/src/misc/settings.cpp +++ b/src/misc/settings.cpp @@ -138,7 +138,7 @@ void Settings::load() smileyPack = s.value("smileyPack", ":/smileys/cylgom/emoticons.xml").toString(); customEmojiFont = s.value("customEmojiFont", true).toBool(); emojiFontFamily = s.value("emojiFontFamily", "DejaVu Sans").toString(); - emojiFontPointSize = s.value("emojiFontPointSize", QApplication::font().pointSize()).toInt(); + emojiFontPointSize = s.value("emojiFontPointSize", 12).toInt(); firstColumnHandlePos = s.value("firstColumnHandlePos", 50).toInt(); secondColumnHandlePosFromRight = s.value("secondColumnHandlePosFromRight", 50).toInt(); timestampFormat = s.value("timestampFormat", "hh:mm").toString(); diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index ce183f705..5b0f2afe7 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -171,6 +171,7 @@ void Widget::init() ui->statusButton->setEnabled(false); idleTimer = new QTimer(); + idleTimer->setSingleShot(true); int mins = Settings::getInstance().getAutoAwayTime(); if (mins > 0) idleTimer->start(mins * 1000*60); @@ -497,6 +498,7 @@ void Widget::onStatusSet(Status status) { case Status::Online: ui->statusButton->setProperty("status" ,"online"); + qDebug() << "Widget: something set the status to online"; break; case Status::Away: ui->statusButton->setProperty("status" ,"away"); @@ -1028,7 +1030,7 @@ bool Widget::event(QEvent * e) case QEvent::KeyRelease: if (autoAwayActive) { - qDebug() << "Widget: auto away deactivated"; + qDebug() << "Widget: auto away deactivated at" << QTime::currentTime().toString(); autoAwayActive = false; emit statusSet(Status::Online); int mins = Settings::getInstance().getAutoAwayTime(); @@ -1047,7 +1049,7 @@ void Widget::onUserAway() if (Settings::getInstance().getAutoAwayTime() > 0 && ui->statusButton->property("status").toString() == "online") // leave user-set statuses in place { - qDebug() << "Widget: auto away activated"; + qDebug() << "Widget: auto away activated" << QTime::currentTime().toString(); emit statusSet(Status::Away); autoAwayActive = true; }