author | zecke <zecke> | 2004-10-16 00:01:01 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-10-16 00:01:01 (UTC) |
commit | df14f647ff1a60ca82e0fa9bd91458be146153b8 (patch) (unidiff) | |
tree | 4859961352851a4392e1442f2080c15bff8ad7bc /x11/libqpe-x11/qpe | |
parent | 419f9710c488f56a7a117eb1529970d3371e0094 (diff) | |
download | opie-df14f647ff1a60ca82e0fa9bd91458be146153b8.zip opie-df14f647ff1a60ca82e0fa9bd91458be146153b8.tar.gz opie-df14f647ff1a60ca82e0fa9bd91458be146153b8.tar.bz2 |
Replace QPEApplication::qpeDir() + "/ with
QPEApplication::qpeDir() + "
as it is guranteed that qpeDir() will have '/' as the last
charachter
-rw-r--r-- | x11/libqpe-x11/qpe/qpeapplication.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/x11/libqpe-x11/qpe/qpeapplication.cpp b/x11/libqpe-x11/qpe/qpeapplication.cpp index 3cb8faf..73e7ce4 100644 --- a/x11/libqpe-x11/qpe/qpeapplication.cpp +++ b/x11/libqpe-x11/qpe/qpeapplication.cpp | |||
@@ -95,118 +95,118 @@ public: | |||
95 | Atom wm_protocols; | 95 | Atom wm_protocols; |
96 | 96 | ||
97 | private: | 97 | private: |
98 | QList<QCopRec> qcopq; | 98 | QList<QCopRec> qcopq; |
99 | }; | 99 | }; |
100 | QPEApplication::Private::~Private() { | 100 | QPEApplication::Private::~Private() { |
101 | } | 101 | } |
102 | QPEApplication::Private::Private() | 102 | QPEApplication::Private::Private() |
103 | : kbgrabber(0 ), presstimer(0 ), rightpressed( FALSE ), kbregrab( FALSE ), notbusysent( FALSE ), | 103 | : kbgrabber(0 ), presstimer(0 ), rightpressed( FALSE ), kbregrab( FALSE ), notbusysent( FALSE ), |
104 | preloaded( FALSE ), forceshow( FALSE ), nomaximize( FALSE ), keep_running( TRUE ), | 104 | preloaded( FALSE ), forceshow( FALSE ), nomaximize( FALSE ), keep_running( TRUE ), |
105 | presswidget( 0 ), qpe_main_widget(0 ) { | 105 | presswidget( 0 ), qpe_main_widget(0 ) { |
106 | 106 | ||
107 | qcopq.setAutoDelete( TRUE ); | 107 | qcopq.setAutoDelete( TRUE ); |
108 | } | 108 | } |
109 | void QPEApplication::Private::enqueueQCop( const QCString& chan, const QCString& msg, | 109 | void QPEApplication::Private::enqueueQCop( const QCString& chan, const QCString& msg, |
110 | const QByteArray& ar ) { | 110 | const QByteArray& ar ) { |
111 | qcopq.append( new QCopRec(chan, msg, ar ) ); | 111 | qcopq.append( new QCopRec(chan, msg, ar ) ); |
112 | } | 112 | } |
113 | void QPEApplication::Private::sendQCopQ() { | 113 | void QPEApplication::Private::sendQCopQ() { |
114 | QCopRec* r; | 114 | QCopRec* r; |
115 | for ( r = qcopq.first(); r; r = qcopq.next() ) { | 115 | for ( r = qcopq.first(); r; r = qcopq.next() ) { |
116 | QCopChannel::sendLocally( r->channel, r->message, r->data ); | 116 | QCopChannel::sendLocally( r->channel, r->message, r->data ); |
117 | } | 117 | } |
118 | qcopq.clear(); | 118 | qcopq.clear(); |
119 | } | 119 | } |
120 | void QPEApplication::Private::show_mx(QWidget* mw, bool nomaximize ) { | 120 | void QPEApplication::Private::show_mx(QWidget* mw, bool nomaximize ) { |
121 | if (mw->layout() && mw->inherits("QDialog") ) { | 121 | if (mw->layout() && mw->inherits("QDialog") ) { |
122 | QPEApplication::showDialog( (QDialog*)mw, nomaximize ); | 122 | QPEApplication::showDialog( (QDialog*)mw, nomaximize ); |
123 | }else { | 123 | }else { |
124 | if (!nomaximize ) | 124 | if (!nomaximize ) |
125 | mw->showMaximized(); | 125 | mw->showMaximized(); |
126 | else | 126 | else |
127 | mw->show(); | 127 | mw->show(); |
128 | } | 128 | } |
129 | } | 129 | } |
130 | void QPEApplication::Private::show( QWidget* mw, bool nomax ) { | 130 | void QPEApplication::Private::show( QWidget* mw, bool nomax ) { |
131 | nomaximize = nomax; | 131 | nomaximize = nomax; |
132 | qpe_main_widget = mw; | 132 | qpe_main_widget = mw; |
133 | 133 | ||
134 | sendQCopQ(); | 134 | sendQCopQ(); |
135 | 135 | ||
136 | if ( preloaded ) { | 136 | if ( preloaded ) { |
137 | if (forceshow ) | 137 | if (forceshow ) |
138 | show_mx(mw, nomax ); | 138 | show_mx(mw, nomax ); |
139 | }else if ( keep_running ) | 139 | }else if ( keep_running ) |
140 | show_mx( mw, nomax ); | 140 | show_mx( mw, nomax ); |
141 | } | 141 | } |
142 | void QPEApplication::Private::loadTextCodecs() { | 142 | void QPEApplication::Private::loadTextCodecs() { |
143 | QString path = QPEApplication::qpeDir() + "/plugins/textcodecs"; | 143 | QString path = QPEApplication::qpeDir() + "plugins/textcodecs"; |
144 | QDir dir( path, "lib*.so" ); | 144 | QDir dir( path, "lib*.so" ); |
145 | QStringList list = dir.entryList(); | 145 | QStringList list = dir.entryList(); |
146 | QStringList::Iterator it; | 146 | QStringList::Iterator it; |
147 | for ( it = list.begin(); it != list.end(); ++it ) { | 147 | for ( it = list.begin(); it != list.end(); ++it ) { |
148 | TextCodecInterface *iface = 0; | 148 | TextCodecInterface *iface = 0; |
149 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 149 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
150 | if ( lib->queryInterface( IID_QtopiaTextCodec, (QUnknownInterface**)&iface ) == QS_OK && iface ) { | 150 | if ( lib->queryInterface( IID_QtopiaTextCodec, (QUnknownInterface**)&iface ) == QS_OK && iface ) { |
151 | QValueList<int> mibs = iface->mibEnums(); | 151 | QValueList<int> mibs = iface->mibEnums(); |
152 | for (QValueList<int>::ConstIterator i = mibs.begin(); i != mibs.end(); ++i) { | 152 | for (QValueList<int>::ConstIterator i = mibs.begin(); i != mibs.end(); ++i) { |
153 | (void)iface->createForMib(*i); | 153 | (void)iface->createForMib(*i); |
154 | // ### it exists now; need to remember if we can delete it | 154 | // ### it exists now; need to remember if we can delete it |
155 | } | 155 | } |
156 | } | 156 | } |
157 | else { | 157 | else { |
158 | lib->unload(); | 158 | lib->unload(); |
159 | delete lib; | 159 | delete lib; |
160 | } | 160 | } |
161 | } | 161 | } |
162 | } | 162 | } |
163 | void QPEApplication::Private::loadImageCodecs() { | 163 | void QPEApplication::Private::loadImageCodecs() { |
164 | QString path = QPEApplication::qpeDir() + "/plugins/imagecodecs"; | 164 | QString path = QPEApplication::qpeDir() + "plugins/imagecodecs"; |
165 | QDir dir( path, "lib*.so" ); | 165 | QDir dir( path, "lib*.so" ); |
166 | QStringList list = dir.entryList(); | 166 | QStringList list = dir.entryList(); |
167 | QStringList::Iterator it; | 167 | QStringList::Iterator it; |
168 | for ( it = list.begin(); it != list.end(); ++it ) { | 168 | for ( it = list.begin(); it != list.end(); ++it ) { |
169 | ImageCodecInterface *iface = 0; | 169 | ImageCodecInterface *iface = 0; |
170 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 170 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
171 | if ( lib->queryInterface( IID_QtopiaImageCodec, (QUnknownInterface**)&iface ) == QS_OK && iface ) { | 171 | if ( lib->queryInterface( IID_QtopiaImageCodec, (QUnknownInterface**)&iface ) == QS_OK && iface ) { |
172 | QStringList formats = iface->keys(); | 172 | QStringList formats = iface->keys(); |
173 | for (QStringList::ConstIterator i = formats.begin(); i != formats.end(); ++i) { | 173 | for (QStringList::ConstIterator i = formats.begin(); i != formats.end(); ++i) { |
174 | (void)iface->installIOHandler(*i); | 174 | (void)iface->installIOHandler(*i); |
175 | // ### it exists now; need to remember if we can delete it | 175 | // ### it exists now; need to remember if we can delete it |
176 | } | 176 | } |
177 | } | 177 | } |
178 | else { | 178 | else { |
179 | lib->unload(); | 179 | lib->unload(); |
180 | delete lib; | 180 | delete lib; |
181 | } | 181 | } |
182 | } | 182 | } |
183 | } | 183 | } |
184 | 184 | ||
185 | // The Help System hook | 185 | // The Help System hook |
186 | namespace { | 186 | namespace { |
187 | class ResourceMimeFactory : public QMimeSourceFactory | 187 | class ResourceMimeFactory : public QMimeSourceFactory |
188 | { | 188 | { |
189 | public: | 189 | public: |
190 | ResourceMimeFactory(); | 190 | ResourceMimeFactory(); |
191 | ~ResourceMimeFactory(); | 191 | ~ResourceMimeFactory(); |
192 | const QMimeSource* data( const QString& abs_name )const; | 192 | const QMimeSource* data( const QString& abs_name )const; |
193 | }; | 193 | }; |
194 | ResourceMimeFactory::ResourceMimeFactory() | 194 | ResourceMimeFactory::ResourceMimeFactory() |
195 | { | 195 | { |
196 | setFilePath( Global::helpPath() ); | 196 | setFilePath( Global::helpPath() ); |
197 | setExtensionType( "html", "text/html;charset=UTF-8" ); | 197 | setExtensionType( "html", "text/html;charset=UTF-8" ); |
198 | } | 198 | } |
199 | ResourceMimeFactory::~ResourceMimeFactory() { | 199 | ResourceMimeFactory::~ResourceMimeFactory() { |
200 | } | 200 | } |
201 | 201 | ||
202 | const QMimeSource* ResourceMimeFactory::data( const QString& abs_name ) const | 202 | const QMimeSource* ResourceMimeFactory::data( const QString& abs_name ) const |
203 | { | 203 | { |
204 | const QMimeSource * r = QMimeSourceFactory::data( abs_name ); | 204 | const QMimeSource * r = QMimeSourceFactory::data( abs_name ); |
205 | if ( !r ) { | 205 | if ( !r ) { |
206 | int sl = abs_name.length(); | 206 | int sl = abs_name.length(); |
207 | do { | 207 | do { |
208 | sl = abs_name.findRev( '/', sl - 1 ); | 208 | sl = abs_name.findRev( '/', sl - 1 ); |
209 | QString name = sl >= 0 ? abs_name.mid( sl + 1 ) : abs_name; | 209 | QString name = sl >= 0 ? abs_name.mid( sl + 1 ) : abs_name; |
210 | int dot = name.findRev( '.' ); | 210 | int dot = name.findRev( '.' ); |
211 | if ( dot >= 0 ) | 211 | if ( dot >= 0 ) |
212 | name = name.left( dot ); | 212 | name = name.left( dot ); |