[vlmc-devel] commit: EffectsEngine: Handle FREI0R_PATH env variable on Linux ( Hugo Beauzée-Luyssen )
git at videolan.org
git at videolan.org
Tue Sep 7 16:54:37 CEST 2010
vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Tue Sep 7 16:52:04 2010 +0200| [fd0fc14bedc74f6e8ae0f721eb72869ce7847a9a] | committer: Hugo Beauzée-Luyssen
EffectsEngine: Handle FREI0R_PATH env variable on Linux
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=fd0fc14bedc74f6e8ae0f721eb72869ce7847a9a
---
src/EffectsEngine/EffectsEngine.cpp | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/src/EffectsEngine/EffectsEngine.cpp b/src/EffectsEngine/EffectsEngine.cpp
index 9d79d7a..ebe711e 100644
--- a/src/EffectsEngine/EffectsEngine.cpp
+++ b/src/EffectsEngine/EffectsEngine.cpp
@@ -28,6 +28,7 @@
#include <QDesktopServices>
#include <QDir>
+#include <QProcess>
#include <QSettings>
#include <QXmlStreamWriter>
@@ -122,10 +123,22 @@ EffectsEngine::loadEffects()
QStringList pathList;
#if defined( Q_OS_UNIX )
- //Refer to http://www.piksel.org/frei0r/1.2/spec/group__pluglocations.html
- pathList << QString( QDir::homePath() + "/.frei0r-1/lib/" ) <<
- QString("/usr/local/lib/frei0r-1/") <<
- QString("/usr/lib/frei0r-1/" );
+ const QStringList &env = QProcess::systemEnvironment();
+ foreach ( const QString &e, env )
+ {
+ if ( e.startsWith( "FREI0R_PATH=" ) == true )
+ {
+ const QString list = e.mid( 12 );
+ pathList = list.split( ':' );
+ }
+ }
+ if ( pathList.isEmpty() == true )
+ {
+ //Refer to http://www.piksel.org/frei0r/1.2/spec/group__pluglocations.html
+ pathList << QString( QDir::homePath() + "/.frei0r-1/lib/" ) <<
+ QString("/usr/local/lib/frei0r-1/") <<
+ QString("/usr/lib/frei0r-1/" );
+ }
#elif defined ( Q_OS_WIN32 )
pathList << QDir::currentPath();
#endif
More information about the Vlmc-devel
mailing list