void BinController::checkThumbnails(const QString thumbFolder) { // Parse all controllers and load thumbnails QMapIterator<QString, ClipController *> i(m_clipList); while (i.hasNext()) { i.next(); ClipController *ctrl = i.value(); bool foundFile = false; if (!ctrl->getClipHash().isEmpty()) { QImage img(thumbFolder + ctrl->getClipHash() + ".png"); if (!img.isNull()) { emit loadThumb(ctrl->clipId(), img, true); foundFile = true; } } if (!foundFile) { // Add clip id to thumbnail generation thread QDomDocument doc; ctrl->getProducerXML(doc); QDomElement xml = doc.documentElement().firstChildElement(QStringLiteral("producer")); if (!xml.isNull()) { xml.setAttribute(QStringLiteral("thumbnailOnly"), 1); emit createThumb(xml, ctrl->clipId(), 150); } } } }
bool EmbroideryThumbnailer::create(const QString& path, int /*w*/, int /*h*/, QImage& img) { img = loadThumb(path); if(img.isNull()) return false; return true; }
RefImage::RefImage(const QUrl uri, QUrl thumbUrl, QNetworkAccessManager *downloadManager) : m_thumbItem(new ThumbnailItem(uri, "thumb_"+nameFromUrl(uri))), m_imageReply(NULL) { setUri(uri); setThumbUri(thumbUrl); setDownloadManager(downloadManager); initThumbItem(); loadThumb(); }