Update the backend when a new plugin favicon is downloaded.

This commit is contained in:
sledgehammer999
2017-06-13 17:55:48 +03:00
parent 8c98c8cb3f
commit 34c29b78f9
3 changed files with 19 additions and 11 deletions

View File

@@ -374,8 +374,10 @@ void PluginSelectDlg::iconDownloaded(const QString &url, QString filePath)
QFile icon(filePath);
icon.open(QIODevice::ReadOnly);
QString iconPath = QString("%1/%2.%3").arg(SearchEngine::pluginsLocation()).arg(id).arg(ICOHandler::canRead(&icon) ? "ico" : "png");
if (QFile::copy(filePath, iconPath))
if (QFile::copy(filePath, iconPath)) {
item->setData(PLUGIN_NAME, Qt::DecorationRole, QVariant(QIcon(iconPath)));
m_pluginManager->updateIconPath(plugin);
}
}
}
// Delete tmp file