コード例 #1
0
ファイル: AbstractResource.cpp プロジェクト: KDE/discover
void AbstractResource::fetchScreenshots()
{
    QList<QUrl> thumbs, screens;
    QUrl thumbnail = thumbnailUrl();
    if(!thumbnail.isEmpty()) {
        thumbs << thumbnail;
        screens << screenshotUrl();
    }
    emit screenshotsFetched(thumbs, screens);
}
コード例 #2
0
void
YTLocalVideoData::thumbnailDownloadFinished(QByteArray data)
{
    Q_ASSERT(!_thumbnailPath.isEmpty());
    QFile thumbFile(_thumbnailPath);
    // TODO: Handle open and write failures
    thumbFile.open(QIODevice::WriteOnly);
    thumbFile.write(data);
    thumbFile.close();
    emit thumbnailUrlChanged(thumbnailUrl());
    qDebug() << "Finished downloading thumbnail for video:" << _videoId;
}