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

List:       kde-commits
Subject:    =?utf-8?q?=5Bkdevplatform/1=2E2=5D_plugins/execute=3A_Just_add_e?=
From:       Aleix Pol <aleixpol () kde ! org>
Date:       2011-02-25 1:51:29
Message-ID: 20110225015129.28596A609B () git ! kde ! org
[Download RAW message or body]

Git commit 377b8ad5930d8e2fb79df9caa893f371cb78b61f by Aleix Pol.
Committed on 25/02/2011 at 02:51.
Pushed by apol into branch '1.2'.

Just add executable binaries to the native combo.
This will make the UI a little more usable and won't make the user think it works in \
cases that it doesn't.

M  +1    -1    plugins/execute/nativeappconfig.cpp     
M  +6    -3    plugins/execute/projecttargetscombobox.cpp     
M  +2    -1    plugins/execute/projecttargetscombobox.h     

http://commits.kde.org/kdevplatform/377b8ad5930d8e2fb79df9caa893f371cb78b61f

diff --git a/plugins/execute/nativeappconfig.cpp \
b/plugins/execute/nativeappconfig.cpp index b8520e0..66b9e9e 100644
--- a/plugins/execute/nativeappconfig.cpp
+++ b/plugins/execute/nativeappconfig.cpp
@@ -73,7 +73,7 @@ void NativeAppConfigPage::loadFromConfiguration(const KConfigGroup& \
                cfg, KDevelo
         executablePath->setUrl( cfg.readEntry( ExecutePlugin::executableEntry, \
KUrl() ) );  } else 
     {
-        projectTarget->setBaseItem( project ? project->projectItem() : 0);
+        projectTarget->setBaseItem( project ? project->projectItem() : 0, true);
         projectTarget->setCurrentItemPath( cfg.readEntry( \
ExecutePlugin::projectTargetEntry, QStringList() ) );  \
projectTargetRadio->setChecked( true );  }
diff --git a/plugins/execute/projecttargetscombobox.cpp \
b/plugins/execute/projecttargetscombobox.cpp index 1f6cb56..1096093 100644
--- a/plugins/execute/projecttargetscombobox.cpp
+++ b/plugins/execute/projecttargetscombobox.cpp
@@ -37,8 +37,10 @@ class ExecutablePathsVisitor
     : public ProjectVisitor
 {
     public:
+        ExecutablePathsVisitor(bool exec) : m_onlyExecutables(exec) {}
         virtual void visit(ProjectExecutableTargetItem* eit) {
-            m_paths += \
KDevelop::joinWithEscaping(eit->model()->pathFromIndex(eit->index()), '/', '\\'); +   \
if(!m_onlyExecutables || eit->type()==ProjectTargetItem::ExecutableTarget) +          \
m_paths += KDevelop::joinWithEscaping(eit->model()->pathFromIndex(eit->index()), '/', \
'\\');  }
         virtual void visit(IProject* p) { ProjectVisitor::visit(p); }
         virtual void visit(ProjectBuildFolderItem* it) { ProjectVisitor::visit(it); \
} @@ -49,11 +51,12 @@ class ExecutablePathsVisitor
         QStringList paths() const { return m_paths; }
         
     private:
+        bool m_onlyExecutables;
         QStringList m_paths;
 };
 
 
-void ProjectTargetsComboBox::setBaseItem(ProjectFolderItem* item)
+void ProjectTargetsComboBox::setBaseItem(ProjectFolderItem* item, bool exec)
 {
     clear();
 
@@ -66,7 +69,7 @@ void ProjectTargetsComboBox::setBaseItem(ProjectFolderItem* item)
         }
     }
     
-    ExecutablePathsVisitor walker;
+    ExecutablePathsVisitor walker(exec);
     foreach(ProjectFolderItem* item, items) {
         walker.visit(item);
     }
diff --git a/plugins/execute/projecttargetscombobox.h \
b/plugins/execute/projecttargetscombobox.h index d927a00..1542268 100644
--- a/plugins/execute/projecttargetscombobox.h
+++ b/plugins/execute/projecttargetscombobox.h
@@ -21,6 +21,7 @@
 #define PROJECTTARGETSCOMBOBOX_H
 
 #include <QtGui/QComboBox>
+#include <project/projectmodel.h>
 
 namespace KDevelop {
 class ProjectFolderItem;
@@ -32,7 +33,7 @@ class ProjectTargetsComboBox : public QComboBox
     public:
         ProjectTargetsComboBox(QWidget* parent = 0);
         
-        void setBaseItem(KDevelop::ProjectFolderItem* item);
+        void setBaseItem(KDevelop::ProjectFolderItem* item, bool exec);
         void setCurrentItemPath(const QStringList& str);
         
         QStringList currentItemPath() const;


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

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