[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeplasma-addons/applets/leavenote
From:       Laurent Montel <montel () kde ! org>
Date:       2009-10-06 11:35:17
Message-ID: 1254828917.396477.22358.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1031883 by mlaurent:

Verify that knotes is on system


 M  +15 -7     leavenote.cpp  


--- trunk/KDE/kdeplasma-addons/applets/leavenote/leavenote.cpp #1031882:1031883
@@ -22,6 +22,8 @@
  */
 
 #include "leavenote.h"
+#include <kstandarddirs.h>
+#include <kmessagebox.h>
 
 #include <QtCore/QProcess>
 #include <QtCore/QHash>
@@ -199,15 +201,21 @@
         if (mTimer && mTimer->isActive()) {
             return;
         }
+        if (KStandardDirs::findExe("knotes").isEmpty())
+        {
+            KMessageBox::error( 0, i18n( "knotes can not find. Please install it to \
be able to send it" ) ); +        }
+        else
+        {
+            // TODO fine grain for errors after start of KNotes
+            QProcess knotes(this);
+            knotes.startDetached("knotes", QStringList() << "--skip-note");
+            knotes.waitForStarted();
 
-        // TODO fine grain for errors after start of KNotes
-        QProcess knotes(this);
-        knotes.startDetached("knotes", QStringList() << "--skip-note");
-        knotes.waitForStarted();
+            /* wait for the dbus interface to settle */
+            mTimer->singleShot(10000, this, SLOT(slotWaitForKNotes()));
+        }
 
-        /* wait for the dbus interface to settle */
-        mTimer->singleShot(10000, this, SLOT(slotWaitForKNotes()));
-
     } else {
         createNote(title, msg);
     }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic