Remove Alarmd events on program uninstall
authorChristophe Dumez <dchris@gmail.com>
Mon, 28 Jun 2010 22:32:52 +0000 (00:32 +0200)
committerChristophe Dumez <dchris@gmail.com>
Mon, 28 Jun 2010 22:32:52 +0000 (00:32 +0200)
Changelog
TimedSilencer.pro.user
main.cpp

index 9be2350..d3abc10 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,2 +1,5 @@
-* Unreleased - Christophe Dumez <dchris@gmail.com> - v0.1
+* Tue Jun 29 2010 - Christophe Dumez <dchris@gmail.com> - v0.2
+    - Remove Alarmd events on program uninstall
+
+* Mon Jun 28 2010 - Christophe Dumez <dchris@gmail.com> - v0.1
     - Initial release
index ca09c68..9a63204 100644 (file)
      <value key="192.168.1.4" type="QDateTime">2010-06-26T16:09:16</value>
      <value key="localhost" type="QDateTime">2010-06-26T16:55:11</value>
     </valuemap>
-    <value key="Qt4ProjectManager.MaemoRunConfiguration.DeviceId" type="qulonglong">16</value>
+    <value key="Qt4ProjectManager.MaemoRunConfiguration.DeviceId" type="qulonglong">8</value>
     <valuemap key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployed" type="QVariantMap">
-     <value key="192.168.1.4" type="QDateTime">2010-06-27T15:34:11</value>
-     <value key="localhost" type="QDateTime">2010-06-28T19:25:15</value>
+     <value key="192.168.1.4" type="QDateTime">2010-06-29T00:09:20</value>
+     <value key="localhost" type="QDateTime">2010-06-28T20:15:39</value>
     </valuemap>
    </valuemap>
    <value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
index c80f3ba..796dfd4 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -18,7 +18,9 @@
 #include <QtGui/QApplication>
 #include <QTranslator>
 #include <QLocale>
+#include <iostream>
 #include "mainwindow.h"
+#include "alarmd_backend.h"
 
 int main(int argc, char *argv[])
 {
@@ -31,6 +33,15 @@ int main(int argc, char *argv[])
   translator.load(":/lang/timedsilencer_"+locale);
   a.installTranslator(&translator);
 
+  if(argc == 2) {
+    QString param = QString::fromLocal8Bit(argv[1]);
+    if(param == "--disable") {
+      std::cout << "Disabling the timed silencer events..." << std::endl;
+      AlarmdBackend::deleteEvents();
+      return 0;
+    }
+  }
+
   // Show Main window
   MainWindow w;
 #if defined(Q_WS_S60)