mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
kioslave: minor thumbnailers review
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
cc7518889c
commit
83720e6c80
4 changed files with 19 additions and 11 deletions
|
@ -51,11 +51,14 @@ extern "C"
|
||||||
{
|
{
|
||||||
KDE_EXPORT ThumbCreator *new_creator()
|
KDE_EXPORT ThumbCreator *new_creator()
|
||||||
{
|
{
|
||||||
return new ComicCreator;
|
return new ComicCreator();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ComicCreator::ComicCreator() : m_loop(0) {}
|
ComicCreator::ComicCreator()
|
||||||
|
: m_loop(0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
bool ComicCreator::create(const QString& path, int width, int height, QImage& img)
|
bool ComicCreator::create(const QString& path, int width, int height, QImage& img)
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,6 +32,10 @@ extern "C"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DjVuCreator::DjVuCreator()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
bool DjVuCreator::create(const QString &path, int width, int height, QImage &img)
|
bool DjVuCreator::create(const QString &path, int width, int height, QImage &img)
|
||||||
{
|
{
|
||||||
const QString ddjvuexe = KStandardDirs::findExe("ddjvu");
|
const QString ddjvuexe = KStandardDirs::findExe("ddjvu");
|
||||||
|
|
|
@ -24,9 +24,10 @@
|
||||||
class DjVuCreator : public ThumbCreator
|
class DjVuCreator : public ThumbCreator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DjVuCreator() {}
|
DjVuCreator();
|
||||||
virtual bool create(const QString &path, int, int, QImage &img);
|
|
||||||
virtual ThumbCreator::Flags flags() const;
|
bool create(const QString &path, int, int, QImage &img) final;
|
||||||
|
ThumbCreator::Flags flags() const final;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _DJVUCREATOR_H_
|
#endif // _DJVUCREATOR_H_
|
||||||
|
|
|
@ -68,10 +68,10 @@ bool EPUBCreator::create(const QString &path, int width, int height, QImage &img
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int coontentpathcounter = 0;
|
int contentpathcounter = 0;
|
||||||
while (s_contentpaths[coontentpathcounter]) {
|
while (s_contentpaths[contentpathcounter]) {
|
||||||
char *epubdata = nullptr;
|
char *epubdata = nullptr;
|
||||||
int epubresult = epub_get_data(epubdocument, s_contentpaths[coontentpathcounter], &epubdata);
|
int epubresult = epub_get_data(epubdocument, s_contentpaths[contentpathcounter], &epubdata);
|
||||||
if (epubresult > 0) {
|
if (epubresult > 0) {
|
||||||
const QString containerstring = QString::fromAscii(epubdata);
|
const QString containerstring = QString::fromAscii(epubdata);
|
||||||
::free(epubdata);
|
::free(epubdata);
|
||||||
|
@ -95,10 +95,10 @@ bool EPUBCreator::create(const QString &path, int width, int height, QImage &img
|
||||||
kDebug() << "Could not find cover reference for" << pathbytes;
|
kDebug() << "Could not find cover reference for" << pathbytes;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
kDebug() << "Could not get" << s_contentpaths[coontentpathcounter] << "for" << pathbytes;
|
kDebug() << "Could not get" << s_contentpaths[contentpathcounter] << "for" << pathbytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
coontentpathcounter++;
|
contentpathcounter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
int coverpathcounter = 0;
|
int coverpathcounter = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue