Bug 116396 - Quanta refuse to launch Gubed plugin
Summary: Quanta refuse to launch Gubed plugin
Status: RESOLVED FIXED
Alias: None
Product: quanta
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Linus McCabe
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-15 03:53 UTC by jerome
Modified: 2005-11-15 11:52 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jerome 2005-11-15 03:53:44 UTC
Version:           inconnu (using KDE 3.5 (RC1), compiled sources)
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.13-SL100_BRANCH_20051109154739-smp

Since I turned to Suse 10 ( OSS and Novell) Quanta (distrib or svn)refuse to launch Gubed(distrib or cvs) plugin with a 'a la Windows' message:

"Impossible de charger le module du débogueur, le code d'erreur 5 a été retourné : ."

I did not find in the various docs and sources what can be this Error 5.

The dot for 'error code' is not very useful...

Along with the acpi this is the only features which do not work on my laptop with Suse... (2 installs with the same results).
The Gubed + Kdewebdev sources which worked fine with a 9.3 install does not work any more on any Suse 10 flavours.
Comment 1 Linus McCabe 2005-11-15 09:00:32 UTC
It is createInstanceFromService that's failing and 5 means "ErrNoComponent - the factory does not support creating components of the specified type".
The reason it doesent say anything after the colon is because no error message is returned from that createInstanceFromService.
(Could also be that KLibLoader::self()->lastErrorMessage() is not the correct way to get the message string)

Anyway, I would think this means either the gubed plugin or desktop file isnt found. Could you do a 'updatedb && locate quantadebuggergubed' and post the results (updatedb will take some time and is not required if you do that regularly)

Also, what are your KDE paths set to?

/Linus
Comment 2 András Manţia 2005-11-15 10:48:10 UTC
SVN commit 480498 by amantia:

It is a QObject, so use Q_OBJECT.
Unfortunately it doesn't solve the critical bug 116396, the debugger client is still not loaded because the dynamic_cast in KParts::ComponentFactory::createInstanceFromFactory fails.

CCBUG: 116396

 M  +1 -1      gubed/quantadebuggergubed.cpp  
 M  +2 -0      interfaces/debuggerclient.cpp  
 M  +2 -0      interfaces/debuggerclient.h  


--- branches/KDE/3.5/kdewebdev/quanta/components/debugger/gubed/quantadebuggergubed.cpp #480497:480498
@@ -43,7 +43,7 @@
 
 
 K_EXPORT_COMPONENT_FACTORY( quantadebuggergubed,
-                            KGenericFactory<QuantaDebuggerGubed>("quantadebuggergubed"))
+                            KGenericFactory<QuantaDebuggerGubed>("quantadebuggergubed"));
 
 const char QuantaDebuggerGubed::protocolversion[] = "0.0.12";
 
--- branches/KDE/3.5/kdewebdev/quanta/components/debugger/interfaces/debuggerclient.cpp #480497:480498
@@ -156,3 +156,5 @@
 {
   KMessageBox::error(NULL, i18n("%1 does not support setting the value of variables.").arg(this->getName()), i18n("Unsupported Debugger Function"));
 }
+
+#include "debuggerclient.moc"
--- branches/KDE/3.5/kdewebdev/quanta/components/debugger/interfaces/debuggerclient.h #480497:480498
@@ -62,6 +62,8 @@
 
 class DebuggerClient : public QObject
 {
+  Q_OBJECT
+
   private:
   protected:
     DebuggerClient(QObject *parent, const char* name);
Comment 3 András Manţia 2005-11-15 11:52:14 UTC
I forgot to CC the bug here.

----------  Forwarded Message  ----------

Subject: branches/KDE/3.5/kdewebdev/quanta
Date: Tuesday 15 November 2005 12:48
From: Andras Mantia <amantia@kde.org>
To: kde-commits@kde.org

SVN commit 480512 by amantia:

Workaround for a failed dynamic_cast when loading a KParts-based
 plugin. Debugger plugins are now loaded and seem to work on SUSE 10 as
 well.

 M  +6 -1      components/debugger/debuggermanager.cpp
 M  +7 -1      project/projectprivate.cpp


---
 branches/KDE/3.5/kdewebdev/quanta/components/debugger/debuggermanager.
cpp #480511:480512 @@ -96,7 +96,12 @@
       if(Project::ref()->debuggerClient() == service->name())
       {
         int errCode = 0;
-        m_client =
 KParts::ComponentFactory::createInstanceFromService<DebuggerClient::De
buggerClient>(service, this, 0, QStringList(), &errCode); +//Workaround
 for dynamic_cast not working correctly on SUSE 10, gcc 4.0.2 +//The
 correct way should be a simple:
+// m_client =
 KParts::ComponentFactory::createInstanceFromService<DebuggerClient>(se
rvice, this, 0, QStringList(), &errCode); +        QObject* obj =
 KParts::ComponentFactory::createInstanceFromService<QObject>(service,
 this, 0, QStringList(), &errCode); +        if (obj &&
 obj->inherits("DebuggerClient"))
+          m_client = static_cast<DebuggerClient *>(obj);

         //kdDebug(24002) << service->name() << " (" << m_client << ")"
 << endl;

--- branches/KDE/3.5/kdewebdev/quanta/project/projectprivate.cpp
 #480511:480512 @@ -1484,8 +1484,14 @@
     KService::Ptr service = *iterDbg;
     if(m_debuggerClientEdit == service->name())
     {
+      DebuggerClient *dbg = dbg;
       int errCode = 0;
-      DebuggerClient::DebuggerClient* dbg =
 KParts::ComponentFactory::createInstanceFromService<DebuggerClient::De
buggerClient>(service, this, 0, QStringList(), &errCode); +//Workaround
 for dynamic_cast not working correctly on SUSE 10, gcc 4.0.2 +//The
 correct way should be a simple:
+// DebuggerClient *dbg =
 KParts::ComponentFactory::createInstanceFromService<DebuggerClient>(se
rvice, this, 0, QStringList(), &errCode); +      QObject* obj =
 KParts::ComponentFactory::createInstanceFromService<QObject>(service,
 this, 0, QStringList(), &errCode); +      if (obj &&
 obj->inherits("DebuggerClient"))
+        dbg = static_cast<DebuggerClient *>(obj);
       if (dbg)
       {
         QDomNode projectNode = m_sessionDom.firstChild().firstChild();

-------------------------------------------------------