mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
- Clean up search engine plugins code
- Update plugins from sourceforge SVN/trunk now to avoid maintenance of another update server
This commit is contained in:
parent
d267d65e57
commit
03552c9a1f
5 changed files with 161 additions and 180 deletions
23
src/misc.h
23
src/misc.h
|
@ -269,29 +269,6 @@ public:
|
|||
list.insert(i, value);
|
||||
}
|
||||
|
||||
static float getPluginVersion(QString filePath) {
|
||||
QFile plugin(filePath);
|
||||
if(!plugin.exists()){
|
||||
qDebug("%s plugin does not exist, returning 0.0", filePath.toLocal8Bit().data());
|
||||
return 0.0;
|
||||
}
|
||||
if(!plugin.open(QIODevice::ReadOnly | QIODevice::Text)){
|
||||
return 0.0;
|
||||
}
|
||||
float version = 0.0;
|
||||
while (!plugin.atEnd()){
|
||||
QByteArray line = plugin.readLine();
|
||||
if(line.startsWith("#VERSION: ")){
|
||||
line = line.split(' ').last();
|
||||
line.replace("\n", "");
|
||||
version = line.toFloat();
|
||||
qDebug("plugin %s version: %.2f", filePath.toLocal8Bit().data(), version);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
||||
static QString magnetUriToHash(QString magnet_uri) {
|
||||
QString hash = "";
|
||||
QRegExp reg("urn:btih:([A-Z2-7=]+)");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue