kioslave: minor thumbnailers review

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-10-04 03:38:56 +03:00
parent cc7518889c
commit 83720e6c80
4 changed files with 19 additions and 11 deletions

View file

@ -51,11 +51,14 @@ extern "C"
{
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)
{
@ -124,7 +127,7 @@ QImage ComicCreator::extractArchiveImage(const QString& path, const ComicCreator
// Can our archive be opened?
if (!cArchive->open(QIODevice::ReadOnly)) {
return QImage();
return QImage();
}
// Get the archive's directory.

View file

@ -32,6 +32,10 @@ extern "C"
}
}
DjVuCreator::DjVuCreator()
{
}
bool DjVuCreator::create(const QString &path, int width, int height, QImage &img)
{
const QString ddjvuexe = KStandardDirs::findExe("ddjvu");

View file

@ -24,9 +24,10 @@
class DjVuCreator : public ThumbCreator
{
public:
DjVuCreator() {}
virtual bool create(const QString &path, int, int, QImage &img);
virtual ThumbCreator::Flags flags() const;
DjVuCreator();
bool create(const QString &path, int, int, QImage &img) final;
ThumbCreator::Flags flags() const final;
};
#endif // _DJVUCREATOR_H_

View file

@ -68,10 +68,10 @@ bool EPUBCreator::create(const QString &path, int width, int height, QImage &img
return false;
}
int coontentpathcounter = 0;
while (s_contentpaths[coontentpathcounter]) {
int contentpathcounter = 0;
while (s_contentpaths[contentpathcounter]) {
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) {
const QString containerstring = QString::fromAscii(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;
}
} else {
kDebug() << "Could not get" << s_contentpaths[coontentpathcounter] << "for" << pathbytes;
kDebug() << "Could not get" << s_contentpaths[contentpathcounter] << "for" << pathbytes;
}
coontentpathcounter++;
contentpathcounter++;
}
int coverpathcounter = 0;