summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-10 22:27:04 (UTC)
committer simon <simon>2002-12-10 22:27:04 (UTC)
commit0ee7b9eb000d0ca5dfeab074e45488d0bc44314b (patch) (unidiff)
treeb10a90cc3a9eb5566bfa9219634f35954447dd68
parent34418795f4bef0466fc92aa9dfd8f25210bc2bc5 (diff)
downloadopie-0ee7b9eb000d0ca5dfeab074e45488d0bc44314b.zip
opie-0ee7b9eb000d0ca5dfeab074e45488d0bc44314b.tar.gz
opie-0ee7b9eb000d0ca5dfeab074e45488d0bc44314b.tar.bz2
- factor out the expensive xine initialization code into a separate method,
as preparation
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp17
-rw-r--r--noncore/multimedia/opieplayer2/lib.h2
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
@@ -39,4 +39,5 @@
39 39
40#include <qfile.h> 40#include <qfile.h>
41#include <qdir.h>
41 42
42#include <qgfx_qws.h> 43#include <qgfx_qws.h>
@@ -74,11 +75,10 @@ Lib::Lib( XineVideoWidget* widget ) {
74 m_wid = widget; 75 m_wid = widget;
75 printf("Lib"); 76 printf("Lib");
76 QCString str( getenv("HOME") ); 77 QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf";
77 str += "/Settings/opiexine.cf";
78 // get the configuration 78 // get the configuration
79 79
80 // not really OO, should be an extra class, later 80 // not really OO, should be an extra class, later
81 if ( !QFile(str).exists() ) { 81 if ( !QFile::exists(configPath) ) {
82 QFile f(str); 82 QFile f(configPath);
83 f.open(IO_WriteOnly); 83 f.open(IO_WriteOnly);
84 QTextStream ts( &f ); 84 QTextStream ts( &f );
@@ -87,7 +87,13 @@ Lib::Lib( XineVideoWidget* widget ) {
87 } 87 }
88 88
89 initialize();
90}
91
92void Lib::initialize()
93{
89 m_xine = xine_new( ); 94 m_xine = xine_new( );
90 95
91 xine_config_load( m_xine, str.data() ); 96 QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf";
97 xine_config_load( m_xine, QFile::encodeName( configPath ) );
92 98
93 xine_init( m_xine ); 99 xine_init( m_xine );
@@ -117,4 +123,5 @@ Lib::Lib( XineVideoWidget* widget ) {
117 123
118 xine_event_create_listener_thread (m_queue, xine_event_handler, this); 124 xine_event_create_listener_thread (m_queue, xine_event_handler, this);
125
119} 126}
120 127
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
@@ -182,4 +182,6 @@ namespace XINE {
182 182
183 private: 183 private:
184 void initialize();
185
184 int m_bytes_per_pixel; 186 int m_bytes_per_pixel;
185 bool m_video:1; 187 bool m_video:1;