summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2017-03-13 22:01:35 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2017-03-13 22:01:35 +0100
commitfbd89b52c144abcba6153e1f8cab1b8b5ea61940 (patch)
tree6e03747787c14d3c8fb6d48189f75dc0ffbcf3ee
parent01d9f9a9b7059fff34089bc7f3eea575b079447a (diff)
downloaddrakx-net-fbd89b52c144abcba6153e1f8cab1b8b5ea61940.tar
drakx-net-fbd89b52c144abcba6153e1f8cab1b8b5ea61940.tar.gz
drakx-net-fbd89b52c144abcba6153e1f8cab1b8b5ea61940.tar.bz2
drakx-net-fbd89b52c144abcba6153e1f8cab1b8b5ea61940.tar.xz
drakx-net-fbd89b52c144abcba6153e1f8cab1b8b5ea61940.zip
Prefer add_seconds() over add() as it uses less CPU and memory
-rwxr-xr-xbin/net_applet4
-rw-r--r--data/net_applet.desktop2
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