mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-21 05:43:32 -07:00
Fix installing search plugin from local file.
This commit is contained in:
parent
14d590b3be
commit
9cac51d9b0
1 changed files with 3 additions and 4 deletions
|
@ -362,11 +362,10 @@ void engineSelectDlg::askForLocalPlugin() {
|
||||||
QStringList pathsList = QFileDialog::getOpenFileNames(0,
|
QStringList pathsList = QFileDialog::getOpenFileNames(0,
|
||||||
tr("Select search plugins"), QDir::homePath(),
|
tr("Select search plugins"), QDir::homePath(),
|
||||||
tr("qBittorrent search plugin")+QString::fromUtf8(" (*.py)"));
|
tr("qBittorrent search plugin")+QString::fromUtf8(" (*.py)"));
|
||||||
QString path;
|
foreach (QString path, pathsList) {
|
||||||
foreach (path, pathsList) {
|
|
||||||
if (path.endsWith(".py", Qt::CaseInsensitive)) {
|
if (path.endsWith(".py", Qt::CaseInsensitive)) {
|
||||||
QString plugin_name = path.split("/").last();
|
QString plugin_name = fsutils::fileName(path);
|
||||||
plugin_name.replace(".py", "", Qt::CaseInsensitive);
|
plugin_name.chop(3); // Remove extension
|
||||||
installPlugin(path, plugin_name);
|
installPlugin(path, plugin_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue