55
66#include < kali-core/VideoPlayer.hpp>
77#include < kali-core/KaliscopeEngine.hpp>
8+ #include < kali-core/settingsTools.hpp>
89#include < mvp-player-core/MVPPlayerEngine.hpp>
910#include < mvp-player-core/MVPPlayerLogic.hpp>
1011#include < mvp-player-core/Settings.hpp>
1617#include < mvp-player-pluger/PluginLoader.hpp>
1718#include < mvp-player-net/client/Client.hpp>
1819
20+ #include < boost-adds/filesystem/bundle_path.hpp>
21+
1922#include < boost-adds/environment.hpp>
2023#include < boost/log/core.hpp>
2124#include < boost/log/trivial.hpp>
@@ -41,7 +44,7 @@ void editSettings( QMainWindow *caller, mvpplayer::MVPPlayerEngine & m, mvpplaye
4144 const int res = settingsDialog.exec ();
4245 if ( !res )
4346 {
44- mvpplayer::Settings::getInstance ().write ( QDir::homePath ().toStdString () + " /" + mvpplayer ::kDefaultSettingsFilename );
47+ mvpplayer::Settings::getInstance ().write ( QDir::homePath ().toStdString () + " /" + kaliscope ::kDefaultSettingsFilename );
4548 }
4649}
4750
@@ -62,13 +65,20 @@ bool editPipelineSettings( QMainWindow *caller, mvpplayer::Settings & settings )
6265 */
6366int main ( int argc, char **argv )
6467{
68+ mvpplayer::Settings::getInstance ().read ( QDir::homePath ().toStdString () + " /" + kaliscope::kDefaultSettingsFilename );
6569 using namespace mvpplayer ;
6670 {
67- Settings::getInstance ().read ( QDir::homePath ().toStdString () + " /" + kDefaultSettingsFilename );
6871 boost::optional<std::string> envStr = boost::get_env ( plugins::kMVPPlayerPluginEnvKey );
69- if ( envStr != boost::none && Settings::getInstance ().has ( " plugins" , " pluginsPath" ) == false )
72+ if ( Settings::getInstance ().has ( " plugins" , " pluginsPath" ) == false )
7073 {
71- Settings::getInstance ().set ( " plugins" , " pluginsPath" , *envStr );
74+ if ( envStr != boost::none )
75+ {
76+ Settings::getInstance ().set ( " plugins" , " pluginsPath" , *envStr );
77+ }
78+ else
79+ {
80+ Settings::getInstance ().set ( " plugins" , " pluginsPath" , ( boost::filesystem::bundle_path () / std::string ( " mvpPlayerPlugins/" ) ).string () );
81+ }
7282 }
7383 }
7484
0 commit comments