![]() Registered Member ![]()
|
I'm willing to write a file preview 'plug-in' (if it works that way) for previewing CBZ/CBR comic book files in Dolphin. I just do not know which part of kdegraphics I must be looking at - can I get some guidance on where to start exactly?
Also, if this is already done, do let me know. I'm using KDE 4.3.2 right now and the feature isn't available in it. (Okular is installed, with all its associated libs - Evince on GNOME shows previews for those files, so why not KDE as well!) |
![]() Administrator ![]()
|
One does not appear to exist at this time. You may find these API docs here to be of help: http://api.kde.org/4.x-api/kdelibs-apid ... eator.html
Existing file preview plugins appear to be in kdegraphics/thumbnailers/
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
OMG Im just starting development on the same comic book previews thingy!
I'm willing to implement this too, as it will be a great learning experience for me. I know Qt development well enough, just want to start writing for kde. I'm just learning how to use svn as of now.
My blog : http://komplexadi.blogspot.com
|
![]() Registered Member ![]()
|
Does anyone here know how to register the plugin created after doing the below stuff (i got it from the KDE api docs ) :
Compile your ThumbCreator as a module. The contents of CMakeLists.txt should look something like this, with "filetype" replaced by the type of file this plugin creates thumbnails for: project(filetypethumbcreator) find_package(KDE4 REQUIRED) include (KDE4Defaults) include(MacroOptionalAddSubdirectory) set(filetypethumbnail_SRCS filetypethumbnail.cpp) kde4_add_ui_files(filetypethumbnail_SRCS config.ui ) kde4_add_plugin(filetypethumbnail ${filetypethumbnail_SRCS}) target_link_libraries(filetypethumbnail ${KDE4_KIO_LIBS}) install(TARGETS filetypethumbnail DESTINATION ${PLUGIN_INSTALL_DIR}) install(FILES filetypethumbcreator.desktop DESTINATION ${SERVICES_INSTALL_DIR}) Create a file filetypethumbcreator.desktop with the following contents: [Desktop Entry] Encoding=UTF-8 Type=Service Name=Name of the type of files your ThumbCreator supports ServiceTypes=ThumbCreator MimeType=application/x-somemimetype; CacheThumbnail=true X-KDE-Library=yourthumbcreator
My blog : http://komplexadi.blogspot.com
|
![]() Administrator ![]()
|
You may need to run kbuildsycoca4 after installing it into $KDEDIR which is usually /usr. You may also need to restart Dolphin. Otherwise, can you please post the source for your file?
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Well, this is the code :
and the other file :
Well, now the problem is at QByteArray data(file->data()). It crashes the program. (I wrote a test program to draw the first image on a window.) Even calling file->copyTo(QString("temp")) to extract the image to another file crashes it. I'm just not seeing why. The crash information given by the KDE Crash handler is this :
I know that the problem is with file->data() because the debug output is this :
Can you help me with this? I want to know how to extract data from the zip file without crashing the program. Thanks in advance ![]()
My blog : http://komplexadi.blogspot.com
|
![]() Administrator ![]()
|
You can't cast QString to KArchiveFile.
You need to create KArchiveFile using its API, see api.kde.org/classmapper.php?class=KArchiveFile
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Uh-well, I had figured that already
![]()
My blog : http://komplexadi.blogspot.com
|
![]() Registered Member ![]()
|
Hello again. Thank you for your help! ![]() After looking at some more thumbnail plugins in KDE/kdebase/kioslave/thumbnail, I managed to write my own. The plugin, whose description and file hosting can be found here (under GPLv3), supports ComicBook files of type .cbr, .cbz and .cbt (RAR, ZIP and TAR). I plan to add .cb7 and .cba (p7zip/ACE) support soon. Current source code for the plugin can be viewed at my bitbucket account here. Hope the source helps anyone else looking to build similar things! ![]() |
Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]