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

List:       kde-commits
Subject:    kdevelop/parts/valgrind
From:       Harald Fernengel <harald () kdevelop ! org>
Date:       2003-01-12 23:37:07
[Download RAW message or body]

CVS commit by harald: 

use KStandardDirs to search for valgrind executable and issue a warning when it could not be found


  M +13 -3     valgrind_dialog.cpp   1.5
  M +1 -1      valgrind_part.cpp   1.4


--- kdevelop/parts/valgrind/valgrind_dialog.cpp  #1.4:1.5
@@ -6,4 +6,6 @@
 #include <kurlrequester.h>
 #include <klineedit.h>
+#include <kstandarddirs.h>
+#include <kmessagebox.h>
 
 #include "dialog_widget.h"
@@ -52,8 +54,16 @@ void ValgrindDialog::setParameters( cons
 void ValgrindDialog::setValExecutable( const QString& ve )
 {
-  if ( ve.isEmpty() )
+  QString vUrl = ve;
+  if ( vUrl.isEmpty() ) {
+    vUrl = KStandardDirs::findExe( "valgrind" );
+  }
+  if ( vUrl.isEmpty() ) {
+    KMessageBox::sorry( this, i18n( "Could not find valgrind in your $PATH. Please make "
+                                    "sure it is installed properly." ),
+                        i18n( "valgrind not found" ) );
     w->valExecutableEdit->setURL( "valgrind" );
-  else
-    w->valExecutableEdit->setURL( ve );
+  } else {
+    w->valExecutableEdit->setURL( vUrl );
+  }
 }
 

--- kdevelop/parts/valgrind/valgrind_part.cpp  #1.3:1.4
@@ -208,5 +208,5 @@ void ValgrindPart::restorePartialProject
 
   QDomElement valElem = el->namedItem( "valgrind" ).toElement();
-  _lastValExec = valElem.attribute( "path", "valgrind" );
+  _lastValExec = valElem.attribute( "path", "" );
   _lastValParams = valElem.attribute( "params", "" );
 }


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

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