From 844ddb2e0a6cdddf183ca3ecf08d1cedece27c71 Mon Sep 17 00:00:00 2001
From: Chris Xiong <chirs241097@gmail.com>
Date: Tue, 14 Feb 2017 17:48:22 +0800
Subject: Scan for plugins in the executable directory instead of the working
 directory.

---
 ChangeLog                         | 4 ++++
 qmidiplayer-desktop/qmpplugin.cpp | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fe98a32..e00527e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-02-14 0.8.5 indev
+Scan for plugins in the executable directory instead
+of the working directory.
+
 2017-02-13 0.8.5 indev
 Also use the new mechanism to handle the main Window.
 Explicit initialization of variable fixes #4 2).
diff --git a/qmidiplayer-desktop/qmpplugin.cpp b/qmidiplayer-desktop/qmpplugin.cpp
index c9a3671..5889b9f 100644
--- a/qmidiplayer-desktop/qmpplugin.cpp
+++ b/qmidiplayer-desktop/qmpplugin.cpp
@@ -17,12 +17,12 @@ void qmpPluginManager::scanPlugins()
 {
 	QDirIterator *dir;
 	std::vector<std::string> cpluginpaths;
-	dir=new QDirIterator(".\\plugins\\");
+	dir=new QDirIterator(QCoreApplication::applicationDirPath()+"/plugins/");
 	while(dir->hasNext())
 	{
 		dir->next();
 		if(dir->fileInfo().suffix()=="dll")
-			cpluginpaths.push_back(std::string(".\\plugins\\")+dir->fileName().toStdString());
+			cpluginpaths.push_back(QCoreApplication::applicationDirPath().toStdString()+std::string("/plugins/")+dir->fileName().toStdString());
 	}
 	delete dir;
 	for(unsigned i=0;i<cpluginpaths.size();++i)
-- 
cgit v1.2.3