diff options
author | Tobias Markmann <tm@ayena.de> | 2016-03-31 14:57:35 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2016-03-31 14:57:35 (GMT) |
commit | cfbdb43d2cadd40aa87338d41548e4bf89e146e6 (patch) | |
tree | 18d94153a302445196fc0c18586abf44a1ce4a38 /Swift/Controllers/StatusTracker.cpp | |
parent | 1d545a4a7fb877f021508094b88c1f17b30d8b4e (diff) | |
download | swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.zip swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.tar.bz2 |
Convert tabs to 4 spaces for all source files
Removed trailing spaces and whitespace on empty lines
in the process.
Changed CheckTabs.py tool to disallow hard tabs in source
files.
Test-Information:
Manually checked 30 random files that the conversion worked
as expected.
Change-Id: I874f99d617bd3d2bb55f02d58f22f58f9b094480
Diffstat (limited to 'Swift/Controllers/StatusTracker.cpp')
-rw-r--r-- | Swift/Controllers/StatusTracker.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/Swift/Controllers/StatusTracker.cpp b/Swift/Controllers/StatusTracker.cpp index e42b99e..51db328 100644 --- a/Swift/Controllers/StatusTracker.cpp +++ b/Swift/Controllers/StatusTracker.cpp @@ -13,46 +13,46 @@ namespace Swift { StatusTracker::StatusTracker() { - isAutoAway_ = false; - queuedPresence_ = boost::make_shared<Presence>(); + isAutoAway_ = false; + queuedPresence_ = boost::make_shared<Presence>(); } boost::shared_ptr<Presence> StatusTracker::getNextPresence() { - boost::shared_ptr<Presence> presence; - if (isAutoAway_) { - presence = boost::make_shared<Presence>(); - presence->setShow(StatusShow::Away); - presence->setStatus(queuedPresence_->getStatus()); - presence->addPayload(boost::make_shared<Idle>(isAutoAwaySince_)); - } else { - presence = queuedPresence_; - } - return presence; + boost::shared_ptr<Presence> presence; + if (isAutoAway_) { + presence = boost::make_shared<Presence>(); + presence->setShow(StatusShow::Away); + presence->setStatus(queuedPresence_->getStatus()); + presence->addPayload(boost::make_shared<Idle>(isAutoAwaySince_)); + } else { + presence = queuedPresence_; + } + return presence; } void StatusTracker::setRequestedPresence(boost::shared_ptr<Presence> presence) { - isAutoAway_ = false; - queuedPresence_ = presence; -// if (presence->getType() == Presence::Unavailable) { -// queuedPresence_ = boost::make_shared<Presence>(); -// } + isAutoAway_ = false; + queuedPresence_ = presence; +// if (presence->getType() == Presence::Unavailable) { +// queuedPresence_ = boost::make_shared<Presence>(); +// } } bool StatusTracker::goAutoAway(const int& seconds) { - if (queuedPresence_->getShow() != StatusShow::Online) { - return false; - } - isAutoAway_ = true; - isAutoAwaySince_ = boost::posix_time::second_clock::universal_time() - boost::posix_time::seconds(seconds); - return true; + if (queuedPresence_->getShow() != StatusShow::Online) { + return false; + } + isAutoAway_ = true; + isAutoAwaySince_ = boost::posix_time::second_clock::universal_time() - boost::posix_time::seconds(seconds); + return true; } bool StatusTracker::goAutoUnAway() { - if (!isAutoAway_) { - return false; - } - isAutoAway_ = false; - return true; + if (!isAutoAway_) { + return false; + } + isAutoAway_ = false; + return true; } } |