summaryrefslogtreecommitdiff
path: root/core
Unidiff
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/multikeyapplet/multikey.cpp2
-rw-r--r--core/apps/taboapp/main.cpp4
-rw-r--r--core/launcher/inputmethods.cpp6
-rw-r--r--core/launcher/irserver.cpp4
-rw-r--r--core/launcher/startmenu.cpp4
-rw-r--r--core/launcher/systray.cpp4
-rw-r--r--core/multimedia/opieplayer/mediaplayerstate.cpp2
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp2
-rw-r--r--core/multimedia/opieplayer/videowidget.cpp2
-rw-r--r--core/opie-login/main.cpp2
-rw-r--r--core/settings/launcher/menusettings.cpp4
-rw-r--r--core/settings/launcher/taskbarsettings.cpp4
-rw-r--r--core/settings/security/multiauthconfig.cpp8
-rw-r--r--core/tools/quicklauncher/dropins.h4
14 files changed, 26 insertions, 26 deletions
diff --git a/core/applets/multikeyapplet/multikey.cpp b/core/applets/multikeyapplet/multikey.cpp
index 195d8a4..8cb9083 100644
--- a/core/applets/multikeyapplet/multikey.cpp
+++ b/core/applets/multikeyapplet/multikey.cpp
@@ -38,97 +38,97 @@ Multikey::Multikey(QWidget *parent) : QLabel(parent), popupMenu(this), current("
38 show(); 38 show();
39} 39}
40 40
41void Multikey::mousePressEvent(QMouseEvent *ev) 41void Multikey::mousePressEvent(QMouseEvent *ev)
42{ 42{
43 if (!sw_maps.count()) 43 if (!sw_maps.count())
44 return; 44 return;
45 45
46 if (ev->button() == RightButton) { 46 if (ev->button() == RightButton) {
47 47
48 QPoint p = mapToGlobal(QPoint(0, 0)); 48 QPoint p = mapToGlobal(QPoint(0, 0));
49 QSize s = popupMenu.sizeHint(); 49 QSize s = popupMenu.sizeHint();
50 int opt = popupMenu.exec(QPoint(p.x() + (width() / 2) - (s.width() / 2), 50 int opt = popupMenu.exec(QPoint(p.x() + (width() / 2) - (s.width() / 2),
51 p.y() - s.height()), 0); 51 p.y() - s.height()), 0);
52 52
53 if (opt == -1) 53 if (opt == -1)
54 return; 54 return;
55 lang = opt; 55 lang = opt;
56 56
57 QCopEnvelope e("MultiKey/Keyboard", "setmultikey(QString)"); 57 QCopEnvelope e("MultiKey/Keyboard", "setmultikey(QString)");
58 e << sw_maps[lang]; 58 e << sw_maps[lang];
59 setText(labels[lang]); 59 setText(labels[lang]);
60 } 60 }
61 QWidget::mousePressEvent(ev); 61 QWidget::mousePressEvent(ev);
62} 62}
63 63
64void Multikey::mouseReleaseEvent(QMouseEvent *ev) 64void Multikey::mouseReleaseEvent(QMouseEvent *ev)
65{ 65{
66 if (!sw_maps.count()) 66 if (!sw_maps.count())
67 return; 67 return;
68 68
69 lang = lang < sw_maps.count()-1 ? lang+1 : 0; 69 lang = lang < sw_maps.count()-1 ? lang+1 : 0;
70 QCopEnvelope e("MultiKey/Keyboard", "setmultikey(QString)"); 70 QCopEnvelope e("MultiKey/Keyboard", "setmultikey(QString)");
71 //odebug << "Lang=" << lang << ", count=" << sw_maps.count() << ", lab=" << labels[lang].ascii() << "" << oendl; 71 //odebug << "Lang=" << lang << ", count=" << sw_maps.count() << ", lab=" << labels[lang].ascii() << "" << oendl;
72 e << sw_maps[lang]; 72 e << sw_maps[lang];
73 setText(labels[lang]); 73 setText(labels[lang]);
74} 74}
75 75
76void Multikey::message(const QCString &message, const QByteArray &data) 76void Multikey::message(const QCString &message, const QByteArray &data)
77{ 77{
78 if ( message == "setsw(QString,QString)" ) { 78 if ( message == "setsw(QString,QString)" ) {
79 79
80 QDataStream stream(data, IO_ReadOnly); 80 QDataStream stream(data, IO_ReadOnly);
81 QString maps, current_map; 81 QString maps, current_map;
82 stream >> maps >> current_map; 82 stream >> maps >> current_map;
83 QStringList sw = QStringList::split(QChar('|'), maps); 83 QStringList sw = QStringList::split(QChar('|'), maps);
84 sw.append(current_map); 84 sw.append(current_map);
85 85
86 QDir map_dir(QPEApplication::qpeDir() + "/share/multikey/", "*.keymap"); 86 QDir map_dir(QPEApplication::qpeDir() + "share/multikey/", "*.keymap");
87 lang = 0; 87 lang = 0;
88 labels.clear(); 88 labels.clear();
89 sw_maps.clear(); 89 sw_maps.clear();
90 popupMenu.clear(); 90 popupMenu.clear();
91 91
92 for (uint i = 0; i < sw.count(); ++i) { 92 for (uint i = 0; i < sw.count(); ++i) {
93 QString keymap_map; 93 QString keymap_map;
94 if (sw[i][0] != '/') { 94 if (sw[i][0] != '/') {
95 95
96 keymap_map = map_dir.absPath() + "/" + sw[i]; 96 keymap_map = map_dir.absPath() + "/" + sw[i];
97 } else { 97 } else {
98 98
99 if ((map_dir.exists(QFileInfo(sw[i]).fileName(), false) 99 if ((map_dir.exists(QFileInfo(sw[i]).fileName(), false)
100 && i != sw.count()-1) || !QFile::exists(sw[i])) { 100 && i != sw.count()-1) || !QFile::exists(sw[i])) {
101 continue; 101 continue;
102 } 102 }
103 keymap_map = sw[i]; 103 keymap_map = sw[i];
104 } 104 }
105 105
106 QFile map(keymap_map); 106 QFile map(keymap_map);
107 if (map.open(IO_ReadOnly)) { 107 if (map.open(IO_ReadOnly)) {
108 QString line; 108 QString line;
109 109
110 map.readLine(line, 1024); 110 map.readLine(line, 1024);
111 while (!map.atEnd()) { 111 while (!map.atEnd()) {
112 112
113 if (line.find(QRegExp("^sw\\s*=\\s*")) != -1) { 113 if (line.find(QRegExp("^sw\\s*=\\s*")) != -1) {
114 114
115 if (i != sw.count()-1) { 115 if (i != sw.count()-1) {
116 if (keymap_map == current_map) { 116 if (keymap_map == current_map) {
117 lang = i; 117 lang = i;
118 } 118 }
119 sw_maps.append(keymap_map); 119 sw_maps.append(keymap_map);
120 labels.append(line.right(line.length() - line.find(QChar('=')) - 1).stripWhiteSpace()); 120 labels.append(line.right(line.length() - line.find(QChar('=')) - 1).stripWhiteSpace());
121 popupMenu.insertItem(labels[labels.count()-1], labels.count()-1); 121 popupMenu.insertItem(labels[labels.count()-1], labels.count()-1);
122 } else { 122 } else {
123 current = line.right(line.length() - line.find(QChar('=')) - 1).stripWhiteSpace(); 123 current = line.right(line.length() - line.find(QChar('=')) - 1).stripWhiteSpace();
124 } 124 }
125 break; 125 break;
126 } 126 }
127 map.readLine(line, 1024); 127 map.readLine(line, 1024);
128 } 128 }
129 map.close(); 129 map.close();
130 } 130 }
131 } 131 }
132 132
133 setText(current); 133 setText(current);
134 } 134 }
diff --git a/core/apps/taboapp/main.cpp b/core/apps/taboapp/main.cpp
index e43f118..e999803 100644
--- a/core/apps/taboapp/main.cpp
+++ b/core/apps/taboapp/main.cpp
@@ -1,57 +1,57 @@
1/* OPIE */ 1/* OPIE */
2#include <oappinterface.h> 2#include <oappinterface.h>
3#include <oappplugin.h> 3#include <oappplugin.h>
4#include <opie2/odebug.h> 4#include <opie2/odebug.h>
5#include <opie2/otabwidget.h> 5#include <opie2/otabwidget.h>
6#include <qpe/qpeapplication.h> 6#include <qpe/qpeapplication.h>
7#include <qpe/qlibrary.h> 7#include <qpe/qlibrary.h>
8using namespace Opie::Core; 8using namespace Opie::Core;
9using namespace Opie::Ui; 9using namespace Opie::Ui;
10 10
11/* QT */ 11/* QT */
12#include <qdir.h> 12#include <qdir.h>
13 13
14int main( int argc, char **argv ) 14int main( int argc, char **argv )
15{ 15{
16 QPEApplication a( argc, argv ); 16 QPEApplication a( argc, argv );
17 17
18 OTabWidget *tabwidget = new OTabWidget(0, "tab widget"); 18 OTabWidget *tabwidget = new OTabWidget(0, "tab widget");
19 19
20 QString path = QPEApplication::qpeDir() + "/plugins/app"; 20 QString path = QPEApplication::qpeDir() + "plugins/app";
21 QDir dir( path, "lib*.so" ); 21 QDir dir( path, "lib*.so" );
22 22
23 QStringList list = dir.entryList(); 23 QStringList list = dir.entryList();
24 QStringList::Iterator it; 24 QStringList::Iterator it;
25 25
26 QInterfacePtr<OAppInterface> iface; 26 QInterfacePtr<OAppInterface> iface;
27 for ( it = list.begin(); it != list.end(); ++it ) { 27 for ( it = list.begin(); it != list.end(); ++it ) {
28 QLibrary *lib = new QLibrary( path + "/" + *it ); 28 QLibrary *lib = new QLibrary( path + "/" + *it );
29 29
30 odebug << "querying: " << QString( path + "/" + *it ) << "" << oendl; 30 odebug << "querying: " << QString( path + "/" + *it ) << "" << oendl;
31 if ( lib->queryInterface( IID_OAppInterface, (QUnknownInterface**)&iface ) == QS_OK ) { 31 if ( lib->queryInterface( IID_OAppInterface, (QUnknownInterface**)&iface ) == QS_OK ) {
32 odebug << "accepted: " << QString( path + "/" + *it ) << "" << oendl; 32 odebug << "accepted: " << QString( path + "/" + *it ) << "" << oendl;
33 33
34 QList<QWidget> list = iface->widgets(); 34 QList<QWidget> list = iface->widgets();
35 QWidget *widget; 35 QWidget *widget;
36 for ( widget = list.first(); widget != 0; widget = list.next() ) 36 for ( widget = list.first(); widget != 0; widget = list.next() )
37 tabwidget->addTab(widget, QString(*it), QString(*it)); 37 tabwidget->addTab(widget, QString(*it), QString(*it));
38 38
39 QString lang = getenv( "LANG" ); 39 QString lang = getenv( "LANG" );
40 if (lang.isNull()) 40 if (lang.isNull())
41 lang = "en"; 41 lang = "en";
42 QTranslator *trans = new QTranslator(qApp); 42 QTranslator *trans = new QTranslator(qApp);
43 QString type = (*it).left( (*it).find(".") ); 43 QString type = (*it).left( (*it).find(".") );
44 if (type.left(3) == "lib") 44 if (type.left(3) == "lib")
45 type = type.mid(3); 45 type = type.mid(3);
46 type = type.right( type.find("lib") ); 46 type = type.right( type.find("lib") );
47 QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; 47 QString tfn = QPEApplication::qpeDir()+"i18n/"+lang+"/"+type+".qm";
48 if ( trans->load( tfn )) 48 if ( trans->load( tfn ))
49 qApp->installTranslator( trans ); 49 qApp->installTranslator( trans );
50 else 50 else
51 delete trans; 51 delete trans;
52 } 52 }
53 } 53 }
54 54
55 a.showMainDocumentWidget(tabwidget); 55 a.showMainDocumentWidget(tabwidget);
56 return a.exec(); 56 return a.exec();
57} 57}
diff --git a/core/launcher/inputmethods.cpp b/core/launcher/inputmethods.cpp
index 586628b..24669ac 100644
--- a/core/launcher/inputmethods.cpp
+++ b/core/launcher/inputmethods.cpp
@@ -172,156 +172,156 @@ void InputMethods::showInputMethod(const QString& name)
172{ 172{
173 int i = 0; 173 int i = 0;
174 QValueList<InputMethod>::Iterator it; 174 QValueList<InputMethod>::Iterator it;
175 InputMethod *im = 0; 175 InputMethod *im = 0;
176 for ( it = inputMethodList.begin(); it != inputMethodList.end(); ++it, i++ ) { 176 for ( it = inputMethodList.begin(); it != inputMethodList.end(); ++it, i++ ) {
177 QString lname = (*it).libName.mid((*it).libName.findRev('/') + 1); 177 QString lname = (*it).libName.mid((*it).libName.findRev('/') + 1);
178 if ( (*it).name() == name || lname == name ) { 178 if ( (*it).name() == name || lname == name ) {
179 im = &(*it); 179 im = &(*it);
180 break; 180 break;
181 } 181 }
182 } 182 }
183 if ( im ) 183 if ( im )
184 chooseKeyboard(im); 184 chooseKeyboard(im);
185} 185}
186 186
187void InputMethods::resetStates() 187void InputMethods::resetStates()
188{ 188{
189 if ( mkeyboard && !mkeyboard->newIM ) 189 if ( mkeyboard && !mkeyboard->newIM )
190 mkeyboard->interface->resetState(); 190 mkeyboard->interface->resetState();
191} 191}
192 192
193QRect InputMethods::inputRect() const 193QRect InputMethods::inputRect() const
194{ 194{
195 if ( !mkeyboard || !mkeyboard->widget || !mkeyboard->widget->isVisible() ) 195 if ( !mkeyboard || !mkeyboard->widget || !mkeyboard->widget->isVisible() )
196 return QRect(); 196 return QRect();
197 else 197 else
198 return mkeyboard->widget->geometry(); 198 return mkeyboard->widget->geometry();
199} 199}
200 200
201void InputMethods::unloadInputMethods() 201void InputMethods::unloadInputMethods()
202{ 202{
203 unloadMethod( inputMethodList ); 203 unloadMethod( inputMethodList );
204 unloadMethod( inputModifierList ); 204 unloadMethod( inputModifierList );
205 inputMethodList.clear(); 205 inputMethodList.clear();
206 inputModifierList.clear(); 206 inputModifierList.clear();
207 207
208} 208}
209 209
210void InputMethods::unloadMethod( QValueList<InputMethod>& list ) { 210void InputMethods::unloadMethod( QValueList<InputMethod>& list ) {
211 QValueList<InputMethod>::Iterator it; 211 QValueList<InputMethod>::Iterator it;
212 212
213 for (it = list.begin(); it != list.end(); ++it ) 213 for (it = list.begin(); it != list.end(); ++it )
214 (*it).releaseInterface(); 214 (*it).releaseInterface();
215 215
216} 216}
217 217
218 218
219QStringList InputMethods::plugins()const { 219QStringList InputMethods::plugins()const {
220 QString path = QPEApplication::qpeDir() + "/plugins/inputmethods"; 220 QString path = QPEApplication::qpeDir() + "plugins/inputmethods";
221#ifdef Q_OS_MACX 221#ifdef Q_OS_MACX
222 QDir dir( path, "lib*.dylib" ); 222 QDir dir( path, "lib*.dylib" );
223#else 223#else
224 QDir dir( path, "lib*.so" ); 224 QDir dir( path, "lib*.so" );
225#endif /* Q_OS_MACX */ 225#endif /* Q_OS_MACX */
226 return dir.entryList(); 226 return dir.entryList();
227} 227}
228 228
229void InputMethods::installTranslator( const QString& type ) { 229void InputMethods::installTranslator( const QString& type ) {
230 QStringList langs = Global::languageList(); 230 QStringList langs = Global::languageList();
231 QStringList::ConstIterator lit; 231 QStringList::ConstIterator lit;
232 for ( lit= langs.begin(); lit!=langs.end(); ++lit) { 232 for ( lit= langs.begin(); lit!=langs.end(); ++lit) {
233 QString lang = *lit; 233 QString lang = *lit;
234 QTranslator * trans = new QTranslator(qApp); 234 QTranslator * trans = new QTranslator(qApp);
235 235
236 QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; 236 QString tfn = QPEApplication::qpeDir()+"i18n/"+lang+"/"+type+".qm";
237 237
238 if ( trans->load( tfn )) 238 if ( trans->load( tfn ))
239 qApp->installTranslator( trans ); 239 qApp->installTranslator( trans );
240 else 240 else
241 delete trans; 241 delete trans;
242 } 242 }
243} 243}
244 244
245void InputMethods::setPreferedHandlers() { 245void InputMethods::setPreferedHandlers() {
246 Config cfg("qpe"); 246 Config cfg("qpe");
247 cfg.setGroup("InputMethod"); 247 cfg.setGroup("InputMethod");
248 QString current = cfg.readEntry("current"); 248 QString current = cfg.readEntry("current");
249 QString im = cfg.readEntry("im"); 249 QString im = cfg.readEntry("im");
250 250
251 QValueList<InputMethod>::Iterator it; 251 QValueList<InputMethod>::Iterator it;
252 if (!inputModifierList.isEmpty() && !im.isEmpty() ) { 252 if (!inputModifierList.isEmpty() && !im.isEmpty() ) {
253 for (it = inputModifierList.begin(); it != inputModifierList.end(); ++it ) 253 for (it = inputModifierList.begin(); it != inputModifierList.end(); ++it )
254 if ( (*it).name() == im ) { 254 if ( (*it).name() == im ) {
255 imethod = &(*it); break; 255 imethod = &(*it); break;
256 } 256 }
257 257
258 } 258 }
259 if (!inputMethodList.isEmpty() && !current.isEmpty() ) { 259 if (!inputMethodList.isEmpty() && !current.isEmpty() ) {
260 for (it = inputMethodList.begin(); it != inputMethodList.end(); ++it ) 260 for (it = inputMethodList.begin(); it != inputMethodList.end(); ++it )
261 if ( (*it).name() == current ) { 261 if ( (*it).name() == current ) {
262 owarn << "preferred keyboard is " << current << "" << oendl; 262 owarn << "preferred keyboard is " << current << "" << oendl;
263 mkeyboard = &(*it); 263 mkeyboard = &(*it);
264 kbdButton->setPixmap( *mkeyboard->icon() ); 264 kbdButton->setPixmap( *mkeyboard->icon() );
265 break; 265 break;
266 } 266 }
267 } 267 }
268 268
269} 269}
270 270
271void InputMethods::loadInputMethods() 271void InputMethods::loadInputMethods()
272{ 272{
273#ifndef QT_NO_COMPONENT 273#ifndef QT_NO_COMPONENT
274 hideInputMethod(); 274 hideInputMethod();
275 mkeyboard = 0; 275 mkeyboard = 0;
276 276
277 unloadInputMethods(); 277 unloadInputMethods();
278 278
279 QString path = QPEApplication::qpeDir() + "/plugins/inputmethods"; 279 QString path = QPEApplication::qpeDir() + "plugins/inputmethods";
280 QStringList list = plugins(); 280 QStringList list = plugins();
281 QStringList::Iterator it; 281 QStringList::Iterator it;
282 for ( it = list.begin(); it != list.end(); ++it ) { 282 for ( it = list.begin(); it != list.end(); ++it ) {
283 InputMethodInterface *iface = 0; 283 InputMethodInterface *iface = 0;
284 ExtInputMethodInterface *eface = 0; 284 ExtInputMethodInterface *eface = 0;
285 QLibrary *lib = new QLibrary( path + "/" + *it ); 285 QLibrary *lib = new QLibrary( path + "/" + *it );
286 286
287 if ( lib->queryInterface( IID_InputMethod, (QUnknownInterface**)&iface ) == QS_OK ) { 287 if ( lib->queryInterface( IID_InputMethod, (QUnknownInterface**)&iface ) == QS_OK ) {
288 InputMethod input; 288 InputMethod input;
289 input.newIM = FALSE; 289 input.newIM = FALSE;
290 input.library = lib; 290 input.library = lib;
291 input.libName = *it; 291 input.libName = *it;
292 input.interface = iface; 292 input.interface = iface;
293 input.widget = input.interface->inputMethod( 0, inputWidgetStyle ); 293 input.widget = input.interface->inputMethod( 0, inputWidgetStyle );
294 input.interface->onKeyPress( this, SLOT(sendKey(ushort,ushort,ushort,bool,bool)) ); 294 input.interface->onKeyPress( this, SLOT(sendKey(ushort,ushort,ushort,bool,bool)) );
295 inputMethodList.append( input ); 295 inputMethodList.append( input );
296 } else if ( lib->queryInterface( IID_ExtInputMethod, (QUnknownInterface**)&eface ) == QS_OK ) { 296 } else if ( lib->queryInterface( IID_ExtInputMethod, (QUnknownInterface**)&eface ) == QS_OK ) {
297 InputMethod input; 297 InputMethod input;
298 input.newIM = TRUE; 298 input.newIM = TRUE;
299 input.library = lib; 299 input.library = lib;
300 input.libName = *it; 300 input.libName = *it;
301 input.extInterface = eface; 301 input.extInterface = eface;
302 input.widget = input.extInterface->keyboardWidget( 0, inputWidgetStyle ); 302 input.widget = input.extInterface->keyboardWidget( 0, inputWidgetStyle );
303 // may be either a simple, or advanced. 303 // may be either a simple, or advanced.
304 if (input.widget) { 304 if (input.widget) {
305 //odebug << "its a keyboard" << oendl; 305 //odebug << "its a keyboard" << oendl;
306 inputMethodList.append( input ); 306 inputMethodList.append( input );
307 } else { 307 } else {
308 //odebug << "its a real im" << oendl; 308 //odebug << "its a real im" << oendl;
309 input.widget = input.extInterface->statusWidget( 0, 0 ); 309 input.widget = input.extInterface->statusWidget( 0, 0 );
310 if (input.widget) { 310 if (input.widget) {
311 //odebug << "blah" << oendl; 311 //odebug << "blah" << oendl;
312 inputModifierList.append( input ); 312 inputModifierList.append( input );
313 imButton->addWidget(input.widget, inputModifierList.count()); 313 imButton->addWidget(input.widget, inputModifierList.count());
314 } 314 }
315 } 315 }
316 }else{ 316 }else{
317 delete lib; 317 delete lib;
318 lib = 0l; 318 lib = 0l;
319 } 319 }
320 installTranslator( (*it).left( (*it).find(".") ) ); 320 installTranslator( (*it).left( (*it).find(".") ) );
321 } 321 }
322 qHeapSort( inputMethodList ); 322 qHeapSort( inputMethodList );
323#endif /* killed BUILT in cause they would not compile */ 323#endif /* killed BUILT in cause they would not compile */
324 324
325 QWSServer::setCurrentInputMethod( 0 ); 325 QWSServer::setCurrentInputMethod( 0 );
326 326
327 /* set the prefered IM + handler */ 327 /* set the prefered IM + handler */
diff --git a/core/launcher/irserver.cpp b/core/launcher/irserver.cpp
index 092eb0c..19cf904 100644
--- a/core/launcher/irserver.cpp
+++ b/core/launcher/irserver.cpp
@@ -1,76 +1,76 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "irserver.h" 21#include "irserver.h"
22#include "obexinterface.h" 22#include "obexinterface.h"
23 23
24/* OPIE */ 24/* OPIE */
25#include <opie2/odebug.h> 25#include <opie2/odebug.h>
26#include <qtopia/qlibrary.h> 26#include <qtopia/qlibrary.h>
27#include <qtopia/qpeapplication.h> 27#include <qtopia/qpeapplication.h>
28 28
29/* QT */ 29/* QT */
30#include <qdir.h> 30#include <qdir.h>
31 31
32IrServer::IrServer( QObject *parent, const char *name ) 32IrServer::IrServer( QObject *parent, const char *name )
33 : QObject( parent, name ), obexIface(0) 33 : QObject( parent, name ), obexIface(0)
34{ 34{
35 lib = 0; 35 lib = 0;
36 obexIface = 0; 36 obexIface = 0;
37 QString path = QPEApplication::qpeDir() + "/plugins/obex/"; 37 QString path = QPEApplication::qpeDir() + "plugins/obex/";
38#ifdef Q_OS_MACX 38#ifdef Q_OS_MACX
39 QDir dir( path, "lib*.dylib" ); 39 QDir dir( path, "lib*.dylib" );
40#else 40#else
41 QDir dir( path, "lib*.so" ); 41 QDir dir( path, "lib*.so" );
42#endif /* Q_OS_MACX */ 42#endif /* Q_OS_MACX */
43 QStringList list = dir.entryList(); 43 QStringList list = dir.entryList();
44 QStringList::Iterator it; 44 QStringList::Iterator it;
45 for ( it = list.begin(); it != list.end(); ++it ) { 45 for ( it = list.begin(); it != list.end(); ++it ) {
46 QLibrary *trylib = new QLibrary( path + *it ); 46 QLibrary *trylib = new QLibrary( path + *it );
47 //odebug << "trying lib " << (path + (*it)) << "" << oendl; 47 //odebug << "trying lib " << (path + (*it)) << "" << oendl;
48 if ( trylib->queryInterface( IID_ObexInterface, (QUnknownInterface**)&obexIface ) == QS_OK ) { 48 if ( trylib->queryInterface( IID_ObexInterface, (QUnknownInterface**)&obexIface ) == QS_OK ) {
49 lib = trylib; 49 lib = trylib;
50 //odebug << "found obex lib" << oendl; 50 //odebug << "found obex lib" << oendl;
51 QString lang = getenv( "LANG" ); 51 QString lang = getenv( "LANG" );
52 QTranslator * trans = new QTranslator(qApp); 52 QTranslator * trans = new QTranslator(qApp);
53 QString type = (*it).left( (*it).find(".") ); 53 QString type = (*it).left( (*it).find(".") );
54 QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; 54 QString tfn = QPEApplication::qpeDir()+"i18n/"+lang+"/"+type+".qm";
55 //odebug << "tr fpr obex: " << tfn << "" << oendl; 55 //odebug << "tr fpr obex: " << tfn << "" << oendl;
56 if ( trans->load( tfn )) 56 if ( trans->load( tfn ))
57 qApp->installTranslator( trans ); 57 qApp->installTranslator( trans );
58 else 58 else
59 delete trans; 59 delete trans;
60 60
61 break; 61 break;
62 } else { 62 } else {
63 delete lib; 63 delete lib;
64 } 64 }
65 } 65 }
66 if ( !lib ) 66 if ( !lib )
67 odebug << "could not load IR plugin" << oendl; 67 odebug << "could not load IR plugin" << oendl;
68} 68}
69 69
70IrServer::~IrServer() 70IrServer::~IrServer()
71{ 71{
72 if ( obexIface ) 72 if ( obexIface )
73 obexIface->release(); 73 obexIface->release();
74 delete lib; 74 delete lib;
75} 75}
76 76
diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp
index f3a7651..66f665f 100644
--- a/core/launcher/startmenu.cpp
+++ b/core/launcher/startmenu.cpp
@@ -270,116 +270,116 @@ void StartMenu::launch()
270 270
271 271
272 272
273 273
274static int compareAppletPositions(const void *b, const void *a) 274static int compareAppletPositions(const void *b, const void *a)
275{ 275{
276 const MenuApplet* aa = *(const MenuApplet**)a; 276 const MenuApplet* aa = *(const MenuApplet**)a;
277 const MenuApplet* ab = *(const MenuApplet**)b; 277 const MenuApplet* ab = *(const MenuApplet**)b;
278 int d = aa->iface->position() - ab->iface->position(); 278 int d = aa->iface->position() - ab->iface->position();
279 if ( d ) return d; 279 if ( d ) return d;
280 return QString::compare(aa->library->library(),ab->library->library()); 280 return QString::compare(aa->library->library(),ab->library->library());
281} 281}
282 282
283void StartMenu::clearApplets() 283void StartMenu::clearApplets()
284{ 284{
285 if ( launchMenu ) 285 if ( launchMenu )
286 launchMenu-> hide(); 286 launchMenu-> hide();
287 287
288 for ( QIntDictIterator<MenuApplet> it( menuApplets ); it.current(); ++it ) { 288 for ( QIntDictIterator<MenuApplet> it( menuApplets ); it.current(); ++it ) {
289 MenuApplet *applet = it.current(); 289 MenuApplet *applet = it.current();
290 if ( launchMenu ) { 290 if ( launchMenu ) {
291 launchMenu->removeItem( applet-> id ); 291 launchMenu->removeItem( applet-> id );
292 delete applet->popup; 292 delete applet->popup;
293 } 293 }
294 294
295 applet->iface->release(); 295 applet->iface->release();
296 applet->library->unload(); 296 applet->library->unload();
297 delete applet-> library; 297 delete applet-> library;
298 } 298 }
299 menuApplets.clear(); 299 menuApplets.clear();
300} 300}
301 301
302 302
303 303
304 304
305void StartMenu::loadApplets() 305void StartMenu::loadApplets()
306{ 306{
307 Config cfg( "StartMenu" ); 307 Config cfg( "StartMenu" );
308 cfg.setGroup( "Applets" ); 308 cfg.setGroup( "Applets" );
309 309
310 // SafeMode causes too much problems, so we disable it for now -- 310 // SafeMode causes too much problems, so we disable it for now --
311 // maybe we should reenable it for OPIE 1.0 - sandman 26.09.02 311 // maybe we should reenable it for OPIE 1.0 - sandman 26.09.02
312 // removed in the remerge PluginManager could handle it 312 // removed in the remerge PluginManager could handle it
313 // we don't currently use it -zecke 313 // we don't currently use it -zecke
314 314
315 QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); 315 QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' );
316 316
317 QString lang = getenv( "LANG" ); 317 QString lang = getenv( "LANG" );
318 QString path = QPEApplication::qpeDir() + "/plugins/applets"; 318 QString path = QPEApplication::qpeDir() + "plugins/applets";
319 QDir dir( path, "lib*.so" ); 319 QDir dir( path, "lib*.so" );
320 QStringList list = dir.entryList(); 320 QStringList list = dir.entryList();
321 QStringList::Iterator it; 321 QStringList::Iterator it;
322 int napplets = 0; 322 int napplets = 0;
323 MenuApplet* *xapplets = new MenuApplet*[list.count()]; 323 MenuApplet* *xapplets = new MenuApplet*[list.count()];
324 for ( it = list.begin(); it != list.end(); ++it ) { 324 for ( it = list.begin(); it != list.end(); ++it ) {
325 if ( exclude.find( *it ) != exclude.end() ) 325 if ( exclude.find( *it ) != exclude.end() )
326 continue; 326 continue;
327 MenuAppletInterface *iface = 0; 327 MenuAppletInterface *iface = 0;
328 QLibrary *lib = new QLibrary( path + "/" + *it ); 328 QLibrary *lib = new QLibrary( path + "/" + *it );
329 if (( lib->queryInterface( IID_MenuApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) { 329 if (( lib->queryInterface( IID_MenuApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) {
330 MenuApplet *applet = new MenuApplet; 330 MenuApplet *applet = new MenuApplet;
331 xapplets[napplets++] = applet; 331 xapplets[napplets++] = applet;
332 applet->library = lib; 332 applet->library = lib;
333 applet->iface = iface; 333 applet->iface = iface;
334 334
335 QTranslator *trans = new QTranslator(qApp); 335 QTranslator *trans = new QTranslator(qApp);
336 QString type = (*it).left( (*it).find(".") ); 336 QString type = (*it).left( (*it).find(".") );
337 QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; 337 QString tfn = QPEApplication::qpeDir()+"i18n/"+lang+"/"+type+".qm";
338 if ( trans->load( tfn )) 338 if ( trans->load( tfn ))
339 qApp->installTranslator( trans ); 339 qApp->installTranslator( trans );
340 else 340 else
341 delete trans; 341 delete trans;
342 } else { 342 } else {
343 exclude += *it; 343 exclude += *it;
344 delete lib; 344 delete lib;
345 } 345 }
346 } 346 }
347 cfg.writeEntry( "ExcludeApplets", exclude, ',' ); 347 cfg.writeEntry( "ExcludeApplets", exclude, ',' );
348 qsort(xapplets, napplets, sizeof(menuApplets[0]), compareAppletPositions); 348 qsort(xapplets, napplets, sizeof(menuApplets[0]), compareAppletPositions);
349 349
350 350
351 while ( napplets-- ) { 351 while ( napplets-- ) {
352 MenuApplet *applet = xapplets[napplets]; 352 MenuApplet *applet = xapplets[napplets];
353 applet->popup = applet->iface->popup( this ); 353 applet->popup = applet->iface->popup( this );
354 354
355 // menuApplets got an id < -1 355 // menuApplets got an id < -1
356 menuApplets.insert( -( currentItem + 2 ), new MenuApplet( *applet ) ); 356 menuApplets.insert( -( currentItem + 2 ), new MenuApplet( *applet ) );
357 currentItem++; 357 currentItem++;
358 } 358 }
359 delete [] xapplets; 359 delete [] xapplets;
360 360
361 addApplets( launchMenu ); 361 addApplets( launchMenu );
362} 362}
363 363
364 364
365/* 365/*
366 * Launcher calls loadMenu too often fix that 366 * Launcher calls loadMenu too often fix that
367 */ 367 */
368void StartMenu::addApplets(QPopupMenu* pop) { 368void StartMenu::addApplets(QPopupMenu* pop) {
369 QIntDict<MenuApplet> dict; 369 QIntDict<MenuApplet> dict;
370 if( pop-> count ( )) 370 if( pop-> count ( ))
371 pop-> insertSeparator ( ); 371 pop-> insertSeparator ( );
372 372
373 for ( QIntDictIterator<MenuApplet> it( menuApplets ); it.current(); ++it ) { 373 for ( QIntDictIterator<MenuApplet> it( menuApplets ); it.current(); ++it ) {
374 MenuApplet *applet = it.current(); 374 MenuApplet *applet = it.current();
375 if ( applet->popup ) 375 if ( applet->popup )
376 applet->id = pop->insertItem( applet->iface->icon(), 376 applet->id = pop->insertItem( applet->iface->icon(),
377 applet->iface->text(), applet->popup ); 377 applet->iface->text(), applet->popup );
378 else 378 else
379 applet->id = pop->insertItem( applet->iface->icon(), 379 applet->id = pop->insertItem( applet->iface->icon(),
380 applet->iface->text() ); 380 applet->iface->text() );
381 381
382 382
383 dict.insert( applet->id, new MenuApplet( *applet ) ); 383 dict.insert( applet->id, new MenuApplet( *applet ) );
384 } 384 }
385 /* need to update the key */ 385 /* need to update the key */
diff --git a/core/launcher/systray.cpp b/core/launcher/systray.cpp
index 3c72d25..d0f1808 100644
--- a/core/launcher/systray.cpp
+++ b/core/launcher/systray.cpp
@@ -52,99 +52,99 @@ static int compareAppletPositions(const void *a, const void *b)
52 int d = ab->iface->position() - aa->iface->position(); 52 int d = ab->iface->position() - aa->iface->position();
53 if ( d ) return d; 53 if ( d ) return d;
54 return QString::compare(ab->name,aa->name); 54 return QString::compare(ab->name,aa->name);
55} 55}
56 56
57void SysTray::loadApplets() 57void SysTray::loadApplets()
58{ 58{
59 hide(); 59 hide();
60 clearApplets(); 60 clearApplets();
61 addApplets(); 61 addApplets();
62} 62}
63 63
64void SysTray::clearApplets() 64void SysTray::clearApplets()
65{ 65{
66#ifndef QT_NO_COMPONENTS 66#ifndef QT_NO_COMPONENTS
67 67
68 /* 68 /*
69 * Note on clearing. SOme applets delete their 69 * Note on clearing. SOme applets delete their
70 * applets themselves some don't do it 70 * applets themselves some don't do it
71 * and on restart this can crash. If we delete it 71 * and on restart this can crash. If we delete it
72 * here we might end up in a double deletion. We could 72 * here we might end up in a double deletion. We could
73 * use QGuardedPtr but that would be one QOBject 73 * use QGuardedPtr but that would be one QOBject
74 * for every applet more but only useful for restart 74 * for every applet more but only useful for restart
75 */ 75 */
76 QValueList<TaskbarApplet>::Iterator mit; 76 QValueList<TaskbarApplet>::Iterator mit;
77 for ( mit = appletList.begin(); mit != appletList.end(); ++mit ) { 77 for ( mit = appletList.begin(); mit != appletList.end(); ++mit ) {
78 (*mit).iface->release(); 78 (*mit).iface->release();
79 (*mit).library->unload(); 79 (*mit).library->unload();
80 delete (*mit).library; 80 delete (*mit).library;
81 } 81 }
82 82
83#endif 83#endif
84 appletList.clear(); 84 appletList.clear();
85 if ( layout ) 85 if ( layout )
86 delete layout; 86 delete layout;
87 layout = new QHBoxLayout( this, 0, 1 ); 87 layout = new QHBoxLayout( this, 0, 1 );
88 layout->setAutoAdd(TRUE); 88 layout->setAutoAdd(TRUE);
89} 89}
90 90
91void SysTray::addApplets() 91void SysTray::addApplets()
92{ 92{
93 hide(); 93 hide();
94#ifndef QT_NO_COMPONENTS 94#ifndef QT_NO_COMPONENTS
95 Config cfg( "Taskbar" ); 95 Config cfg( "Taskbar" );
96 cfg.setGroup( "Applets" ); 96 cfg.setGroup( "Applets" );
97 QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); 97 QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' );
98 98
99 QString lang = getenv( "LANG" ); 99 QString lang = getenv( "LANG" );
100 QString path = QPEApplication::qpeDir() + "/plugins/applets"; 100 QString path = QPEApplication::qpeDir() + "plugins/applets";
101#ifdef Q_OS_MACX 101#ifdef Q_OS_MACX
102 QDir dir( path, "lib*.dylib" ); 102 QDir dir( path, "lib*.dylib" );
103#else 103#else
104 QDir dir( path, "lib*.so" ); 104 QDir dir( path, "lib*.so" );
105#endif /* Q_OS_MACX */ 105#endif /* Q_OS_MACX */
106 QStringList list = dir.entryList(); 106 QStringList list = dir.entryList();
107 QStringList::Iterator it; 107 QStringList::Iterator it;
108 int napplets=0; 108 int napplets=0;
109 TaskbarApplet* *applets = new TaskbarApplet*[list.count()]; 109 TaskbarApplet* *applets = new TaskbarApplet*[list.count()];
110 for ( it = list.begin(); it != list.end(); ++it ) { 110 for ( it = list.begin(); it != list.end(); ++it ) {
111 if ( exclude.find( *it ) != exclude.end() ) 111 if ( exclude.find( *it ) != exclude.end() )
112 continue; 112 continue;
113 owarn << "Found Applet: " << (*it) << "" << oendl; 113 owarn << "Found Applet: " << (*it) << "" << oendl;
114 TaskbarAppletInterface *iface = 0; 114 TaskbarAppletInterface *iface = 0;
115 QLibrary *lib = new QLibrary( path + "/" + *it ); 115 QLibrary *lib = new QLibrary( path + "/" + *it );
116 if (( lib->queryInterface( IID_TaskbarApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) { 116 if (( lib->queryInterface( IID_TaskbarApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) {
117 TaskbarApplet *applet = new TaskbarApplet; 117 TaskbarApplet *applet = new TaskbarApplet;
118 applets[napplets++] = applet; 118 applets[napplets++] = applet;
119 applet->library = lib; 119 applet->library = lib;
120 applet->iface = iface; 120 applet->iface = iface;
121 121
122 QTranslator *trans = new QTranslator(qApp); 122 QTranslator *trans = new QTranslator(qApp);
123 QString type = (*it).left( (*it).find(".") ); 123 QString type = (*it).left( (*it).find(".") );
124 QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; 124 QString tfn = QPEApplication::qpeDir()+"i18n/"+lang+"/"+type+".qm";
125 if ( trans->load( tfn )) 125 if ( trans->load( tfn ))
126 qApp->installTranslator( trans ); 126 qApp->installTranslator( trans );
127 else 127 else
128 delete trans; 128 delete trans;
129 } else { 129 } else {
130 exclude += *it; 130 exclude += *it;
131 delete lib; 131 delete lib;
132 } 132 }
133 } 133 }
134 cfg.writeEntry( "ExcludeApplets", exclude, ',' ); 134 cfg.writeEntry( "ExcludeApplets", exclude, ',' );
135 qsort(applets,napplets,sizeof(applets[0]),compareAppletPositions); 135 qsort(applets,napplets,sizeof(applets[0]),compareAppletPositions);
136 while (napplets--) { 136 while (napplets--) {
137 TaskbarApplet *applet = applets[napplets]; 137 TaskbarApplet *applet = applets[napplets];
138 applet->applet = applet->iface->applet( this ); 138 applet->applet = applet->iface->applet( this );
139 appletList.append(*applet); 139 appletList.append(*applet);
140 } 140 }
141 delete [] applets; 141 delete [] applets;
142#else /* ## FIXME single app */ 142#else /* ## FIXME single app */
143 TaskbarApplet * const applet = new TaskbarApplet(); 143 TaskbarApplet * const applet = new TaskbarApplet();
144 applet->iface = new ClockAppletImpl(); 144 applet->iface = new ClockAppletImpl();
145 applet->applet = applet->iface->applet( this ); 145 applet->applet = applet->iface->applet( this );
146 appletList.append( applet ); 146 appletList.append( applet );
147#endif 147#endif
148 show(); 148 show();
149} 149}
150 150
diff --git a/core/multimedia/opieplayer/mediaplayerstate.cpp b/core/multimedia/opieplayer/mediaplayerstate.cpp
index b700cd1..8b0fbbc 100644
--- a/core/multimedia/opieplayer/mediaplayerstate.cpp
+++ b/core/multimedia/opieplayer/mediaplayerstate.cpp
@@ -94,97 +94,97 @@ struct MediaPlayerPlugin {
94 94
95static QValueList<MediaPlayerPlugin> pluginList; 95static QValueList<MediaPlayerPlugin> pluginList;
96 96
97 97
98// Find the first decoder which supports this type of file 98// Find the first decoder which supports this type of file
99MediaPlayerDecoder *MediaPlayerState::newDecoder( const QString& file ) { 99MediaPlayerDecoder *MediaPlayerState::newDecoder( const QString& file ) {
100 MediaPlayerDecoder *tmpDecoder = NULL; 100 MediaPlayerDecoder *tmpDecoder = NULL;
101 QValueList<MediaPlayerPlugin>::Iterator it; 101 QValueList<MediaPlayerPlugin>::Iterator it;
102 for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { 102 for ( it = pluginList.begin(); it != pluginList.end(); ++it ) {
103 if ( (*it).decoder->isFileSupported( file ) ) { 103 if ( (*it).decoder->isFileSupported( file ) ) {
104 tmpDecoder = (*it).decoder; 104 tmpDecoder = (*it).decoder;
105 break; 105 break;
106 } 106 }
107 } 107 }
108 if(file.left(4)=="http") 108 if(file.left(4)=="http")
109 isStreaming = TRUE; 109 isStreaming = TRUE;
110 else 110 else
111 isStreaming = FALSE; 111 isStreaming = FALSE;
112 return decoder = tmpDecoder; 112 return decoder = tmpDecoder;
113} 113}
114 114
115 115
116MediaPlayerDecoder *MediaPlayerState::curDecoder() { 116MediaPlayerDecoder *MediaPlayerState::curDecoder() {
117 return decoder; 117 return decoder;
118} 118}
119 119
120 120
121// ### hack to get true sample count 121// ### hack to get true sample count
122MediaPlayerDecoder *MediaPlayerState::libMpeg3Decoder() { 122MediaPlayerDecoder *MediaPlayerState::libMpeg3Decoder() {
123 return libmpeg3decoder; 123 return libmpeg3decoder;
124} 124}
125 125
126// ### hack to get true sample count 126// ### hack to get true sample count
127// MediaPlayerDecoder *MediaPlayerState::libWavDecoder() { 127// MediaPlayerDecoder *MediaPlayerState::libWavDecoder() {
128// return libwavdecoder; 128// return libwavdecoder;
129// } 129// }
130 130
131void MediaPlayerState::loadPlugins() { 131void MediaPlayerState::loadPlugins() {
132 // odebug << "load plugins" << oendl; 132 // odebug << "load plugins" << oendl;
133#ifndef QT_NO_COMPONENT 133#ifndef QT_NO_COMPONENT
134 QValueList<MediaPlayerPlugin>::Iterator mit; 134 QValueList<MediaPlayerPlugin>::Iterator mit;
135 for ( mit = pluginList.begin(); mit != pluginList.end(); ++mit ) { 135 for ( mit = pluginList.begin(); mit != pluginList.end(); ++mit ) {
136 (*mit).iface->release(); 136 (*mit).iface->release();
137 (*mit).library->unload(); 137 (*mit).library->unload();
138 delete (*mit).library; 138 delete (*mit).library;
139 } 139 }
140 pluginList.clear(); 140 pluginList.clear();
141 141
142 QString path = QPEApplication::qpeDir() + "/plugins/codecs"; 142 QString path = QPEApplication::qpeDir() + "plugins/codecs";
143 QDir dir( path, "lib*.so" ); 143 QDir dir( path, "lib*.so" );
144 QStringList list = dir.entryList(); 144 QStringList list = dir.entryList();
145 QStringList::Iterator it; 145 QStringList::Iterator it;
146 for ( it = list.begin(); it != list.end(); ++it ) { 146 for ( it = list.begin(); it != list.end(); ++it ) {
147 MediaPlayerPluginInterface *iface = 0; 147 MediaPlayerPluginInterface *iface = 0;
148 QLibrary *lib = new QLibrary( path + "/" + *it ); 148 QLibrary *lib = new QLibrary( path + "/" + *it );
149// odebug << "querying: " << QString( path + "/" + *it ) << "" << oendl; 149// odebug << "querying: " << QString( path + "/" + *it ) << "" << oendl;
150 150
151 if ( lib->queryInterface( IID_MediaPlayerPlugin, (QUnknownInterface**)&iface ) == QS_OK ) { 151 if ( lib->queryInterface( IID_MediaPlayerPlugin, (QUnknownInterface**)&iface ) == QS_OK ) {
152 152
153// odebug << "loading: " << QString( path + "/" + *it ) << "" << oendl; 153// odebug << "loading: " << QString( path + "/" + *it ) << "" << oendl;
154 154
155 MediaPlayerPlugin plugin; 155 MediaPlayerPlugin plugin;
156 plugin.library = lib; 156 plugin.library = lib;
157 plugin.iface = iface; 157 plugin.iface = iface;
158 plugin.decoder = plugin.iface->decoder(); 158 plugin.decoder = plugin.iface->decoder();
159 plugin.encoder = plugin.iface->encoder(); 159 plugin.encoder = plugin.iface->encoder();
160 pluginList.append( plugin ); 160 pluginList.append( plugin );
161 161
162 // ### hack to get true sample count 162 // ### hack to get true sample count
163 if ( plugin.decoder->pluginName() == QString("LibMpeg3Plugin") ) 163 if ( plugin.decoder->pluginName() == QString("LibMpeg3Plugin") )
164 libmpeg3decoder = plugin.decoder; 164 libmpeg3decoder = plugin.decoder;
165 165
166 } else { 166 } else {
167 delete lib; 167 delete lib;
168 } 168 }
169 } 169 }
170#else 170#else
171 pluginList.clear(); 171 pluginList.clear();
172 172
173 MediaPlayerPlugin plugin0; 173 MediaPlayerPlugin plugin0;
174 plugin0.iface = new LibMpeg3PluginImpl; 174 plugin0.iface = new LibMpeg3PluginImpl;
175 plugin0.decoder = plugin0.iface->decoder(); 175 plugin0.decoder = plugin0.iface->decoder();
176 plugin0.encoder = plugin0.iface->encoder(); 176 plugin0.encoder = plugin0.iface->encoder();
177 pluginList.append( plugin0 ); 177 pluginList.append( plugin0 );
178 178
179 MediaPlayerPlugin plugin1; 179 MediaPlayerPlugin plugin1;
180 plugin1.iface = new LibMadPluginImpl; 180 plugin1.iface = new LibMadPluginImpl;
181 plugin1.decoder = plugin1.iface->decoder(); 181 plugin1.decoder = plugin1.iface->decoder();
182 plugin1.encoder = plugin1.iface->encoder(); 182 plugin1.encoder = plugin1.iface->encoder();
183 pluginList.append( plugin1 ); 183 pluginList.append( plugin1 );
184 184
185 MediaPlayerPlugin plugin2; 185 MediaPlayerPlugin plugin2;
186 plugin2.iface = new WavPluginImpl; 186 plugin2.iface = new WavPluginImpl;
187 plugin2.decoder = plugin2.iface->decoder(); 187 plugin2.decoder = plugin2.iface->decoder();
188 plugin2.encoder = plugin2.iface->encoder(); 188 plugin2.encoder = plugin2.iface->encoder();
189 pluginList.append( plugin2 ); 189 pluginList.append( plugin2 );
190#endif 190#endif
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index 46aeff2..db2bf1b 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -1337,97 +1337,97 @@ void PlayListWidget::keyPressEvent( QKeyEvent *)
1337// case Key_R: //remove from playlist 1337// case Key_R: //remove from playlist
1338// removeSelected(); 1338// removeSelected();
1339// break; 1339// break;
1340// case Key_P: //play 1340// case Key_P: //play
1341// odebug << "Play" << oendl; 1341// odebug << "Play" << oendl;
1342// playSelected(); 1342// playSelected();
1343// break; 1343// break;
1344// case Key_Space: 1344// case Key_Space:
1345// odebug << "Play" << oendl; 1345// odebug << "Play" << oendl;
1346// playSelected(); 1346// playSelected();
1347// break; 1347// break;
1348// } 1348// }
1349} 1349}
1350 1350
1351void PlayListWidget::doBlank() { 1351void PlayListWidget::doBlank() {
1352 // odebug << "do blanking" << oendl; 1352 // odebug << "do blanking" << oendl;
1353#ifdef QT_QWS_DEVFS 1353#ifdef QT_QWS_DEVFS
1354 fd=open("/dev/fb/0",O_RDWR); 1354 fd=open("/dev/fb/0",O_RDWR);
1355#else 1355#else
1356 fd=open("/dev/fb0",O_RDWR); 1356 fd=open("/dev/fb0",O_RDWR);
1357#endif 1357#endif
1358 if (fd != -1) { 1358 if (fd != -1) {
1359 ioctl(fd,FBIOBLANK,1); 1359 ioctl(fd,FBIOBLANK,1);
1360 // close(fd); 1360 // close(fd);
1361 } 1361 }
1362} 1362}
1363 1363
1364void PlayListWidget::doUnblank() { 1364void PlayListWidget::doUnblank() {
1365 // this crashes opieplayer with a segfault 1365 // this crashes opieplayer with a segfault
1366 // int fd; 1366 // int fd;
1367 // fd=open("/dev/fb0",O_RDWR); 1367 // fd=open("/dev/fb0",O_RDWR);
1368 // odebug << "do unblanking" << oendl; 1368 // odebug << "do unblanking" << oendl;
1369 if (fd != -1) { 1369 if (fd != -1) {
1370 ioctl(fd,FBIOBLANK,0); 1370 ioctl(fd,FBIOBLANK,0);
1371 close(fd); 1371 close(fd);
1372 } 1372 }
1373 QCopEnvelope h("QPE/System", "setBacklight(int)"); 1373 QCopEnvelope h("QPE/System", "setBacklight(int)");
1374 h <<-3;// v[1]; // -3 Force on 1374 h <<-3;// v[1]; // -3 Force on
1375} 1375}
1376 1376
1377void PlayListWidget::populateSkinsMenu() { 1377void PlayListWidget::populateSkinsMenu() {
1378 int item = 0; 1378 int item = 0;
1379 defaultSkinIndex = 0; 1379 defaultSkinIndex = 0;
1380 QString skinName; 1380 QString skinName;
1381 Config cfg( "OpiePlayer" ); 1381 Config cfg( "OpiePlayer" );
1382 cfg.setGroup("Options" ); 1382 cfg.setGroup("Options" );
1383 QString skin = cfg.readEntry( "Skin", "default" ); 1383 QString skin = cfg.readEntry( "Skin", "default" );
1384 1384
1385 QDir skinsDir( QPEApplication::qpeDir() + "/pics/opieplayer2/skins" ); 1385 QDir skinsDir( QPEApplication::qpeDir() + "pics/opieplayer2/skins" );
1386 skinsDir.setFilter( QDir::Dirs ); 1386 skinsDir.setFilter( QDir::Dirs );
1387 skinsDir.setSorting(QDir::Name ); 1387 skinsDir.setSorting(QDir::Name );
1388 const QFileInfoList *skinslist = skinsDir.entryInfoList(); 1388 const QFileInfoList *skinslist = skinsDir.entryInfoList();
1389 QFileInfoListIterator it( *skinslist ); 1389 QFileInfoListIterator it( *skinslist );
1390 QFileInfo *fi; 1390 QFileInfo *fi;
1391 while ( ( fi = it.current() ) ) { 1391 while ( ( fi = it.current() ) ) {
1392 skinName = fi->fileName(); 1392 skinName = fi->fileName();
1393 // odebug << fi->fileName() << oendl; 1393 // odebug << fi->fileName() << oendl;
1394 if( skinName != "." && skinName != ".." && skinName !="CVS" ) { 1394 if( skinName != "." && skinName != ".." && skinName !="CVS" ) {
1395 item = skinsMenu->insertItem( fi->fileName() ) ; 1395 item = skinsMenu->insertItem( fi->fileName() ) ;
1396 } 1396 }
1397 if( skinName == "default" ) { 1397 if( skinName == "default" ) {
1398 defaultSkinIndex = item; 1398 defaultSkinIndex = item;
1399 } 1399 }
1400 if( skinName == skin ) { 1400 if( skinName == skin ) {
1401 skinsMenu->setItemChecked( item, TRUE ); 1401 skinsMenu->setItemChecked( item, TRUE );
1402 } 1402 }
1403 ++it; 1403 ++it;
1404 } 1404 }
1405} 1405}
1406 1406
1407void PlayListWidget::skinsMenuActivated( int item ) { 1407void PlayListWidget::skinsMenuActivated( int item ) {
1408 for( int i = defaultSkinIndex; i > defaultSkinIndex - static_cast<int>(skinsMenu->count()); i-- ) { 1408 for( int i = defaultSkinIndex; i > defaultSkinIndex - static_cast<int>(skinsMenu->count()); i-- ) {
1409 skinsMenu->setItemChecked( i, FALSE ); 1409 skinsMenu->setItemChecked( i, FALSE );
1410 } 1410 }
1411 skinsMenu->setItemChecked( item, TRUE ); 1411 skinsMenu->setItemChecked( item, TRUE );
1412 1412
1413 Config cfg( "OpiePlayer" ); 1413 Config cfg( "OpiePlayer" );
1414 cfg.setGroup("Options"); 1414 cfg.setGroup("Options");
1415 cfg.writeEntry("Skin", skinsMenu->text( item ) ); 1415 cfg.writeEntry("Skin", skinsMenu->text( item ) );
1416} 1416}
1417 1417
1418void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { 1418void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) {
1419 // odebug << "qcop message "+msg << oendl; 1419 // odebug << "qcop message "+msg << oendl;
1420 QDataStream stream ( data, IO_ReadOnly ); 1420 QDataStream stream ( data, IO_ReadOnly );
1421 if ( msg == "play()" ) { //plays current selection 1421 if ( msg == "play()" ) { //plays current selection
1422 btnPlay( true); 1422 btnPlay( true);
1423 } else if ( msg == "stop()" ) { 1423 } else if ( msg == "stop()" ) {
1424 mediaPlayerState->setPlaying( false); 1424 mediaPlayerState->setPlaying( false);
1425 } else if ( msg == "togglePause()" ) { 1425 } else if ( msg == "togglePause()" ) {
1426 mediaPlayerState->togglePaused(); 1426 mediaPlayerState->togglePaused();
1427 } else if ( msg == "next()" ) { //select next in lis 1427 } else if ( msg == "next()" ) { //select next in lis
1428 mediaPlayerState->setNext(); 1428 mediaPlayerState->setNext();
1429 } else if ( msg == "prev()" ) { //select previous in list 1429 } else if ( msg == "prev()" ) { //select previous in list
1430 mediaPlayerState->setPrev(); 1430 mediaPlayerState->setPrev();
1431 } else if ( msg == "toggleLooping()" ) { //loop or not loop 1431 } else if ( msg == "toggleLooping()" ) { //loop or not loop
1432 mediaPlayerState->toggleLooping(); 1432 mediaPlayerState->toggleLooping();
1433 } else if ( msg == "toggleShuffled()" ) { //shuffled or not shuffled 1433 } else if ( msg == "toggleShuffled()" ) { //shuffled or not shuffled
diff --git a/core/multimedia/opieplayer/videowidget.cpp b/core/multimedia/opieplayer/videowidget.cpp
index 2396ed5..c545511 100644
--- a/core/multimedia/opieplayer/videowidget.cpp
+++ b/core/multimedia/opieplayer/videowidget.cpp
@@ -53,97 +53,97 @@ struct MediaButton {
53// int controlType; 53// int controlType;
54}; 54};
55 55
56 56
57// Layout information for the videoButtons (and if it is a toggle button or not) 57// Layout information for the videoButtons (and if it is a toggle button or not)
58MediaButton videoButtons[] = { 58MediaButton videoButtons[] = {
59 { FALSE, FALSE, FALSE }, // stop 59 { FALSE, FALSE, FALSE }, // stop
60 { FALSE, FALSE, FALSE }, // play 60 { FALSE, FALSE, FALSE }, // play
61 { FALSE, FALSE, FALSE }, // previous 61 { FALSE, FALSE, FALSE }, // previous
62 { FALSE, FALSE, FALSE }, // next 62 { FALSE, FALSE, FALSE }, // next
63 { FALSE, FALSE, FALSE }, // volUp 63 { FALSE, FALSE, FALSE }, // volUp
64 { FALSE, FALSE, FALSE }, // volDown 64 { FALSE, FALSE, FALSE }, // volDown
65 { TRUE, FALSE, FALSE } // fullscreen 65 { TRUE, FALSE, FALSE } // fullscreen
66}; 66};
67 67
68//static const int numButtons = (sizeof(videoButtons)/sizeof(MediaButton)); 68//static const int numButtons = (sizeof(videoButtons)/sizeof(MediaButton));
69 69
70const char *skinV_mask_file_names[7] = { 70const char *skinV_mask_file_names[7] = {
71 "stop","play","back","fwd","up","down","full" 71 "stop","play","back","fwd","up","down","full"
72}; 72};
73 73
74static const int numVButtons = (sizeof(videoButtons)/sizeof(MediaButton)); 74static const int numVButtons = (sizeof(videoButtons)/sizeof(MediaButton));
75 75
76VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : 76VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) :
77 QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) 77 QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 )
78{ 78{
79 setCaption( tr("OpiePlayer") ); 79 setCaption( tr("OpiePlayer") );
80 Config cfg("OpiePlayer"); 80 Config cfg("OpiePlayer");
81 81
82 cfg.setGroup("Options"); 82 cfg.setGroup("Options");
83 skin = cfg.readEntry("Skin","default"); 83 skin = cfg.readEntry("Skin","default");
84 84
85 QString skinPath; 85 QString skinPath;
86 skinPath = "opieplayer2/skins/" + skin; 86 skinPath = "opieplayer2/skins/" + skin;
87 if(!QDir(QString(getenv("OPIEDIR")) +"/pics/"+skinPath).exists()) 87 if(!QDir(QString(getenv("OPIEDIR")) +"/pics/"+skinPath).exists())
88 skinPath = "opieplayer2/skins/default"; 88 skinPath = "opieplayer2/skins/default";
89 89
90 90
91// QString skinPath = "opieplayer2/skins/" + skin; 91// QString skinPath = "opieplayer2/skins/" + skin;
92 92
93 pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); 93 pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) );
94 imgUp = new QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) ); 94 imgUp = new QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) );
95 imgDn = new QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) ); 95 imgDn = new QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) );
96 96
97 imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 ); 97 imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 );
98 imgButtonMask->fill( 0 ); 98 imgButtonMask->fill( 0 );
99 99
100 for ( int i = 0; i < 7; i++ ) { 100 for ( int i = 0; i < 7; i++ ) {
101 QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + 101 QString filename = QString( QPEApplication::qpeDir() + "pics/" + skinPath +
102 "/skinV_mask_" + skinV_mask_file_names[i] + ".png" ); 102 "/skinV_mask_" + skinV_mask_file_names[i] + ".png" );
103 // odebug << "loading "+filename << oendl; 103 // odebug << "loading "+filename << oendl;
104 masks[i] = new QBitmap( filename ); 104 masks[i] = new QBitmap( filename );
105 105
106 if ( !masks[i]->isNull() ) { 106 if ( !masks[i]->isNull() ) {
107 QImage imgMask = masks[i]->convertToImage(); 107 QImage imgMask = masks[i]->convertToImage();
108 uchar **dest = imgButtonMask->jumpTable(); 108 uchar **dest = imgButtonMask->jumpTable();
109 for ( int y = 0; y < imgUp->height(); y++ ) { 109 for ( int y = 0; y < imgUp->height(); y++ ) {
110 uchar *line = dest[y]; 110 uchar *line = dest[y];
111 for ( int x = 0; x < imgUp->width(); x++ ) { 111 for ( int x = 0; x < imgUp->width(); x++ ) {
112 if ( !qRed( imgMask.pixel( x, y ) ) ) 112 if ( !qRed( imgMask.pixel( x, y ) ) )
113 line[x] = i + 1; 113 line[x] = i + 1;
114 } 114 }
115 } 115 }
116 } 116 }
117 } 117 }
118 for ( int i = 0; i < 7; i++ ) { 118 for ( int i = 0; i < 7; i++ ) {
119 buttonPixUp[i] = NULL; 119 buttonPixUp[i] = NULL;
120 buttonPixDown[i] = NULL; 120 buttonPixDown[i] = NULL;
121 } 121 }
122 122
123 QWidget *d = QApplication::desktop(); 123 QWidget *d = QApplication::desktop();
124 int width = d->width(); 124 int width = d->width();
125 int height = d->height(); 125 int height = d->height();
126 126
127 if( (width != pixBg->width() ) || (height != pixBg->height() ) ) { 127 if( (width != pixBg->width() ) || (height != pixBg->height() ) ) {
128 QImage img; 128 QImage img;
129 img = pixBg->convertToImage(); 129 img = pixBg->convertToImage();
130 pixBg->convertFromImage( img.smoothScale( width, height)); 130 pixBg->convertFromImage( img.smoothScale( width, height));
131 } 131 }
132 132
133 setBackgroundPixmap( *pixBg ); 133 setBackgroundPixmap( *pixBg );
134 currentFrame = new QImage( 220 + 2, 160, (QPixmap::defaultDepth() == 16) ? 16 : 32 ); 134 currentFrame = new QImage( 220 + 2, 160, (QPixmap::defaultDepth() == 16) ? 16 : 32 );
135 slider = new QSlider( Qt::Horizontal, this ); 135 slider = new QSlider( Qt::Horizontal, this );
136 slider->setMinValue( 0 ); 136 slider->setMinValue( 0 );
137 slider->setMaxValue( 1 ); 137 slider->setMaxValue( 1 );
138 138
139 slider->setBackgroundPixmap( *pixBg ); 139 slider->setBackgroundPixmap( *pixBg );
140 slider->setFocusPolicy( QWidget::NoFocus ); 140 slider->setFocusPolicy( QWidget::NoFocus );
141// slider->setGeometry( QRect( 7, 250, 220, 20 ) ); 141// slider->setGeometry( QRect( 7, 250, 220, 20 ) );
142 142
143 connect(slider,SIGNAL(sliderPressed()),this,SLOT(sliderPressed())); 143 connect(slider,SIGNAL(sliderPressed()),this,SLOT(sliderPressed()));
144 connect(slider,SIGNAL(sliderReleased()),this,SLOT(sliderReleased())); 144 connect(slider,SIGNAL(sliderReleased()),this,SLOT(sliderReleased()));
145 145
146 connect(mediaPlayerState,SIGNAL(lengthChanged(long)),this,SLOT(setLength(long))); 146 connect(mediaPlayerState,SIGNAL(lengthChanged(long)),this,SLOT(setLength(long)));
147 connect(mediaPlayerState,SIGNAL(positionChanged(long)),this,SLOT(setPosition(long))); 147 connect(mediaPlayerState,SIGNAL(positionChanged(long)),this,SLOT(setPosition(long)));
148 connect(mediaPlayerState,SIGNAL(positionUpdated(long)),this,SLOT(setPosition(long))); 148 connect(mediaPlayerState,SIGNAL(positionUpdated(long)),this,SLOT(setPosition(long)));
149 connect(mediaPlayerState,SIGNAL(viewChanged(char)),this,SLOT(setView(char))); 149 connect(mediaPlayerState,SIGNAL(viewChanged(char)),this,SLOT(setView(char)));
diff --git a/core/opie-login/main.cpp b/core/opie-login/main.cpp
index f0a8ba2..0699d0a 100644
--- a/core/opie-login/main.cpp
+++ b/core/opie-login/main.cpp
@@ -135,97 +135,97 @@ int main ( int argc, char **argv )
135 } 135 }
136 } 136 }
137 int killedbysig = 0; 137 int killedbysig = 0;
138 userExited=0; 138 userExited=0;
139 if (WIFEXITED(status)!=0 ) { 139 if (WIFEXITED(status)!=0 ) {
140 if (WEXITSTATUS(status)==137) { 140 if (WEXITSTATUS(status)==137) {
141 userExited=1; 141 userExited=1;
142 } 142 }
143 } 143 }
144 144
145 if ( WIFSIGNALED( status )) { 145 if ( WIFSIGNALED( status )) {
146 switch ( WTERMSIG( status )) { 146 switch ( WTERMSIG( status )) {
147 case SIGTERM: 147 case SIGTERM:
148 case SIGINT : 148 case SIGINT :
149 case SIGKILL: 149 case SIGKILL:
150 break; 150 break;
151 151
152 default : 152 default :
153 killedbysig = WTERMSIG( status ); 153 killedbysig = WTERMSIG( status );
154 break; 154 break;
155 } 155 }
156 } 156 }
157 if ( killedbysig ) { // qpe was killed by an uncaught signal 157 if ( killedbysig ) { // qpe was killed by an uncaught signal
158 qApp = 0; 158 qApp = 0;
159 159
160 ::syslog ( LOG_ERR, "Opie was killed by a signal #%d", killedbysig ); 160 ::syslog ( LOG_ERR, "Opie was killed by a signal #%d", killedbysig );
161 161
162 QWSServer::setDesktopBackground ( QImage ( )); 162 QWSServer::setDesktopBackground ( QImage ( ));
163 QApplication *app = new QApplication ( argc, argv, QApplication::GuiServer ); 163 QApplication *app = new QApplication ( argc, argv, QApplication::GuiServer );
164 app-> setFont ( QFont ( "Helvetica", 10 )); 164 app-> setFont ( QFont ( "Helvetica", 10 ));
165 app-> setStyle ( new QPEStyle ( )); 165 app-> setStyle ( new QPEStyle ( ));
166 166
167 // const char *sig = ::strsignal ( killedbysig ); 167 // const char *sig = ::strsignal ( killedbysig );
168 const char *sig = ::sys_siglist[killedbysig]; 168 const char *sig = ::sys_siglist[killedbysig];
169 QLabel *l = new QLabel ( 0, "sig", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool ); 169 QLabel *l = new QLabel ( 0, "sig", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool );
170 l-> setText ( LoginWindowImpl::tr( "Opie was terminated\nby an uncaught signal\n(%1)\n" ). arg ( sig )); 170 l-> setText ( LoginWindowImpl::tr( "Opie was terminated\nby an uncaught signal\n(%1)\n" ). arg ( sig ));
171 l-> setAlignment ( Qt::AlignCenter ); 171 l-> setAlignment ( Qt::AlignCenter );
172 l-> move ( 0, 0 ); 172 l-> move ( 0, 0 );
173 l-> resize ( app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( )); 173 l-> resize ( app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( ));
174 l-> show ( ); 174 l-> show ( );
175 QTimer::singleShot ( 3000, app, SLOT( quit())); 175 QTimer::singleShot ( 3000, app, SLOT( quit()));
176 app-> exec ( ); 176 app-> exec ( );
177 delete app; 177 delete app;
178 qApp = 0; 178 qApp = 0;
179 } 179 }
180 } 180 }
181 else { 181 else {
182 if ( !autolog ) { 182 if ( !autolog ) {
183 QString confFile=QPEApplication::qpeDir() + "/etc/opie-login.conf"; 183 QString confFile=QPEApplication::qpeDir() + "etc/opie-login.conf";
184 Config cfg ( confFile, Config::File ); 184 Config cfg ( confFile, Config::File );
185 cfg. setGroup ( "General" ); 185 cfg. setGroup ( "General" );
186 QString user = cfg. readEntry ( "AutoLogin" ); 186 QString user = cfg. readEntry ( "AutoLogin" );
187 187
188 if ( !user. isEmpty ( )) 188 if ( !user. isEmpty ( ))
189 autolog = ::strdup ( user. latin1 ( )); 189 autolog = ::strdup ( user. latin1 ( ));
190 } 190 }
191 191
192 if ( autolog && !userExited ) { 192 if ( autolog && !userExited ) {
193 193
194 QWSServer::setDesktopBackground( QImage() ); 194 QWSServer::setDesktopBackground( QImage() );
195 ODevice::inst ( )-> setDisplayStatus ( true ); 195 ODevice::inst ( )-> setDisplayStatus ( true );
196 ODevice::inst ( )-> setSoftSuspend ( false ); 196 ODevice::inst ( )-> setSoftSuspend ( false );
197 LoginApplication *app = new LoginApplication ( argc, argv, ppid ); 197 LoginApplication *app = new LoginApplication ( argc, argv, ppid );
198 LoginApplication::setLoginAs ( autolog ); 198 LoginApplication::setLoginAs ( autolog );
199 199
200 200
201 if ( LoginApplication::changeIdentity ( )) 201 if ( LoginApplication::changeIdentity ( ))
202 ::exit ( LoginApplication::login ( )); 202 ::exit ( LoginApplication::login ( ));
203 else 203 else
204 ::exit ( 0 ); 204 ::exit ( 0 );
205 } 205 }
206 else { 206 else {
207 ::exit ( login_main ( argc, argv, ppid )); 207 ::exit ( login_main ( argc, argv, ppid ));
208 } 208 }
209 } 209 }
210 } 210 }
211 return 0; 211 return 0;
212} 212}
213 213
214void sigterm ( int /*sig*/ ) 214void sigterm ( int /*sig*/ )
215{ 215{
216 ::exit ( 0 ); 216 ::exit ( 0 );
217} 217}
218 218
219 219
220void exit_closelog ( ) 220void exit_closelog ( )
221{ 221{
222 ::closelog ( ); 222 ::closelog ( );
223} 223}
224 224
225 225
226class LoginScreenSaver : public QWSScreenSaver 226class LoginScreenSaver : public QWSScreenSaver
227{ 227{
228public: 228public:
229 LoginScreenSaver ( ) 229 LoginScreenSaver ( )
230 { 230 {
231 m_lcd_status = true; 231 m_lcd_status = true;
diff --git a/core/settings/launcher/menusettings.cpp b/core/settings/launcher/menusettings.cpp
index 2b64c47..55bf358 100644
--- a/core/settings/launcher/menusettings.cpp
+++ b/core/settings/launcher/menusettings.cpp
@@ -36,115 +36,115 @@
36 36
37#include <qdir.h> 37#include <qdir.h>
38#include <qlistview.h> 38#include <qlistview.h>
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qheader.h> 40#include <qheader.h>
41#include <qlayout.h> 41#include <qlayout.h>
42#include <qlabel.h> 42#include <qlabel.h>
43#include <qwhatsthis.h> 43#include <qwhatsthis.h>
44 44
45#include <stdlib.h> 45#include <stdlib.h>
46 46
47 47
48MenuSettings::MenuSettings ( QWidget *parent, const char *name ) 48MenuSettings::MenuSettings ( QWidget *parent, const char *name )
49 : QWidget ( parent, name ) 49 : QWidget ( parent, name )
50{ 50{
51 m_applets_changed = false; 51 m_applets_changed = false;
52 52
53 QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); 53 QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 );
54 54
55 QLabel *l = new QLabel ( tr( "Load applets in O-Menu:" ), this ); 55 QLabel *l = new QLabel ( tr( "Load applets in O-Menu:" ), this );
56 lay-> addWidget ( l ); 56 lay-> addWidget ( l );
57 57
58 m_list = new QListView ( this ); 58 m_list = new QListView ( this );
59 m_list-> addColumn ( "foobar" ); 59 m_list-> addColumn ( "foobar" );
60 m_list-> header ( )-> hide ( ); 60 m_list-> header ( )-> hide ( );
61 61
62 lay-> addWidget ( m_list ); 62 lay-> addWidget ( m_list );
63 63
64 m_menutabs = new QCheckBox ( tr( "Show Launcher tabs in O-Menu" ), this ); 64 m_menutabs = new QCheckBox ( tr( "Show Launcher tabs in O-Menu" ), this );
65 lay-> addWidget ( m_menutabs ); 65 lay-> addWidget ( m_menutabs );
66 66
67 m_menusubpopup = new QCheckBox ( tr( "Show Applications in Subpopups" ), this ); 67 m_menusubpopup = new QCheckBox ( tr( "Show Applications in Subpopups" ), this );
68 lay-> addWidget ( m_menusubpopup ); 68 lay-> addWidget ( m_menusubpopup );
69 69
70 QWhatsThis::add ( m_list, tr( "Check the applets that you want to have included in the O-Menu." )); 70 QWhatsThis::add ( m_list, tr( "Check the applets that you want to have included in the O-Menu." ));
71 QWhatsThis::add ( m_menutabs, tr( "Adds the contents of the Launcher Tabs as menus in the O-Menu." )); 71 QWhatsThis::add ( m_menutabs, tr( "Adds the contents of the Launcher Tabs as menus in the O-Menu." ));
72 72
73 connect ( m_list, SIGNAL( clicked(QListViewItem*)), this, SLOT( appletChanged())); 73 connect ( m_list, SIGNAL( clicked(QListViewItem*)), this, SLOT( appletChanged()));
74 74
75 init ( ); 75 init ( );
76} 76}
77 77
78void MenuSettings::init ( ) 78void MenuSettings::init ( )
79{ 79{
80 Config cfg ( "StartMenu" ); 80 Config cfg ( "StartMenu" );
81 cfg. setGroup ( "Applets" ); 81 cfg. setGroup ( "Applets" );
82 QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); 82 QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' );
83 83
84 QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; 84 QString path = QPEApplication::qpeDir ( ) + "plugins/applets";
85#ifdef Q_OS_MACX 85#ifdef Q_OS_MACX
86 QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); 86 QStringList list = QDir ( path, "lib*.dylib" ). entryList ( );
87#else 87#else
88 QStringList list = QDir ( path, "lib*.so" ). entryList ( ); 88 QStringList list = QDir ( path, "lib*.so" ). entryList ( );
89#endif /* Q_OS_MACX */ 89#endif /* Q_OS_MACX */
90 90
91 for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { 91 for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) {
92 QString name; 92 QString name;
93 QPixmap icon; 93 QPixmap icon;
94 MenuAppletInterface *iface = 0; 94 MenuAppletInterface *iface = 0;
95 95
96 QLibrary *lib = new QLibrary ( path + "/" + *it ); 96 QLibrary *lib = new QLibrary ( path + "/" + *it );
97 lib-> queryInterface ( IID_MenuApplet, (QUnknownInterface**) &iface ); 97 lib-> queryInterface ( IID_MenuApplet, (QUnknownInterface**) &iface );
98 if ( iface ) { 98 if ( iface ) {
99 QString lang = getenv( "LANG" ); 99 QString lang = getenv( "LANG" );
100 QTranslator *trans = new QTranslator ( qApp ); 100 QTranslator *trans = new QTranslator ( qApp );
101 QString type = (*it). left ((*it). find (".")); 101 QString type = (*it). left ((*it). find ("."));
102 QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; 102 QString tfn = QPEApplication::qpeDir ( ) + "i18n/" + lang + "/" + type + ".qm";
103 if ( trans-> load ( tfn )) 103 if ( trans-> load ( tfn ))
104 qApp-> installTranslator ( trans ); 104 qApp-> installTranslator ( trans );
105 else 105 else
106 delete trans; 106 delete trans;
107 name = iface-> name ( ); 107 name = iface-> name ( );
108 icon = iface-> icon ( ). pixmap ( QIconSet::Small, QIconSet::Normal ); 108 icon = iface-> icon ( ). pixmap ( QIconSet::Small, QIconSet::Normal );
109 iface-> release ( ); 109 iface-> release ( );
110 lib-> unload ( ); 110 lib-> unload ( );
111 111
112 QCheckListItem *item; 112 QCheckListItem *item;
113 item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox ); 113 item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox );
114 if ( !icon. isNull ( )) 114 if ( !icon. isNull ( ))
115 item-> setPixmap ( 0, icon ); 115 item-> setPixmap ( 0, icon );
116 item-> setOn ( exclude. find ( *it ) == exclude. end ( )); 116 item-> setOn ( exclude. find ( *it ) == exclude. end ( ));
117 m_applets [*it] = item; 117 m_applets [*it] = item;
118 } else { 118 } else {
119 delete lib; 119 delete lib;
120 } 120 }
121 } 121 }
122 122
123 cfg. setGroup ( "Menu" ); 123 cfg. setGroup ( "Menu" );
124 m_menutabs->setChecked( cfg.readBoolEntry( "LauncherTabs", true ) ); 124 m_menutabs->setChecked( cfg.readBoolEntry( "LauncherTabs", true ) );
125 m_menusubpopup->setChecked( cfg.readBoolEntry( "LauncherSubPopup", true ) ); 125 m_menusubpopup->setChecked( cfg.readBoolEntry( "LauncherSubPopup", true ) );
126 m_menusubpopup->setEnabled( m_menutabs->isChecked() ); 126 m_menusubpopup->setEnabled( m_menutabs->isChecked() );
127 connect( m_menutabs, SIGNAL( stateChanged(int) ), m_menusubpopup, SLOT( setEnabled(bool) ) ); 127 connect( m_menutabs, SIGNAL( stateChanged(int) ), m_menusubpopup, SLOT( setEnabled(bool) ) );
128 128
129} 129}
130 130
131void MenuSettings::appletChanged() 131void MenuSettings::appletChanged()
132{ 132{
133 m_applets_changed = true; 133 m_applets_changed = true;
134} 134}
135 135
136void MenuSettings::accept ( ) 136void MenuSettings::accept ( )
137{ 137{
138 bool apps_changed = false; 138 bool apps_changed = false;
139 139
140 Config cfg ( "StartMenu" ); 140 Config cfg ( "StartMenu" );
141 cfg. setGroup ( "Applets" ); 141 cfg. setGroup ( "Applets" );
142 if ( m_applets_changed ) { 142 if ( m_applets_changed ) {
143 QStringList exclude; 143 QStringList exclude;
144 QMap <QString, QCheckListItem *>::Iterator it; 144 QMap <QString, QCheckListItem *>::Iterator it;
145 for ( it = m_applets. begin ( ); it != m_applets. end ( ); ++it ) { 145 for ( it = m_applets. begin ( ); it != m_applets. end ( ); ++it ) {
146 if ( !(*it)-> isOn ( )) 146 if ( !(*it)-> isOn ( ))
147 exclude << it. key ( ); 147 exclude << it. key ( );
148 } 148 }
149 cfg. writeEntry ( "ExcludeApplets", exclude, ',' ); 149 cfg. writeEntry ( "ExcludeApplets", exclude, ',' );
150 } 150 }
diff --git a/core/settings/launcher/taskbarsettings.cpp b/core/settings/launcher/taskbarsettings.cpp
index 8dd9e97..861ff3a 100644
--- a/core/settings/launcher/taskbarsettings.cpp
+++ b/core/settings/launcher/taskbarsettings.cpp
@@ -32,118 +32,118 @@
32#include <qpe/config.h> 32#include <qpe/config.h>
33#include <qpe/qlibrary.h> 33#include <qpe/qlibrary.h>
34#include <qpe/qpeapplication.h> 34#include <qpe/qpeapplication.h>
35#include <qpe/taskbarappletinterface.h> 35#include <qpe/taskbarappletinterface.h>
36#include <qpe/qcopenvelope_qws.h> 36#include <qpe/qcopenvelope_qws.h>
37#include <opie2/odebug.h> 37#include <opie2/odebug.h>
38 38
39/* QT */ 39/* QT */
40#include <qdir.h> 40#include <qdir.h>
41#include <qlistview.h> 41#include <qlistview.h>
42#include <qheader.h> 42#include <qheader.h>
43#include <qlayout.h> 43#include <qlayout.h>
44#include <qlabel.h> 44#include <qlabel.h>
45#include <qwhatsthis.h> 45#include <qwhatsthis.h>
46 46
47/* STD */ 47/* STD */
48#include <stdlib.h> 48#include <stdlib.h>
49 49
50 50
51TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name ) 51TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name )
52 : QWidget ( parent, name ) 52 : QWidget ( parent, name )
53{ 53{
54 m_applets_changed = false; 54 m_applets_changed = false;
55 55
56 QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); 56 QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 );
57 57
58 QLabel *l = new QLabel ( tr( "Load applets in Taskbar:" ), this ); 58 QLabel *l = new QLabel ( tr( "Load applets in Taskbar:" ), this );
59 lay-> addWidget ( l ); 59 lay-> addWidget ( l );
60 60
61 m_list = new QListView ( this ); 61 m_list = new QListView ( this );
62 m_list-> addColumn ( "foobar" ); 62 m_list-> addColumn ( "foobar" );
63 m_list-> header ( )-> hide ( ); 63 m_list-> header ( )-> hide ( );
64 64
65 lay-> addWidget ( m_list ); 65 lay-> addWidget ( m_list );
66 66
67 QWhatsThis::add ( m_list, tr( "Check the applets that you want displayed in the Taskbar." )); 67 QWhatsThis::add ( m_list, tr( "Check the applets that you want displayed in the Taskbar." ));
68 68
69 connect ( m_list, SIGNAL( clicked(QListViewItem*)), this, SLOT( appletChanged())); 69 connect ( m_list, SIGNAL( clicked(QListViewItem*)), this, SLOT( appletChanged()));
70 70
71 init ( ); 71 init ( );
72} 72}
73 73
74void TaskbarSettings::init ( ) 74void TaskbarSettings::init ( )
75{ 75{
76 Config cfg ( "Taskbar" ); 76 Config cfg ( "Taskbar" );
77 cfg. setGroup ( "Applets" ); 77 cfg. setGroup ( "Applets" );
78 QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); 78 QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' );
79 79
80 QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; 80 QString path = QPEApplication::qpeDir ( ) + "plugins/applets";
81#ifdef Q_OS_MACX 81#ifdef Q_OS_MACX
82 QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); 82 QStringList list = QDir ( path, "lib*.dylib" ). entryList ( );
83#else 83#else
84 QStringList list = QDir ( path, "lib*.so" ). entryList ( ); 84 QStringList list = QDir ( path, "lib*.so" ). entryList ( );
85#endif /* Q_OS_MACX */ 85#endif /* Q_OS_MACX */
86 86
87 for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { 87 for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) {
88 QString name; 88 QString name;
89 QPixmap icon; 89 QPixmap icon;
90 TaskbarNamedAppletInterface *iface = 0; 90 TaskbarNamedAppletInterface *iface = 0;
91 91
92 owarn << "Load applet: " << (*it) << "" << oendl; 92 owarn << "Load applet: " << (*it) << "" << oendl;
93 QLibrary *lib = new QLibrary ( path + "/" + *it ); 93 QLibrary *lib = new QLibrary ( path + "/" + *it );
94 lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface ); 94 lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface );
95 owarn << "<1>" << oendl; 95 owarn << "<1>" << oendl;
96 if ( iface ) { 96 if ( iface ) {
97 owarn << "<2>" << oendl; 97 owarn << "<2>" << oendl;
98 QString lang = getenv( "LANG" ); 98 QString lang = getenv( "LANG" );
99 QTranslator *trans = new QTranslator ( qApp ); 99 QTranslator *trans = new QTranslator ( qApp );
100 QString type = (*it). left ((*it). find (".")); 100 QString type = (*it). left ((*it). find ("."));
101 QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; 101 QString tfn = QPEApplication::qpeDir ( ) + "i18n/" + lang + "/" + type + ".qm";
102 if ( trans-> load ( tfn )) 102 if ( trans-> load ( tfn ))
103 qApp-> installTranslator ( trans ); 103 qApp-> installTranslator ( trans );
104 else 104 else
105 delete trans; 105 delete trans;
106 name = iface-> name ( ); 106 name = iface-> name ( );
107 icon = iface-> icon ( ); 107 icon = iface-> icon ( );
108 iface-> release ( ); 108 iface-> release ( );
109 } 109 }
110 owarn << "<3>" << oendl; 110 owarn << "<3>" << oendl;
111 if ( !iface ) { 111 if ( !iface ) {
112 owarn << "<4>" << oendl; 112 owarn << "<4>" << oendl;
113 lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface ); 113 lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface );
114 114
115 if ( iface ) { 115 if ( iface ) {
116 owarn << "<5>" << oendl; 116 owarn << "<5>" << oendl;
117 name = (*it). mid ( 3 ); 117 name = (*it). mid ( 3 );
118 owarn << "Found applet: " << name << "" << oendl; 118 owarn << "Found applet: " << name << "" << oendl;
119#ifdef Q_OS_MACX 119#ifdef Q_OS_MACX
120 int sep = name. find( ".dylib" ); 120 int sep = name. find( ".dylib" );
121#else 121#else
122 int sep = name. find( ".so" ); 122 int sep = name. find( ".so" );
123#endif /* Q_OS_MACX */ 123#endif /* Q_OS_MACX */
124 if ( sep > 0 ) 124 if ( sep > 0 )
125 name. truncate ( sep ); 125 name. truncate ( sep );
126 sep = name. find ( "applet" ); 126 sep = name. find ( "applet" );
127 if ( sep == (int) name.length ( ) - 6 ) 127 if ( sep == (int) name.length ( ) - 6 )
128 name. truncate ( sep ); 128 name. truncate ( sep );
129 name[0] = name[0]. upper ( ); 129 name[0] = name[0]. upper ( );
130 iface-> release ( ); 130 iface-> release ( );
131 } 131 }
132 } 132 }
133 owarn << "<6>" << oendl; 133 owarn << "<6>" << oendl;
134 134
135 if ( iface ) { 135 if ( iface ) {
136 owarn << "<7>" << oendl; 136 owarn << "<7>" << oendl;
137 QCheckListItem *item; 137 QCheckListItem *item;
138 item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox ); 138 item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox );
139 if ( !icon. isNull ( )) 139 if ( !icon. isNull ( ))
140 item-> setPixmap ( 0, icon ); 140 item-> setPixmap ( 0, icon );
141 item-> setOn ( exclude. find ( *it ) == exclude. end ( )); 141 item-> setOn ( exclude. find ( *it ) == exclude. end ( ));
142 m_applets [*it] = item; 142 m_applets [*it] = item;
143 } 143 }
144 lib-> unload ( ); 144 lib-> unload ( );
145 delete lib; 145 delete lib;
146 } 146 }
147} 147}
148 148
149void TaskbarSettings::appletChanged() 149void TaskbarSettings::appletChanged()
diff --git a/core/settings/security/multiauthconfig.cpp b/core/settings/security/multiauthconfig.cpp
index e545e17..45d691b 100644
--- a/core/settings/security/multiauthconfig.cpp
+++ b/core/settings/security/multiauthconfig.cpp
@@ -109,97 +109,97 @@ void MultiauthGeneralConfig::tryAuth()
109 QMessageBox confirmSave( 109 QMessageBox confirmSave(
110 tr("Attention"), 110 tr("Attention"),
111 "<p>" + tr("You must save your current settings before trying to authenticate. Press OK to accept and launch a simulated authentication process.") + "</p><p><em>" + 111 "<p>" + tr("You must save your current settings before trying to authenticate. Press OK to accept and launch a simulated authentication process.") + "</p><p><em>" +
112 tr("If you don't like the result of this test, don't forget to change your settings before you exit the configuration application!") + "</em></p>", 112 tr("If you don't like the result of this test, don't forget to change your settings before you exit the configuration application!") + "</em></p>",
113 QMessageBox::Warning, 113 QMessageBox::Warning,
114 QMessageBox::Cancel, QMessageBox::Yes, QMessageBox::NoButton, 114 QMessageBox::Cancel, QMessageBox::Yes, QMessageBox::NoButton,
115 0, QString::null, TRUE, WStyle_StaysOnTop); 115 0, QString::null, TRUE, WStyle_StaysOnTop);
116 confirmSave.setButtonText(QMessageBox::Cancel, tr("Cancel")); 116 confirmSave.setButtonText(QMessageBox::Cancel, tr("Cancel"));
117 confirmSave.setButtonText(QMessageBox::Yes, tr("OK")); 117 confirmSave.setButtonText(QMessageBox::Yes, tr("OK"));
118 118
119 if ( confirmSave.exec() == QMessageBox::Yes) 119 if ( confirmSave.exec() == QMessageBox::Yes)
120 { 120 {
121 owarn << "writing config as user accepted" << oendl; 121 owarn << "writing config as user accepted" << oendl;
122 m_parentConfig->writeConfigs(); 122 m_parentConfig->writeConfigs();
123 owarn << "testing authentication" << oendl; 123 owarn << "testing authentication" << oendl;
124 // launch the authentication in testing mode 124 // launch the authentication in testing mode
125 Opie::Security::MultiauthPassword::authenticate(Opie::Security::TestNow); 125 Opie::Security::MultiauthPassword::authenticate(Opie::Security::TestNow);
126 } 126 }
127} 127}
128 128
129 129
130/// Builds and displays the Opie multi-authentication configuration dialog 130/// Builds and displays the Opie multi-authentication configuration dialog
131static void test_and_start() { 131static void test_and_start() {
132 Config pcfg("Security"); 132 Config pcfg("Security");
133 pcfg.setGroup( "Misc" ); 133 pcfg.setGroup( "Misc" );
134 bool protectConfigDialog = ! pcfg.readBoolEntry("noProtectConfig", true); 134 bool protectConfigDialog = ! pcfg.readBoolEntry("noProtectConfig", true);
135 135
136 if (protectConfigDialog && Opie::Security::Internal::runPlugins() != 0) { 136 if (protectConfigDialog && Opie::Security::Internal::runPlugins() != 0) {
137 owarn << "authentication failed, not showing opie-security" << oendl; 137 owarn << "authentication failed, not showing opie-security" << oendl;
138 exit( -1 ); 138 exit( -1 );
139 } 139 }
140} 140}
141 141
142 142
143 143
144 MultiauthConfig::MultiauthConfig(QWidget* par, const char* w = "MultiauthConfig dialog", WFlags f = 0) 144 MultiauthConfig::MultiauthConfig(QWidget* par, const char* w = "MultiauthConfig dialog", WFlags f = 0)
145: QDialog(par, w, TRUE, f), 145: QDialog(par, w, TRUE, f),
146 m_mainTW(0), m_pluginListView(0), m_pluginListWidget(0), 146 m_mainTW(0), m_pluginListView(0), m_pluginListWidget(0),
147 m_generalConfig(0), m_loginWidget(0), m_syncWidget(0), 147 m_generalConfig(0), m_loginWidget(0), m_syncWidget(0),
148 m_nbSuccessReq(0), m_plugins_changed(false) 148 m_nbSuccessReq(0), m_plugins_changed(false)
149{ 149{
150 /* Initializes the global configuration window 150 /* Initializes the global configuration window
151 */ 151 */
152 test_and_start(); 152 test_and_start();
153 153
154 /* Checks (and memorizes) if any authentication plugins are 154 /* Checks (and memorizes) if any authentication plugins are
155 * installed on the system 155 * installed on the system
156 */ 156 */
157 QString path = QPEApplication::qpeDir() + "/plugins/security"; 157 QString path = QPEApplication::qpeDir() + "plugins/security";
158 QDir dir( path, "lib*.so" ); 158 QDir dir( path, "lib*.so" );
159 QStringList list = dir.entryList(); 159 QStringList list = dir.entryList();
160 160
161 m_pluginsInstalled = ! list.isEmpty(); 161 m_pluginsInstalled = ! list.isEmpty();
162 if (m_pluginsInstalled == false) 162 if (m_pluginsInstalled == false)
163 owarn << "no authentication plugins installed! Talking about it in the last tab..." << oendl; 163 owarn << "no authentication plugins installed! Talking about it in the last tab..." << oendl;
164 164
165 setCaption( tr( "Security configuration" ) ); 165 setCaption( tr( "Security configuration" ) );
166 QVBoxLayout *layout = new QVBoxLayout( this ); 166 QVBoxLayout *layout = new QVBoxLayout( this );
167 m_mainTW = new Opie::Ui::OTabWidget( this, "main tab widget" ); 167 m_mainTW = new Opie::Ui::OTabWidget( this, "main tab widget" );
168 layout->addWidget(m_mainTW); 168 layout->addWidget(m_mainTW);
169 169
170 if (m_pluginsInstalled) 170 if (m_pluginsInstalled)
171 { 171 {
172 m_pluginListWidget = new QWidget(m_mainTW, "plugin list widget"); 172 m_pluginListWidget = new QWidget(m_mainTW, "plugin list widget");
173 QVBoxLayout * pluginListLayout = new QVBoxLayout(m_pluginListWidget); 173 QVBoxLayout * pluginListLayout = new QVBoxLayout(m_pluginListWidget);
174 pluginListLayout->setSpacing(6); 174 pluginListLayout->setSpacing(6);
175 pluginListLayout->setMargin(11); 175 pluginListLayout->setMargin(11);
176 QLabel * pluginListTitle = new QLabel( tr( "Load which plugins in what order:" ), m_pluginListWidget ); 176 QLabel * pluginListTitle = new QLabel( tr( "Load which plugins in what order:" ), m_pluginListWidget );
177 pluginListLayout->addWidget(pluginListTitle); 177 pluginListLayout->addWidget(pluginListTitle);
178 QHBox * pluginListHB = new QHBox(m_pluginListWidget); 178 QHBox * pluginListHB = new QHBox(m_pluginListWidget);
179 pluginListLayout->addWidget(pluginListHB); 179 pluginListLayout->addWidget(pluginListHB);
180 180
181 m_pluginListView = new QListView(pluginListHB); 181 m_pluginListView = new QListView(pluginListHB);
182 m_pluginListView->addColumn("PluginList"); 182 m_pluginListView->addColumn("PluginList");
183 m_pluginListView->header()->hide(); 183 m_pluginListView->header()->hide();
184 m_pluginListView->setSorting(-1); 184 m_pluginListView->setSorting(-1);
185 QWhatsThis::add(m_pluginListView, tr( "Check a checkbox to activate/deactivate a plugin or use the arrow buttons on the right to change the order they will appear in" )); 185 QWhatsThis::add(m_pluginListView, tr( "Check a checkbox to activate/deactivate a plugin or use the arrow buttons on the right to change the order they will appear in" ));
186 186
187 QVBox * pluginListVB = new QVBox(pluginListHB); 187 QVBox * pluginListVB = new QVBox(pluginListHB);
188 new ToolButton( pluginListVB, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) ); 188 new ToolButton( pluginListVB, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) );
189 new ToolButton( pluginListVB, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) ); 189 new ToolButton( pluginListVB, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) );
190 m_mainTW->addTab( m_pluginListWidget, "pass", tr( "plugins" ) ); 190 m_mainTW->addTab( m_pluginListWidget, "pass", tr( "plugins" ) );
191 191
192 connect ( m_pluginListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( pluginsChanged ( ) ) ); 192 connect ( m_pluginListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( pluginsChanged ( ) ) );
193 193
194 // general Opie multi-authentication configuration tab 194 // general Opie multi-authentication configuration tab
195 m_generalConfig = new MultiauthGeneralConfig(this, m_mainTW); 195 m_generalConfig = new MultiauthGeneralConfig(this, m_mainTW);
196 m_mainTW->addTab(m_generalConfig, "SettingsIcon", tr( "Authentication") ); 196 m_mainTW->addTab(m_generalConfig, "SettingsIcon", tr( "Authentication") );
197 197
198 } 198 }
199 // login settings page 199 // login settings page
200 m_loginWidget = new LoginBase(m_mainTW, "login config widget"); 200 m_loginWidget = new LoginBase(m_mainTW, "login config widget");
201 m_mainTW->addTab(m_loginWidget, "security/users", tr( "Login") ); 201 m_mainTW->addTab(m_loginWidget, "security/users", tr( "Login") );
202 202
203 // sync settings page 203 // sync settings page
204 m_syncWidget = new SyncBase( m_mainTW, "sync config widget" ); 204 m_syncWidget = new SyncBase( m_mainTW, "sync config widget" );
205 m_mainTW->addTab(m_syncWidget, "security/sync", tr( "Sync") ); 205 m_mainTW->addTab(m_syncWidget, "security/sync", tr( "Sync") );
@@ -329,97 +329,97 @@ void MultiauthConfig::readConfig()
329 329
330 pcfg->setGroup( "Plugins" ); 330 pcfg->setGroup( "Plugins" );
331 m_excludePlugins = pcfg->readListEntry( "ExcludePlugins", ',' ); 331 m_excludePlugins = pcfg->readListEntry( "ExcludePlugins", ',' );
332 m_allPlugins = pcfg->readListEntry( "AllPlugins", ',' ); 332 m_allPlugins = pcfg->readListEntry( "AllPlugins", ',' );
333 } 333 }
334 334
335 /* Login and Sync stuff */ 335 /* Login and Sync stuff */
336 pcfg->setGroup("Sync"); 336 pcfg->setGroup("Sync");
337 int auth_peer = pcfg->readNumEntry("auth_peer",0xc0a88100);//new default 192.168.129.0/24 337 int auth_peer = pcfg->readNumEntry("auth_peer",0xc0a88100);//new default 192.168.129.0/24
338 int auth_peer_bits = pcfg->readNumEntry("auth_peer_bits",24); 338 int auth_peer_bits = pcfg->readNumEntry("auth_peer_bits",24);
339 339
340 pcfg->setGroup("SyncMode"); 340 pcfg->setGroup("SyncMode");
341 int mode = pcfg->readNumEntry("Mode",2); // Default to Sharp 341 int mode = pcfg->readNumEntry("Mode",2); // Default to Sharp
342 switch( mode ) { 342 switch( mode ) {
343 case 0x01: 343 case 0x01:
344 m_syncWidget->syncModeCombo->setCurrentItem( 0 ); 344 m_syncWidget->syncModeCombo->setCurrentItem( 0 );
345 break; 345 break;
346 case 0x02: 346 case 0x02:
347 default: 347 default:
348 m_syncWidget->syncModeCombo->setCurrentItem( 1 ); 348 m_syncWidget->syncModeCombo->setCurrentItem( 1 );
349 break; 349 break;
350 case 0x04: 350 case 0x04:
351 m_syncWidget->syncModeCombo->setCurrentItem( 2 ); 351 m_syncWidget->syncModeCombo->setCurrentItem( 2 );
352 break; 352 break;
353 } 353 }
354 /* 354 /*
355 cfg.setGroup("Remote"); 355 cfg.setGroup("Remote");
356 if ( telnetAvailable() ) 356 if ( telnetAvailable() )
357 telnet->setChecked(cfg.readEntry("allow_telnet")); 357 telnet->setChecked(cfg.readEntry("allow_telnet"));
358 else 358 else
359 telnet->hide(); 359 telnet->hide();
360 360
361 if ( sshAvailable() ) 361 if ( sshAvailable() )
362 ssh->setChecked(cfg.readEntry("allow_ssh")); 362 ssh->setChecked(cfg.readEntry("allow_ssh"));
363 else 363 else
364 ssh->hide(); 364 ssh->hide();
365 */ 365 */
366 366
367 // release the Config handler 367 // release the Config handler
368 delete pcfg; 368 delete pcfg;
369 // indeed, selectNet will open the config file... 369 // indeed, selectNet will open the config file...
370 selectNet(auth_peer,auth_peer_bits,TRUE); 370 selectNet(auth_peer,auth_peer_bits,TRUE);
371 371
372 connect( m_syncWidget->syncnet, SIGNAL(textChanged(const QString&)), 372 connect( m_syncWidget->syncnet, SIGNAL(textChanged(const QString&)),
373 this, SLOT(setSyncNet(const QString&))); 373 this, SLOT(setSyncNet(const QString&)));
374 374
375 375
376 376
377 QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf"; 377 QString configFile = QPEApplication::qpeDir() + "etc/opie-login.conf";
378 Config loginCfg(configFile,Config::File); 378 Config loginCfg(configFile,Config::File);
379 379
380 loginCfg.setGroup("General"); 380 loginCfg.setGroup("General");
381 autoLoginName=loginCfg.readEntry("AutoLogin",""); 381 autoLoginName=loginCfg.readEntry("AutoLogin","");
382 382
383 if (autoLoginName.stripWhiteSpace().isEmpty()) { 383 if (autoLoginName.stripWhiteSpace().isEmpty()) {
384 autoLogin=false; 384 autoLogin=false;
385 } else { 385 } else {
386 autoLogin=true; 386 autoLogin=true;
387 } 387 }
388 388
389 389
390 connect(m_loginWidget->autologinToggle, SIGNAL(toggled(bool)), this, SLOT(toggleAutoLogin(bool))); 390 connect(m_loginWidget->autologinToggle, SIGNAL(toggled(bool)), this, SLOT(toggleAutoLogin(bool)));
391 connect(m_loginWidget->userlist, SIGNAL(activated(int)), this, SLOT(changeLoginName(int))); 391 connect(m_loginWidget->userlist, SIGNAL(activated(int)), this, SLOT(changeLoginName(int)));
392 connect(m_syncWidget->restoredefaults,SIGNAL(clicked()), this, SLOT(restoreDefaults())); 392 connect(m_syncWidget->restoredefaults,SIGNAL(clicked()), this, SLOT(restoreDefaults()));
393 connect(m_syncWidget->deleteentry,SIGNAL(clicked()), this, SLOT(deleteListEntry())); 393 connect(m_syncWidget->deleteentry,SIGNAL(clicked()), this, SLOT(deleteListEntry()));
394 394
395 loadUsers(); 395 loadUsers();
396 updateGUI(); 396 updateGUI();
397 397
398} 398}
399 399
400void MultiauthConfig::writeConfig() 400void MultiauthConfig::writeConfig()
401{ 401{
402 Config* pcfg = new Config("Security"); 402 Config* pcfg = new Config("Security");
403 403
404 if (m_pluginsInstalled) 404 if (m_pluginsInstalled)
405 { 405 {
406 pcfg->setGroup( "Plugins" ); 406 pcfg->setGroup( "Plugins" );
407 QStringList exclude; 407 QStringList exclude;
408 QStringList include; 408 QStringList include;
409 QStringList allPlugins; 409 QStringList allPlugins;
410 410
411 QListViewItemIterator list_it( m_pluginListView ); 411 QListViewItemIterator list_it( m_pluginListView );
412 412
413 // this makes sure the names get saved in the order selected 413 // this makes sure the names get saved in the order selected
414 for ( ; list_it.current(); ++list_it ) { 414 for ( ; list_it.current(); ++list_it ) {
415 QMap <QString, QCheckListItem *>::Iterator it; 415 QMap <QString, QCheckListItem *>::Iterator it;
416 for ( it = m_plugins.begin(); it != m_plugins. end (); ++it ) { 416 for ( it = m_plugins.begin(); it != m_plugins. end (); ++it ) {
417 if ( list_it.current() == (*it) && !(*it)-> isOn () ) { 417 if ( list_it.current() == (*it) && !(*it)-> isOn () ) {
418 exclude << it.key(); 418 exclude << it.key();
419 } else if ( list_it.current() == (*it) && (*it)-> isOn () ){ 419 } else if ( list_it.current() == (*it) && (*it)-> isOn () ){
420 include << it.key(); 420 include << it.key();
421 } 421 }
422 if ( list_it.current() == (*it) ) { 422 if ( list_it.current() == (*it) ) {
423 allPlugins << it.key(); 423 allPlugins << it.key();
424 } 424 }
425 } 425 }
@@ -444,117 +444,117 @@ void MultiauthConfig::writeConfig()
444 QString sn = m_syncWidget->syncnet->currentText(); 444 QString sn = m_syncWidget->syncnet->currentText();
445 parseNet(sn,auth_peer,auth_peer_bits); 445 parseNet(sn,auth_peer,auth_peer_bits);
446 446
447 //this is the *selected* (active) net range 447 //this is the *selected* (active) net range
448 pcfg->writeEntry("auth_peer",auth_peer); 448 pcfg->writeEntry("auth_peer",auth_peer);
449 pcfg->writeEntry("auth_peer_bits",auth_peer_bits); 449 pcfg->writeEntry("auth_peer_bits",auth_peer_bits);
450 450
451 //write back all other net ranges in *cleartext* 451 //write back all other net ranges in *cleartext*
452 for (int i=0; i<10; i++) { 452 for (int i=0; i<10; i++) {
453 QString target; 453 QString target;
454 target.sprintf("net%d", i); 454 target.sprintf("net%d", i);
455 if ( i < m_syncWidget->syncnet->count() ) 455 if ( i < m_syncWidget->syncnet->count() )
456 pcfg->writeEntry(target, m_syncWidget->syncnet->text(i)); 456 pcfg->writeEntry(target, m_syncWidget->syncnet->text(i));
457 else // no more entry in the syncnet list -> we clear the line 457 else // no more entry in the syncnet list -> we clear the line
458 pcfg->writeEntry(target, ""); 458 pcfg->writeEntry(target, "");
459 } 459 }
460 460
461#ifdef ODP 461#ifdef ODP
462#error "Use 0,1,2 and use Launcher" 462#error "Use 0,1,2 and use Launcher"
463#endif 463#endif
464 /* keep the old code so we don't use currentItem directly */ 464 /* keep the old code so we don't use currentItem directly */
465 int value = 0x02; 465 int value = 0x02;
466 switch( m_syncWidget->syncModeCombo->currentItem() ) { 466 switch( m_syncWidget->syncModeCombo->currentItem() ) {
467 case 0: 467 case 0:
468 value = 0x01; 468 value = 0x01;
469 break; 469 break;
470 case 1: 470 case 1:
471 value = 0x02; 471 value = 0x02;
472 break; 472 break;
473 case 2: 473 case 2:
474 value = 0x04; 474 value = 0x04;
475 break; 475 break;
476 } 476 }
477 pcfg->setGroup("SyncMode"); 477 pcfg->setGroup("SyncMode");
478 pcfg->writeEntry( "Mode", value ); 478 pcfg->writeEntry( "Mode", value );
479 479
480 /* 480 /*
481 pcfg->setGroup("Remote"); 481 pcfg->setGroup("Remote");
482 if ( telnetAvailable() ) 482 if ( telnetAvailable() )
483 pcfg->writeEntry("allow_telnet",telnet->isChecked()); 483 pcfg->writeEntry("allow_telnet",telnet->isChecked());
484 if ( sshAvailable() ) 484 if ( sshAvailable() )
485 pcfg->writeEntry("allow_ssh",ssh->isChecked()); 485 pcfg->writeEntry("allow_ssh",ssh->isChecked());
486 // ### write ssh/telnet sys config files 486 // ### write ssh/telnet sys config files
487 */ 487 */
488 488
489 //release the Config handler 489 //release the Config handler
490 delete pcfg; 490 delete pcfg;
491 491
492 QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf"; 492 QString configFile = QPEApplication::qpeDir() + "etc/opie-login.conf";
493 Config loginCfg(configFile,Config::File); 493 Config loginCfg(configFile,Config::File);
494 loginCfg.setGroup("General"); 494 loginCfg.setGroup("General");
495 495
496 if (autoLogin) { 496 if (autoLogin) {
497 loginCfg.writeEntry("AutoLogin",autoLoginName); 497 loginCfg.writeEntry("AutoLogin",autoLoginName);
498 } else { 498 } else {
499 loginCfg.removeEntry("AutoLogin"); 499 loginCfg.removeEntry("AutoLogin");
500 } 500 }
501 501
502} 502}
503 503
504/// slot used to record the fact plugins order has been modified 504/// slot used to record the fact plugins order has been modified
505void MultiauthConfig::pluginsChanged() { 505void MultiauthConfig::pluginsChanged() {
506 m_plugins_changed = true; 506 m_plugins_changed = true;
507} 507}
508 508
509/// loads each multiauth plugin 509/// loads each multiauth plugin
510void MultiauthConfig::loadPlugins() { 510void MultiauthConfig::loadPlugins() {
511 511
512 QString path = QPEApplication::qpeDir() + "/plugins/security"; 512 QString path = QPEApplication::qpeDir() + "plugins/security";
513 QDir dir( path, "lib*.so" ); 513 QDir dir( path, "lib*.so" );
514 514
515 QStringList list = dir.entryList(); 515 QStringList list = dir.entryList();
516 QStringList::Iterator it; 516 QStringList::Iterator it;
517 517
518 // temporary list used to sort plugins 518 // temporary list used to sort plugins
519 QMap<QString, MultiauthPlugin> sortList; 519 QMap<QString, MultiauthPlugin> sortList;
520 520
521 for ( it = list.begin(); it != list.end(); ++it ) { 521 for ( it = list.begin(); it != list.end(); ++it ) {
522 QInterfacePtr<MultiauthPluginInterface> iface; 522 QInterfacePtr<MultiauthPluginInterface> iface;
523 QLibrary *lib = new QLibrary( path + "/" + *it ); 523 QLibrary *lib = new QLibrary( path + "/" + *it );
524 QString libPath(path + "/" + *it); 524 QString libPath(path + "/" + *it);
525 525
526 if ( lib->queryInterface( IID_MultiauthPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { 526 if ( lib->queryInterface( IID_MultiauthPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) {
527 MultiauthPlugin plugin; 527 MultiauthPlugin plugin;
528 plugin.library = lib; 528 plugin.library = lib;
529 plugin.iface = iface; 529 plugin.iface = iface;
530 plugin.name = QString(*it); 530 plugin.name = QString(*it);
531 531
532 // find out if plugins should be launched 532 // find out if plugins should be launched
533 if ( m_excludePlugins.grep( *it ).isEmpty() ) { 533 if ( m_excludePlugins.grep( *it ).isEmpty() ) {
534 plugin.active = true; 534 plugin.active = true;
535 } else { 535 } else {
536 plugin.active = false; 536 plugin.active = false;
537 } 537 }
538 538
539 plugin.pluginObject = plugin.iface->plugin(); 539 plugin.pluginObject = plugin.iface->plugin();
540 540
541 // "prebuffer" it in one more list, to get the sorting done 541 // "prebuffer" it in one more list, to get the sorting done
542 sortList.insert( plugin.name, plugin ); 542 sortList.insert( plugin.name, plugin );
543 543
544 // on first start the list is off course empty 544 // on first start the list is off course empty
545 if ( m_allPlugins.isEmpty() ) { 545 if ( m_allPlugins.isEmpty() ) {
546 pluginList.append( plugin ); 546 pluginList.append( plugin );
547 } 547 }
548 // if plugin is not yet in the list, add it to the layout too 548 // if plugin is not yet in the list, add it to the layout too
549 else if ( !m_allPlugins.contains( plugin.name ) ) { 549 else if ( !m_allPlugins.contains( plugin.name ) ) {
550 pluginList.append( plugin ); 550 pluginList.append( plugin );
551 } 551 }
552 552
553 } else { 553 } else {
554 delete lib; 554 delete lib;
555 } 555 }
556 556
557 } // end for 557 } // end for
558 558
559 // put m_allPlugins tempPlugin objects into pluginList 559 // put m_allPlugins tempPlugin objects into pluginList
560 if ( !m_allPlugins.isEmpty() ) { 560 if ( !m_allPlugins.isEmpty() ) {
diff --git a/core/tools/quicklauncher/dropins.h b/core/tools/quicklauncher/dropins.h
index a9664f8..df364ce 100644
--- a/core/tools/quicklauncher/dropins.h
+++ b/core/tools/quicklauncher/dropins.h
@@ -1,71 +1,71 @@
1/* OPIE */ 1/* OPIE */
2#include <opie2/owait.h> 2#include <opie2/owait.h>
3using namespace Opie::Ui; 3using namespace Opie::Ui;
4 4
5#include <qtopia/qcom.h> 5#include <qtopia/qcom.h>
6#include <qtopia/qlibrary.h> 6#include <qtopia/qlibrary.h>
7#include <qtopia/qpeapplication.h> 7#include <qtopia/qpeapplication.h>
8#include <qtopia/applicationinterface.h> 8#include <qtopia/applicationinterface.h>
9#include <qtopia/resource.h> 9#include <qtopia/resource.h>
10 10
11/* QT */ 11/* QT */
12#include <qmetaobject.h> 12#include <qmetaobject.h>
13#include <qmap.h> 13#include <qmap.h>
14#include <qstring.h> 14#include <qstring.h>
15 15
16namespace QuickPrivate { 16namespace QuickPrivate {
17 17
18 struct PluginLoader { 18 struct PluginLoader {
19 PluginLoader( const char* ) { 19 PluginLoader( const char* ) {
20 } 20 }
21 21
22 QRESULT queryInterface( const QString& app, const QUuid&, QUnknownInterface** ); 22 QRESULT queryInterface( const QString& app, const QUuid&, QUnknownInterface** );
23 void releaseInterface( QUnknownInterface* ); 23 void releaseInterface( QUnknownInterface* );
24 QMap<QUnknownInterface*, QLibrary*> libs; 24 QMap<QUnknownInterface*, QLibrary*> libs;
25 }; 25 };
26 26
27 /* 27 /*
28 * We can skip installing a Translator here because Opies QPEApplication 28 * We can skip installing a Translator here because Opies QPEApplication
29 * will do that in initApp for us as well 29 * will do that in initApp for us as well
30 */ 30 */
31 QRESULT PluginLoader::queryInterface( const QString& libFile, const QUuid& uuid, QUnknownInterface** iface ) { 31 QRESULT PluginLoader::queryInterface( const QString& libFile, const QUuid& uuid, QUnknownInterface** iface ) {
32 QRESULT res = QS_FALSE; 32 QRESULT res = QS_FALSE;
33 *iface = 0; 33 *iface = 0;
34 34
35 // This code is very platform specific.. We should find better 35 // This code is very platform specific.. We should find better
36 // solutions to handle names.. Maybe one central function would be 36 // solutions to handle names.. Maybe one central function would be
37 // better than checking this ".so" stuff all around in the sources.. 37 // better than checking this ".so" stuff all around in the sources..
38 // (eilers) 38 // (eilers)
39 39
40 // Below lines from TT then mine again 40 // Below lines from TT then mine again
41 QString name = libFile; 41 QString name = libFile;
42 if ( libFile.findRev(".so") == (int)libFile.length()-3 ) { 42 if ( libFile.findRev(".so") == (int)libFile.length()-3 ) {
43 name = libFile.left( libFile.length()-3 ); 43 name = libFile.left( libFile.length()-3 );
44 if ( name.find( "lib" ) == 0 ) 44 if ( name.find( "lib" ) == 0 )
45 name = name.mid( 3 ); 45 name = name.mid( 3 );
46 } 46 }
47#ifdef Q_OS_MACX 47#ifdef Q_OS_MACX
48 QString path = QPEApplication::qpeDir() + "/plugins/application/lib"+name+".dylib"; 48 QString path = QPEApplication::qpeDir() + "plugins/application/lib"+name+".dylib";
49#else 49#else
50 QString path = QPEApplication::qpeDir() + "/plugins/application/lib"+name+".so"; 50 QString path = QPEApplication::qpeDir() + "plugins/application/lib"+name+".so";
51#endif 51#endif
52 52
53 QLibrary *lib = new QLibrary( path ); 53 QLibrary *lib = new QLibrary( path );
54 if ( lib->queryInterface( uuid, iface ) == QS_OK && iface ) { 54 if ( lib->queryInterface( uuid, iface ) == QS_OK && iface ) {
55 libs.insert( *iface, lib ); 55 libs.insert( *iface, lib );
56 res = QS_OK; 56 res = QS_OK;
57 } 57 }
58 58
59 return res; 59 return res;
60 } 60 }
61 61
62 void PluginLoader::releaseInterface( QUnknownInterface* iface ) { 62 void PluginLoader::releaseInterface( QUnknownInterface* iface ) {
63 if ( libs.contains( iface ) ) { 63 if ( libs.contains( iface ) ) {
64 iface->release(); 64 iface->release();
65 delete libs[iface]; 65 delete libs[iface];
66 libs.remove( iface ); // we only handle pointers so even if the object is not valid the address-space is 66 libs.remove( iface ); // we only handle pointers so even if the object is not valid the address-space is
67 } 67 }
68 } 68 }
69 69
70} 70}
71 71