diff options
author | Chris Xiong <chirs241097@gmail.com> | 2019-12-04 23:02:40 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2019-12-04 23:02:40 +0800 |
commit | 06496661120f7858f26a29f76631e6f0a0ebae7f (patch) | |
tree | 569d912a4d10a9439e2def8d71e5d9dcafe2cb95 /qmidiplayer-desktop | |
parent | 96a17cb0283647b7a5b7afa9c35a5d1d2b8d6fc7 (diff) | |
download | QMidiPlayer-06496661120f7858f26a29f76631e6f0a0ebae7f.tar.xz |
Do not crash if midi device is disconnected during the playback.
Linux build no longer searches working directory for plugins. Instead
it should search the plugin folder in the executable directory.
Documentation update.
Diffstat (limited to 'qmidiplayer-desktop')
-rw-r--r-- | qmidiplayer-desktop/qmpplugin.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/qmidiplayer-desktop/qmpplugin.cpp b/qmidiplayer-desktop/qmpplugin.cpp index 774f0da..8f16573 100644 --- a/qmidiplayer-desktop/qmpplugin.cpp +++ b/qmidiplayer-desktop/qmpplugin.cpp @@ -65,12 +65,12 @@ void qmpPluginManager::scanPlugins(const std::vector<std::string> &pp) } delete dir; #endif - dir=new QDirIterator("./"); + dir=new QDirIterator(QCoreApplication::applicationDirPath()+"/plugins/"); while(dir->hasNext()) { dir->next(); if(dir->fileInfo().suffix()=="so") - cpluginpaths.push_back(std::string("./")+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) @@ -114,7 +114,7 @@ void qmpPluginManager::initPlugins() for(unsigned i=0;i<plugins.size();++i) { if(!plugins[i].enabled)continue; - printf("Loaded plugin: %s\n",plugins[i].path.c_str()); + fprintf(stderr,"Loaded plugin: %s\n",plugins[i].path.c_str()); plugins[i].pinterface->init();plugins[i].initialized=true; } } |