summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2017-03-13 21:59:11 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2017-03-13 21:59:11 +0100
commita3ccd5ba235c27b2f7b80b6e9daa3d77c52d26bb (patch)
tree758d114294295f0b47a8a8749c07f3d9bda8b653
parent9e1a187dbda6d1c2a9cc70e5827098644afe0d53 (diff)
downloadmgaonline-a3ccd5ba235c27b2f7b80b6e9daa3d77c52d26bb.tar
mgaonline-a3ccd5ba235c27b2f7b80b6e9daa3d77c52d26bb.tar.gz
mgaonline-a3ccd5ba235c27b2f7b80b6e9daa3d77c52d26bb.tar.bz2
mgaonline-a3ccd5ba235c27b2f7b80b6e9daa3d77c52d26bb.tar.xz
mgaonline-a3ccd5ba235c27b2f7b80b6e9daa3d77c52d26bb.zip
Prefer add_seconds() over add() as it uses less CPU and memory
-rwxr-xr-xmgaapplet4
1 files changed, 2 insertions, 2 deletions
diff --git a/mgaapplet b/mgaapplet
index 79541d70..c406f3d1 100755
--- a/mgaapplet
+++ b/mgaapplet
@@ -598,7 +598,7 @@ sub silentCheck() {
}
sub setup_cyclic_check() {
- $network_timeout = Glib::Timeout->add(2000, sub { checkNetwork(); 1 });
+ $network_timeout = Glib::Timeout->add_seconds(2, sub { checkNetwork(); 1 });
$timeout = Glib::Timeout->add_seconds($config{UPDATE_FREQUENCY}, sub {
checkUpdates();
1;
@@ -716,7 +716,7 @@ sub go2State {
my $timeout = 5000;
$bubble->set_timeout($timeout);
# both need to be in a eval block in case notification daemon isn't running:
- Glib::Timeout->add($timeout, sub { eval { $bubble->close }; 0 });
+ Glib::Timeout->add_seconds($timeout/1000, sub { eval { $bubble->close }; 0 });
eval { $bubble->show };
warn ">> ERR:$@" if $@;
}