[vlmc-devel] commit: EffectsEngine: Use the appdirectory/effects on win32 ( Hugo Beauzée-Luyssen )
git at videolan.org
git at videolan.org
Tue Sep 21 15:04:45 CEST 2010
vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Tue Sep 21 15:01:44 2010 +0200| [bc39a6ad4c802e456d15fcf6992c3f7f740846f8] | committer: Hugo Beauzée-Luyssen
EffectsEngine: Use the appdirectory/effects on win32
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=bc39a6ad4c802e456d15fcf6992c3f7f740846f8
---
src/EffectsEngine/EffectsEngine.cpp | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/src/EffectsEngine/EffectsEngine.cpp b/src/EffectsEngine/EffectsEngine.cpp
index 5e4dc13..d9745bb 100644
--- a/src/EffectsEngine/EffectsEngine.cpp
+++ b/src/EffectsEngine/EffectsEngine.cpp
@@ -34,6 +34,10 @@
#include <QtDebug>
+#ifdef Q_OS_WIN
+#include <windows.h>
+#endif
+
EffectsEngine::EffectsEngine()
{
m_cache = new QSettings( QDesktopServices::storageLocation(
@@ -134,7 +138,14 @@ EffectsEngine::loadEffects()
QString("/usr/lib/frei0r-1/" );
}
#elif defined ( Q_OS_WIN32 )
- pathList << QDir::currentPath() + "/effects/";
+ TCHAR appDir[128];
+ if ( GetModuleFileName( NULL, appDir, 128 ) > 0 )
+ pathList << QString( appDir );
+ else
+ {
+ qWarning() << "Failed to get application directory. Using current path.";
+ pathList << QDir::currentPath() + "/effects/";
+ }
#endif
foreach ( const QString &path, pathList )
{
More information about the Vlmc-devel
mailing list