mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
libs: replace FavIconsModule::startDownload() with its body
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
d811882f97
commit
15838c25d7
2 changed files with 9 additions and 17 deletions
|
@ -124,22 +124,6 @@ void FavIconsModule::downloadUrlIcon(const QString &url)
|
|||
emit iconChanged(url, iconName);
|
||||
return;
|
||||
}
|
||||
|
||||
startDownload(url, iconFile);
|
||||
}
|
||||
|
||||
void FavIconsModule::forceDownloadUrlIcon(const QString &url)
|
||||
{
|
||||
d->failedDownloads.removeAll(url); // force a download to happen
|
||||
const QString iconName = iconNameFromURL(url);
|
||||
const QString iconFile = iconFilePath(iconName);
|
||||
QFile::remove(iconFile);
|
||||
downloadUrlIcon(url);
|
||||
}
|
||||
|
||||
void FavIconsModule::startDownload(const QString &url, const QString &iconFile)
|
||||
{
|
||||
const QString iconName = iconNameFromURL(url);
|
||||
if (d->queuedDownloads.contains(iconName)) {
|
||||
kDebug() << "Icon download queued for" << url;
|
||||
return;
|
||||
|
@ -155,6 +139,15 @@ void FavIconsModule::startDownload(const QString &url, const QString &iconFile)
|
|||
startJob(url, faviconUrl, iconFile);
|
||||
}
|
||||
|
||||
void FavIconsModule::forceDownloadUrlIcon(const QString &url)
|
||||
{
|
||||
d->failedDownloads.removeAll(url); // force a download to happen
|
||||
const QString iconName = iconNameFromURL(url);
|
||||
const QString iconFile = iconFilePath(iconName);
|
||||
QFile::remove(iconFile);
|
||||
downloadUrlIcon(url);
|
||||
}
|
||||
|
||||
void FavIconsModule::startJob(const QString &url, const QString &faviconUrl, const QString &iconFile)
|
||||
{
|
||||
kDebug() << "Downloading" << faviconUrl << "as" << iconFile;
|
||||
|
|
|
@ -81,7 +81,6 @@ private Q_SLOTS:
|
|||
void slotFinished(KJob *kjob);
|
||||
|
||||
private:
|
||||
void startDownload(const QString &url, const QString &iconFile);
|
||||
void startJob(const QString &url, const QString &faviconUrl, const QString &iconFile);
|
||||
void downloadSuccess(const QString &url);
|
||||
void downloadError(const QString &url);
|
||||
|
|
Loading…
Add table
Reference in a new issue