Browse Source

Fix installing search plugin from local file.

adaptive-webui-19844
sledgehammer999 9 years ago
parent
commit
21f18d015d
  1. 7
      src/searchengine/engineselectdlg.cpp

7
src/searchengine/engineselectdlg.cpp

@ -358,11 +358,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 = Utils::Fs::fileName(path);
plugin_name.replace(".py", "", Qt::CaseInsensitive); plugin_name.chop(3); // Remove extension
installPlugin(path, plugin_name); installPlugin(path, plugin_name);
} }
} }

Loading…
Cancel
Save