Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[buteo-sync-plugins-social] Adapt to libsocialcache downloader api. JB#59640 #13

Merged
merged 1 commit into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/google/google-contacts/googlecontactimagedownloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ GoogleContactImageDownloader::GoogleContactImageDownloader()

QString GoogleContactImageDownloader::staticOutputFile(const QString &identifier, const QUrl &url)
{
return makeOutputFile(SocialSyncInterface::Google, SocialSyncInterface::Contacts, identifier, url.toString());
return makeUrlOutputFile(SocialSyncInterface::Google, SocialSyncInterface::Contacts, identifier,
url.toString(), QString());
}

QNetworkReply * GoogleContactImageDownloader::createReply(const QString &url,
Expand All @@ -50,7 +51,10 @@ QNetworkReply * GoogleContactImageDownloader::createReply(const QString &url,
return d->networkAccessManager->get(request);
}

QString GoogleContactImageDownloader::outputFile(const QString &url, const QVariantMap &data) const
QString GoogleContactImageDownloader::outputFile(const QString &url,
const QVariantMap &data,
const QString &mimeType) const
{
Q_UNUSED(mimeType); // TODO: use
return staticOutputFile(data.value(IMAGE_DOWNLOADER_IDENTIFIER_KEY).toString(), url);
}
2 changes: 1 addition & 1 deletion src/google/google-contacts/googlecontactimagedownloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class GoogleContactImageDownloader: public AbstractImageDownloader
protected:
QNetworkReply * createReply(const QString &url, const QVariantMap &metadata);
// This is a reimplemented method, used by AbstractImageDownloader
QString outputFile(const QString &url, const QVariantMap &data) const;
QString outputFile(const QString &url, const QVariantMap &data, const QString &mimeType) const override;
private:
Q_DECLARE_PRIVATE(AbstractImageDownloader)
};
Expand Down
2 changes: 1 addition & 1 deletion src/google/google-contacts/googlepeoplejson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ bool GooglePeople::Photo::saveContactDetails(QContact *contact, const QList<Phot
const QString localFilePath = GoogleContactImageDownloader::staticOutputFile(guid, photo.url);
if (localFilePath.isEmpty()) {
qCWarning(lcSocialPlugin) << "Cannot generate local file name for avatar url:" << photo.url
<< "for contact:" << guid;
<< "for contact:" << guid;
continue;
}

Expand Down
7 changes: 5 additions & 2 deletions src/vk/vk-contacts/vkcontactimagedownloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ VKContactImageDownloader::VKContactImageDownloader()

QString VKContactImageDownloader::staticOutputFile(const QString &identifier, const QUrl &url)
{
return makeOutputFile(SocialSyncInterface::VK, SocialSyncInterface::Contacts, identifier, url.toString());
return makeUrlOutputFile(SocialSyncInterface::VK, SocialSyncInterface::Contacts, identifier,
url.toString(), QString());
}

QNetworkReply * VKContactImageDownloader::createReply(const QString &url,
Expand All @@ -34,7 +35,9 @@ QNetworkReply * VKContactImageDownloader::createReply(const QString &url,
return d->networkAccessManager->get(request);
}

QString VKContactImageDownloader::outputFile(const QString &url, const QVariantMap &data) const
QString VKContactImageDownloader::outputFile(const QString &url, const QVariantMap &data,
const QString &mimeType) const
{
Q_UNUSED(mimeType); // TODO: use
return staticOutputFile(data.value(IMAGE_DOWNLOADER_IDENTIFIER_KEY).toString(), url);
}
2 changes: 1 addition & 1 deletion src/vk/vk-contacts/vkcontactimagedownloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class VKContactImageDownloader: public AbstractImageDownloader
protected:
QNetworkReply * createReply(const QString &url, const QVariantMap &metadata);
// This is a reimplemented method, used by AbstractImageDownloader
QString outputFile(const QString &url, const QVariantMap &data) const;
QString outputFile(const QString &url, const QVariantMap &data, const QString &mimeType) const override;
private:
Q_DECLARE_PRIVATE(AbstractImageDownloader)
};
Expand Down