This forum has been archived. All content is frozen. Please use KDE Discuss instead.

kwordpart plugin not found

Tags: None
(comma "," separated)
xyfix
Registered Member
Posts
110
Karma
0

Re: kwordpart plugin not found

Wed Jan 20, 2010 4:35 pm
Just to be save ( because I sourced the bashrc many times ) I rebooted my machine and checked all the variables. They are set according to what you've written in this post. I also recalled you wrote that kde4-config is for kde4 so I executed a few commands:

[user@localhost1016:~/koffice-2.1/ ]$ kde4-config --expandvars
[user@localhost1016:~/koffice-2.1/ ]$ kde4-config --prefix
/usr
[user@localhost1016:~/koffice-2.1/ ]$ kde4-config --exec-prefix
/usr
[user@localhost1016:~/koffice-2.1/ ]$ kde4-config --libsuffix
[user@localhost1016:~/koffice-2.1/ ]$
[user@localhost1016:~/koffice-2.1/ ]$ kde4-config --path apps
/home/user/.kde4/share/applnk/:/usr/share/applnk/
[user@localhost1016:~/koffice-2.1/ ]$ kde4-config --path config
/home/user/.kde4/share/config/:/home/user/koffice-2.1/install/share/config/:/usr/share/kde4/config/:/etc/kde4/share/config/
[user@localhost1016:~/koffice-2.1/ ]$ kde4-config --path exe
/home/user/.kde4/lib/kde4/libexec/:/usr/lib/kde4/libexec/:/home/user/koffice-2.1/install/bin/:/usr/bin/
[user@localhost1016:~/koffice-2.1/ ]$ kde4-config --path lib
/home/user/.kde4/lib/:/home/user/koffice-2.1/install/lib/:/usr/lib/
[user@localhost1016:~/koffice-2.1/ ]$ kde4-config --path module
/home/user/.kde4/lib/kde4/:/home/user/koffice-2.1/install/lib/kde4/:/usr/lib/kde4/
[user@localhost1016:~/koffice-2.1/ ]$ kde4-config --path services
/home/user/.kde4/share/kde4/services/:/home/user/koffice-2.1/install/share/kde4/services/:/usr/share/kde4/services/
[user@localhost1016:~/koffice-2.1/ ]$$ kde4-config --path servicetypes
/home/user/.kde4/share/kde4/servicetypes/:/home/user/koffice-2.1/install/share/kde4/servicetypes/:/usr/share/kde4/servicetypes/
[user@localhost1016:~/koffice-2.1/ ]$


never tried kdebugdialog, but I'll do my best.
xyfix
Registered Member
Posts
110
Karma
0

Re: kwordpart plugin not found

Wed Jan 20, 2010 4:41 pm
some extra info after kdebugdialog

myapp(5863)/ findLibraryInternal: plugins should not have a 'lib' prefix: "libkwordpart.so"
myapp(5863)/ findLibraryInternal: plugins should not have a 'lib' prefix: "libkwordpart.so"
myapp(5863)/ kde4Factory: The library "/home/user/koffice-2.1/install/lib/kde4/libkwordpart.so" does not offer a qt_plugin_instance function.
kword(5863)/kdecore (KLibLoader) kde4Factory: The library "/home/user/koffice-2.1/install/lib/kde4/defaulttools.so" does not offer a qt_plugin_instance function.
kword(5863)/kdecore (KLibLoader) kde4Factory: The library "/home/user/koffice-2.1/install/lib/kde4/kopabackgroundtool.so" does not offer a qt_plugin_instance function.
kword(5863)/kdecore (KLibLoader) kde4Factory: The library "/home/user/koffice-2.1/install/lib/kde4/textshape.so" does not offer a qt_plugin_instance function.
kword(5863)/kdecore (KLibLoader) kde4Factory: The library "/home/user/koffice-2.1/install/lib/kde4/pathshapes.so" does not offer a qt_plugin_instance function.
kword(5863)/kdecore (KLibLoader) kde4Factory: The library "/home/user/koffice-2.1/install/lib/kde4/pictureshape.so" does not offer a qt_plugin_instance function.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: kwordpart plugin not found

Thu Jan 21, 2010 9:39 pm
That indicates that the Part is being loaded successfully. Make sure that the KPart is properly parented to the appropriate parent widget.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
xyfix
Registered Member
Posts
110
Karma
0

Re: kwordpart plugin not found

Fri Jan 22, 2010 7:51 am
OK, I don't quite understand that. This works for the katepart, shouldn't it also work with kwordpart in exactly the same manner? The parent widget is a QVBoxLayout, the piece of code above is preceded by:

Code: Select all
QWidget* privateLayoutWidget = new QWidget( parent );
privateLayoutWidget->setObjectName("privateLayoutWidget");

QVBoxLayout* layout2 = new QVBoxLayout( privateLayoutWidget);
layout2->setObjectName("layout2");


I guess that should be OK then...right??
xyfix
Registered Member
Posts
110
Karma
0

Re: kwordpart plugin not found

Fri Jan 22, 2010 11:13 am
I'm think you guys are right about the kwordpart being loaded, how else would I get this message then?

Calling appendChild() on a null node does nothing.
kword(17654)/kparts KParts::Part::slotWidgetDestroyed: deleting part "document_0


this message shows up after the rest of the
...does not offer qt_plugin_instance function
messages and after I close my app.
xyfix
Registered Member
Posts
110
Karma
0

Re: kwordpart plugin not found

Fri Jan 22, 2010 12:30 pm
My previous remark isn't valid I think, because after debugging I saw that the
If(factory)
is false so it never enters it. So there is no way that the kwordpart is found....I guess :?
xyfix
Registered Member
Posts
110
Karma
0

Re: kwordpart plugin not found

Fri Jan 22, 2010 1:40 pm
Tried some new code to get some services back, this is the code

Code: Select all
KService::List offers=KServiceTypeTrader::self()->query("KParts/ReadWritePart");
KService::List::const_iterator iter;

for(iter = offers.begin(); iter < offers.end(); ++iter)
{
   QString error;
   KService::Ptr service = *iter;

   KPluginFactory *factory = KPluginLoader(service->library()).factory();

   if (!factory)
  {
     kError(5001) << "KPluginFactory could not load the plugin:" << service->library();

    continue;
  }
   
  kDebug() << "Load plugin:" << service->name();
}


this is the gdb debug output:
myapp(18472)/ ReportEditor::initialiseReportArea: Load plugin: "Embedded Advanced Text Editor"
(gdb) next
(gdb) next
(gdb) next
(gdb) next
(gdb) next
myapp(18472)/ findLibraryInternal: plugins should not have a 'lib' prefix: "libkwordpart.so"
myapp(18472)/ findLibraryInternal: plugins should not have a 'lib' prefix: "libkwordpart.so"
myapp(18472)/ kde4Factory: The library "/home/user/koffice-2.1/install/lib/kde4/libkwordpart.so" does not offer a qt_plugin_instance function.
(gdb) next
(gdb) next
kword(18472) ReportEditor::initialiseReportArea: Load plugin: "KOffice Word Processing Component"
(gdb) next


And then the for loop ends, it seems like the kwordpart is found...is it?
xyfix
Registered Member
Posts
110
Karma
0

Re: kwordpart plugin not found

Fri Jan 22, 2010 3:49 pm
Strange...I tried running the kword that I just build (fresh checkout ) and I see the same errors, but kword comes up an works like a charm, here is the output when running kword:

kword(31262)/kdecore (KSycoca) KSycocaPrivate::openDatabase: Trying to open ksycoca from "/var/tmp/kdecache-userMUYcc8/ksycoca4"
kword(31262)/kdecore (KLibLoader) findLibraryInternal: plugins should not have a 'lib' prefix: "libkwordpart.so"
kword(31262)/kdecore (KLibLoader) kde4Factory: The library "/home/user/koffice-2.1/install/lib/kde4/libkwordpart.so" does not offer a qt_plugin_instance function.
kword(31262)/kdecore (KLibLoader) kde4Factory: The library "/home/user/koffice-2.1/install/lib/kde4/defaulttools.so" does not offer a qt_plugin_instance function.
kword(31262)/kdecore (KLibLoader) kde4Factory: The library "/home/user/koffice-2.1/install/lib/kde4/kpresentertoolanimation.so" does not offer a qt_plugin_instance function.
kword(31262)/kdecore (KLibLoader) kde4Factory: The library "/home/user/koffice-2.1/install/lib/kde4/kopabackgroundtool.so" does not offer a qt_plugin_instance function.
kword(31262)/kdecore (KLibLoader) kde4Factory: The library "/home/user/koffice-2.1/install/lib/kde4/paragraphtool.so" does not offer a qt_plugin_instance function.
kword(31262)/kdecore (KLibLoader) kde4Factory: The library "/home/user/koffice-2.1/install/lib/kde4/divineproportionshape.so" does not offer a qt_plugin_instance function.
kword(31262)/kdecore (KLibLoader) kde4Factory: The library "/home/user/koffice-2.1/install/lib/kde4/formulashape.so" does not offer a qt_plugin_instance function.
kword(31262)/kdecore (KLibLoader) kde4Factory: The library "/home/user/koffice-2.1/install/lib/kde4/textshape.so" does not offer a qt_plugin_instance function.
kword(31262)/kdecore (KLibLoader) kde4Factory: The library "/home/user/koffice-2.1/install/lib/kde4/artistictextshape.so" does not offer a qt_plugin_instance function.
kword(31262)/kdecore (KLibLoader) kde4Factory: The library "/home/user/koffice-2.1/install/lib/kde4/chartshape.so" does not offer a qt_plugin_instance function.
kword(31262)/kdecore (KLibLoader) kde4Factory: The library "/home/user/koffice-2.1/install/lib/kde4/pathshapes.so" does not offer a qt_plugin_instance function.
kword(31262)/kdecore (KLibLoader) kde4Factory: The library "/home/user/koffice-2.1/install/lib/kde4/pictureshape.so" does not offer a qt_plugin_instance function.
kword(31262)/kdecore (KLibLoader) findLibraryInternal: plugins should not have a 'lib' prefix: "libxsltexport.so"
kword(31262)/kfile (kdelibs) KFileWidget::KFileWidget: startDir KUrl("kfiledialog:/OpenDialog")
kword(31262)/kfile (kdelibs) KFileWidget::getStartUrl: for KUrl("kfiledialog:/OpenDialog") ret KUrl("file:///home/user/Documents") recentDirClass ":OpenDialog" fileName ""
kword(31262)/kfile (kdelibs) KDirOperator::setDirLister: mainWidget= KoMainWindow(0x81d5e20, name = "MainWindow#1")
kword(31262)/kfile (kdelibs) KDirOperator::Private::updateSorting: changing sort flags from -1 to 4
kword(31262)/kfile (kdelibs) KDirOperator::Private::updateSorting: changing sort flags from 4 to 4
kword(31262)/kfile (kdelibs) KUrlComboBox::setUrl: setURL: text= "/home/user/Documents"
kword(31262)/kfile (kdelibs) KFileWidget::KFileWidget: statJob found filename "Documents"
kword(31262)/kfile (kdelibs) KFileWidget::KFileWidget: selecting filename "Documents"
kword(31262)/kfile (kdelibs) KDirOperator::setCurrentItems:
kword(31262)/kfile (kdelibs) KDirOperator::setCurrentItems:
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: "application/vnd.oasis.opendocument.text"
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: "application/vnd.oasis.opendocument.text-template"
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: "application/x-kword"
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: "application/x-hancomword"
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: Could not create mimetype!
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: "text/xml"
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: Could not create mimetype!
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: "application/x-amipro"
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: "text/plain"
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: "text/html"
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: "application/x-applix-word"
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: "application/x-abiword"
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: "text/vnd.wap.wml"
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: "application/x-mswrite"
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: "application/vnd.sun.xml.writer"
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: "application/vnd.sun.xml.writer.template"
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: "application/vnd.sun.xml.writer.master"
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: Could not create mimetype!
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: "application/rtf"
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: "application/vnd.palm"
kword(31262)/kfile (kdelibs) KFileFilterCombo::setMimeFilter: Could not create mimetype!
kword(31262)/kfile (kdelibs) KDirOperator::setCurrentItem:
kword(31262)/kfile (kdelibs) KDirOperator::setCurrentItem:
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: kwordpart plugin not found

Fri Jan 22, 2010 11:53 pm
The previous code was likely fine.
Try this to perform the loading instead.

Code: Select all
m_part = factory->create<KParts::ReadWritePart *>(this, this, "kwordpart" );


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
xyfix
Registered Member
Posts
110
Karma
0

Re: kwordpart plugin not found

Tue Jan 26, 2010 8:51 am
Sorry for the late reply, but had a long weekend. I tried the suggestion of bcooksley but this is what I get:

Code: Select all
source/Report/reporteditor.cpp:107: error: cannot convert ‘KParts::ReadWritePart**’ to ‘KParts::ReadWritePart*’ in assignment
/usr/include/kpluginfactory.h: In member function ‘T* KPluginFactory::create(QWidget*, QObject*, const QString&, const QVariantList&) [with T = KParts::ReadWritePart*]’:
source/Report/reporteditor.cpp:107:   instantiated from here
/usr/include/kpluginfactory.h:515: error: ‘staticMetaObject’ is not a member of ‘KParts::ReadWritePart*’
/usr/include/QtCore/qobject.h: In function ‘T qobject_cast(QObject*) [with T = KParts::ReadWritePart**]’:
/usr/include/kpluginfactory.h:517:   instantiated from ‘T* KPluginFactory::create(QWidget*, QObject*, const QString&, const QVariantList&) [with T = KParts::ReadWritePart*]’
source/Report/reporteditor.cpp:107:   instantiated from here
/usr/include/QtCore/qobject.h:441: error: request for member ‘qt_check_for_QOBJECT_macro’ in ‘*0u’, which is of non-class type ‘KParts::ReadWritePart*’
/usr/include/QtCore/qobject.h:443: error: request for member ‘staticMetaObject’ in ‘*0u’, which is of non-class type ‘KParts::ReadWritePart*’
xyfix
Registered Member
Posts
110
Karma
0

Re: kwordpart plugin not found

Tue Jan 26, 2010 10:03 am
I suspect that the my issue has something to do with the last message in my out when running my app.

Code: Select all
Calling appendChild() on a null node does nothing.


This statement is spit out after the createGUI(m_part) statement is hit.I'm googling on this,but so far no success. Is there anybody who has seen this before?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: kwordpart plugin not found

Tue Jan 26, 2010 8:38 pm
Oops, try this instead.
Code: Select all
m_part = factory->create<KParts::ReadWritePart>(this, this, "kwordpart" );


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
xyfix
Registered Member
Posts
110
Karma
0

Re: kwordpart plugin not found

Tue Jan 26, 2010 9:15 pm
I've also tried that one to after I got the error message but that didn't help either. What I see on the console as output of my program are the first couple of lines equil to the output when I start kword ( see 2 postings before ) via the console up to the line

Code: Select all
kword(31262)/kdecore (KLibLoader) kde4Factory: The library "/home/user/koffice-2.1/install/lib/kde4/pictureshape.so" does not offer a qt_plugin_instance function


So this is the last line and it's followed by

Code: Select all
Calling appendChild() on a null node does nothing.


Thus my program never reaches the line

Code: Select all
kword(31262)/kdecore (KLibLoader) findLibraryInternal: plugins should not have a 'lib' prefix: "libxsltexport.so"
xyfix
Registered Member
Posts
110
Karma
0

Re: kwordpart plugin not found

Wed Jan 27, 2010 1:08 pm
After much experimenting and help of dfaure it works. The messages I received on the console could be ignore since the plugin is loaded as it should be. But the preferred way is this:

Code: Select all
 
KService::Ptr service = KService::serviceByDesktopPath("kwordpart.desktop");
  KParts::ReadWritePart *m_part = 0;

  if (service)
  {
      m_part = service->createInstance<KParts::ReadWritePart>(0);
      if (m_part)
      {
          m_part->setParent(this);
          this->layout()->addWidget( m_part->widget() );
          m_part->openUrl(KUrl("/home/user/report.fodt"));
      }
      else
      {
          return;
      }
  }
  else
  {
      qDebug("service kwordpart.desktop not found");
  }

  OGUINameSpace::getMainWindow()->createGUI(m_part);


....and kword works.

Thanks to dfaure of the kde development team and co-designer of the KParts-technology


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]