mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-21 08:09:35 +08:00
Fix segfault on Linux due to early initialization of global var.
Utils::Misc::pythonVersion() gets called before the Logger is initialized.
This commit is contained in:
parent
f6bbd9377f
commit
47d9c12f4b
@ -48,9 +48,12 @@
|
|||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
|
|
||||||
enum EngineColumns {ENGINE_NAME, ENGINE_VERSION, ENGINE_URL, ENGINE_STATE, ENGINE_ID};
|
enum EngineColumns {ENGINE_NAME, ENGINE_VERSION, ENGINE_URL, ENGINE_STATE, ENGINE_ID};
|
||||||
const QString UPDATE_URL = QString("https://raw.github.com/qbittorrent/qBittorrent/master/src/searchengine/") + (Utils::Misc::pythonVersion() >= 3 ? "nova3" : "nova") + "/engines/";
|
|
||||||
|
|
||||||
engineSelectDlg::engineSelectDlg(QWidget *parent, SupportedEngines *supported_engines) : QDialog(parent), supported_engines(supported_engines) {
|
engineSelectDlg::engineSelectDlg(QWidget *parent, SupportedEngines *supported_engines)
|
||||||
|
: QDialog(parent)
|
||||||
|
, supported_engines(supported_engines)
|
||||||
|
, m_updateUrl(QString("https://raw.github.com/qbittorrent/qBittorrent/master/src/searchengine/") + (Utils::Misc::pythonVersion() >= 3 ? "nova3" : "nova") + "/engines/")
|
||||||
|
{
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
pluginsTree->setRootIsDecorated(false);
|
pluginsTree->setRootIsDecorated(false);
|
||||||
@ -107,7 +110,7 @@ void engineSelectDlg::dragEnterEvent(QDragEnterEvent *event) {
|
|||||||
void engineSelectDlg::on_updateButton_clicked() {
|
void engineSelectDlg::on_updateButton_clicked() {
|
||||||
// Download version file from update server on sourceforge
|
// Download version file from update server on sourceforge
|
||||||
setCursor(QCursor(Qt::WaitCursor));
|
setCursor(QCursor(Qt::WaitCursor));
|
||||||
downloadFromUrl(QString(UPDATE_URL) + "versions.txt");
|
downloadFromUrl(m_updateUrl + "versions.txt");
|
||||||
}
|
}
|
||||||
|
|
||||||
void engineSelectDlg::toggleEngineState(QTreeWidgetItem *item, int) {
|
void engineSelectDlg::toggleEngineState(QTreeWidgetItem *item, int) {
|
||||||
@ -394,8 +397,8 @@ bool engineSelectDlg::parseVersionsFile(QString versions_file) {
|
|||||||
qDebug("Plugin: %s is outdated", qPrintable(plugin_name));
|
qDebug("Plugin: %s is outdated", qPrintable(plugin_name));
|
||||||
// Downloading update
|
// Downloading update
|
||||||
setCursor(QCursor(Qt::WaitCursor));
|
setCursor(QCursor(Qt::WaitCursor));
|
||||||
downloadFromUrl(UPDATE_URL + plugin_name + ".py");
|
downloadFromUrl(m_updateUrl + plugin_name + ".py");
|
||||||
//downloadFromUrl(UPDATE_URL + plugin_name + ".png");
|
//downloadFromUrl(m_updateUrl + plugin_name + ".png");
|
||||||
updated = true;
|
updated = true;
|
||||||
}else {
|
}else {
|
||||||
qDebug("Plugin: %s is up to date", qPrintable(plugin_name));
|
qDebug("Plugin: %s is up to date", qPrintable(plugin_name));
|
||||||
|
@ -45,6 +45,7 @@ class engineSelectDlg : public QDialog, public Ui::engineSelect{
|
|||||||
void downloadFromUrl(const QString &url);
|
void downloadFromUrl(const QString &url);
|
||||||
|
|
||||||
SupportedEngines *supported_engines;
|
SupportedEngines *supported_engines;
|
||||||
|
const QString m_updateUrl;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
engineSelectDlg(QWidget *parent, SupportedEngines *supported_engines);
|
engineSelectDlg(QWidget *parent, SupportedEngines *supported_engines);
|
||||||
|
Loading…
Reference in New Issue
Block a user