mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-12 18:24:58 +08:00
commit
7aae915a68
@ -63,14 +63,10 @@ namespace Http
|
|||||||
const char HEADER_REQUEST_METHOD_POST[] = "POST";
|
const char HEADER_REQUEST_METHOD_POST[] = "POST";
|
||||||
|
|
||||||
const char CONTENT_TYPE_HTML[] = "text/html";
|
const char CONTENT_TYPE_HTML[] = "text/html";
|
||||||
const char CONTENT_TYPE_JS[] = "application/javascript";
|
|
||||||
const char CONTENT_TYPE_JSON[] = "application/json";
|
const char CONTENT_TYPE_JSON[] = "application/json";
|
||||||
const char CONTENT_TYPE_BMP[] = "image/bmp";
|
|
||||||
const char CONTENT_TYPE_GIF[] = "image/gif";
|
const char CONTENT_TYPE_GIF[] = "image/gif";
|
||||||
const char CONTENT_TYPE_JPEG[] = "image/jpeg";
|
|
||||||
const char CONTENT_TYPE_PNG[] = "image/png";
|
const char CONTENT_TYPE_PNG[] = "image/png";
|
||||||
const char CONTENT_TYPE_TXT[] = "text/plain";
|
const char CONTENT_TYPE_TXT[] = "text/plain";
|
||||||
const char CONTENT_TYPE_SVG[] = "image/svg+xml";
|
|
||||||
const char CONTENT_TYPE_FORM_ENCODED[] = "application/x-www-form-urlencoded";
|
const char CONTENT_TYPE_FORM_ENCODED[] = "application/x-www-form-urlencoded";
|
||||||
const char CONTENT_TYPE_FORM_DATA[] = "multipart/form-data";
|
const char CONTENT_TYPE_FORM_DATA[] = "multipart/form-data";
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
|
|
||||||
#include "searchpluginmanager.h"
|
#include "searchpluginmanager.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QDomDocument>
|
#include <QDomDocument>
|
||||||
@ -458,7 +460,7 @@ void SearchPluginManager::update()
|
|||||||
if (!engineElem.isNull()) {
|
if (!engineElem.isNull()) {
|
||||||
QString pluginName = engineElem.tagName();
|
QString pluginName = engineElem.tagName();
|
||||||
|
|
||||||
PluginInfo *plugin = new PluginInfo;
|
std::unique_ptr<PluginInfo> plugin {new PluginInfo {}};
|
||||||
plugin->name = pluginName;
|
plugin->name = pluginName;
|
||||||
plugin->version = getPluginVersion(pluginPath(pluginName));
|
plugin->version = getPluginVersion(pluginPath(pluginName));
|
||||||
plugin->fullName = engineElem.elementsByTagName("name").at(0).toElement().text();
|
plugin->fullName = engineElem.elementsByTagName("name").at(0).toElement().text();
|
||||||
@ -473,15 +475,15 @@ void SearchPluginManager::update()
|
|||||||
QStringList disabledEngines = Preferences::instance()->getSearchEngDisabled();
|
QStringList disabledEngines = Preferences::instance()->getSearchEngDisabled();
|
||||||
plugin->enabled = !disabledEngines.contains(pluginName);
|
plugin->enabled = !disabledEngines.contains(pluginName);
|
||||||
|
|
||||||
updateIconPath(plugin);
|
updateIconPath(plugin.get());
|
||||||
|
|
||||||
if (!m_plugins.contains(pluginName)) {
|
if (!m_plugins.contains(pluginName)) {
|
||||||
m_plugins[pluginName] = plugin;
|
m_plugins[pluginName] = plugin.release();
|
||||||
emit pluginInstalled(pluginName);
|
emit pluginInstalled(pluginName);
|
||||||
}
|
}
|
||||||
else if (m_plugins[pluginName]->version != plugin->version) {
|
else if (m_plugins[pluginName]->version != plugin->version) {
|
||||||
delete m_plugins.take(pluginName);
|
delete m_plugins.take(pluginName);
|
||||||
m_plugins[pluginName] = plugin;
|
m_plugins[pluginName] = plugin.release();
|
||||||
emit pluginUpdated(pluginName);
|
emit pluginUpdated(pluginName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user