summaryrefslogtreecommitdiff
path: root/core
Side-by-side diff
Diffstat (limited to 'core') (more/less context) (show 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("
show();
}
void Multikey::mousePressEvent(QMouseEvent *ev)
{
if (!sw_maps.count())
return;
if (ev->button() == RightButton) {
QPoint p = mapToGlobal(QPoint(0, 0));
QSize s = popupMenu.sizeHint();
int opt = popupMenu.exec(QPoint(p.x() + (width() / 2) - (s.width() / 2),
p.y() - s.height()), 0);
if (opt == -1)
return;
lang = opt;
QCopEnvelope e("MultiKey/Keyboard", "setmultikey(QString)");
e << sw_maps[lang];
setText(labels[lang]);
}
QWidget::mousePressEvent(ev);
}
void Multikey::mouseReleaseEvent(QMouseEvent *ev)
{
if (!sw_maps.count())
return;
lang = lang < sw_maps.count()-1 ? lang+1 : 0;
QCopEnvelope e("MultiKey/Keyboard", "setmultikey(QString)");
//odebug << "Lang=" << lang << ", count=" << sw_maps.count() << ", lab=" << labels[lang].ascii() << "" << oendl;
e << sw_maps[lang];
setText(labels[lang]);
}
void Multikey::message(const QCString &message, const QByteArray &data)
{
if ( message == "setsw(QString,QString)" ) {
QDataStream stream(data, IO_ReadOnly);
QString maps, current_map;
stream >> maps >> current_map;
QStringList sw = QStringList::split(QChar('|'), maps);
sw.append(current_map);
- QDir map_dir(QPEApplication::qpeDir() + "/share/multikey/", "*.keymap");
+ QDir map_dir(QPEApplication::qpeDir() + "share/multikey/", "*.keymap");
lang = 0;
labels.clear();
sw_maps.clear();
popupMenu.clear();
for (uint i = 0; i < sw.count(); ++i) {
QString keymap_map;
if (sw[i][0] != '/') {
keymap_map = map_dir.absPath() + "/" + sw[i];
} else {
if ((map_dir.exists(QFileInfo(sw[i]).fileName(), false)
&& i != sw.count()-1) || !QFile::exists(sw[i])) {
continue;
}
keymap_map = sw[i];
}
QFile map(keymap_map);
if (map.open(IO_ReadOnly)) {
QString line;
map.readLine(line, 1024);
while (!map.atEnd()) {
if (line.find(QRegExp("^sw\\s*=\\s*")) != -1) {
if (i != sw.count()-1) {
if (keymap_map == current_map) {
lang = i;
}
sw_maps.append(keymap_map);
labels.append(line.right(line.length() - line.find(QChar('=')) - 1).stripWhiteSpace());
popupMenu.insertItem(labels[labels.count()-1], labels.count()-1);
} else {
current = line.right(line.length() - line.find(QChar('=')) - 1).stripWhiteSpace();
}
break;
}
map.readLine(line, 1024);
}
map.close();
}
}
setText(current);
}
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 @@
/* OPIE */
#include <oappinterface.h>
#include <oappplugin.h>
#include <opie2/odebug.h>
#include <opie2/otabwidget.h>
#include <qpe/qpeapplication.h>
#include <qpe/qlibrary.h>
using namespace Opie::Core;
using namespace Opie::Ui;
/* QT */
#include <qdir.h>
int main( int argc, char **argv )
{
QPEApplication a( argc, argv );
OTabWidget *tabwidget = new OTabWidget(0, "tab widget");
- QString path = QPEApplication::qpeDir() + "/plugins/app";
+ QString path = QPEApplication::qpeDir() + "plugins/app";
QDir dir( path, "lib*.so" );
QStringList list = dir.entryList();
QStringList::Iterator it;
QInterfacePtr<OAppInterface> iface;
for ( it = list.begin(); it != list.end(); ++it ) {
QLibrary *lib = new QLibrary( path + "/" + *it );
odebug << "querying: " << QString( path + "/" + *it ) << "" << oendl;
if ( lib->queryInterface( IID_OAppInterface, (QUnknownInterface**)&iface ) == QS_OK ) {
odebug << "accepted: " << QString( path + "/" + *it ) << "" << oendl;
QList<QWidget> list = iface->widgets();
QWidget *widget;
for ( widget = list.first(); widget != 0; widget = list.next() )
tabwidget->addTab(widget, QString(*it), QString(*it));
QString lang = getenv( "LANG" );
if (lang.isNull())
lang = "en";
QTranslator *trans = new QTranslator(qApp);
QString type = (*it).left( (*it).find(".") );
if (type.left(3) == "lib")
type = type.mid(3);
type = type.right( type.find("lib") );
- QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm";
+ QString tfn = QPEApplication::qpeDir()+"i18n/"+lang+"/"+type+".qm";
if ( trans->load( tfn ))
qApp->installTranslator( trans );
else
delete trans;
}
}
a.showMainDocumentWidget(tabwidget);
return a.exec();
}
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)
{
int i = 0;
QValueList<InputMethod>::Iterator it;
InputMethod *im = 0;
for ( it = inputMethodList.begin(); it != inputMethodList.end(); ++it, i++ ) {
QString lname = (*it).libName.mid((*it).libName.findRev('/') + 1);
if ( (*it).name() == name || lname == name ) {
im = &(*it);
break;
}
}
if ( im )
chooseKeyboard(im);
}
void InputMethods::resetStates()
{
if ( mkeyboard && !mkeyboard->newIM )
mkeyboard->interface->resetState();
}
QRect InputMethods::inputRect() const
{
if ( !mkeyboard || !mkeyboard->widget || !mkeyboard->widget->isVisible() )
return QRect();
else
return mkeyboard->widget->geometry();
}
void InputMethods::unloadInputMethods()
{
unloadMethod( inputMethodList );
unloadMethod( inputModifierList );
inputMethodList.clear();
inputModifierList.clear();
}
void InputMethods::unloadMethod( QValueList<InputMethod>& list ) {
QValueList<InputMethod>::Iterator it;
for (it = list.begin(); it != list.end(); ++it )
(*it).releaseInterface();
}
QStringList InputMethods::plugins()const {
- QString path = QPEApplication::qpeDir() + "/plugins/inputmethods";
+ QString path = QPEApplication::qpeDir() + "plugins/inputmethods";
#ifdef Q_OS_MACX
QDir dir( path, "lib*.dylib" );
#else
QDir dir( path, "lib*.so" );
#endif /* Q_OS_MACX */
return dir.entryList();
}
void InputMethods::installTranslator( const QString& type ) {
QStringList langs = Global::languageList();
QStringList::ConstIterator lit;
for ( lit= langs.begin(); lit!=langs.end(); ++lit) {
QString lang = *lit;
QTranslator * trans = new QTranslator(qApp);
- QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm";
+ QString tfn = QPEApplication::qpeDir()+"i18n/"+lang+"/"+type+".qm";
if ( trans->load( tfn ))
qApp->installTranslator( trans );
else
delete trans;
}
}
void InputMethods::setPreferedHandlers() {
Config cfg("qpe");
cfg.setGroup("InputMethod");
QString current = cfg.readEntry("current");
QString im = cfg.readEntry("im");
QValueList<InputMethod>::Iterator it;
if (!inputModifierList.isEmpty() && !im.isEmpty() ) {
for (it = inputModifierList.begin(); it != inputModifierList.end(); ++it )
if ( (*it).name() == im ) {
imethod = &(*it); break;
}
}
if (!inputMethodList.isEmpty() && !current.isEmpty() ) {
for (it = inputMethodList.begin(); it != inputMethodList.end(); ++it )
if ( (*it).name() == current ) {
owarn << "preferred keyboard is " << current << "" << oendl;
mkeyboard = &(*it);
kbdButton->setPixmap( *mkeyboard->icon() );
break;
}
}
}
void InputMethods::loadInputMethods()
{
#ifndef QT_NO_COMPONENT
hideInputMethod();
mkeyboard = 0;
unloadInputMethods();
- QString path = QPEApplication::qpeDir() + "/plugins/inputmethods";
+ QString path = QPEApplication::qpeDir() + "plugins/inputmethods";
QStringList list = plugins();
QStringList::Iterator it;
for ( it = list.begin(); it != list.end(); ++it ) {
InputMethodInterface *iface = 0;
ExtInputMethodInterface *eface = 0;
QLibrary *lib = new QLibrary( path + "/" + *it );
if ( lib->queryInterface( IID_InputMethod, (QUnknownInterface**)&iface ) == QS_OK ) {
InputMethod input;
input.newIM = FALSE;
input.library = lib;
input.libName = *it;
input.interface = iface;
input.widget = input.interface->inputMethod( 0, inputWidgetStyle );
input.interface->onKeyPress( this, SLOT(sendKey(ushort,ushort,ushort,bool,bool)) );
inputMethodList.append( input );
} else if ( lib->queryInterface( IID_ExtInputMethod, (QUnknownInterface**)&eface ) == QS_OK ) {
InputMethod input;
input.newIM = TRUE;
input.library = lib;
input.libName = *it;
input.extInterface = eface;
input.widget = input.extInterface->keyboardWidget( 0, inputWidgetStyle );
// may be either a simple, or advanced.
if (input.widget) {
//odebug << "its a keyboard" << oendl;
inputMethodList.append( input );
} else {
//odebug << "its a real im" << oendl;
input.widget = input.extInterface->statusWidget( 0, 0 );
if (input.widget) {
//odebug << "blah" << oendl;
inputModifierList.append( input );
imButton->addWidget(input.widget, inputModifierList.count());
}
}
}else{
delete lib;
lib = 0l;
}
installTranslator( (*it).left( (*it).find(".") ) );
}
qHeapSort( inputMethodList );
#endif /* killed BUILT in cause they would not compile */
QWSServer::setCurrentInputMethod( 0 );
/* 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 @@
/**********************************************************************
** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
** This file is part of the Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "irserver.h"
#include "obexinterface.h"
/* OPIE */
#include <opie2/odebug.h>
#include <qtopia/qlibrary.h>
#include <qtopia/qpeapplication.h>
/* QT */
#include <qdir.h>
IrServer::IrServer( QObject *parent, const char *name )
: QObject( parent, name ), obexIface(0)
{
lib = 0;
obexIface = 0;
- QString path = QPEApplication::qpeDir() + "/plugins/obex/";
+ QString path = QPEApplication::qpeDir() + "plugins/obex/";
#ifdef Q_OS_MACX
QDir dir( path, "lib*.dylib" );
#else
QDir dir( path, "lib*.so" );
#endif /* Q_OS_MACX */
QStringList list = dir.entryList();
QStringList::Iterator it;
for ( it = list.begin(); it != list.end(); ++it ) {
QLibrary *trylib = new QLibrary( path + *it );
//odebug << "trying lib " << (path + (*it)) << "" << oendl;
if ( trylib->queryInterface( IID_ObexInterface, (QUnknownInterface**)&obexIface ) == QS_OK ) {
lib = trylib;
//odebug << "found obex lib" << oendl;
QString lang = getenv( "LANG" );
QTranslator * trans = new QTranslator(qApp);
QString type = (*it).left( (*it).find(".") );
- QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm";
+ QString tfn = QPEApplication::qpeDir()+"i18n/"+lang+"/"+type+".qm";
//odebug << "tr fpr obex: " << tfn << "" << oendl;
if ( trans->load( tfn ))
qApp->installTranslator( trans );
else
delete trans;
break;
} else {
delete lib;
}
}
if ( !lib )
odebug << "could not load IR plugin" << oendl;
}
IrServer::~IrServer()
{
if ( obexIface )
obexIface->release();
delete lib;
}
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()
static int compareAppletPositions(const void *b, const void *a)
{
const MenuApplet* aa = *(const MenuApplet**)a;
const MenuApplet* ab = *(const MenuApplet**)b;
int d = aa->iface->position() - ab->iface->position();
if ( d ) return d;
return QString::compare(aa->library->library(),ab->library->library());
}
void StartMenu::clearApplets()
{
if ( launchMenu )
launchMenu-> hide();
for ( QIntDictIterator<MenuApplet> it( menuApplets ); it.current(); ++it ) {
MenuApplet *applet = it.current();
if ( launchMenu ) {
launchMenu->removeItem( applet-> id );
delete applet->popup;
}
applet->iface->release();
applet->library->unload();
delete applet-> library;
}
menuApplets.clear();
}
void StartMenu::loadApplets()
{
Config cfg( "StartMenu" );
cfg.setGroup( "Applets" );
// SafeMode causes too much problems, so we disable it for now --
// maybe we should reenable it for OPIE 1.0 - sandman 26.09.02
// removed in the remerge PluginManager could handle it
// we don't currently use it -zecke
QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' );
QString lang = getenv( "LANG" );
- QString path = QPEApplication::qpeDir() + "/plugins/applets";
+ QString path = QPEApplication::qpeDir() + "plugins/applets";
QDir dir( path, "lib*.so" );
QStringList list = dir.entryList();
QStringList::Iterator it;
int napplets = 0;
MenuApplet* *xapplets = new MenuApplet*[list.count()];
for ( it = list.begin(); it != list.end(); ++it ) {
if ( exclude.find( *it ) != exclude.end() )
continue;
MenuAppletInterface *iface = 0;
QLibrary *lib = new QLibrary( path + "/" + *it );
if (( lib->queryInterface( IID_MenuApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) {
MenuApplet *applet = new MenuApplet;
xapplets[napplets++] = applet;
applet->library = lib;
applet->iface = iface;
QTranslator *trans = new QTranslator(qApp);
QString type = (*it).left( (*it).find(".") );
- QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm";
+ QString tfn = QPEApplication::qpeDir()+"i18n/"+lang+"/"+type+".qm";
if ( trans->load( tfn ))
qApp->installTranslator( trans );
else
delete trans;
} else {
exclude += *it;
delete lib;
}
}
cfg.writeEntry( "ExcludeApplets", exclude, ',' );
qsort(xapplets, napplets, sizeof(menuApplets[0]), compareAppletPositions);
while ( napplets-- ) {
MenuApplet *applet = xapplets[napplets];
applet->popup = applet->iface->popup( this );
// menuApplets got an id < -1
menuApplets.insert( -( currentItem + 2 ), new MenuApplet( *applet ) );
currentItem++;
}
delete [] xapplets;
addApplets( launchMenu );
}
/*
* Launcher calls loadMenu too often fix that
*/
void StartMenu::addApplets(QPopupMenu* pop) {
QIntDict<MenuApplet> dict;
if( pop-> count ( ))
pop-> insertSeparator ( );
for ( QIntDictIterator<MenuApplet> it( menuApplets ); it.current(); ++it ) {
MenuApplet *applet = it.current();
if ( applet->popup )
applet->id = pop->insertItem( applet->iface->icon(),
applet->iface->text(), applet->popup );
else
applet->id = pop->insertItem( applet->iface->icon(),
applet->iface->text() );
dict.insert( applet->id, new MenuApplet( *applet ) );
}
/* 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)
int d = ab->iface->position() - aa->iface->position();
if ( d ) return d;
return QString::compare(ab->name,aa->name);
}
void SysTray::loadApplets()
{
hide();
clearApplets();
addApplets();
}
void SysTray::clearApplets()
{
#ifndef QT_NO_COMPONENTS
/*
* Note on clearing. SOme applets delete their
* applets themselves some don't do it
* and on restart this can crash. If we delete it
* here we might end up in a double deletion. We could
* use QGuardedPtr but that would be one QOBject
* for every applet more but only useful for restart
*/
QValueList<TaskbarApplet>::Iterator mit;
for ( mit = appletList.begin(); mit != appletList.end(); ++mit ) {
(*mit).iface->release();
(*mit).library->unload();
delete (*mit).library;
}
#endif
appletList.clear();
if ( layout )
delete layout;
layout = new QHBoxLayout( this, 0, 1 );
layout->setAutoAdd(TRUE);
}
void SysTray::addApplets()
{
hide();
#ifndef QT_NO_COMPONENTS
Config cfg( "Taskbar" );
cfg.setGroup( "Applets" );
QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' );
QString lang = getenv( "LANG" );
- QString path = QPEApplication::qpeDir() + "/plugins/applets";
+ QString path = QPEApplication::qpeDir() + "plugins/applets";
#ifdef Q_OS_MACX
QDir dir( path, "lib*.dylib" );
#else
QDir dir( path, "lib*.so" );
#endif /* Q_OS_MACX */
QStringList list = dir.entryList();
QStringList::Iterator it;
int napplets=0;
TaskbarApplet* *applets = new TaskbarApplet*[list.count()];
for ( it = list.begin(); it != list.end(); ++it ) {
if ( exclude.find( *it ) != exclude.end() )
continue;
owarn << "Found Applet: " << (*it) << "" << oendl;
TaskbarAppletInterface *iface = 0;
QLibrary *lib = new QLibrary( path + "/" + *it );
if (( lib->queryInterface( IID_TaskbarApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) {
TaskbarApplet *applet = new TaskbarApplet;
applets[napplets++] = applet;
applet->library = lib;
applet->iface = iface;
QTranslator *trans = new QTranslator(qApp);
QString type = (*it).left( (*it).find(".") );
- QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm";
+ QString tfn = QPEApplication::qpeDir()+"i18n/"+lang+"/"+type+".qm";
if ( trans->load( tfn ))
qApp->installTranslator( trans );
else
delete trans;
} else {
exclude += *it;
delete lib;
}
}
cfg.writeEntry( "ExcludeApplets", exclude, ',' );
qsort(applets,napplets,sizeof(applets[0]),compareAppletPositions);
while (napplets--) {
TaskbarApplet *applet = applets[napplets];
applet->applet = applet->iface->applet( this );
appletList.append(*applet);
}
delete [] applets;
#else /* ## FIXME single app */
TaskbarApplet * const applet = new TaskbarApplet();
applet->iface = new ClockAppletImpl();
applet->applet = applet->iface->applet( this );
appletList.append( applet );
#endif
show();
}
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 {
static QValueList<MediaPlayerPlugin> pluginList;
// Find the first decoder which supports this type of file
MediaPlayerDecoder *MediaPlayerState::newDecoder( const QString& file ) {
MediaPlayerDecoder *tmpDecoder = NULL;
QValueList<MediaPlayerPlugin>::Iterator it;
for ( it = pluginList.begin(); it != pluginList.end(); ++it ) {
if ( (*it).decoder->isFileSupported( file ) ) {
tmpDecoder = (*it).decoder;
break;
}
}
if(file.left(4)=="http")
isStreaming = TRUE;
else
isStreaming = FALSE;
return decoder = tmpDecoder;
}
MediaPlayerDecoder *MediaPlayerState::curDecoder() {
return decoder;
}
// ### hack to get true sample count
MediaPlayerDecoder *MediaPlayerState::libMpeg3Decoder() {
return libmpeg3decoder;
}
// ### hack to get true sample count
// MediaPlayerDecoder *MediaPlayerState::libWavDecoder() {
// return libwavdecoder;
// }
void MediaPlayerState::loadPlugins() {
// odebug << "load plugins" << oendl;
#ifndef QT_NO_COMPONENT
QValueList<MediaPlayerPlugin>::Iterator mit;
for ( mit = pluginList.begin(); mit != pluginList.end(); ++mit ) {
(*mit).iface->release();
(*mit).library->unload();
delete (*mit).library;
}
pluginList.clear();
- QString path = QPEApplication::qpeDir() + "/plugins/codecs";
+ QString path = QPEApplication::qpeDir() + "plugins/codecs";
QDir dir( path, "lib*.so" );
QStringList list = dir.entryList();
QStringList::Iterator it;
for ( it = list.begin(); it != list.end(); ++it ) {
MediaPlayerPluginInterface *iface = 0;
QLibrary *lib = new QLibrary( path + "/" + *it );
// odebug << "querying: " << QString( path + "/" + *it ) << "" << oendl;
if ( lib->queryInterface( IID_MediaPlayerPlugin, (QUnknownInterface**)&iface ) == QS_OK ) {
// odebug << "loading: " << QString( path + "/" + *it ) << "" << oendl;
MediaPlayerPlugin plugin;
plugin.library = lib;
plugin.iface = iface;
plugin.decoder = plugin.iface->decoder();
plugin.encoder = plugin.iface->encoder();
pluginList.append( plugin );
// ### hack to get true sample count
if ( plugin.decoder->pluginName() == QString("LibMpeg3Plugin") )
libmpeg3decoder = plugin.decoder;
} else {
delete lib;
}
}
#else
pluginList.clear();
MediaPlayerPlugin plugin0;
plugin0.iface = new LibMpeg3PluginImpl;
plugin0.decoder = plugin0.iface->decoder();
plugin0.encoder = plugin0.iface->encoder();
pluginList.append( plugin0 );
MediaPlayerPlugin plugin1;
plugin1.iface = new LibMadPluginImpl;
plugin1.decoder = plugin1.iface->decoder();
plugin1.encoder = plugin1.iface->encoder();
pluginList.append( plugin1 );
MediaPlayerPlugin plugin2;
plugin2.iface = new WavPluginImpl;
plugin2.decoder = plugin2.iface->decoder();
plugin2.encoder = plugin2.iface->encoder();
pluginList.append( plugin2 );
#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 *)
// case Key_R: //remove from playlist
// removeSelected();
// break;
// case Key_P: //play
// odebug << "Play" << oendl;
// playSelected();
// break;
// case Key_Space:
// odebug << "Play" << oendl;
// playSelected();
// break;
// }
}
void PlayListWidget::doBlank() {
// odebug << "do blanking" << oendl;
#ifdef QT_QWS_DEVFS
fd=open("/dev/fb/0",O_RDWR);
#else
fd=open("/dev/fb0",O_RDWR);
#endif
if (fd != -1) {
ioctl(fd,FBIOBLANK,1);
// close(fd);
}
}
void PlayListWidget::doUnblank() {
// this crashes opieplayer with a segfault
// int fd;
// fd=open("/dev/fb0",O_RDWR);
// odebug << "do unblanking" << oendl;
if (fd != -1) {
ioctl(fd,FBIOBLANK,0);
close(fd);
}
QCopEnvelope h("QPE/System", "setBacklight(int)");
h <<-3;// v[1]; // -3 Force on
}
void PlayListWidget::populateSkinsMenu() {
int item = 0;
defaultSkinIndex = 0;
QString skinName;
Config cfg( "OpiePlayer" );
cfg.setGroup("Options" );
QString skin = cfg.readEntry( "Skin", "default" );
- QDir skinsDir( QPEApplication::qpeDir() + "/pics/opieplayer2/skins" );
+ QDir skinsDir( QPEApplication::qpeDir() + "pics/opieplayer2/skins" );
skinsDir.setFilter( QDir::Dirs );
skinsDir.setSorting(QDir::Name );
const QFileInfoList *skinslist = skinsDir.entryInfoList();
QFileInfoListIterator it( *skinslist );
QFileInfo *fi;
while ( ( fi = it.current() ) ) {
skinName = fi->fileName();
// odebug << fi->fileName() << oendl;
if( skinName != "." && skinName != ".." && skinName !="CVS" ) {
item = skinsMenu->insertItem( fi->fileName() ) ;
}
if( skinName == "default" ) {
defaultSkinIndex = item;
}
if( skinName == skin ) {
skinsMenu->setItemChecked( item, TRUE );
}
++it;
}
}
void PlayListWidget::skinsMenuActivated( int item ) {
for( int i = defaultSkinIndex; i > defaultSkinIndex - static_cast<int>(skinsMenu->count()); i-- ) {
skinsMenu->setItemChecked( i, FALSE );
}
skinsMenu->setItemChecked( item, TRUE );
Config cfg( "OpiePlayer" );
cfg.setGroup("Options");
cfg.writeEntry("Skin", skinsMenu->text( item ) );
}
void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) {
// odebug << "qcop message "+msg << oendl;
QDataStream stream ( data, IO_ReadOnly );
if ( msg == "play()" ) { //plays current selection
btnPlay( true);
} else if ( msg == "stop()" ) {
mediaPlayerState->setPlaying( false);
} else if ( msg == "togglePause()" ) {
mediaPlayerState->togglePaused();
} else if ( msg == "next()" ) { //select next in lis
mediaPlayerState->setNext();
} else if ( msg == "prev()" ) { //select previous in list
mediaPlayerState->setPrev();
} else if ( msg == "toggleLooping()" ) { //loop or not loop
mediaPlayerState->toggleLooping();
} 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 {
// int controlType;
};
// Layout information for the videoButtons (and if it is a toggle button or not)
MediaButton videoButtons[] = {
{ FALSE, FALSE, FALSE }, // stop
{ FALSE, FALSE, FALSE }, // play
{ FALSE, FALSE, FALSE }, // previous
{ FALSE, FALSE, FALSE }, // next
{ FALSE, FALSE, FALSE }, // volUp
{ FALSE, FALSE, FALSE }, // volDown
{ TRUE, FALSE, FALSE } // fullscreen
};
//static const int numButtons = (sizeof(videoButtons)/sizeof(MediaButton));
const char *skinV_mask_file_names[7] = {
"stop","play","back","fwd","up","down","full"
};
static const int numVButtons = (sizeof(videoButtons)/sizeof(MediaButton));
VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) :
QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 )
{
setCaption( tr("OpiePlayer") );
Config cfg("OpiePlayer");
cfg.setGroup("Options");
skin = cfg.readEntry("Skin","default");
QString skinPath;
skinPath = "opieplayer2/skins/" + skin;
if(!QDir(QString(getenv("OPIEDIR")) +"/pics/"+skinPath).exists())
skinPath = "opieplayer2/skins/default";
// QString skinPath = "opieplayer2/skins/" + skin;
pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) );
imgUp = new QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) );
imgDn = new QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) );
imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 );
imgButtonMask->fill( 0 );
for ( int i = 0; i < 7; i++ ) {
- QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath +
+ QString filename = QString( QPEApplication::qpeDir() + "pics/" + skinPath +
"/skinV_mask_" + skinV_mask_file_names[i] + ".png" );
// odebug << "loading "+filename << oendl;
masks[i] = new QBitmap( filename );
if ( !masks[i]->isNull() ) {
QImage imgMask = masks[i]->convertToImage();
uchar **dest = imgButtonMask->jumpTable();
for ( int y = 0; y < imgUp->height(); y++ ) {
uchar *line = dest[y];
for ( int x = 0; x < imgUp->width(); x++ ) {
if ( !qRed( imgMask.pixel( x, y ) ) )
line[x] = i + 1;
}
}
}
}
for ( int i = 0; i < 7; i++ ) {
buttonPixUp[i] = NULL;
buttonPixDown[i] = NULL;
}
QWidget *d = QApplication::desktop();
int width = d->width();
int height = d->height();
if( (width != pixBg->width() ) || (height != pixBg->height() ) ) {
QImage img;
img = pixBg->convertToImage();
pixBg->convertFromImage( img.smoothScale( width, height));
}
setBackgroundPixmap( *pixBg );
currentFrame = new QImage( 220 + 2, 160, (QPixmap::defaultDepth() == 16) ? 16 : 32 );
slider = new QSlider( Qt::Horizontal, this );
slider->setMinValue( 0 );
slider->setMaxValue( 1 );
slider->setBackgroundPixmap( *pixBg );
slider->setFocusPolicy( QWidget::NoFocus );
// slider->setGeometry( QRect( 7, 250, 220, 20 ) );
connect(slider,SIGNAL(sliderPressed()),this,SLOT(sliderPressed()));
connect(slider,SIGNAL(sliderReleased()),this,SLOT(sliderReleased()));
connect(mediaPlayerState,SIGNAL(lengthChanged(long)),this,SLOT(setLength(long)));
connect(mediaPlayerState,SIGNAL(positionChanged(long)),this,SLOT(setPosition(long)));
connect(mediaPlayerState,SIGNAL(positionUpdated(long)),this,SLOT(setPosition(long)));
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 )
}
}
int killedbysig = 0;
userExited=0;
if (WIFEXITED(status)!=0 ) {
if (WEXITSTATUS(status)==137) {
userExited=1;
}
}
if ( WIFSIGNALED( status )) {
switch ( WTERMSIG( status )) {
case SIGTERM:
case SIGINT :
case SIGKILL:
break;
default :
killedbysig = WTERMSIG( status );
break;
}
}
if ( killedbysig ) { // qpe was killed by an uncaught signal
qApp = 0;
::syslog ( LOG_ERR, "Opie was killed by a signal #%d", killedbysig );
QWSServer::setDesktopBackground ( QImage ( ));
QApplication *app = new QApplication ( argc, argv, QApplication::GuiServer );
app-> setFont ( QFont ( "Helvetica", 10 ));
app-> setStyle ( new QPEStyle ( ));
// const char *sig = ::strsignal ( killedbysig );
const char *sig = ::sys_siglist[killedbysig];
QLabel *l = new QLabel ( 0, "sig", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool );
l-> setText ( LoginWindowImpl::tr( "Opie was terminated\nby an uncaught signal\n(%1)\n" ). arg ( sig ));
l-> setAlignment ( Qt::AlignCenter );
l-> move ( 0, 0 );
l-> resize ( app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( ));
l-> show ( );
QTimer::singleShot ( 3000, app, SLOT( quit()));
app-> exec ( );
delete app;
qApp = 0;
}
}
else {
if ( !autolog ) {
- QString confFile=QPEApplication::qpeDir() + "/etc/opie-login.conf";
+ QString confFile=QPEApplication::qpeDir() + "etc/opie-login.conf";
Config cfg ( confFile, Config::File );
cfg. setGroup ( "General" );
QString user = cfg. readEntry ( "AutoLogin" );
if ( !user. isEmpty ( ))
autolog = ::strdup ( user. latin1 ( ));
}
if ( autolog && !userExited ) {
QWSServer::setDesktopBackground( QImage() );
ODevice::inst ( )-> setDisplayStatus ( true );
ODevice::inst ( )-> setSoftSuspend ( false );
LoginApplication *app = new LoginApplication ( argc, argv, ppid );
LoginApplication::setLoginAs ( autolog );
if ( LoginApplication::changeIdentity ( ))
::exit ( LoginApplication::login ( ));
else
::exit ( 0 );
}
else {
::exit ( login_main ( argc, argv, ppid ));
}
}
}
return 0;
}
void sigterm ( int /*sig*/ )
{
::exit ( 0 );
}
void exit_closelog ( )
{
::closelog ( );
}
class LoginScreenSaver : public QWSScreenSaver
{
public:
LoginScreenSaver ( )
{
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 @@
#include <qdir.h>
#include <qlistview.h>
#include <qcheckbox.h>
#include <qheader.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qwhatsthis.h>
#include <stdlib.h>
MenuSettings::MenuSettings ( QWidget *parent, const char *name )
: QWidget ( parent, name )
{
m_applets_changed = false;
QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 );
QLabel *l = new QLabel ( tr( "Load applets in O-Menu:" ), this );
lay-> addWidget ( l );
m_list = new QListView ( this );
m_list-> addColumn ( "foobar" );
m_list-> header ( )-> hide ( );
lay-> addWidget ( m_list );
m_menutabs = new QCheckBox ( tr( "Show Launcher tabs in O-Menu" ), this );
lay-> addWidget ( m_menutabs );
m_menusubpopup = new QCheckBox ( tr( "Show Applications in Subpopups" ), this );
lay-> addWidget ( m_menusubpopup );
QWhatsThis::add ( m_list, tr( "Check the applets that you want to have included in the O-Menu." ));
QWhatsThis::add ( m_menutabs, tr( "Adds the contents of the Launcher Tabs as menus in the O-Menu." ));
connect ( m_list, SIGNAL( clicked(QListViewItem*)), this, SLOT( appletChanged()));
init ( );
}
void MenuSettings::init ( )
{
Config cfg ( "StartMenu" );
cfg. setGroup ( "Applets" );
QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' );
- QString path = QPEApplication::qpeDir ( ) + "/plugins/applets";
+ QString path = QPEApplication::qpeDir ( ) + "plugins/applets";
#ifdef Q_OS_MACX
QStringList list = QDir ( path, "lib*.dylib" ). entryList ( );
#else
QStringList list = QDir ( path, "lib*.so" ). entryList ( );
#endif /* Q_OS_MACX */
for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) {
QString name;
QPixmap icon;
MenuAppletInterface *iface = 0;
QLibrary *lib = new QLibrary ( path + "/" + *it );
lib-> queryInterface ( IID_MenuApplet, (QUnknownInterface**) &iface );
if ( iface ) {
QString lang = getenv( "LANG" );
QTranslator *trans = new QTranslator ( qApp );
QString type = (*it). left ((*it). find ("."));
- QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm";
+ QString tfn = QPEApplication::qpeDir ( ) + "i18n/" + lang + "/" + type + ".qm";
if ( trans-> load ( tfn ))
qApp-> installTranslator ( trans );
else
delete trans;
name = iface-> name ( );
icon = iface-> icon ( ). pixmap ( QIconSet::Small, QIconSet::Normal );
iface-> release ( );
lib-> unload ( );
QCheckListItem *item;
item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox );
if ( !icon. isNull ( ))
item-> setPixmap ( 0, icon );
item-> setOn ( exclude. find ( *it ) == exclude. end ( ));
m_applets [*it] = item;
} else {
delete lib;
}
}
cfg. setGroup ( "Menu" );
m_menutabs->setChecked( cfg.readBoolEntry( "LauncherTabs", true ) );
m_menusubpopup->setChecked( cfg.readBoolEntry( "LauncherSubPopup", true ) );
m_menusubpopup->setEnabled( m_menutabs->isChecked() );
connect( m_menutabs, SIGNAL( stateChanged(int) ), m_menusubpopup, SLOT( setEnabled(bool) ) );
}
void MenuSettings::appletChanged()
{
m_applets_changed = true;
}
void MenuSettings::accept ( )
{
bool apps_changed = false;
Config cfg ( "StartMenu" );
cfg. setGroup ( "Applets" );
if ( m_applets_changed ) {
QStringList exclude;
QMap <QString, QCheckListItem *>::Iterator it;
for ( it = m_applets. begin ( ); it != m_applets. end ( ); ++it ) {
if ( !(*it)-> isOn ( ))
exclude << it. key ( );
}
cfg. writeEntry ( "ExcludeApplets", exclude, ',' );
}
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 @@
#include <qpe/config.h>
#include <qpe/qlibrary.h>
#include <qpe/qpeapplication.h>
#include <qpe/taskbarappletinterface.h>
#include <qpe/qcopenvelope_qws.h>
#include <opie2/odebug.h>
/* QT */
#include <qdir.h>
#include <qlistview.h>
#include <qheader.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qwhatsthis.h>
/* STD */
#include <stdlib.h>
TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name )
: QWidget ( parent, name )
{
m_applets_changed = false;
QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 );
QLabel *l = new QLabel ( tr( "Load applets in Taskbar:" ), this );
lay-> addWidget ( l );
m_list = new QListView ( this );
m_list-> addColumn ( "foobar" );
m_list-> header ( )-> hide ( );
lay-> addWidget ( m_list );
QWhatsThis::add ( m_list, tr( "Check the applets that you want displayed in the Taskbar." ));
connect ( m_list, SIGNAL( clicked(QListViewItem*)), this, SLOT( appletChanged()));
init ( );
}
void TaskbarSettings::init ( )
{
Config cfg ( "Taskbar" );
cfg. setGroup ( "Applets" );
QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' );
- QString path = QPEApplication::qpeDir ( ) + "/plugins/applets";
+ QString path = QPEApplication::qpeDir ( ) + "plugins/applets";
#ifdef Q_OS_MACX
QStringList list = QDir ( path, "lib*.dylib" ). entryList ( );
#else
QStringList list = QDir ( path, "lib*.so" ). entryList ( );
#endif /* Q_OS_MACX */
for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) {
QString name;
QPixmap icon;
TaskbarNamedAppletInterface *iface = 0;
owarn << "Load applet: " << (*it) << "" << oendl;
QLibrary *lib = new QLibrary ( path + "/" + *it );
lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface );
owarn << "<1>" << oendl;
if ( iface ) {
owarn << "<2>" << oendl;
QString lang = getenv( "LANG" );
QTranslator *trans = new QTranslator ( qApp );
QString type = (*it). left ((*it). find ("."));
- QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm";
+ QString tfn = QPEApplication::qpeDir ( ) + "i18n/" + lang + "/" + type + ".qm";
if ( trans-> load ( tfn ))
qApp-> installTranslator ( trans );
else
delete trans;
name = iface-> name ( );
icon = iface-> icon ( );
iface-> release ( );
}
owarn << "<3>" << oendl;
if ( !iface ) {
owarn << "<4>" << oendl;
lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface );
if ( iface ) {
owarn << "<5>" << oendl;
name = (*it). mid ( 3 );
owarn << "Found applet: " << name << "" << oendl;
#ifdef Q_OS_MACX
int sep = name. find( ".dylib" );
#else
int sep = name. find( ".so" );
#endif /* Q_OS_MACX */
if ( sep > 0 )
name. truncate ( sep );
sep = name. find ( "applet" );
if ( sep == (int) name.length ( ) - 6 )
name. truncate ( sep );
name[0] = name[0]. upper ( );
iface-> release ( );
}
}
owarn << "<6>" << oendl;
if ( iface ) {
owarn << "<7>" << oendl;
QCheckListItem *item;
item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox );
if ( !icon. isNull ( ))
item-> setPixmap ( 0, icon );
item-> setOn ( exclude. find ( *it ) == exclude. end ( ));
m_applets [*it] = item;
}
lib-> unload ( );
delete lib;
}
}
void 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()
QMessageBox confirmSave(
tr("Attention"),
"<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>" +
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>",
QMessageBox::Warning,
QMessageBox::Cancel, QMessageBox::Yes, QMessageBox::NoButton,
0, QString::null, TRUE, WStyle_StaysOnTop);
confirmSave.setButtonText(QMessageBox::Cancel, tr("Cancel"));
confirmSave.setButtonText(QMessageBox::Yes, tr("OK"));
if ( confirmSave.exec() == QMessageBox::Yes)
{
owarn << "writing config as user accepted" << oendl;
m_parentConfig->writeConfigs();
owarn << "testing authentication" << oendl;
// launch the authentication in testing mode
Opie::Security::MultiauthPassword::authenticate(Opie::Security::TestNow);
}
}
/// Builds and displays the Opie multi-authentication configuration dialog
static void test_and_start() {
Config pcfg("Security");
pcfg.setGroup( "Misc" );
bool protectConfigDialog = ! pcfg.readBoolEntry("noProtectConfig", true);
if (protectConfigDialog && Opie::Security::Internal::runPlugins() != 0) {
owarn << "authentication failed, not showing opie-security" << oendl;
exit( -1 );
}
}
MultiauthConfig::MultiauthConfig(QWidget* par, const char* w = "MultiauthConfig dialog", WFlags f = 0)
: QDialog(par, w, TRUE, f),
m_mainTW(0), m_pluginListView(0), m_pluginListWidget(0),
m_generalConfig(0), m_loginWidget(0), m_syncWidget(0),
m_nbSuccessReq(0), m_plugins_changed(false)
{
/* Initializes the global configuration window
*/
test_and_start();
/* Checks (and memorizes) if any authentication plugins are
* installed on the system
*/
- QString path = QPEApplication::qpeDir() + "/plugins/security";
+ QString path = QPEApplication::qpeDir() + "plugins/security";
QDir dir( path, "lib*.so" );
QStringList list = dir.entryList();
m_pluginsInstalled = ! list.isEmpty();
if (m_pluginsInstalled == false)
owarn << "no authentication plugins installed! Talking about it in the last tab..." << oendl;
setCaption( tr( "Security configuration" ) );
QVBoxLayout *layout = new QVBoxLayout( this );
m_mainTW = new Opie::Ui::OTabWidget( this, "main tab widget" );
layout->addWidget(m_mainTW);
if (m_pluginsInstalled)
{
m_pluginListWidget = new QWidget(m_mainTW, "plugin list widget");
QVBoxLayout * pluginListLayout = new QVBoxLayout(m_pluginListWidget);
pluginListLayout->setSpacing(6);
pluginListLayout->setMargin(11);
QLabel * pluginListTitle = new QLabel( tr( "Load which plugins in what order:" ), m_pluginListWidget );
pluginListLayout->addWidget(pluginListTitle);
QHBox * pluginListHB = new QHBox(m_pluginListWidget);
pluginListLayout->addWidget(pluginListHB);
m_pluginListView = new QListView(pluginListHB);
m_pluginListView->addColumn("PluginList");
m_pluginListView->header()->hide();
m_pluginListView->setSorting(-1);
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" ));
QVBox * pluginListVB = new QVBox(pluginListHB);
new ToolButton( pluginListVB, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) );
new ToolButton( pluginListVB, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) );
m_mainTW->addTab( m_pluginListWidget, "pass", tr( "plugins" ) );
connect ( m_pluginListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( pluginsChanged ( ) ) );
// general Opie multi-authentication configuration tab
m_generalConfig = new MultiauthGeneralConfig(this, m_mainTW);
m_mainTW->addTab(m_generalConfig, "SettingsIcon", tr( "Authentication") );
}
// login settings page
m_loginWidget = new LoginBase(m_mainTW, "login config widget");
m_mainTW->addTab(m_loginWidget, "security/users", tr( "Login") );
// sync settings page
m_syncWidget = new SyncBase( m_mainTW, "sync config widget" );
m_mainTW->addTab(m_syncWidget, "security/sync", tr( "Sync") );
@@ -329,97 +329,97 @@ void MultiauthConfig::readConfig()
pcfg->setGroup( "Plugins" );
m_excludePlugins = pcfg->readListEntry( "ExcludePlugins", ',' );
m_allPlugins = pcfg->readListEntry( "AllPlugins", ',' );
}
/* Login and Sync stuff */
pcfg->setGroup("Sync");
int auth_peer = pcfg->readNumEntry("auth_peer",0xc0a88100);//new default 192.168.129.0/24
int auth_peer_bits = pcfg->readNumEntry("auth_peer_bits",24);
pcfg->setGroup("SyncMode");
int mode = pcfg->readNumEntry("Mode",2); // Default to Sharp
switch( mode ) {
case 0x01:
m_syncWidget->syncModeCombo->setCurrentItem( 0 );
break;
case 0x02:
default:
m_syncWidget->syncModeCombo->setCurrentItem( 1 );
break;
case 0x04:
m_syncWidget->syncModeCombo->setCurrentItem( 2 );
break;
}
/*
cfg.setGroup("Remote");
if ( telnetAvailable() )
telnet->setChecked(cfg.readEntry("allow_telnet"));
else
telnet->hide();
if ( sshAvailable() )
ssh->setChecked(cfg.readEntry("allow_ssh"));
else
ssh->hide();
*/
// release the Config handler
delete pcfg;
// indeed, selectNet will open the config file...
selectNet(auth_peer,auth_peer_bits,TRUE);
connect( m_syncWidget->syncnet, SIGNAL(textChanged(const QString&)),
this, SLOT(setSyncNet(const QString&)));
- QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf";
+ QString configFile = QPEApplication::qpeDir() + "etc/opie-login.conf";
Config loginCfg(configFile,Config::File);
loginCfg.setGroup("General");
autoLoginName=loginCfg.readEntry("AutoLogin","");
if (autoLoginName.stripWhiteSpace().isEmpty()) {
autoLogin=false;
} else {
autoLogin=true;
}
connect(m_loginWidget->autologinToggle, SIGNAL(toggled(bool)), this, SLOT(toggleAutoLogin(bool)));
connect(m_loginWidget->userlist, SIGNAL(activated(int)), this, SLOT(changeLoginName(int)));
connect(m_syncWidget->restoredefaults,SIGNAL(clicked()), this, SLOT(restoreDefaults()));
connect(m_syncWidget->deleteentry,SIGNAL(clicked()), this, SLOT(deleteListEntry()));
loadUsers();
updateGUI();
}
void MultiauthConfig::writeConfig()
{
Config* pcfg = new Config("Security");
if (m_pluginsInstalled)
{
pcfg->setGroup( "Plugins" );
QStringList exclude;
QStringList include;
QStringList allPlugins;
QListViewItemIterator list_it( m_pluginListView );
// this makes sure the names get saved in the order selected
for ( ; list_it.current(); ++list_it ) {
QMap <QString, QCheckListItem *>::Iterator it;
for ( it = m_plugins.begin(); it != m_plugins. end (); ++it ) {
if ( list_it.current() == (*it) && !(*it)-> isOn () ) {
exclude << it.key();
} else if ( list_it.current() == (*it) && (*it)-> isOn () ){
include << it.key();
}
if ( list_it.current() == (*it) ) {
allPlugins << it.key();
}
}
@@ -444,117 +444,117 @@ void MultiauthConfig::writeConfig()
QString sn = m_syncWidget->syncnet->currentText();
parseNet(sn,auth_peer,auth_peer_bits);
//this is the *selected* (active) net range
pcfg->writeEntry("auth_peer",auth_peer);
pcfg->writeEntry("auth_peer_bits",auth_peer_bits);
//write back all other net ranges in *cleartext*
for (int i=0; i<10; i++) {
QString target;
target.sprintf("net%d", i);
if ( i < m_syncWidget->syncnet->count() )
pcfg->writeEntry(target, m_syncWidget->syncnet->text(i));
else // no more entry in the syncnet list -> we clear the line
pcfg->writeEntry(target, "");
}
#ifdef ODP
#error "Use 0,1,2 and use Launcher"
#endif
/* keep the old code so we don't use currentItem directly */
int value = 0x02;
switch( m_syncWidget->syncModeCombo->currentItem() ) {
case 0:
value = 0x01;
break;
case 1:
value = 0x02;
break;
case 2:
value = 0x04;
break;
}
pcfg->setGroup("SyncMode");
pcfg->writeEntry( "Mode", value );
/*
pcfg->setGroup("Remote");
if ( telnetAvailable() )
pcfg->writeEntry("allow_telnet",telnet->isChecked());
if ( sshAvailable() )
pcfg->writeEntry("allow_ssh",ssh->isChecked());
// ### write ssh/telnet sys config files
*/
//release the Config handler
delete pcfg;
- QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf";
+ QString configFile = QPEApplication::qpeDir() + "etc/opie-login.conf";
Config loginCfg(configFile,Config::File);
loginCfg.setGroup("General");
if (autoLogin) {
loginCfg.writeEntry("AutoLogin",autoLoginName);
} else {
loginCfg.removeEntry("AutoLogin");
}
}
/// slot used to record the fact plugins order has been modified
void MultiauthConfig::pluginsChanged() {
m_plugins_changed = true;
}
/// loads each multiauth plugin
void MultiauthConfig::loadPlugins() {
- QString path = QPEApplication::qpeDir() + "/plugins/security";
+ QString path = QPEApplication::qpeDir() + "plugins/security";
QDir dir( path, "lib*.so" );
QStringList list = dir.entryList();
QStringList::Iterator it;
// temporary list used to sort plugins
QMap<QString, MultiauthPlugin> sortList;
for ( it = list.begin(); it != list.end(); ++it ) {
QInterfacePtr<MultiauthPluginInterface> iface;
QLibrary *lib = new QLibrary( path + "/" + *it );
QString libPath(path + "/" + *it);
if ( lib->queryInterface( IID_MultiauthPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) {
MultiauthPlugin plugin;
plugin.library = lib;
plugin.iface = iface;
plugin.name = QString(*it);
// find out if plugins should be launched
if ( m_excludePlugins.grep( *it ).isEmpty() ) {
plugin.active = true;
} else {
plugin.active = false;
}
plugin.pluginObject = plugin.iface->plugin();
// "prebuffer" it in one more list, to get the sorting done
sortList.insert( plugin.name, plugin );
// on first start the list is off course empty
if ( m_allPlugins.isEmpty() ) {
pluginList.append( plugin );
}
// if plugin is not yet in the list, add it to the layout too
else if ( !m_allPlugins.contains( plugin.name ) ) {
pluginList.append( plugin );
}
} else {
delete lib;
}
} // end for
// put m_allPlugins tempPlugin objects into pluginList
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 @@
/* OPIE */
#include <opie2/owait.h>
using namespace Opie::Ui;
#include <qtopia/qcom.h>
#include <qtopia/qlibrary.h>
#include <qtopia/qpeapplication.h>
#include <qtopia/applicationinterface.h>
#include <qtopia/resource.h>
/* QT */
#include <qmetaobject.h>
#include <qmap.h>
#include <qstring.h>
namespace QuickPrivate {
struct PluginLoader {
PluginLoader( const char* ) {
}
QRESULT queryInterface( const QString& app, const QUuid&, QUnknownInterface** );
void releaseInterface( QUnknownInterface* );
QMap<QUnknownInterface*, QLibrary*> libs;
};
/*
* We can skip installing a Translator here because Opies QPEApplication
* will do that in initApp for us as well
*/
QRESULT PluginLoader::queryInterface( const QString& libFile, const QUuid& uuid, QUnknownInterface** iface ) {
QRESULT res = QS_FALSE;
*iface = 0;
// This code is very platform specific.. We should find better
// solutions to handle names.. Maybe one central function would be
// better than checking this ".so" stuff all around in the sources..
// (eilers)
// Below lines from TT then mine again
QString name = libFile;
if ( libFile.findRev(".so") == (int)libFile.length()-3 ) {
name = libFile.left( libFile.length()-3 );
if ( name.find( "lib" ) == 0 )
name = name.mid( 3 );
}
#ifdef Q_OS_MACX
- QString path = QPEApplication::qpeDir() + "/plugins/application/lib"+name+".dylib";
+ QString path = QPEApplication::qpeDir() + "plugins/application/lib"+name+".dylib";
#else
- QString path = QPEApplication::qpeDir() + "/plugins/application/lib"+name+".so";
+ QString path = QPEApplication::qpeDir() + "plugins/application/lib"+name+".so";
#endif
QLibrary *lib = new QLibrary( path );
if ( lib->queryInterface( uuid, iface ) == QS_OK && iface ) {
libs.insert( *iface, lib );
res = QS_OK;
}
return res;
}
void PluginLoader::releaseInterface( QUnknownInterface* iface ) {
if ( libs.contains( iface ) ) {
iface->release();
delete libs[iface];
libs.remove( iface ); // we only handle pointers so even if the object is not valid the address-space is
}
}
}