Diffstat (limited to 'noncore/multimedia/opieplayer2/lib.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 9e818eb..641cbca 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp @@ -39,4 +39,5 @@ #include <qfile.h> +#include <qdir.h> #include <qgfx_qws.h> @@ -74,11 +75,10 @@ Lib::Lib( XineVideoWidget* widget ) { m_wid = widget; printf("Lib"); - QCString str( getenv("HOME") ); - str += "/Settings/opiexine.cf"; + QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf"; // get the configuration // not really OO, should be an extra class, later - if ( !QFile(str).exists() ) { - QFile f(str); + if ( !QFile::exists(configPath) ) { + QFile f(configPath); f.open(IO_WriteOnly); QTextStream ts( &f ); @@ -87,7 +87,13 @@ Lib::Lib( XineVideoWidget* widget ) { } + initialize(); +} + +void Lib::initialize() +{ m_xine = xine_new( ); - xine_config_load( m_xine, str.data() ); + QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf"; + xine_config_load( m_xine, QFile::encodeName( configPath ) ); xine_init( m_xine ); @@ -117,4 +123,5 @@ Lib::Lib( XineVideoWidget* widget ) { xine_event_create_listener_thread (m_queue, xine_event_handler, this); + } |