|
|
@ -240,6 +240,20 @@ bool SearchEngine::uninstallPlugin(const QString &name) |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SearchEngine::updateIconPath(PluginInfo * const plugin) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (!plugin) return; |
|
|
|
|
|
|
|
QString iconPath = QString("%1/%2.png").arg(pluginsLocation()).arg(plugin->name); |
|
|
|
|
|
|
|
if (QFile::exists(iconPath)) { |
|
|
|
|
|
|
|
plugin->iconPath = iconPath; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
iconPath = QString("%1/%2.ico").arg(pluginsLocation()).arg(plugin->name); |
|
|
|
|
|
|
|
if (QFile::exists(iconPath)) |
|
|
|
|
|
|
|
plugin->iconPath = iconPath; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SearchEngine::checkForUpdates() |
|
|
|
void SearchEngine::checkForUpdates() |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Download version file from update server on sourceforge
|
|
|
|
// Download version file from update server on sourceforge
|
|
|
@ -528,16 +542,7 @@ void SearchEngine::update() |
|
|
|
QStringList disabledEngines = Preferences::instance()->getSearchEngDisabled(); |
|
|
|
QStringList disabledEngines = Preferences::instance()->getSearchEngDisabled(); |
|
|
|
plugin->enabled = !disabledEngines.contains(pluginName); |
|
|
|
plugin->enabled = !disabledEngines.contains(pluginName); |
|
|
|
|
|
|
|
|
|
|
|
// Handle icon
|
|
|
|
updateIconPath(plugin); |
|
|
|
QString iconPath = QString("%1/%2.png").arg(pluginsLocation()).arg(pluginName); |
|
|
|
|
|
|
|
if (QFile::exists(iconPath)) { |
|
|
|
|
|
|
|
plugin->iconPath = iconPath; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
iconPath = QString("%1/%2.ico").arg(pluginsLocation()).arg(pluginName); |
|
|
|
|
|
|
|
if (QFile::exists(iconPath)) |
|
|
|
|
|
|
|
plugin->iconPath = iconPath; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!m_plugins.contains(pluginName)) { |
|
|
|
if (!m_plugins.contains(pluginName)) { |
|
|
|
m_plugins[pluginName] = plugin; |
|
|
|
m_plugins[pluginName] = plugin; |
|
|
|