Commit 979e76fb authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Import the mobipocket thubmnailer from kdegraphics-mobipocket

parent 28aeb621
Pipeline #109535 passed with stage
in 1 minute and 1 second
......@@ -9,3 +9,4 @@ Dependencies:
'frameworks/karchive': '@stable'
'graphics/libkexiv2': '@same'
'graphics/libkdcraw': '@same'
'graphics/kdegraphics-mobipocket': '@same'
......@@ -35,6 +35,14 @@ set_package_properties("KF5KDcraw" PROPERTIES
PURPOSE "Required to build the RAW thumbnailer"
)
find_package(QMobipocket)
set_package_properties("QMobipocket" PROPERTIES
DESCRIPTION "A library for accessing mobipocket files"
URL "www.kde.org"
TYPE OPTIONAL
PURPOSE "Required to build the mobipocket thumbnailer"
)
ecm_optional_add_subdirectory(ps)
......@@ -44,6 +52,10 @@ endif()
ecm_optional_add_subdirectory(blend)
if(QMobipocket_FOUND)
ecm_optional_add_subdirectory(mobipocket)
endif()
install(FILES org.kde.kdegraphics-thumbnailers.metainfo.xml
DESTINATION ${KDE_INSTALL_METAINFODIR})
......
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/lib
)
########### next target ###############
set(mobithumbnail_SRCS
mobithumbnail.cpp
)
find_package(KF5 REQUIRED
KIO
)
add_library(mobithumbnail MODULE ${mobithumbnail_SRCS})
target_link_libraries(mobithumbnail KF5::KIOCore KF5::KIOWidgets Qt5::Gui qmobipocket)
install(TARGETS mobithumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR})
########### install files ###############
install( FILES mobithumbnail.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
/***************************************************************************
* Copyright (C) 2008 by Jakub Stachowski <qbast@go2.pl> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include "mobithumbnail.h"
#include <qmobipocket/mobipocket.h>
#include <qmobipocket/qfilestream.h>
#include <QFile>
extern "C"
{
Q_DECL_EXPORT ThumbCreator *new_creator()
{
return new MobiThumbnail;
}
}
bool MobiThumbnail::create(const QString &path, int width, int height, QImage &img)
{
Q_UNUSED(width);
Q_UNUSED(height);
Mobipocket::QFileStream f(path);
Mobipocket::Document doc(&f);
if (!doc.isValid()) return false;
img=doc.thumbnail();
return !img.isNull();
}
ThumbCreator::Flags MobiThumbnail::flags() const
{
return static_cast<Flags>(None);
}
[Desktop Entry]
Type=Service
Name=Mobipocket Files
Name[ar]=ملفات Mobipocket
Name[bg]=Файлове за Mobipocket
Name[bs]=Mobipoketove datoteke
Name[ca]=Fitxers Mobipocket
Name[ca@valencia]=Fitxers Mobipocket
Name[cs]=Dokumenty Mobipocket
Name[da]=Mobipocket-filer
Name[de]=Mobipocket-Dateien
Name[el]=Αρχεία Mobipocket
Name[en_GB]=Mobipocket Files
Name[es]=Archivos Mobipocket
Name[et]=Mobipocketi failid
Name[eu]=Mobipocket fitxategiak
Name[fi]=Mobipocket-tiedostot
Name[fr]=Fichiers « Mobipocket »
Name[ga]=Comhaid Mobipocket
Name[gl]=Ficheiros de Mobipocket
Name[hi]=मोबिपोकेट फाइलें
Name[hr]=Mobipocket datoteke
Name[hu]=Mobipocket-féjlok
Name[ia]=Files de Mobipocket
Name[is]=Mobipocket skrár
Name[it]=File Mobipocket
Name[ja]=Mobipocket ファイル
Name[kk]=Mobipocket файлдары
Name[km]=ឯកសារ Mobipocket
Name[ko]=Mobipocket 파일
Name[lt]=Mobipocket failai
Name[lv]=Mobipocket faili
Name[ml]=മൊബി പോക്കറ്റ്‌ ഫയലുകൾ
Name[mr]=मोबीपॉकेट फाईल्स
Name[nb]=Mobipocket-filer
Name[nds]=Mobipocket-Dateien
Name[nl]=Mobipocket-bestanden
Name[nn]=Mobipocket-filer
Name[pa]=ਮੋਬੀਪਾਕਟ ਫਾਇਲਾਂ
Name[pl]=Pliki Mobipocket
Name[pt]=Ficheiros do Mobipocket
Name[pt_BR]=Arquivos do Mobipocket
Name[ro]=Fișiere Mobipocket
Name[ru]=Электронные книги Mobipocket
Name[si]=Mobipocket ගොනු
Name[sk]=Mobipocket súbory
Name[sl]=Datoteke Mobipocket
Name[sq]=Skedarët Mobipocket
Name[sr]=Мобипокетови фајлови
Name[sr@ijekavian]=Мобипокетови фајлови
Name[sr@ijekavianlatin]=Mobipocketovi fajlovi
Name[sr@latin]=Mobipocketovi fajlovi
Name[sv]=Mobipocket-filer
Name[tg]=Файлҳои «Mobipocket»
Name[tr]=Mobipocket Dosyaları
Name[ug]=Mobipocket ھۆججەتلىرى
Name[uk]=Файли Mobipocket
Name[x-test]=xxMobipocket Filesxx
Name[zh_CN]=Mobipocket 文件
Name[zh_TW]=Mobipocket 檔案
X-KDE-ServiceTypes=ThumbCreator
MimeType=application/x-mobipocket-ebook;
X-KDE-Library=mobithumbnail
CacheThumbnail=true
/***************************************************************************
* Copyright (C) 2008 by Jakub Stachowski <qbast@go2.pl> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef MOBITHUMBNAIL_H
#define MOBITHUMBNAIL_H
#include <kio/thumbcreator.h>
class MobiThumbnail : public ThumbCreator
{
public:
MobiThumbnail() {}
bool create(const QString &path, int, int, QImage &img) override;
Flags flags() const override;
};
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment