moin,
some days ago, KDevelop-team released a new version of KDevelop and 
KDevPlatform. If you install it, it will break KTechLab. So I created a patch 
that makes KTechLab use the newer API. This brings some advantages. I 
mentioned faster start-up times. Also the API made it possible to remove some 
hacks I created. Unfortunately it’s not compatible at some points.

You should be able to use "git am" to apply the patch. I haven’t pushed it 
into master, because I promised to stay compatible with 4.0 ;) That’s what 
should be the case. But in the future, we need to bump versions… once again.

bye then
julian
From 10f8a6923e64b4e9eb08a54f328b81cd64f135f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Julian=20B=C3=A4ume?= <jul...@svg4all.de>
Date: Wed, 20 Oct 2010 18:10:47 +0200
Subject: [PATCH] bump to KDevplatform 1.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Some things are necessary:

 * simplify project parsing

make parsing work without knowledge about the root item. the root item’s
parent will be NULL, so this is indication enough.

this is necessary, because these methods will be removed in KDevplatform
1.1.

 * remove IExtension interface again

this is removed in KDevplatform 1.1

 * bump version in desktop files
---
 src/interfaces/irouterplugin.h                     |    2 --
 src/kdevplugins/ktlproject/ktlproject.desktop      |    2 +-
 src/kdevplugins/ktlproject/ktlprojectmanager.cpp   |   15 +++++++--------
 .../automatic_router/ktlautomatic_router.desktop   |    2 +-
 .../automatic_router/ktlautomaticrouterplugin.h    |    1 -
 src/plugins/basic_ec/ktlbasic_ec.desktop           |    2 +-
 src/plugins/circuit/ktlcircuit.desktop             |    2 +-
 .../logic_components/ktllogic_components.desktop   |    2 +-
 src/plugins/simulator/ktlsimulator.desktop         |    2 +-
 9 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/src/interfaces/irouterplugin.h b/src/interfaces/irouterplugin.h
index b7abdd6..48ba984 100644
--- a/src/interfaces/irouterplugin.h
+++ b/src/interfaces/irouterplugin.h
@@ -25,7 +25,6 @@
 #include "ktlinterfacesexport.h"
 
 #include <QtCore/QObject>
-#include <interfaces/iextension.h>
 
 class QPointF;
 class QPainterPath;
@@ -68,7 +67,6 @@ protected:
 
 }
 
-KDEV_DECLARE_EXTENSION_INTERFACE_NS( KTechLab, IRouterPlugin, "org.ktechlab.IRouterPlugin" )
 Q_DECLARE_INTERFACE( KTechLab::IRouterPlugin, "org.ktechlab.IRouterPlugin" )
 
 #endif // IROUTERPLUGIN_H
diff --git a/src/kdevplugins/ktlproject/ktlproject.desktop b/src/kdevplugins/ktlproject/ktlproject.desktop
index 1c9d8d4..7b93018 100644
--- a/src/kdevplugins/ktlproject/ktlproject.desktop
+++ b/src/kdevplugins/ktlproject/ktlproject.desktop
@@ -10,7 +10,7 @@ X-KDE-PluginInfo-Name=ktlprojectmanager
 X-KDE-PluginInfo-Author=Julian Bäume
 X-KDE-PluginInfo-Version=0.1
 X-KDE-PluginInfo-License=LGPL
-X-KDevelop-Version=9
+X-KDevelop-Version=10
 X-KDevelop-Category=Project
 X-KDevelop-Mode=GUI
 X-KDevelop-SupportedMimeTypes=application/x-ktechlab
diff --git a/src/kdevplugins/ktlproject/ktlprojectmanager.cpp b/src/kdevplugins/ktlproject/ktlprojectmanager.cpp
index 2f1d01a..019f57d 100644
--- a/src/kdevplugins/ktlproject/ktlprojectmanager.cpp
+++ b/src/kdevplugins/ktlproject/ktlprojectmanager.cpp
@@ -49,17 +49,17 @@ class KDevelop::KTLProjectManagerPrivate
     {
         QStack<QString> domPath;
         domPath.push( name );
-        //TODO: can this be done without dynamic_cast?
-        ProjectFolderItem *wItem = dynamic_cast<ProjectFolderItem*>( item->parent() );
-        if (!wItem) {
+        if (!item->parent()) {
             //this must be the project root
             return projectDomDocument.documentElement();
         }
-        while (!wItem->isProjectRoot()){
-            domPath.push( wItem->folderName() );
-            //TODO: can this be done without dynamic_cast?
-            wItem = dynamic_cast<ProjectFolderItem*>( wItem->parent() );
+        ProjectBaseItem *wItem = item;
+        while ((wItem = wItem->parent())){
+            if (wItem->folder())
+                domPath.push( wItem->folder()->folderName() );
         };
+        //remove last element, because it’s the root element, we don’t want to find that
+        domPath.pop();
 
         QDomElement child = projectDomDocument.documentElement();
         while ( !domPath.isEmpty() ){
@@ -196,7 +196,6 @@ IProjectFileManager::Features KTLProjectManager::features() const
 ProjectFolderItem* KTLProjectManager::import( IProject* project )
 {
   ProjectFolderItem *rootItem = new ProjectFolderItem( project, project->folder() );
-  rootItem->setProjectRoot(true);
 
   d->projectFile = rootItem->project()->folder();
   d->projectFile.addPath(rootItem->project()->name()+".ktechlab");
diff --git a/src/plugins/automatic_router/ktlautomatic_router.desktop b/src/plugins/automatic_router/ktlautomatic_router.desktop
index 40dc5cf..e8a6176 100644
--- a/src/plugins/automatic_router/ktlautomatic_router.desktop
+++ b/src/plugins/automatic_router/ktlautomatic_router.desktop
@@ -10,7 +10,7 @@ X-KDE-PluginInfo-Name=ktlautomatic_router
 X-KDE-PluginInfo-Author=Julian Bäume
 X-KDE-PluginInfo-Version=0.1
 X-KDE-PluginInfo-License=LGPL
-X-KDevelop-Version=9
+X-KDevelop-Version=10
 X-KDevelop-Category=Project
 X-KDevelop-Mode=GUI
 X-KDevelop-SupportedMimeTypes=application/x-circuit,application/x-flowcode
diff --git a/src/plugins/automatic_router/ktlautomaticrouterplugin.h b/src/plugins/automatic_router/ktlautomaticrouterplugin.h
index 3f2e169..df582fd 100644
--- a/src/plugins/automatic_router/ktlautomaticrouterplugin.h
+++ b/src/plugins/automatic_router/ktlautomaticrouterplugin.h
@@ -23,7 +23,6 @@
 
 #include <interfaces/iplugin.h>
 #include <interfaces/irouterplugin.h>
-#include <interfaces/iextension.h>
 #include <QVariantList>
 
 class AutomaticRouter : public KDevelop::IPlugin, public KTechLab::IRouterPlugin
diff --git a/src/plugins/basic_ec/ktlbasic_ec.desktop b/src/plugins/basic_ec/ktlbasic_ec.desktop
index 532f638..8c4735e 100644
--- a/src/plugins/basic_ec/ktlbasic_ec.desktop
+++ b/src/plugins/basic_ec/ktlbasic_ec.desktop
@@ -10,7 +10,7 @@ X-KDE-PluginInfo-Name=ktlbasicec
 X-KDE-PluginInfo-Author=Julian Bäume
 X-KDE-PluginInfo-Version=0.1
 X-KDE-PluginInfo-License=LGPL
-X-KDevelop-Version=9
+X-KDevelop-Version=10
 X-KDevelop-Category=Project
 X-KDevelop-Mode=GUI
 X-KDevelop-SupportedMimeTypes=application/x-circuit
diff --git a/src/plugins/circuit/ktlcircuit.desktop b/src/plugins/circuit/ktlcircuit.desktop
index 32e1a3e..1d8b269 100644
--- a/src/plugins/circuit/ktlcircuit.desktop
+++ b/src/plugins/circuit/ktlcircuit.desktop
@@ -10,7 +10,7 @@ X-KDE-PluginInfo-Name=ktlcircuit
 X-KDE-PluginInfo-Author=Julian Bäume
 X-KDE-PluginInfo-Version=0.1
 X-KDE-PluginInfo-License=LGPL
-X-KDevelop-Version=9
+X-KDevelop-Version=10
 X-KDevelop-Category=Global
 X-KDevelop-Mode=NoGUI
 X-KDevelop-SupportedMimeTypes=application/x-circuit
diff --git a/src/plugins/logic_components/ktllogic_components.desktop b/src/plugins/logic_components/ktllogic_components.desktop
index fdfb47d..a72bee1 100644
--- a/src/plugins/logic_components/ktllogic_components.desktop
+++ b/src/plugins/logic_components/ktllogic_components.desktop
@@ -10,7 +10,7 @@ X-KDE-PluginInfo-Name=ktllogic
 X-KDE-PluginInfo-Author=Julian Bäume
 X-KDE-PluginInfo-Version=0.1
 X-KDE-PluginInfo-License=LGPL
-X-KDevelop-Version=9
+X-KDevelop-Version=10
 X-KDevelop-Category=Global
 X-KDevelop-Mode=GUI
 X-KDevelop-SupportedMimeTypes=application/x-circuit
diff --git a/src/plugins/simulator/ktlsimulator.desktop b/src/plugins/simulator/ktlsimulator.desktop
index 7807c2f..bfcc548 100644
--- a/src/plugins/simulator/ktlsimulator.desktop
+++ b/src/plugins/simulator/ktlsimulator.desktop
@@ -10,7 +10,7 @@ X-KDE-PluginInfo-Name=ktlsimulator
 X-KDE-PluginInfo-Author=Zoltan Padrah
 X-KDE-PluginInfo-Version=0.1
 X-KDE-PluginInfo-License=LGPL
-X-KDevelop-Version=9
+X-KDevelop-Version=10
 X-KDevelop-Category=Project
 X-KDevelop-Mode=GUI
 X-KDevelop-SupportedMimeTypes=application/x-circuit
-- 
1.7.1

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Ktechlab-devel mailing list
Ktechlab-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ktechlab-devel

Reply via email to