You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

kismet

Beginner

  • "kismet" started this thread

Posts: 6

Location: Livorno - Italy

Occupation: Student

  • Send private message

1

Wednesday, July 6th 2005, 6:48pm

First KFilePlugin problem

Hi All,
I'm trying to create my first KFilePlugin with the help of:
- KDevelop Project Wizard
- Providing file meta-data support with KFile plugins

But when I test the Plugin Konqueror send me the following error:

KFileMetaInfo: WARNING: error loading the plugin from kfile_mng.desktop


I'll post my kfile_mng.desktop that for me seems correct.

[Desktop Entry]
Encoding=UTF-8
Type=Service
Name=MNG Info
ServiceTypes=KFilePlugin
X-KDE-Library=kfile_mng
MimeType=text/html

I have changed the mimeType even in kfile_mng.cpp

Please help :-(

P.S.: The information that I want to display are only Size and Items

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

2

Thursday, July 7th 2005, 9:30am

text/html?

The name of the plugin would suggest it works on mng files, not on HTML files.
In case it does work on mng files, have you tried the respective MIME type?

Cheers,
_
Qt/KDE Developer
Debian User

kismet

Beginner

  • "kismet" started this thread

Posts: 6

Location: Livorno - Italy

Occupation: Student

  • Send private message

3

Thursday, July 7th 2005, 11:09am

Quoted

Originally posted by anda_skoa
text/html?

The name of the plugin would suggest it works on mng files, not on HTML files.
In case it does work on mng files, have you tried the respective MIME type?

Cheers,
_


I haven't tryed the respective MIME typese for two reason:
1 - The information that this KFilePlugin add is just the size of the file
2 - I have changed the souce code so it should be usable for text/html file

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

4

Thursday, July 7th 2005, 5:36pm

You could check if the debug areas for KMetaFile and its plugins are activated (using kdebugdialog) and then run Konqueror from a Konsole to see the debug output.

Maybe it has some hint on what it failes to get from the plugin.

Cheers,
_
Qt/KDE Developer
Debian User

kismet

Beginner

  • "kismet" started this thread

Posts: 6

Location: Livorno - Italy

Occupation: Student

  • Send private message

5

Saturday, July 9th 2005, 5:16pm

Konqueror give me these messagese when I righe click on some file that should be handled by my plug-in:
KFileMetaInfo: WARNING: error loading the plugin from kfile_mng.desktop

I have tryed to use kdebugdialog but I don't understand what should I look for.

Also looking to the diffences to my project and the one in the tutorial I have found that:
- I compile only my plug-in and not the whole KDE enviroment
- I put kfile_mng.desktop, kfile_mng.la, kfile_mng.so in the same directory that is /home/<user>/.kde/share/services/

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

6

Sunday, July 10th 2005, 4:10pm

Quoted

Originally posted by kismet
I have tryed to use kdebugdialog but I don't understand what should I look for.

It allows to enable specific debug output categories, for example from kdelibs library loader, etc

Quoted


- I put kfile_mng.desktop, kfile_mng.la, kfile_mng.so in the same directory that is /home/<user>/.kde/share/services/


Well, that is correct for the .desktop file, but the library has to be one of those:
kde-config --path module

Usually when developing something plugin like one installs into a special prefix, in order to create the same situation as later in a real install.

The additional KDE directory can be added to the KDEDIRS variable, so there is no need to install into the package manager controlled tree.

Cheers,
_
Qt/KDE Developer
Debian User

kismet

Beginner

  • "kismet" started this thread

Posts: 6

Location: Livorno - Italy

Occupation: Student

  • Send private message

7

Sunday, July 10th 2005, 6:04pm

Thank you for your good hint.

But now I trying to change strategy, I've open a new project from KDevelop using the wizard for KDE/KFilePlugin and without changin any line of code I have compiled and installed the project.

KDevlop have created an automake project so that when I've launched:
make install
I have seen

Source code

1
2
3
4
5
test -z "/usr/local/kde/lib/kde3" || mkdir -p -- "/usr/local/kde/lib/kde3"
 /bin/sh ../libtool --silent --mode=install /usr/bin/install -c -p  'kfile_kfiletest.la' '/usr/local/kde/lib/kde3/kfile_kfiletest.la'
PATH="$PATH:/sbin" ldconfig -n /usr/local/kde/lib/kde3
test -z "/usr/local/kde/share/services" || mkdir -p -- "/usr/local/kde/share/services"
 /usr/bin/install -c -p -m 644 '/home/kismet/Progetti/kfiletest/src/kfile_kfiletest.desktop' '/usr/local/kde/share/services/kfile_kfiletest.desktop'


That I think that update the library of KDE.

Now when I right click on html file I don't get the error message from Konqueror, but I'm unable to see the extra Tab create by me :(

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

8

Sunday, July 10th 2005, 10:01pm

Check that KDEDIRS includes your default KDE directory and /usr/local/kde

For example
#> env ¦ grep KDEDIRS

should at least look like this
KDEDIRS=/usr/:/usr/local/kde

(assuming your KDE is installed in /usr, if in doubt run kde-config --prefix)

This has to be present at the time startkde runs.
If it isn't yet you easily expand the startup environment by putting a small shell script in and of the directories listed by the following command

#> kde-config --path exe | sed s#bin#env#g

The shell script would then include something like this
---- kdedirs.sh -----
export KDEDIRS=/usr:/usr/local/kde
---------------------

Cheers,
_
Qt/KDE Developer
Debian User