From b8a6b47b2984fb0d9e51934979b3b128a88316f6 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Fri, 16 Feb 2018 17:16:29 -0600 Subject: [PATCH] Replace manual library suffix check with QLibrary::isLibrary --- src/nostalgia/studio/mainwindow.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/nostalgia/studio/mainwindow.cpp b/src/nostalgia/studio/mainwindow.cpp index 5ac5087a..f2b8292b 100644 --- a/src/nostalgia/studio/mainwindow.cpp +++ b/src/nostalgia/studio/mainwindow.cpp @@ -81,17 +81,9 @@ void MainWindow::loadPlugins() { } void MainWindow::loadPluginDir(QString dir) { -#if defined(Q_OS_WIN) - constexpr auto libSuffix = ".dll"; -#elif defined(Q_OS_MAC) - constexpr auto libSuffix = ".dylib"; -#else - constexpr auto libSuffix = ".so"; -#endif - for (auto pluginPath : QDir(dir).entryList()) { pluginPath = dir + '/' + pluginPath; - if (pluginPath.endsWith(libSuffix)) { + if (QLibrary::isLibrary(pluginPath)) { loadPlugin(pluginPath); } }