mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-03 06:02:29 -06:00
Performance improvement on ARM
This commit is contained in:
@@ -224,15 +224,15 @@ QTreeWidgetItem* engineSelectDlg::findItemWithID(QString id){
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool engineSelectDlg::isUpdateNeeded(QString plugin_name, float new_version) const {
|
||||
float old_version = SearchEngine::getPluginVersion(misc::searchEngineLocation()+QDir::separator()+"engines"+QDir::separator()+plugin_name+".py");
|
||||
bool engineSelectDlg::isUpdateNeeded(QString plugin_name, qreal new_version) const {
|
||||
qreal old_version = SearchEngine::getPluginVersion(misc::searchEngineLocation()+QDir::separator()+"engines"+QDir::separator()+plugin_name+".py");
|
||||
qDebug("IsUpdate needed? tobeinstalled: %.2f, alreadyinstalled: %.2f", new_version, old_version);
|
||||
return (new_version > old_version);
|
||||
}
|
||||
|
||||
void engineSelectDlg::installPlugin(QString path, QString plugin_name) {
|
||||
qDebug("Asked to install plugin at %s", qPrintable(path));
|
||||
float new_version = SearchEngine::getPluginVersion(path);
|
||||
qreal new_version = SearchEngine::getPluginVersion(path);
|
||||
qDebug("Version to be installed: %.2f", new_version);
|
||||
if(!isUpdateNeeded(plugin_name, new_version)) {
|
||||
qDebug("Apparently update is not needed, we have a more recent version");
|
||||
@@ -372,7 +372,7 @@ bool engineSelectDlg::parseVersionsFile(QString versions_file) {
|
||||
if(!plugin_name.endsWith(":")) continue;
|
||||
plugin_name.chop(1); // remove trailing ':'
|
||||
bool ok;
|
||||
float version = list.last().toFloat(&ok);
|
||||
qreal version = list.last().toFloat(&ok);
|
||||
qDebug("read line %s: %.2f", qPrintable(plugin_name), version);
|
||||
if(!ok) continue;
|
||||
file_correct = true;
|
||||
|
||||
@@ -52,7 +52,7 @@ class engineSelectDlg : public QDialog, public Ui::engineSelect{
|
||||
|
||||
protected:
|
||||
bool parseVersionsFile(QString versions_file);
|
||||
bool isUpdateNeeded(QString plugin_name, float new_version) const;
|
||||
bool isUpdateNeeded(QString plugin_name, qreal new_version) const;
|
||||
|
||||
signals:
|
||||
void enginesChanged();
|
||||
|
||||
@@ -188,7 +188,7 @@ SearchEngine::~SearchEngine(){
|
||||
searchProcess->waitForFinished();
|
||||
foreach(QProcess *downloader, downloaders) {
|
||||
// Make sure we disconnect the SIGNAL/SLOT first
|
||||
// To avoid double free
|
||||
// To avoid qreal free
|
||||
downloader->disconnect();
|
||||
downloader->kill();
|
||||
downloader->waitForFinished();
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
~SearchEngine();
|
||||
QString selectedCategory() const;
|
||||
|
||||
static float getPluginVersion(QString filePath) {
|
||||
static qreal getPluginVersion(QString filePath) {
|
||||
QFile plugin(filePath);
|
||||
if(!plugin.exists()){
|
||||
qDebug("%s plugin does not exist, returning 0.0", qPrintable(filePath));
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
if(!plugin.open(QIODevice::ReadOnly | QIODevice::Text)){
|
||||
return 0.0;
|
||||
}
|
||||
float version = 0.0;
|
||||
qreal version = 0.0;
|
||||
while (!plugin.atEnd()){
|
||||
QByteArray line = plugin.readLine();
|
||||
if(line.startsWith("#VERSION: ")){
|
||||
|
||||
Reference in New Issue
Block a user