[PC-BSD Commits] r20325 - pcbsd/current/src-qt4/life-preserver
svn at pcbsd.org
svn at pcbsd.org
Fri Nov 30 07:58:16 PST 2012
Author: kris
Date: 2012-11-30 15:58:15 +0000 (Fri, 30 Nov 2012)
New Revision: 20325
Modified:
pcbsd/current/src-qt4/life-preserver/lifePreserverMain.cpp
pcbsd/current/src-qt4/life-preserver/lifePreserverMain.h
Log:
Bugfixes for Life Preserver, cleanup how
we do the timers, this should fix some weird Xorg CPU usage
bugs
Modified: pcbsd/current/src-qt4/life-preserver/lifePreserverMain.cpp
===================================================================
--- pcbsd/current/src-qt4/life-preserver/lifePreserverMain.cpp 2012-11-30 15:25:18 UTC (rev 20324)
+++ pcbsd/current/src-qt4/life-preserver/lifePreserverMain.cpp 2012-11-30 15:58:15 UTC (rev 20325)
@@ -76,11 +76,10 @@
connect(actionRestore, SIGNAL( triggered(bool) ), this, SLOT(slotPushRestorePreserverClicked() ) );
// Start monitoring for changes
- QTimer::singleShot(2000, this, SLOT(slotScanPreserversForChanges() ) );
+ QTimer *traytimer = new QTimer(this);
+ connect(traytimer, SIGNAL(timeout()), this, SLOT(slotScanPreserversForChanges()));
+ traytimer->start(10000);
- // Start our tray animation loop
- QTimer::singleShot(1000, this, SLOT(slotTrayAnimation() ) );
-
// See if we need to start a backup now
QString cronscript = LIFEPRESERVERPATH + "/scripts/check-backups.sh &";
system(cronscript.toLatin1());
@@ -95,21 +94,16 @@
if ( failedBackups )
setIcon = ":/images/images/tray-icon-failed.png";
- if ( curActive ) {
- aniStep++;
- setIcon = ":/images/images/tray-icon-active" + tmp.setNum(aniStep) + ".png";
- if ( aniStep == 16 )
- aniStep = 0;
+ if ( curActive )
+ setIcon = ":/images/images/tray-icon-active7.png";
- trayIcon->setIcon(QIcon(setIcon));
- setWindowIcon(QIcon(setIcon));
- QTimer::singleShot(150, this, SLOT(slotTrayAnimation() ) );
- } else {
- trayIcon->setIcon(QIcon(setIcon));
- setWindowIcon(QIcon(setIcon));
- QTimer::singleShot(10000, this, SLOT(slotTrayAnimation() ) );
- }
+ if ( lastIcon == setIcon )
+ return;
+ trayIcon->setIcon(QIcon(setIcon));
+ setWindowIcon(QIcon(setIcon));
+ lastIcon = setIcon;
+
}
// Slot which brings up the restore widgets for a preserver
@@ -193,7 +187,7 @@
trayIcon->setToolTip(tooltip);
- QTimer::singleShot(6000, this, SLOT(slotScanPreserversForChanges() ) );
+ slotTrayAnimation();
}
// Slot which checks which preserver is currently highlighted
Modified: pcbsd/current/src-qt4/life-preserver/lifePreserverMain.h
===================================================================
--- pcbsd/current/src-qt4/life-preserver/lifePreserverMain.h 2012-11-30 15:25:18 UTC (rev 20324)
+++ pcbsd/current/src-qt4/life-preserver/lifePreserverMain.h 2012-11-30 15:58:15 UTC (rev 20325)
@@ -73,6 +73,7 @@
bool failedBackups;
bool curActive;
bool runAtStart;
+ QString lastIcon;
int aniStep;
signals:
More information about the Commits
mailing list