KDE/kdevelop

Matt Rogers mattr at kde.org
Thu Aug 24 04:13:19 UTC 2006


SVN commit 576422 by mattr:

Remove the convenience method from KDevPlugin for extension.
Use KDevPluginController::extension() instead via KDevCore instead.

If we need the convenience of having it in KDevPlugin, we can add it
back, but let's try it this way first

CCMAIL: kdevelop-devel at kdevelop.org


 M  +7 -2      buildtools/builders/makebuilder/kdevmakebuilder.cpp  
 M  +30 -25    kdevelop.kdevelop  
 M  +3 -7      lib/interfaces/kdevmakeinterface.h  
 M  +0 -5      lib/kdevplugin.cpp  
 M  +0 -20     lib/kdevplugin.h  
 M  +1 -1      lib/kdevplugincontroller.cpp  
 M  +6 -1      lib/kdevplugincontroller.h  


--- trunk/KDE/kdevelop/buildtools/builders/makebuilder/kdevmakebuilder.cpp #576421:576422
@@ -8,6 +8,7 @@
 
 #include <kdevproject.h>
 #include <kdevcore.h>
+#include <kdevplugincontroller.h>
 #include <kdevmakeinterface.h>
 #include <domutil.h>
 
@@ -33,7 +34,10 @@
     m_project = qobject_cast<KDevProject*>(parent);
     Q_ASSERT(m_project);
 
-    if (KDevMakeFrontend *make = project()->extension<KDevMakeFrontend>("KDevelop/MakeFrontend")) {
+    KDevPluginController* kdpc = KDevCore::pluginController();
+    KDevMakeFrontend* make = kdpc->extension<KDevMakeFrontend>("KDevelop/MakeFrontend");
+    if ( make )
+    {
         connect(make, SIGNAL(commandFinished(const QString &)),
             this, SLOT(commandFinished(const QString &)));
 
@@ -75,7 +79,8 @@
 
 bool KDevMakeBuilder::build(KDevProjectItem *dom)
 {
-    if (KDevMakeFrontend *make = project()->extension<KDevMakeFrontend>("KDevelop/MakeFrontend")) {
+    KDevPluginController* kdpc = KDevCore::pluginController();
+    if (KDevMakeFrontend *make = kdpc->extension<KDevMakeFrontend>("KDevelop/MakeFrontend")) {
         if (KDevProjectFolderItem *folder = dom->folder()) {
             // ### compile the folder
             QString command = buildCommand(dom);
--- trunk/KDE/kdevelop/kdevelop.kdevelop #576421:576422
@@ -15,24 +15,9 @@
     <description/>
     <ignoreparts>
       <part>kdevbookmarks</part>
-      <part>kdevclassview</part>
-      <part>kdevsnippet</part>
-      <part>kdevctags2</part>
-      <part>kdevdocumentation</part>
-      <part>kdevdoxygen</part>
-      <part>kdevfilegroups</part>
+      <part>kdevfilelist</part>
       <part>kdevdistpart</part>
-      <part>kdevopenwith</part>
-      <part>kdevpartexplorer</part>
-      <part>kdevquickopen</part>
-      <part>kdevregexptest</part>
-      <part>kdevscripting</part>
-      <part>kdevsecurity</part>
-      <part>kdevfilter</part>
-      <part>kdevtexttools</part>
-      <part>kdevtools</part>
     </ignoreparts>
-    <versioncontrol>kdevsubversion</versioncontrol>
     <defaultencoding/>
   </general>
   <kdevfileview>
@@ -46,7 +31,7 @@
       <hidenonlocation>false</hidenonlocation>
     </groups>
     <tree>
-      <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+      <hidepatterns>*.o,*.lo,*~</hidepatterns>
       <hidenonprojectfiles>false</hidenonprojectfiles>
       <showvcsfields>false</showvcsfields>
     </tree>
@@ -200,6 +185,14 @@
       <codeCompletionDelay>250</codeCompletionDelay>
       <argumentsHintDelay>400</argumentsHintDelay>
       <headerCompletionDelay>250</headerCompletionDelay>
+      <showOnlyAccessibleItems>false</showOnlyAccessibleItems>
+      <completionBoxItemOrder>0</completionBoxItemOrder>
+      <howEvaluationContextMenu>true</howEvaluationContextMenu>
+      <showCommentWithArgumentHint>true</showCommentWithArgumentHint>
+      <statusBarTypeEvaluation>false</statusBarTypeEvaluation>
+      <namespaceAliases>std=_GLIBCXX_STD</namespaceAliases>
+      <processPrimaryTypes>true</processPrimaryTypes>
+      <processFunctionArguments>false</processFunctionArguments>
     </codecompletion>
     <creategettersetter>
       <prefixGet/>
@@ -214,6 +207,8 @@
       <used>true</used>
       <version>4</version>
       <root>/home/qt/4.1</root>
+      <includestyle>4</includestyle>
+      <designerintegration>ExternalDesigner</designerintegration>
     </qt>
     <splitheadersource>
       <enabled>false</enabled>
@@ -237,33 +232,43 @@
       <terminal>false</terminal>
       <autocompile>true</autocompile>
       <envvars>
-        <envvar value="unix:abstract=/tmp/dbus-5c1qUTESsp,guid=fa749744e8e025172e8bc5b855da4b00" name="DBUS_SESSION_BUS_ADDRESS" />
-        <envvar value="28575" name="DBUS_SESSION_BUS_PID" />
         <envvar value="$HOME/.kde4" name="KDEHOME" />
         <envvar value="/tmp/$USER-kde4" name="KDETMP" />
         <envvar value="/var/tmp/$USER-kde4" name="KDEVARTMP" />
         <envvar value="$LD_LIBRARY_PATH:$QTDIR/lib" name="LD_LIBRARY_PATH" />
-        <envvar value="/home/kde/installs/4.0/bin:/home/qt/4.1/bin:$PATH" name="PATH" />
-        <envvar value="/home/qt/4.1" name="QTDIR" />
+        <envvar value="/home/kde/installs/4.0/bin:/home/qt/4.2/bin:$PATH" name="PATH" />
+        <envvar value="/home/qt/4.2" name="QTDIR" />
       </envvars>
     </run>
     <build>
       <buildtool>make</buildtool>
-      <builddir>/home/kde/build/home/kde/trunk/KDE/kdevelop</builddir>
+      <builddir>/home/kde/trunk/KDE/kdevelop</builddir>
     </build>
     <make>
       <abortonerror>false</abortonerror>
-      <numberofjobs>1</numberofjobs>
+      <numberofjobs>4</numberofjobs>
       <prio>0</prio>
       <dontact>false</dontact>
-      <makebin>make install</makebin>
+      <makebin>makeobj</makebin>
       <defaulttarget/>
       <makeoptions/>
       <selectedenvironment>default</selectedenvironment>
       <environments>
-        <default/>
+        <default>
+          <envvar value="/home/kde/installs/4.0" name="KDEDIR" />
+          <envvar value="$HOME/.kde4" name="KDEHOME" />
+          <envvar value="/tmp/$USER-kde4" name="KDETMP" />
+          <envvar value="/var/tmp/$USER-kde4" name="KDEVARTMP" />
+          <envvar value="s:/home/kde/trunk/:/home/kde/trunk/build/:" name="OBJ_REPLACEMENT" />
+          <envvar value="/opt/icecream/bin:/home/kde/installs/4.0/bin:/home/qt/4.2/bin:$PATH" name="PATH" />
+          <envvar value="/home/qt/4.2/lib:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" name="PKG_CONFIG_PATH" />
+          <envvar value="/home/qt/4.2" name="QTDIR" />
+        </default>
       </environments>
     </make>
+    <general>
+      <activedir/>
+    </general>
   </kdevcustomproject>
   <ctagspart>
     <customArguments/>
--- trunk/KDE/kdevelop/lib/interfaces/kdevmakeinterface.h #576421:576422
@@ -57,13 +57,9 @@
 public:
 
     /**Constructor.
-    @param info Important information about the plugin - plugin internal and generic
-    (GUI) name, description, a list of authors, etc. That information is used to show
-    plugin information in various places like "about application" dialog, plugin selector
-    dialog, etc. Plugin does not take ownership on info object, also its lifetime should
-    be equal to the lifetime of the plugin.
-    @param parent The parent object for the plugin.
-    */
+     * @param instance The instance object created by the plugin factory
+     * @param parent The parent object for the plugin.
+     */
     KDevMakeFrontend(KInstance *instance, QObject *parent=0)
         :KDevPlugin(instance, parent) {}
 
--- trunk/KDE/kdevelop/lib/kdevplugin.cpp #576421:576422
@@ -63,9 +63,4 @@
     return false;
 }
 
-KDevPlugin * KDevPlugin::extension_internal( const QString &serviceType, const QString &constraint )
-{
-    return KDevCore::pluginController() ->extension( serviceType, constraint );
-}
-
 #include "kdevplugin.moc"
--- trunk/KDE/kdevelop/lib/kdevplugin.h #576421:576422
@@ -138,26 +138,6 @@
      */
     virtual bool isCentralPlugin() const;
 
-    //FIXME Is this used for anything?
-    /**Queries for the plugin which supports given service type (such plugins are called extensions in KDevelop).
-    All already loaded plugins will be queried and the <b>first loaded one</b> to support
-    the service type will be returned. Any plugin can be an extension, only "ServiceTypes=..."
-    entry is required in .desktop file for that plugin.
-
-    Template argument is used as a type to cast the result to. This is done because extension
-    is usually derived from a certain base class and not directly from KDevPlugin.
-    @param serviceType The service type of an extension (like "KDevelop/SourceFormatter").
-    @param constraint The constraint which is applied when quering for the service. This
-    constraint is a usual KTrader constraint statement (like "[X-KDevelop-Foo]=='MyFoo'").
-    @return A KDevelop extension plugin for given service type or 0 if no plugin supports it*/
-    template <class Extension>
-    Extension *extension(const QString &serviceType, const QString &constraint = "")
-    {
-       return static_cast<Extension*>(extension_internal(serviceType, constraint));
-    }
-
-private:
-    KDevPlugin *extension_internal(const QString &serviceType, const QString &constraint = "");
 };
 
 #endif
--- trunk/KDE/kdevelop/lib/kdevplugincontroller.cpp #576421:576422
@@ -253,7 +253,7 @@
     return m_parts.values();
 }
 
-KDevPlugin * KDevPluginController::extension( const QString & serviceType, const QString & constraint )
+KDevPlugin * KDevPluginController::getExtension( const QString & serviceType, const QString & constraint )
 {
     KService::List offers = KDevPluginController::query( serviceType, constraint );
     for ( KService::List::const_iterator it = offers.constBegin(); it != offers.constEnd(); ++it )
--- trunk/KDE/kdevelop/lib/kdevplugincontroller.h #576421:576422
@@ -104,7 +104,11 @@
      * constraint is a usual KTrader constraint statement (like "[X-KDevelop-Foo]=='MyFoo'").
      * @return A KDevelop extension plugin for given service type or 0 if no plugin supports it
      */
-    KDevPlugin *extension( const QString &serviceType, const QString &constraint = "" );
+    template <class Extension>
+    Extension *extension(const QString &serviceType, const QString &constraint = "")
+    {
+        return static_cast<Extension*>(getExtension( serviceType, constraint ) );
+    }
 
     /**
      * Queries KDevelop services. Version is checked automatically
@@ -187,6 +191,7 @@
 
 private:
     static KDevPlugin *loadPlugin( const KService::Ptr &service );
+    KDevPlugin* getExtension( const QString&, const QString& );
 
     QHash<QString, KDevPlugin *> m_parts;
     QString m_profile;




More information about the KDevelop-devel mailing list