diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2017-03-13 21:59:11 +0100 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2017-03-13 21:59:11 +0100 |
commit | a3ccd5ba235c27b2f7b80b6e9daa3d77c52d26bb (patch) | |
tree | 758d114294295f0b47a8a8749c07f3d9bda8b653 /mgaapplet | |
parent | 9e1a187dbda6d1c2a9cc70e5827098644afe0d53 (diff) | |
download | mgaonline-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
Diffstat (limited to 'mgaapplet')
-rwxr-xr-x | mgaapplet | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 $@; } |