author | simon <simon> | 2002-12-10 22:27:04 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-10 22:27:04 (UTC) |
commit | 0ee7b9eb000d0ca5dfeab074e45488d0bc44314b (patch) (side-by-side diff) | |
tree | b10a90cc3a9eb5566bfa9219634f35954447dd68 /noncore | |
parent | 34418795f4bef0466fc92aa9dfd8f25210bc2bc5 (diff) | |
download | opie-0ee7b9eb000d0ca5dfeab074e45488d0bc44314b.zip opie-0ee7b9eb000d0ca5dfeab074e45488d0bc44314b.tar.gz opie-0ee7b9eb000d0ca5dfeab074e45488d0bc44314b.tar.bz2 |
- factor out the expensive xine initialization code into a separate method,
as preparation
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 17 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.h | 2 |
2 files changed, 14 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 @@ -40,2 +40,3 @@ #include <qfile.h> +#include <qdir.h> @@ -75,4 +76,3 @@ Lib::Lib( XineVideoWidget* widget ) { printf("Lib"); - QCString str( getenv("HOME") ); - str += "/Settings/opiexine.cf"; + QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf"; // get the configuration @@ -80,4 +80,4 @@ Lib::Lib( XineVideoWidget* widget ) { // 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); @@ -88,5 +88,11 @@ 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 ) ); @@ -118,2 +124,3 @@ Lib::Lib( XineVideoWidget* widget ) { xine_event_create_listener_thread (m_queue, xine_event_handler, this); + } diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h index 37a4f9a..d546c99 100644 --- a/noncore/multimedia/opieplayer2/lib.h +++ b/noncore/multimedia/opieplayer2/lib.h @@ -183,2 +183,4 @@ namespace XINE { private: + void initialize(); + int m_bytes_per_pixel; |