From fbd89b52c144abcba6153e1f8cab1b8b5ea61940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Buclin?= Date: Mon, 13 Mar 2017 22:01:35 +0100 Subject: Prefer add_seconds() over add() as it uses less CPU and memory --- bin/net_applet | 4 ++-- data/net_applet.desktop | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/net_applet b/bin/net_applet index 683add7..4732e9c 100755 --- a/bin/net_applet +++ b/bin/net_applet @@ -453,7 +453,7 @@ sub checkNetworkForce() { } sub cronNetwork() { my $i; - $timeout = Glib::Timeout->add(2000, sub { + $timeout = Glib::Timeout->add_seconds(2, sub { checkWireless() if !($i++%30); checkNetwork(); 1; @@ -489,7 +489,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 $@; $need_update = 1; diff --git a/data/net_applet.desktop b/data/net_applet.desktop index 9f1b1d3..6aa27de 100644 --- a/data/net_applet.desktop +++ b/data/net_applet.desktop @@ -5,5 +5,5 @@ Exec=/usr/bin/net_applet --force Icon=/usr/share/libDrakX/pixmaps/connected.png Type=Application Categories=GTK;System;Monitor;X-MandrivaLinux-CrossDesktop; -X-KDE-autostart-after=kdesktop +X-KDE-autostart-after=panel StartupNotify=false -- cgit v1.2.1