This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Caching thumbnails

Tags: None
(comma "," separated)
Sparkling Gentleman
Registered Member
Posts
9
Karma
0

Caching thumbnails

Sun Mar 15, 2020 9:04 pm
I'm trying to fix bug I opened some time ago (https://bugs.kde.org/show_bug.cgi?id=411919) and I'm having problem with finding code responsible for saving thumbnail.

After lots of digging through code, kio:src/widgets/previewjob:slotThumbData looks like a place where this would happen, but even when I comment out this block
Code: Select all
    if (save) {
        thumb.setText(QStringLiteral("Thumb::URI"), QString::fromUtf8(origName));
        thumb.setText(QStringLiteral("Thumb::MTime"), QString::number(tOrig.toSecsSinceEpoch()));
        thumb.setText(QStringLiteral("Thumb::Size"), number(currentItem.item.size()));
        thumb.setText(QStringLiteral("Thumb::Mimetype"), currentItem.item.mimetype());
        QString thumbnailerVersion = currentItem.plugin->property(QStringLiteral("ThumbnailerVersion"), QVariant::String).toString();
        QString signature = QLatin1String("KDE Thumbnail Generator ") + currentItem.plugin->name();
        if (!thumbnailerVersion.isEmpty()) {
            signature.append(QLatin1String(" (v") + thumbnailerVersion + QLatin1Char(')'));
        }
        thumb.setText(QStringLiteral("Software"), signature);
         QSaveFile saveFile(thumbPath + thumbName);
         if (saveFile.open(QIODevice::WriteOnly)) {
             if (thumb.save(&saveFile, "PNG")) {
                 saveFile.commit();
             }
         }
    }

completely. Running dolphin still generates thumbnails under ~/.catche/thumbnails
I do see my debug messages though, so it should be fine. Any idea why this would happen?
Sparkling Gentleman
Registered Member
Posts
9
Karma
0

Re: Caching thumbnails

Sun Mar 15, 2020 9:35 pm
I've made bit of progress. Commenting this code doesn't stop all previews from generating, but it works for some of them. Namely previews used to show four files inside a directory do appear in thumbnails directory, but regular files don't.

If someone knows this code, pointers still will be appreciated, but finally I'm on a point where I should be able to handle it on my own.


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell