Exemplo n.º 1
0
QImage ImageProviderThumbnail::requestImage(const QString &filename_encoded, QSize *, const QSize &requestedSize) {

    QByteArray filename = QByteArray::fromPercentEncoding(filename_encoded.toUtf8());

    // Return full thumbnail
    return getThumbnailImage(filename.replace("//","/"));

}
Exemplo n.º 2
0
    //----------------------------------------------------------------------------------------------------------------
    //- THREAD-SAFETY: must be thread-safe like an int! => no dangling references to this instance!
    IconLoader getAsyncIconLoader(const Zstring& itemPathImpl) const override //noexcept!
    {
        IconLoader wl = {};
        wl.getFileIcon = [itemPathImpl](int pixelSize) //noexcept!
        {
            try
            {
                initComForThread(); //throw FileError
                return getFileIcon(itemPathImpl, pixelSize);
            }
            catch (FileError&) { assert(false); return ImageHolder(); }
        };

        wl.getThumbnailImage = [itemPathImpl](int pixelSize) //noexcept!
        {
            try
            {
                initComForThread(); //throw FileError
                return getThumbnailImage(itemPathImpl, pixelSize);
            }
            catch (FileError&) { assert(false); return ImageHolder(); }
        };
        return wl;
    }