From 2d7eebdbf07d374c23e40a01efec3d486f46a693 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Tue, 26 Jun 2018 05:52:50 +0000 Subject: improved plugin search git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8058 90c681e8-e032-0410-971d-27865f9a5e38 --- src/qmmpui/commandlinemanager.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/qmmpui/commandlinemanager.cpp') diff --git a/src/qmmpui/commandlinemanager.cpp b/src/qmmpui/commandlinemanager.cpp index e50baaa9b..8074d5b12 100644 --- a/src/qmmpui/commandlinemanager.cpp +++ b/src/qmmpui/commandlinemanager.cpp @@ -43,16 +43,12 @@ void CommandLineManager::checkOptions() m_options = new QList; m_files = new QHash; - QDir pluginsDir (Qmmp::pluginsPath()); - pluginsDir.cd("CommandLineOptions"); - QStringList filters; - filters << "*.dll" << "*.so"; - foreach (QString fileName, pluginsDir.entryList(filters, QDir::Files)) + foreach (QString filePath, Qmmp::findPlugins("CommandLineOptions")) { - QPluginLoader loader(pluginsDir.absoluteFilePath(fileName)); + QPluginLoader loader(filePath); QObject *plugin = loader.instance(); if (loader.isLoaded()) - /*qDebug("CommandLineManager: loaded plugin %s", qPrintable(fileName))*/; + /*qDebug("CommandLineManager: loaded plugin %s", qPrintable(QFileInfo(filePath).filePath()));*/; else qWarning("CommandLineManager: %s", qPrintable(loader.errorString ())); @@ -63,7 +59,7 @@ void CommandLineManager::checkOptions() if (option) { m_options->append(option); - m_files->insert(option, pluginsDir.absoluteFilePath(fileName)); + m_files->insert(option, filePath); qApp->installTranslator(option->createTranslator(qApp)); } } -- cgit v1.2.3-13-gbd6f