author | zecke <zecke> | 2004-10-16 00:01:01 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-10-16 00:01:01 (UTC) |
commit | df14f647ff1a60ca82e0fa9bd91458be146153b8 (patch) (side-by-side diff) | |
tree | 4859961352851a4392e1442f2080c15bff8ad7bc | |
parent | 419f9710c488f56a7a117eb1529970d3371e0094 (diff) | |
download | opie-df14f647ff1a60ca82e0fa9bd91458be146153b8.zip opie-df14f647ff1a60ca82e0fa9bd91458be146153b8.tar.gz opie-df14f647ff1a60ca82e0fa9bd91458be146153b8.tar.bz2 |
Replace QPEApplication::qpeDir() + "/ with
QPEApplication::qpeDir() + "
as it is guranteed that qpeDir() will have '/' as the last
charachter
45 files changed, 80 insertions, 80 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 } } } diff --git a/inputmethods/multikey/configdlg.cpp b/inputmethods/multikey/configdlg.cpp index 1fba9bc..fe5051d 100644 --- a/inputmethods/multikey/configdlg.cpp +++ b/inputmethods/multikey/configdlg.cpp @@ -34,97 +34,97 @@ #include "keyboard.h" using namespace Opie; using namespace Opie::Ui; // ConfigDlg::ConfigDlg() {{{1 ConfigDlg::ConfigDlg () : QDialog () { setCaption( tr("Multikey Configuration") ); Config config ("multikey"); config.setGroup("keymaps"); QString current_map = config.readEntry("current", 0); /* * 'general config' tab */ QVBoxLayout *base_lay = new QVBoxLayout(this); QTabWidget *tabs = new QTabWidget(this, "tabs"); QWidget *gen_box = new QWidget(tabs, "gen_tab"); QVBoxLayout *gen_lay = new QVBoxLayout(gen_box); gen_lay->setMargin(3); QGroupBox *map_group = new QGroupBox (2, Qt::Vertical, tr("Keymap File"), gen_box); QHBox *hbox1 = new QHBox(map_group); keymaps = new QListBox(hbox1); keymaps->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); QVBox *vbox1 = new QVBox(hbox1); QToolButton *tb1 = new QToolButton(vbox1, tr("Move Up")); tb1->setPixmap(Resource::loadPixmap("up")); tb1->setAutoRaise(TRUE); tb1->setFocusPolicy(QWidget::NoFocus); tb1->setToggleButton(FALSE); connect(tb1, SIGNAL(clicked()), this, SLOT(moveSelectedUp())); QToolButton *tb2 = new QToolButton(vbox1, tr("Move Down")); tb2->setPixmap(Resource::loadPixmap("down")); tb2->setAutoRaise(TRUE); tb2->setFocusPolicy(QWidget::NoFocus); tb2->setToggleButton(FALSE); connect(tb2, SIGNAL(clicked()), this, SLOT(moveSelectedDown())); QString cur(tr("Current Language")); keymaps->insertItem(cur); keymaps->setSelected(0, true); - QDir map_dir(QPEApplication::qpeDir() + "/share/multikey", "*.keymap"); + QDir map_dir(QPEApplication::qpeDir() + "share/multikey", "*.keymap"); default_maps = map_dir.entryList(); // so i can access it in other places custom_maps = config.readListEntry("maps", QChar('|')); sw_maps = ConfigDlg::loadSw(); QStringList sw_copy(sw_maps); for (uint i = 0; i < sw_copy.count(); i++) { QString keymap_map; if (sw_copy[i][0] != '/') { /* share/multikey */ keymap_map = map_dir.absPath() + "/" + sw_copy[i]; } else { if (map_dir.exists(QFileInfo(sw_copy[i]).fileName(), false) || !QFile::exists(sw_copy[i])) { custom_maps.remove(sw_copy[i]); sw_maps.remove(sw_copy[i]); // remove it from the list too config.writeEntry("maps", custom_maps.join("|")); continue; } keymap_map = sw_copy[i]; } QFile map(keymap_map); if (map.open(IO_ReadOnly)) { QString line; bool found = 0; map.readLine(line, 1024); while (!map.atEnd()) { if (line.find(QRegExp("^title\\s*=\\s*")) != -1) { keymaps->insertItem(line.right(line.length() - line.find(QChar('=')) - 1).stripWhiteSpace()); found = 1; break; } map.readLine(line, 1024); } if (!found) keymaps->insertItem(keymap_map); map.close(); } @@ -203,97 +203,97 @@ ConfigDlg::ConfigDlg () : QDialog () if (color.isEmpty()) { color = QStringList::split(",", "240,240,240"); config.writeEntry("keycolor", color.join(",")); } */ keycolor_button->setPalette(QPalette(QColor(color[0].toInt(), color[1].toInt(), color[2].toInt()))); label = new QLabel(tr("Key Pressed Color"), color_grid); keycolor_pressed_button = new QPushButton(color_grid); connect(keycolor_pressed_button, SIGNAL(clicked()), SLOT(keyColorPressedClicked())); keycolor_pressed_button->setFlat(TRUE); color = config.readListEntry("keycolor_pressed", QChar(',')); keycolor_pressed_button->setPalette(QPalette((QColor(color[0].toInt(), color[1].toInt(), color[2].toInt())))); label = new QLabel(tr("Line Color"), color_grid); keycolor_lines_button = new QPushButton(color_grid); connect(keycolor_lines_button, SIGNAL(clicked()), SLOT(keyColorLinesClicked())); keycolor_lines_button->setFlat(TRUE); color = config.readListEntry("keycolor_lines", QChar(',')); keycolor_lines_button->setPalette(QPalette((QColor(color[0].toInt(), color[1].toInt(), color[2].toInt())))); label = new QLabel(tr("Text Color"), color_grid); textcolor_button = new QPushButton(color_grid); connect(textcolor_button, SIGNAL(clicked()), SLOT(textColorClicked())); textcolor_button->setFlat(TRUE); color = config.readListEntry("textcolor", QChar(',')); textcolor_button->setPalette(QPalette((QColor(color[0].toInt(), color[1].toInt(), color[2].toInt())))); label = new QLabel("", color_grid); // a spacer so the above buttons dont expand label->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); /* FIXME: hacked spacer height */ QSpacerItem *spacer = new QSpacerItem(0, 300, QSizePolicy::Expanding, QSizePolicy::Maximum); color_lay->addWidget(color_grid, 0, 0); color_lay->addItem(spacer); tabs->addTab(color_box, tr("Colors")); base_lay->addWidget(tabs); } QStringList ConfigDlg::loadSw() { Config *config = new Config("multikey"); config->setGroup("keymaps"); - QDir map_dir(QPEApplication::qpeDir() + "/share/multikey", "*.keymap"); + QDir map_dir(QPEApplication::qpeDir() + "share/multikey", "*.keymap"); QStringList d_maps = map_dir.entryList(); // so i can access it in other places QStringList c_maps = config->readListEntry("maps", QChar('|')); QStringList s_maps = config->readListEntry("sw", QChar('|')); delete config; if (!s_maps.count()) { s_maps = d_maps+c_maps; } else { /* Clear non existents entries */ QStringList s_copy(s_maps); for (uint i = 0; i < s_copy.count(); ++i) { if (d_maps.find(s_copy[i]) == d_maps.end() && c_maps.find(s_copy[i]) == c_maps.end()) { s_maps.remove(s_copy[i]); } } /* Update sw_maps from default_maps */ for (uint i = 0; i < d_maps.count(); ++i) { if (s_maps.find(d_maps[i]) == s_maps.end()) { s_maps.append(d_maps[i]); } } /* Update sw_maps from custom_maps */ for (uint i = 0; i < c_maps.count(); ++i) { if (s_maps.find(c_maps[i]) == s_maps.end()) { s_maps.append(c_maps[i]); } } } return s_maps; } void ConfigDlg::accept() { /* Writing all stuffs to config */ Config *config = new Config("multikey"); config->setGroup("general"); config->writeEntry("usePickboard", pick_button->isChecked()); // default closed config->writeEntry("useRepeat", repeat_button->isChecked()); // default closed config->setGroup("keymaps"); config->writeEntry("sw", sw_maps, QChar('|')); config->writeEntry("maps", custom_maps, QChar('|')); delete config; diff --git a/inputmethods/multikey/keyboard.cpp b/inputmethods/multikey/keyboard.cpp index 7ddfd3e..f8cafd5 100644 --- a/inputmethods/multikey/keyboard.cpp +++ b/inputmethods/multikey/keyboard.cpp @@ -1332,102 +1332,102 @@ ushort Keyboard::constoe(const ushort c) { case 0x1112: return 0x11c2; default: return 0; } } else { //echar to schar switch (c) { case 0x11a8: return 0x1100; case 0x11a9: return 0x1101; case 0x11ab: return 0x1102; case 0x11ae: return 0x1103; case 0x11af: return 0x1105; case 0x11b7: return 0x1106; case 0x11b8: return 0x1107; case 0x11ba: return 0x1109; case 0x11bb: return 0x110a; case 0x11bc: return 0x110b; case 0x11bd: return 0x110c; case 0x11be: return 0x110e; case 0x11bf: return 0x110f; case 0x11c0: return 0x1110; case 0x11c1: return 0x1111; case 0x11c2: return 0x1112; default: return 0; } } } // Keys::Keys {{{1 Keys::Keys() { Config *config = new Config ("multikey"); config->setGroup( "keymaps" ); QString map = config->readEntry( "current" ); delete config; if (map.isNull() || !(QFile(map).exists())) { Config *config = new Config("locale"); config->setGroup( "Language" ); QString l = config->readEntry( "Language" , "en" ); delete config; - map = QPEApplication::qpeDir() + "/share/multikey/" + map = QPEApplication::qpeDir() + "share/multikey/" + l + ".keymap"; } if (map.isNull() || !(QFile(map).exists())) { - map = QPEApplication::qpeDir() + "/share/multikey/en.keymap"; + map = QPEApplication::qpeDir() + "share/multikey/en.keymap"; } setKeysFromFile(map); } Keys::Keys(const char * filename) { setKeysFromFile(filename); } // Keys::setKeysFromFile {{{2 void Keys::setKeysFromFile(const char * filename) { QFile f(filename); if (f.open(IO_ReadOnly)) { QTextStream t(&f); int row; int qcode; ushort unicode; int width; QString buf; QString comment; char * xpm[256]; //couldnt be larger than that... could it? QImage *xpm2pix = 0; buf = t.readLine(); while (buf) { // get rid of comments buf.replace(QRegExp("#.*$", FALSE, FALSE), ""); // key definition if (buf.contains(QRegExp("^\\d+\\s+[0-1a-fx]+", FALSE, FALSE))) { // no $1 type referencing!!! this implementation of regexp sucks // dont know of any sscanf() type funcs in Qt lib QTextStream tmp (buf, IO_ReadOnly); tmp >> row >> qcode >> unicode >> width >> comment; buf = t.readLine(); int xpmLineCount = 0; xpm2pix = 0; // erase blank space while (buf.contains(QRegExp("^\\s*$")) && buf) buf = t.readLine(); diff --git a/libopie2/opiecore/opluginloader.cpp b/libopie2/opiecore/opluginloader.cpp index 2a6e369..d33eac6 100644 --- a/libopie2/opiecore/opluginloader.cpp +++ b/libopie2/opiecore/opluginloader.cpp @@ -428,97 +428,97 @@ QUnknownInterface* OGenericPluginLoader::load( const OPluginItem& item, const QU */ setSafeMode( pa, true ); QLibrary *lib = Internal::OPluginLibraryHolder::self()->ref( pa ); if ( !lib ) { setSafeMode(); return 0l; } /** * try to load the plugin and just in case initialize the pointer to a pointer again */ QUnknownInterface* iface=0; if ( lib->queryInterface( uuid, &iface ) == QS_OK ) { installTranslators( item.name() ); m_library.insert( iface, lib ); }else iface = 0; setSafeMode(); return iface; } /** * @internal and reads in the safe mode */ void OGenericPluginLoader::readConfig() { /* read the config for SafeMode */ OConfig conf( m_dir + "-odpplugins" ); conf.setGroup( "General" ); m_isSafeMode = conf.readBoolEntry( "SafeMode", false ); } /** * @internal Enter or leave SafeMode */ void OGenericPluginLoader::setSafeMode(const QString& str, bool b) { OConfig conf( m_dir + "-odpplugins" ); conf.setGroup( "General" ); conf.writeEntry( "SafeMode", b ); conf.writeEntry( "CrashedPlugin", str ); } /** * @internal * - * Set the List of Plugin Dirs to lst. Currently only QPEApplication::qpeDir()+"/plugins/"+mytype + * Set the List of Plugin Dirs to lst. Currently only QPEApplication::qpeDir()+"plugins/"+mytype * is used as plugin dir */ void OGenericPluginLoader::setPluginDirs( const QStringList& lst ) { m_plugDirs = lst; } /** * * @internal * Set the Plugin Dir to str. Str will be the only element in the list of plugin dirs */ void OGenericPluginLoader::setPluginDir( const QString& str) { m_plugDirs.clear(); m_plugDirs.append( str ); } /** * @internal */ bool OGenericPluginLoader::isSorted()const{ return m_isSorted; } /* * make libfoo.so.1.0.0 -> foo on UNIX * make libfoo.dylib -> foo on MAC OS X Unix * windows is obviously missing */ /** * @internal */ QString OGenericPluginLoader::unlibify( const QString& str ) { QString st = str.mid( str.find( "lib" )+3 ); #ifdef Q_OS_MACX return st.left( st.findRev( ".dylib" ) ); #else return st.left( st.findRev( ".so" ) ); #endif } /** * @internal * * \brief method to return available plugins. Internal and for reeimplementations * *Return a List of Plugins for a dir and add positions and remove disabled. * If a plugin is on the excluded list assign position -2 @@ -593,97 +593,97 @@ OPluginItem::List OGenericPluginLoader::plugins( const QString& _dir, bool sorte } return lst; } /** * @internal generate a list of languages from $LANG */ QStringList OGenericPluginLoader::languageList() { if ( m_languages.isEmpty() ) { /* * be_BY.CP1251 We will add, be_BY.CP1251,be_BY,be * to our list of languages. * Also for de_DE@euro we will add de_DE@eurp, de_DE, de * to our list of languages */ QString str = ::getenv( "LANG" ); m_languages += str; int pos = str.find( '@' ); if( pos > 0 ) m_languages += str.left( pos ); pos = str.find( '.' ); if ( pos > 0 ) m_languages += str.left( pos ); int n_pos = str.find( '_' ); if ( n_pos > 0 ) m_languages += str.left( n_pos ); } return m_languages; } /** * @internal * Tries to install languages using the languageList for the type */ void OGenericPluginLoader::installTranslators(const QString& type) { QStringList lst = languageList(); /* * for each language and maybe later for each language dir... * try to load a Translator */ for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { QTranslator* trans = new QTranslator( qApp ); - QString tfn = QPEApplication::qpeDir()+"/i18n/" + *it + "/lib" + type + ".qm" ; + QString tfn = QPEApplication::qpeDir()+"i18n/" + *it + "/lib" + type + ".qm" ; /* * If loaded then install else clean up and don't leak */ if ( trans->load( tfn ) ) qApp->installTranslator( trans ); else delete trans; } } /** * \brief Simple c'tor. * * Simple C'tor same as the one of the base class. Additional this * class can cast for you if you nee it. * * * @param name The name of your plugin class * @param sorted If plugins are sorted * * @see OGenericPluginLoader */ OPluginLoader::OPluginLoader( const QString& name, bool sorted ) : OGenericPluginLoader( name, sorted ) { } /** * d'tor * @see OGenericPluginLoader::~OGenericPluginLoader */ OPluginLoader::~OPluginLoader() { } /** * \brief C'Tor using a OGenericPluginLoader * The C'tor. Pass your OGenericPluginLoader to manage * OGenericPluginLoader::allAvailable plugins. * * * @param loader A Pointer to your OGenericPluginLoader */ OPluginManager::OPluginManager( OGenericPluginLoader* loader) : m_loader( loader ), m_isSorted( false ) { } diff --git a/libopie2/opienet/omanufacturerdb.cpp b/libopie2/opienet/omanufacturerdb.cpp index 32bae0a..7e185a2 100644 --- a/libopie2/opienet/omanufacturerdb.cpp +++ b/libopie2/opienet/omanufacturerdb.cpp @@ -25,97 +25,97 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "omanufacturerdb.h" #define OPIE_IMPROVE_GUI_LATENCY 1 /* OPIE */ #include <opie2/odebug.h> #include <qpe/qpeapplication.h> #ifdef OPIE_IMPROVE_GUI_LATENCY #include <qpe/global.h> #endif /* QT */ #include <qapplication.h> #include <qfile.h> #include <qtextstream.h> using namespace Opie::Core; namespace Opie { namespace Net { OManufacturerDB* OManufacturerDB::_instance = 0; OManufacturerDB* OManufacturerDB::instance() { if ( !OManufacturerDB::_instance ) { odebug << "OManufacturerDB::instance(): creating OManufacturerDB..." << oendl; _instance = new OManufacturerDB(); } return _instance; } OManufacturerDB::OManufacturerDB() { #ifdef OPIE_IMPROVE_GUI_LATENCY Global::statusMessage( "Reading Manufacturers..." ); #endif QString filename( "/etc/manufacturers" ); odebug << "OManufacturerDB: trying to read " << filename << oendl; if ( !QFile::exists( filename ) ) { - filename = QPEApplication::qpeDir()+"/etc/manufacturers"; + filename = QPEApplication::qpeDir()+"etc/manufacturers"; odebug << "OManufacturerDB: trying to read " << filename << oendl; if ( !QFile::exists( filename ) ) { filename = "/usr/share/wellenreiter/manufacturers"; odebug << "OManufacturerDB: trying to read " << filename << oendl; } } QFile file( filename ); bool hasFile = file.open( IO_ReadOnly ); if (!hasFile) { owarn << "OManufacturerDB: no valid manufacturer list found." << oendl; } else { odebug << "OManufacturerDB: found manufacturer list in " << filename << oendl; QTextStream s( &file ); QString addr; QString manu; QString extManu; #ifdef OPIE_IMPROVE_GUI_LATENCY int counter = 0; #endif while (!s.atEnd()) { s >> addr; s >> manu; s >> extManu; manufacturers.insert( addr, manu ); manufacturersExt.insert( addr, extManu ); // odebug << "OmanufacturerDB: parse '" << addr << "' as '" << manu << "' (" << extManu << ")" << oendl; #ifdef OPIE_IMPROVE_GUI_LATENCY counter++; if ( counter == 50 ) { qApp->processEvents(); counter = 0; } #endif } odebug << "OManufacturerDB: manufacturer list completed." << oendl; #ifdef OPIE_IMPROVE_GUI_LATENCY Global::statusMessage( "Manufacturers Complete..." ); #endif } } diff --git a/libopie2/opiesecurity/multiauthcommon.cpp b/libopie2/opiesecurity/multiauthcommon.cpp index 9de62d2..e563193 100644 --- a/libopie2/opiesecurity/multiauthcommon.cpp +++ b/libopie2/opiesecurity/multiauthcommon.cpp @@ -44,97 +44,97 @@ void SecOwnerDlg::resizeEvent( QResizeEvent * ) } bool SecOwnerDlg::eventFilter(QObject *o, QEvent *e) { if (e->type() == QEvent::KeyPress || e->type() == QEvent::MouseButtonPress ) { accept(); return TRUE; } return QWidget::eventFilter(o, e); } void SecOwnerDlg::mousePressEvent( QMouseEvent * ) { accept(); } namespace Internal { /// run plugins until we reach nbSuccessMin successes int runPlugins() { SecOwnerDlg *oi = 0; // see if there is contact information. QString vfilename = Global::applicationFileName("addressbook", "businesscard.vcf"); if (QFile::exists(vfilename)) { Contact c; c = Contact::readVCard( vfilename )[0]; oi = new SecOwnerDlg(0, 0, c, TRUE, TRUE); } Config config("Security"); config.setGroup("Plugins"); QStringList plugins = config.readListEntry("IncludePlugins", ','); /* if there are no configured plugins, we simply return 0 to * let the user in: */ if (plugins.isEmpty() == true) { owarn << "No authentication plugin has been configured yet!" << oendl; odebug << "Letting the user in..." << oendl; if(oi) delete oi; return 0; } config.setGroup("Misc"); int nbSuccessMin = config.readNumEntry("nbSuccessMin", 1); int nbSuccess = 0; /* tries to launch successively each plugin in $OPIEDIR/plugins/security * directory which file name is in Security.conf / [Misc] / IncludePlugins */ - QString path = QPEApplication::qpeDir() + "/plugins/security"; + QString path = QPEApplication::qpeDir() + "plugins/security"; QStringList::Iterator libIt; for ( libIt = plugins.begin(); libIt != plugins.end(); ++libIt ) { QInterfacePtr<MultiauthPluginInterface> iface; QLibrary *lib = new QLibrary( path + "/" + *libIt ); if ( lib->queryInterface( IID_MultiauthPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { // the plugin is a true Multiauth plugin odebug << "Accepted plugin: " << QString( path + "/" + *libIt ) << oendl; odebug << "Plugin name: " << iface->plugin()->pluginName() << oendl; int resultCode; int tries = 0; // perform authentication resultCode = iface->plugin()->authenticate(); // display the result in command line QString resultMessage; switch (resultCode) { case MultiauthPluginObject::Success: resultMessage = "Success!"; nbSuccess++; break; case MultiauthPluginObject::Failure: resultMessage = "Failure..."; break; case MultiauthPluginObject::Skip: resultMessage = "Skip"; break; } odebug << "Plugin result: " << resultMessage << oendl; // if failure, wait, reperform, wait, reperform... until right while (resultCode == MultiauthPluginObject::Failure) { tries++; owarn << "This plugin has failed " << tries << " times already" << oendl; // displays owner information, if any if (oi) { oi->exec(); odebug << "Contact information displayed" << oendl; diff --git a/library/fontdatabase.cpp b/library/fontdatabase.cpp index d94e338..7934a09 100644 --- a/library/fontdatabase.cpp +++ b/library/fontdatabase.cpp @@ -122,97 +122,97 @@ QStringList FontDatabase::families() const } #ifdef QT_NO_FONTDATABASE /*! Returns a list of standard fontsizes. */ QValueList<int> FontDatabase::standardSizes() { static int s[]={ 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72, 0 }; static bool first = TRUE; static QValueList<int> sList; if ( first ) { first = FALSE; int i = 0; while( s[i] ) sList.append( s[i++] ); } return sList; } #endif /*! Load any font renderer plugins that are available and make the fonts that the plugins can read available. */ void FontDatabase::loadRenderers() { #ifndef QWS return; #else #ifndef QT_NO_COMPONENT if ( !factoryList ) factoryList = new QValueList<FontFactory>; QValueList<FontFactory>::Iterator mit; for ( mit = factoryList->begin(); mit != factoryList->end(); ++mit ) { qt_fontmanager->factories.setAutoDelete( false ); qt_fontmanager->factories.removeRef( (*mit).factory ); qt_fontmanager->factories.setAutoDelete( true ); (*mit).interface->release(); (*mit).library->unload(); delete (*mit).library; } factoryList->clear(); - QString path = QPEApplication::qpeDir() + "/plugins/fontfactories"; + QString path = QPEApplication::qpeDir() + "plugins/fontfactories"; #ifdef Q_OS_MACX QDir dir( path, "lib*.dylib" ); #else QDir dir( path, "lib*.so" ); #endif if ( !dir.exists()) return; QStringList list = dir.entryList(); QStringList::Iterator it; for ( it = list.begin(); it != list.end(); ++it ) { FontFactoryInterface *iface = 0; QLibrary *lib = new QLibrary( path + "/" + *it ); if ( lib->queryInterface( IID_FontFactory, (QUnknownInterface**)&iface ) == QS_OK ) { FontFactory factory; factory.library = lib; factory.interface = iface; factory.factory = factory.interface->fontFactory(); factoryList->append( factory ); qt_fontmanager->factories.append( factory.factory ); readFonts( factory.factory ); } else { delete lib; } } #endif #endif } /*! \internal */ void FontDatabase::readFonts( QFontFactory *factory ) { #ifndef QWS return; #else // Load in font definition file QString fn = fontDir() + "fontdir"; FILE* fontdef=fopen(fn.local8Bit(),"r"); if(!fontdef) { QCString temp=fn.local8Bit(); qWarning("Cannot find font definition file %s - is $QTDIR set correctly?", temp.data()); return; } char buf[200]=""; diff --git a/library/network.cpp b/library/network.cpp index f2a673c..0bbbec1 100644 --- a/library/network.cpp +++ b/library/network.cpp @@ -374,75 +374,75 @@ bool Network::networkOnline() return ns && ns->networkOnline(); } /*! \internal */ void Network::createServer(QObject* parent) { ns = new NetworkServer(parent); } /*! \internal */ int Network::addStateWidgets(QWidget* parent) { int n=0; QStringList l = Network::choices(); QVBoxLayout* vb = new QVBoxLayout(parent); for (QStringList::ConstIterator it=l.begin(); it!=l.end(); ++it) { Config cfg(*it,Config::File); cfg.setGroup("Info"); QString type = cfg.readEntry("Type"); NetworkInterface* plugin = Network::loadPlugin(type); cfg.setGroup("Properties"); if ( plugin ) { QWidget* w; if ( (w=plugin->addStateWidget(parent,cfg)) ) { n++; vb->addWidget(w); } } } return n; } static QDict<NetworkInterface> *ifaces; /*! \internal */ NetworkInterface* Network::loadPlugin(const QString& type) { #ifndef QT_NO_COMPONENT if ( !ifaces ) ifaces = new QDict<NetworkInterface>; NetworkInterface *iface = ifaces->find(type); if ( !iface ) { #ifdef Q_OS_MACX - QString libfile = QPEApplication::qpeDir() + "/plugins/network/lib" + type + ".dylib"; + QString libfile = QPEApplication::qpeDir() + "plugins/network/lib" + type + ".dylib"; #else - QString libfile = QPEApplication::qpeDir() + "/plugins/network/lib" + type + ".so"; + QString libfile = QPEApplication::qpeDir() + "plugins/network/lib" + type + ".so"; #endif QLibrary lib(libfile); if ( !lib.queryInterface( IID_Network, (QUnknownInterface**)&iface ) == QS_OK ) return 0; ifaces->insert(type,iface); QStringList langs = Global::languageList(); for (QStringList::ConstIterator it = langs.begin(); it!=langs.end(); ++it) { QString lang = *it; QTranslator * trans = new QTranslator(qApp); - QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/lib"+type+".qm"; + QString tfn = QPEApplication::qpeDir()+"i18n/"+lang+"/lib"+type+".qm"; if ( trans->load( tfn )) qApp->installTranslator( trans ); else delete trans; } } return iface; #else return 0; #endif } #include "network.moc" #endif // QT_NO_COP diff --git a/library/qpedecoration_qws.cpp b/library/qpedecoration_qws.cpp index 7842ebd..8b02de6 100644 --- a/library/qpedecoration_qws.cpp +++ b/library/qpedecoration_qws.cpp @@ -491,97 +491,97 @@ static QString libname; bool QPEDecoration::helpExists() const { if ( helpFile.isNull() ) { QStringList helpPath = Global::helpPath(); QString hf = QString(qApp->argv()[0]) + ".html"; bool he = FALSE; for (QStringList::ConstIterator it=helpPath.begin(); it!=helpPath.end() && !he; ++it) he = QFile::exists( *it + "/" + hf ); ((QPEDecoration*)this)->helpFile = hf; ((QPEDecoration*)this)->helpexists = he; return he; } return helpexists; } QPEDecoration::QPEDecoration() : QWSDefaultDecoration() { if ( wdlib ) { delete wdlib; wdlib = 0; } else { delete wdiface; } wdiface = new DefaultWindowDecoration; helpexists = FALSE; // We don't know (flagged by helpFile being null) qpeManager = new QPEManager( this ); imageOk = Resource::loadImage( "OKButton" ); imageClose = Resource::loadImage( "CloseButton" ); imageHelp = Resource::loadImage( "HelpButton" ); } QPEDecoration::QPEDecoration( const QString &plugin ) : QWSDefaultDecoration() { libname = plugin; if ( wdlib ) { wdiface->release(); wdlib->unload(); delete wdlib; wdlib = 0; } else { delete wdiface; } WindowDecorationInterface *iface = 0; - QString path = QPEApplication::qpeDir() + "/plugins/decorations/"; + QString path = QPEApplication::qpeDir() + "plugins/decorations/"; #ifdef Q_OS_MACX if ( plugin.find( ".dylib" ) > 0 ) { #else if ( plugin.find( ".so" ) > 0 ) { #endif // full library name supplied path += plugin; } else { #ifdef Q_OS_MACX path += "lib" + plugin.lower() + ".dylib"; // compatibility #else path += "lib" + plugin.lower() + ".so"; // compatibility #endif } QLibrary *lib = new QLibrary( path ); if ( lib->queryInterface( IID_WindowDecoration, (QUnknownInterface**)&iface ) == QS_OK && iface ) { wdiface = iface; wdlib = lib; } else { delete lib; wdiface = new DefaultWindowDecoration; } helpexists = FALSE; // We don't know (flagged by helpFile being null) qpeManager = new QPEManager( this ); } QPEDecoration::~QPEDecoration() { delete qpeManager; } const char **QPEDecoration::menuPixmap() { return (const char **)0; } const char **QPEDecoration::closePixmap() { return (const char **)qpe_close_xpm; } const char **QPEDecoration::minimizePixmap() { diff --git a/libslcompat/slmisc.h b/libslcompat/slmisc.h index 20ba988..442b098 100644 --- a/libslcompat/slmisc.h +++ b/libslcompat/slmisc.h @@ -1,77 +1,77 @@ /* * Copyright (C) 2002 SHARP CORPORATION All rights reserved. */ #ifndef _SLMISC_H_INCLUDED #define _SLMISC_H_INCLUDED #include <qpe/qpeapplication.h> #include <qfileinfo.h> #include <qpe/global.h> #include <qmessagebox.h> #define _SLPOWER class QPopupMenu; class QListView; #if !defined(_SLPOWER) class PowerStatus; #else class SlPowerStatus; #endif class Config; typedef ulong SlResolutionScale; class SlMisc { public: static bool isExecutable(const QString &c) { - QFileInfo exec(QPEApplication::qpeDir() + "/bin/" + c); + QFileInfo exec(QPEApplication::qpeDir() + "bin/" + c); return exec.isExecutable(); }; static ulong availableMemory(); static bool invalidFileName(QString &fName); static QString getValidFileName(const QString &baseName); static QString getCanonicalPath(const QString &fName); static void enableAutoPowerOff(bool isOn); static void enableAutoPowerOff(bool isOn,bool DimAlso,bool ScreenSaverAlso=FALSE); static void enableLockApplication(bool); static bool isTheSmbShareFileHasWriteEntry(const QString &shareFName); static bool isTheSmbShareFileNowCopy(const QString &shareFName); static bool checkTheSmbShareFileMode(const QString &shareFName, char modeMask, char checkMode, bool equality); static bool isTheFileLockedBySmbd(const QString &fName); static bool isSambaForked(); static void startSamba(); static void stopSamba(); enum ListType { Pid, CmdLine, Both }; static QStringList procList (const QRegExp& re, uint max = 0, enum ListType type = Pid); static void dumpMemInfo(bool isShowHeap); static bool canCreateTheFile(const QString&); static QString getLanguage(); static QSize getMaximizedWidgetInfo(); static QSize SlMisc::getScrollbarMetrics(); static int getDpi(); static SlResolutionScale getResolutionScale(); static int getMaximizedWidgetContentsWidth(); static bool isLandscape(); static void requestCloseFile(const QString&); static void requestOpenFile(const QString&); static void insertStandardFontMenu(QPopupMenu *pm); static void insertAllFontMenu(QPopupMenu *pm); static int getLogicalSizeFromMenuId(int id); static void setFontSizeItemChecked(QPopupMenu *pm,int logicalSize); static int getFontPointSize(int logicalSize); static void toggleFontSize(QPopupMenu *pm,int &logicalSize,bool isLarge=true); static void toggleAllFontSize(QPopupMenu *pm,int *fontSize,bool isLarge=true); static void SlFontArrange (QWidget* widget); static void SlLayoutSpaceArrange (QObject* object); static bool checkBatteryError(const QString &module_name, bool force); static bool checkBatteryErrorWithoutDialog(const QString &module_name, bool force); enum InputDeviceType { BuiltinKeyboard = 1, diff --git a/noncore/applets/zkbapplet/applet/zkbwidget.cpp b/noncore/applets/zkbapplet/applet/zkbwidget.cpp index 8499500..13729ea 100644 --- a/noncore/applets/zkbapplet/applet/zkbwidget.cpp +++ b/noncore/applets/zkbapplet/applet/zkbwidget.cpp @@ -1,92 +1,92 @@ #include <opie2/otaskbarapplet.h> #include <opie2/okeyfilter.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/applnk.h> #include <qpe/qpeapplication.h> #include <qpe/resource.h> #include <stdio.h> #include <unistd.h> #include "zkbwidget.h" #include "zkbcfg.h" using namespace Opie::Ui; ZkbWidget::ZkbWidget(QWidget* parent) :QLabel(parent),keymap(0),disabled(Resource::loadPixmap("zkb-disabled")) { labels = new QPopupMenu(); connect(labels, SIGNAL(activated(int)), this, SLOT(labelChanged(int))); loadKeymap(); channel = new QCopChannel("QPE/zkb", this); connect(channel, SIGNAL(received(const QCString&,const QByteArray&)), this, SLOT(signalReceived(const QCString&,const QByteArray&))); setFixedWidth ( AppLnk::smallIconSize() ); setFixedHeight ( AppLnk::smallIconSize() ); } ZkbWidget::~ZkbWidget() { if (keymap != 0) { delete keymap; keymap = 0; } } int ZkbWidget::position() { return 8; } bool ZkbWidget::loadKeymap() { - ZkbConfig c(QPEApplication::qpeDir()+"/share/zkb"); + ZkbConfig c(QPEApplication::qpeDir()+"share/zkb"); QFontMetrics fm(font()); if (keymap != 0) { delete keymap; keymap = 0; } Keymap* km = new Keymap(); if (!c.load("zkb.xml", *km, "")) { delete km; setPixmap(disabled); return false; } connect(km, SIGNAL(stateChanged(const QString&)), this, SLOT(stateChanged(const QString&))); Opie::Core::OKeyFilter::inst()->addHandler(km); Keymap* oldkm = keymap; keymap = km; if (oldkm != 0) { delete oldkm; } QString ltext = keymap->getCurrentLabel(); if (ltext.length()==0) ltext = "??"; setText(ltext); labels->clear(); QStringList l = keymap->listLabels(); labels->insertItem(disabled, 0, 0); int n = 1; w = 0; for(QStringList::Iterator it = l.begin(); it != l.end(); ++it, n++) { // printf("label: %s\n", (const char*) (*it).utf8()); labels->insertItem(*it, n, n); int lw = fm.width(*it); if (lw > w) { w = lw; } } diff --git a/noncore/applets/zkbapplet/keyzcfg/cfgdlg.cpp b/noncore/applets/zkbapplet/keyzcfg/cfgdlg.cpp index 8d868d4..4190a9e 100644 --- a/noncore/applets/zkbapplet/keyzcfg/cfgdlg.cpp +++ b/noncore/applets/zkbapplet/keyzcfg/cfgdlg.cpp @@ -23,110 +23,110 @@ CfgDlg::CfgDlg(QWidget* parent, CfgFile* cf, QApplication* app, bool mod): connect(delButton, SIGNAL(clicked()), this, SLOT(del())); QPushButton* slabelButton = new QPushButton("Set Label", this); //apply->setText("Apply"); connect(slabelButton, SIGNAL(clicked()), this, SLOT(setLabel())); QLabel* l = new QLabel("Label", this); label = new QLineEdit(this); QLabel* adlabel = new QLabel("Auto Repeat Delay (ms)", this); QLabel* aplabel = new QLabel("Auto Repeat Period (ms)", this); ad = new QSpinBox(50, 5000, 5, this); ap = new QSpinBox(0, 5000, 5, this); // QLabel* adms = new QLabel("ms", this); // QLabel* apms = new QLabel("ms", this); // QCheckBox* enable = new QCheckBox("Enable", t); gl->setColStretch(0, 1); gl->setColStretch(1, 1); gl->setColStretch(3, 1); gl->setColStretch(4, 1); gl->setRowStretch(3, 1); gl->addMultiCellWidget(flabel, 0, 0, 0, 1); gl->addMultiCellWidget(klabel, 0, 0, 3, 4); gl->addMultiCellWidget(files, 1, 3, 0, 1); gl->addMultiCellWidget(keymaps, 1, 3, 3, 4); gl->addWidget(addButton, 1, 2); gl->addWidget(delButton, 2, 2); gl->addWidget(l, 4, 0); gl->addWidget(label, 4, 1); gl->addMultiCellWidget(slabelButton, 4, 4, 3, 4); gl->addMultiCellWidget(adlabel, 5, 5, 0, 2); gl->addMultiCellWidget(ad, 5, 5, 3, 4); // gl->addWidget(adms, 5, 3); gl->addMultiCellWidget(aplabel, 6, 6, 0, 2); gl->addMultiCellWidget(ap, 6, 6, 3, 4); // gl->addWidget(apms, 6, 3); QList<CfgEntry>& e = cfile->getEntries(); for(uint i = 0; i < e.count(); i++) { CfgEntry* entry = e.at(i); keymaps->insertItem(entry->getFile()); m.insert(entry->getFile(), entry->getLabel()); } - QDir dir(QPEApplication::qpeDir()+"/share/zkb", "*.xml"); + QDir dir(QPEApplication::qpeDir()+"share/zkb", "*.xml"); QStringList flist = dir.entryList(); QStringList::Iterator sit; for(sit = flist.begin(); sit != flist.end(); ++sit) { if (*sit != "common.xml" && *sit != "zkb.xml" && m.find(*sit) == m.end()) { files->insertItem(*sit); } } ad->setValue(cfile->getAutorepeatDelay()); ap->setValue(cfile->getAutorepeatPeriod()); // gl->addMultiCellWidget(enable, 7, 7, 0, 4); } CfgDlg::~CfgDlg() { } void CfgDlg::add() { if (!files->currentText().isEmpty()) { QString t = files->currentText(); files->removeItem(files->currentItem()); keymaps->insertItem(t); cfile->replaceEntry(t, ""); m.replace(t, ""); } } void CfgDlg::del() { if (!keymaps->currentText().isEmpty()) { QString t = keymaps->currentText(); keymaps->removeItem(keymaps->currentItem()); cfile->deleteEntry(t); files->insertItem(t); m.remove(files->currentText()); } } void CfgDlg::setLabel() { if (!keymaps->currentText().isEmpty()) { cfile->replaceEntry(keymaps->currentText(), label->text()); m.replace(keymaps->currentText(), label->text()); } } void CfgDlg::keymapHighlighted(const QString&text) { label->setText(*m.find(text)); } void CfgDlg::accept() { cfile->setAutorepeatDelay(ad->value()); cfile->setAutorepeatPeriod(ap->value()); CfgParser p; - p.save(QPEApplication::qpeDir()+"/share/zkb/zkb.xml", *cfile); + p.save(QPEApplication::qpeDir()+"share/zkb/zkb.xml", *cfile); QCopEnvelope("QPE/zkb", "reload()"); QDialog::accept(); } diff --git a/noncore/applets/zkbapplet/keyzcfg/main.cpp b/noncore/applets/zkbapplet/keyzcfg/main.cpp index 4615562..afd0f6a 100644 --- a/noncore/applets/zkbapplet/keyzcfg/main.cpp +++ b/noncore/applets/zkbapplet/keyzcfg/main.cpp @@ -1,22 +1,22 @@ #include <stdio.h> #include <qpe/qpeapplication.h> #include <qlayout.h> #include <qmainwindow.h> #include "cfgdlg.h" int main( int argc, char **argv ) { QPEApplication app(argc, argv); CfgFile cfile; CfgParser cp; - cp.load(QPEApplication::qpeDir()+"/share/zkb/zkb.xml", cfile); + cp.load(QPEApplication::qpeDir()+"share/zkb/zkb.xml", cfile); CfgDlg c(0, &cfile, &app, true); app.showMainWidget(&c); int ret = QPEApplication::execDialog(&c); return ret; } diff --git a/noncore/apps/opie-bartender/bartender.cpp b/noncore/apps/opie-bartender/bartender.cpp index 59fc242..b4958b3 100644 --- a/noncore/apps/opie-bartender/bartender.cpp +++ b/noncore/apps/opie-bartender/bartender.cpp @@ -68,97 +68,97 @@ Bartender::Bartender( QWidget* parent, const char* name, WFlags fl ) fileMenu->insertItem(tr("Open Drink")); fileMenu->insertItem(tr("Find by Drink Name")); fileMenu->insertItem(tr("Find by Alcohol")); QPopupMenu *editMenu; editMenu = new QPopupMenu( this); menuBar->insertItem( tr("Edit"), editMenu ); editMenu->insertItem(tr("edit")); connect( fileMenu, SIGNAL( activated(int) ), this, SLOT( fileMenuActivated(int) )); connect( editMenu, SIGNAL( activated(int) ), this, SLOT( editMenuActivated(int) )); QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), "New", 0, this, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); a->addTo( ToolBar1 ); a = new QAction( tr( "Open" ), Resource::loadPixmap( "bartender/bartender_sm" ), "open", 0, this, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( openCurrentDrink() ) ); a->addTo( ToolBar1 ); a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), "Find", 0, this, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( askSearch() ) ); a->addTo( ToolBar1 ); a = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ),"Edit", 0, this, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( doEdit() ) ); a->addTo( ToolBar1 ); QPushButton *t; t= new QPushButton( "BAC", ToolBar1, "bacButtin"); connect( t, SIGNAL( clicked() ), this, SLOT( doBac() ) ); DrinkView = new QListView( this, "DrinkView" ); DrinkView->addColumn( tr( "Name of Drink" ) ); // DrinkView->setRootIsDecorated( TRUE ); DrinkView->header()->hide(); QPEApplication::setStylusOperation( DrinkView->viewport(),QPEApplication::RightOnHold); connect(DrinkView, SIGNAL( doubleClicked(QListViewItem*)),this,SLOT(showDrink(QListViewItem*))); connect(DrinkView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), this,SLOT( showDrink(int,QListViewItem*,const QPoint&,int))); layout->addMultiCellWidget( DrinkView, 1, 2, 0, 4 ); if(QDir("db").exists()) { dbFile.setName( "db/drinkdb.txt"); } else - dbFile.setName( QPEApplication::qpeDir()+"/etc/bartender/drinkdb.txt"); + dbFile.setName( QPEApplication::qpeDir()+"etc/bartender/drinkdb.txt"); initDrinkDb(); } Bartender::~Bartender() { } /* this happens right before exit */ void Bartender::cleanUp() { dbFile.close(); } void Bartender::initDrinkDb() { if(!dbFile.isOpen()) if ( !dbFile.open( IO_ReadOnly)) { QMessageBox::message( (tr("Note")), (tr("Drink database not opened sucessfully.\n")) ); return; } fillList(); } void Bartender::fillList() { dbFile.at(1); DrinkView->clear(); int i=0; QListViewItem * item ; QTextStream t( &dbFile); QString s; while ( !t.eof()) { s = t.readLine(); if(s.find("#",0,TRUE) != -1) { // odebug << s.right(s.length()-2) << oendl; item= new QListViewItem( DrinkView, 0 ); item->setText( 0, s.right(s.length()-2)); i++; } } odebug << "there are currently " << i << " of drinks" << oendl; } void Bartender::fileNew() { New_Drink *newDrinks; newDrinks = new New_Drink(this,"New Drink....", TRUE); QString newName, newIng; QPEApplication::execDialog( newDrinks ); diff --git a/noncore/apps/opie-console/fixit.cpp b/noncore/apps/opie-console/fixit.cpp index 3b0044a..f170074 100644 --- a/noncore/apps/opie-console/fixit.cpp +++ b/noncore/apps/opie-console/fixit.cpp @@ -9,86 +9,86 @@ FixIt::FixIt() { m_file = "#\n# /etc/inittab" "#" "" "# 0 - halt (Do NOT set initdefault to this)" "# 1 - Single user mode" "# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)" "# 3 - Full multiuser mode" "# 4 - JavaVM(Intent) developer mode" "# 5 - JavaVM(Intent)" "# 6 - reboot (Do NOT set initdefault to this)" "#" "id:5:initdefault:" "" "# Specify things to do when starting" "si::sysinit:/etc/rc.d/rc.sysinit" "" "l0:0:wait:/root/etc/rc.d/rc 0" "l1:1:wait:/etc/rc.d/rc 1" "l2:2:wait:/etc/rc.d/rc 2" "l3:3:wait:/etc/rc.d/rc 3" "l4:4:wait:/etc/rc.d/rc 4" "l5:5:wait:/etc/rc.d/rc 5" "l6:6:wait:/root/etc/rc.d/rc 6" "" "# Specify things to do before rebooting" "um::ctrlaltdel:/bin/umount -a -r > /dev/null 2>&1" "sw::ctrlaltdel:/sbin/swapoff -a > /dev/null 2>&1" "" "# Specify program to run on ttyS0" "s0:24:respawn:/sbin/getty 9600 ttyS0" "#pd:5:respawn:/etc/sync/serialctl" "" "# Specify program to run on tty1" "1:2:respawn:/sbin/getty 9600 tty1" "ln:345:respawn:survive -l 6 /sbin/launch" "#qt:5:respawn:/sbin/qt" "" "# collie sp." "sy::respawn:/sbin/shsync\n"; } /* * the retail Zaurus is broken in many ways * one is that pppd is listening on our port... * we've to stop it from that and then do kill(SIGHUP,1); */ void FixIt::fixIt() { #ifndef EAST - ::rename("/etc/inittab", QPEApplication::qpeDir() + "/etc/inittab" ); + ::rename("/etc/inittab", QPEApplication::qpeDir() + "etc/inittab" ); QFile file( "/etc/inittab" ); if ( file.open(IO_WriteOnly | IO_Raw ) ) { file.writeBlock(m_file,strlen(m_file) ); } file.close(); ::kill( SIGHUP, 1 ); #else OProcess m_kill; - m_kill << QPEApplication::qpeDir() + "/share/opie-console/sl6000_embedix_kill_0_1.sh"; + m_kill << QPEApplication::qpeDir() + "share/opie-console/sl6000_embedix_kill_0_1.sh"; if ( !m_kill.start(OProcess::DontCare,OProcess::NoCommunication) ) { owarn << "could not execute kill script" << oendl; } else { Global::statusMessage( QObject::tr("Fixing up Embedix")); } #endif } void FixIt::breakIt() { #ifdef EAST OProcess m_restart; - m_restart << QPEApplication::qpeDir() + "/share/opie-console/sl6000_embedix_restart_0_1.sh"; + m_restart << QPEApplication::qpeDir() + "share/opie-console/sl6000_embedix_restart_0_1.sh"; if ( !m_restart.start(OProcess::DontCare,OProcess::NoCommunication) ) { owarn << "could not execute restart script" << oendl; } #endif } #endif diff --git a/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp b/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp index 020a116..3c096ed 100644 --- a/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp +++ b/noncore/apps/opie-gutenbrowser/LibraryDialog.cpp @@ -5,101 +5,101 @@ // copyright : (C) 2000 - 2004 by llornkcor // email : ljp@llornkcor.com // ***************************************************/ // /*************************************************************************** // * This program is free software; you can redistribute it and/or modify * // * it under the terms of the GNU General Public License as published by * // * the Free Software Foundation; either version 2 of the License, or * // * (at your option) any later version. * // ***************************************************************************/ //ftp://ibiblio.org/pub/docs/books/gutenberg/GUTINDEX.ALL #include "LibraryDialog.h" #include "output.h" /* OPIE */ #include <qpe/applnk.h> #include <qpe/qpeapplication.h> #include <qpe/qpedialog.h> #include <opie2/odebug.h> /* QT */ #include <qpushbutton.h> #include <qmultilineedit.h> //#include <qlayout.h> /* STD */ #include <unistd.h> #include <stdio.h> #include <stdlib.h> /* * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ LibraryDialog::LibraryDialog( QWidget* parent, const char* name , bool /*modal*/, WFlags fl ) : QDialog( parent, name, true/* modal*/, fl ) { if ( !name ) setName( "LibraryDialog" ); indexLoaded=false; initDialog(); // this->setMaximumWidth(240); index = "GUTINDEX.ALL"; local_library = (QDir::homeDirPath ()) +"/Applications/gutenbrowser/"; local_index = local_library + index; QString iniFile ; - iniFile = QPEApplication::qpeDir()+"/etc/gutenbrowser/gutenbrowserrc"; + iniFile = QPEApplication::qpeDir()+"etc/gutenbrowser/gutenbrowserrc"; - new_index =QPEApplication::qpeDir()+"/etc/gutenbrowser/PGWHOLE.TXT"; + new_index =QPEApplication::qpeDir()+"etc/gutenbrowser/PGWHOLE.TXT"; - old_index = QPEApplication::qpeDir()+"/etc/gutenbrowser/GUTINDEX.ALL"; + old_index = QPEApplication::qpeDir()+"etc/gutenbrowser/GUTINDEX.ALL"; // old_index = QPEApplication::qpeDir()+"etc/gutenbrowser/GUTINDEX.ALL"; // iniFile = local_library+"gutenbrowserrc"; // new_index = local_library + "PGWHOLE.TXT"; // old_index = local_library + "GUTINDEX.ALL"; Config config("Gutenbrowser"); config.setGroup( "HttpServer" ); proxy_http = config.readEntry("Preferred", "http://sailor.gutenbook.org"); config.setGroup( "FTPsite" ); ftp_host=config.readEntry("SiteName", "sailor.gutenberg.org"); odebug << "Library Dialog: ftp_host is "+ftp_host << oendl; // ftp_host=ftp_host.right(ftp_host.length()-(ftp_host.find(") ",0,TRUE)+1) ); // ftp_host=ftp_host.stripWhiteSpace(); ftp_base_dir= config.readEntry("base", "/pub/gutenberg"); i_binary = 0; config.setGroup("SortAuth"); if( config.readEntry("authSort", "FALSE") == "TRUE") authBox->setChecked(TRUE); config.setGroup("General"); downDir =config.readEntry( "DownloadDirectory",local_library); odebug << "downDir is "+downDir << oendl; newindexLib.setName( old_index); indexLib.setName( old_index); new QPEDialogListener(this); QTimer::singleShot( 1000, this, SLOT( FindLibrary()) ); } LibraryDialog::~LibraryDialog() { // delete QList_Item2; // delete QList_Item1; // delete QList_Item3; // delete QList_Item4; // delete QList_Item5; // saveConfig(); } /*This groks using PGWHOLE.TXT */ void LibraryDialog::Newlibrary() diff --git a/noncore/apps/opie-gutenbrowser/ftpsitedlg.cpp b/noncore/apps/opie-gutenbrowser/ftpsitedlg.cpp index a9c7346..de9c72b 100644 --- a/noncore/apps/opie-gutenbrowser/ftpsitedlg.cpp +++ b/noncore/apps/opie-gutenbrowser/ftpsitedlg.cpp @@ -1,89 +1,89 @@ /*************************************************************************** ftpsitedlg.cpp - description ------------------- begin : Tue Jul 25 2000 copyright : (C) 2000 -2004 by llornkcor email : ljp@llornkcor.com ***************************************************************************/ /*************************************************************************** * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ #include "optionsDialog.h" #include "gutenbrowser.h" //#include "NetworkDialog.h" #include "output.h" /* OPIE */ #include <opie2/odebug.h> #include <qpe/config.h> /* QT */ #include <qprogressbar.h> #include <qurloperator.h> #include <qlistbox.h> /* STD */ #include <stdlib.h> #include <unistd.h> #include <stdio.h> // :)~ void optionsDialog::ftpSiteDlg( ) { //printf( "ftpSiteDlg: ListFile is "+ ListFile +"\n" ); // initDialog(); local_library = (QDir::homeDirPath ()) +"/Applications/gutenbrowser/"; // ListFile = local_library + "ftpList"; - ListFile = QPEApplication::qpeDir() + "/etc/gutenbrowser"; + ListFile = QPEApplication::qpeDir() + "etc/gutenbrowser"; QDir dir(ListFile); if( !dir.exists()) dir.mkdir(ListFile,true); ListFile+="/ftpList"; odebug << "opening "+ListFile << oendl; if ( QFile(ListFile).exists() ) { openSiteList(); } else { switch( QMessageBox::warning( this, "Gutenbrowser", "Do you want to download \nan ftp site list?", QMessageBox::Yes, QMessageBox::No)) { case QMessageBox::Yes: // yes getSite(); break; case QMessageBox::No: // No // exit break; } } } /* // get ftp list from web- parse it. */ void optionsDialog::getSite() { QString file_name; QString ftp_listFileURL; QString outputFile; // outputFile = local_library+ "list.html"; outputFile = ListFile + "list.html"; QString networkUrl= "http://www.gutenberg.org/www/mirror.sites.html"; //http://www.gutenberg.org/index.html"; // QString networkUrl= "http://llornkcor.com/index.shtml"; // // "http://www.gutenberg.org/index.html" // //Qhttp stops working at times.... :( // NetworkDialog *NetworkDlg; // NetworkDlg = new NetworkDialog( this,"Network Protocol Dialog",TRUE,0,networkUrl,outputFile); // if( NetworkDlg->exec() != 0 ) // { // use new, improved, *INSTANT* network-dialog-file-getterer // odebug << "gitcha!" << oendl; // } // delete NetworkDlg; //#ifdef Q_WS_QWS // TODO qprocess here diff --git a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp index 644fae8..fac21da 100644 --- a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp +++ b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp @@ -97,102 +97,102 @@ Gutenbrowser::Gutenbrowser(QWidget *,const char*, WFlags ) buttons2 = new QHBoxLayout(-1,"buttons2"); edits = new QHBoxLayout(-1,"edits"); useSplitter=TRUE; initConfig(); initMenuBar(); initButtonBar(); initStatusBar(); initView(); initSlots(); qDebug("init finished"); QPEApplication::setStylusOperation( mainList->viewport(),QPEApplication::RightOnHold); connect( mainList, SIGNAL( mouseButtonPressed( int, QListBoxItem *, const QPoint &)), this, SLOT( mainListPressed(int, QListBoxItem *, const QPoint &)) ); if( useIcons) toggleButtonIcons( TRUE); else toggleButtonIcons( FALSE); enableButtons(false); Config config("Gutenbrowser"); // populate menubuttonlist config.setGroup("General"); config.setGroup( "Files" ); QString s_numofFiles = config.readEntry("NumberOfFiles", "0" ); int i_numofFiles = s_numofFiles.toInt(); QString tempFileName; for (int i = 0; i <= i_numofFiles; i++) { // tempFileName.setNum(i); config.setGroup( "Files" ); QString ramble = config.readEntry( QString::number(i), "" ); config.setGroup( "Titles" ); QString tempTitle = config.readEntry( ramble, ""); config.setGroup( tempTitle); int index = config.readNumEntry( "LineNumber", -1 ); if( index != -1) { odebug << tempTitle << oendl; if(!tempTitle.isEmpty()) bookmarksMenu->insertItem( tempTitle); } } // QString gutenIndex= local_library + "GUTINDEX.ALL"; - QString gutenIndex = QPEApplication::qpeDir()+ "/etc/gutenbrowser/GUTINDEX.ALL"; + QString gutenIndex = QPEApplication::qpeDir()+ "etc/gutenbrowser/GUTINDEX.ALL"; qDebug("gutenindex "+gutenIndex ); if( QFile( gutenIndex).exists() ) { indexLib.setName( gutenIndex); } else { - QString localLibIndexFile = QPEApplication::qpeDir()+ "/etc/gutenbrowser/PGWHOLE.TXT"; + QString localLibIndexFile = QPEApplication::qpeDir()+ "etc/gutenbrowser/PGWHOLE.TXT"; // QString localLibIndexFile= local_library + "PGWHOLE.TXT"; newindexLib.setName( localLibIndexFile); } qDebug("attempting new library"); LibraryDlg = new LibraryDialog( this, "Library Index" /*, TRUE */); loadCheck = false; chdir(local_library); if(!showMainList) { Lview->setFocus(); // if(firstTime) // Bookmark(); for (int i=1;i< qApp->argc();i++) { qDebug("Suppose we open somethin"); if(!load(qApp->argv()[i])) return; } } else { fillWithTitles(); mainList->setFocus(); // mainList->setCurrentItem(0); } writeConfig(); QTimer::singleShot( 250, this, SLOT(hideView()) ); } //end init Gutenbrowser::~Gutenbrowser() { // QPEApplication::grabKeyboard(); // QPEApplication::ungrabKeyboard(); odebug << "Exit" << oendl; } /* Google.com search */ void Gutenbrowser::InfoBarClick() { QString text; if( Lview->hasSelectedText()) { Lview->copy(); QClipboard *cb = QApplication::clipboard(); text = cb->text(); } else { // text=title; text=this->caption(); } searchGoogle(text); } /* download http with wget or preferred browser */ diff --git a/noncore/apps/opie-gutenbrowser/helpme.cpp b/noncore/apps/opie-gutenbrowser/helpme.cpp index 53e0236..0e23114 100644 --- a/noncore/apps/opie-gutenbrowser/helpme.cpp +++ b/noncore/apps/opie-gutenbrowser/helpme.cpp @@ -13,97 +13,97 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "helpme.h" #include "helpwindow.h" /* OPIE */ #include <qpe/qcopenvelope_qws.h> #include <qpe/qpeapplication.h> #include <opie2/odebug.h> /* QT */ #include <qprogressdialog.h> #include <qlayout.h> /* STD */ #include <sys/stat.h> #include <unistd.h> HelpMe::HelpMe(QWidget *parent, QString name ) : QDialog(parent,name) { local_library = ( QDir::homeDirPath ())+"/Applications/gutenbrowser/"; setCaption(tr("Gutenbrowser About " VERSION)); QGridLayout *layout = new QGridLayout( this ); layout->setSpacing( 4 ); layout->setMargin( 4 ); Edit = new QMultiLineEdit(this, ""); Edit->setReadOnly(true); Edit->append(tr("Based on gutenbook.pl, available from http://www.gutenbook.org")); Edit->append(tr("Much appreciation to Lee Burgess,")); Edit->append(tr("for the original idea and concept of gutenbook.\n")); Edit->append(tr("A list of current Gutenberg ftp sites is at http://promo.net/pg/index.html\n")); Edit->append(tr("For bug reports, comments or questions about Gutenbrowser, email")); Edit->append(tr("ljp@llornkcor.com\n")); Edit->append(tr("\nMade using Qt, Qt Embedded, and Qtopia, a cross platform development API\nhttp://www.trolltech.com\n\n")); Edit->append(tr("Arnold's Laws of Documentation:")); Edit->append(tr("(1) If it should exist, it doesn't.")); Edit->append(tr("(2) If it does exist, it's out of date.")); Edit->append(tr("(3) Only documentation for")); Edit->append(tr("useless programs transcends the")); Edit->append(tr("first two laws.\n")); Edit->append(tr("Everything is temporary, anyway....\n :o)")); Edit->setWordWrap(QMultiLineEdit::WidgetWidth); QString pixDir; - pixDir=QPEApplication::qpeDir()+"/pics/"; + pixDir=QPEApplication::qpeDir()+"pics/"; QPushButton *help; help = new QPushButton(this); help->setPixmap( QPixmap( pixDir+"gutenbrowser/help.png")); help->setText("Help"); connect( help,SIGNAL(clicked()),this,SLOT( help() )); /* QPushButton *ok; ok = new QPushButton(this); ok->setPixmap( QPixmap( pixDir+"/gutenbrowser/exit.png")); ok->setText("ok"); connect(ok,SIGNAL(clicked()),this,SLOT(accept() )); */ help->setFixedHeight(25); // ok->setFixedHeight(25); // layout->addMultiCellWidget( ok, 0, 0, 4, 4 ); layout->addMultiCellWidget( help, 0, 0, 4, 4 ); layout->addMultiCellWidget( Edit, 1, 1, 0, 4 ); } HelpMe::~HelpMe() { //delete Edit; } void HelpMe::goToURL() { url = "http://www.llornkcor.com/"; goGetit( url); } void HelpMe::goToURL2() { url = "http://www.gutenberg.org"; goGetit( url); } void HelpMe::goToURL3() { url = "http://www.gutenbook.org"; goGetit( url); } void HelpMe::goGetit( QString url) { HelpWindow *help = new HelpWindow( url, ".", 0, "gutenbrowser"); diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp index 6aa6392..1ae3b15 100644 --- a/noncore/apps/zsafe/zsafe.cpp +++ b/noncore/apps/zsafe/zsafe.cpp @@ -2731,97 +2731,97 @@ void ZSafe::addCategory() QString categ; QString firstCategory; dialog->CategoryField->clear(); // remove all items while( it != list.end() ) { QString *cat = new QString (*it); if (cat->contains("-field1", FALSE)) { #ifdef DESKTOP #ifndef Q_WS_WIN categ = cat->section ("-field1", 0, 0); #else int pos = cat->find ("-field1"); categ = cat->left (pos); #endif #else int pos = cat->find ("-field1"); cat->truncate(pos); categ = *cat; #endif if (!categ.isEmpty()) { dialog->CategoryField->insertItem (categ, -1); if (firstCategory.isEmpty()) firstCategory = categ; } } ++it; } if (firstCategory.isEmpty()) setCategoryDialogFields(dialog); else setCategoryDialogFields(dialog, firstCategory); // CategoryDialog *dialog = new CategoryDialog(this, "Category", TRUE); if (initIcons) { Wait waitDialog(this, tr("Wait dialog")); waitDialog.waitLabel->setText(tr("Gathering icons...")); waitDialog.show(); qApp->processEvents(); #ifdef DESKTOP QDir d(iconPath); #else - QDir d(QPEApplication::qpeDir() + "/pics/"); + QDir d(QPEApplication::qpeDir() + "pics/"); #endif d.setFilter( QDir::Files); const QFileInfoList *list = d.entryInfoList(); QFileInfoListIterator it( *list ); // create list iterator QFileInfo *fi; // pointer for traversing dialog->IconField->insertItem("predefined"); while ( (fi=it.current()) ) { // for each file... QString fileName = fi->fileName(); if(fileName.right(4) == ".png"){ fileName = fileName.mid(0,fileName.length()-4); #ifdef DESKTOP QPixmap imageOfFile; imageOfFile.load(iconPath + fi->fileName()); #else QPixmap imageOfFile(Resource::loadPixmap(fileName)); #endif QImage foo = imageOfFile.convertToImage(); foo = foo.smoothScale(16,16); imageOfFile.convertFromImage(foo); dialog->IconField->insertItem(imageOfFile,fileName); } ++it; } waitDialog.hide(); } #ifndef Q_WS_WIN dialog->show(); #endif #ifndef DESKTOP // dialog->move (20, 100); #endif DialogCode result = (DialogCode) dialog->exec(); #ifdef DESKTOP result = Accepted; #endif QString category; QString icon; QString fullIconPath; QPixmap *pix; if (result == Accepted) { modified = true; category = dialog->CategoryField->currentText(); icon = dialog->IconField->currentText()+".png"; @@ -2915,154 +2915,154 @@ void ZSafe::delCategory() ListView->takeItem(selectedItem); delete selectedItem; selectedItem = NULL; break; case 1: // Don't delete break; } } } void ZSafe::setCategoryDialogFields(CategoryDialog *dialog) { if (!dialog) return; QString icon; if (selectedItem) { dialog->Field1->setText(getFieldLabel (selectedItem, "1", tr("Name"))); dialog->Field2->setText(getFieldLabel (selectedItem, "2", tr("Username"))); dialog->Field3->setText(getFieldLabel (selectedItem, "3", tr("Password"))); dialog->Field4->setText(getFieldLabel (selectedItem, "4", tr("Comment"))); dialog->Field5->setText(getFieldLabel (selectedItem, "5", tr("Field 4"))); dialog->Field6->setText(getFieldLabel (selectedItem, "6", tr("Field 5"))); Category *cat= categories.find (selectedItem->text(0)); if (cat) { icon = cat->getIconName(); } else icon = conf->readEntry(APP_KEY+selectedItem->text(0)); } else { dialog->Field1->setText(tr("Name")); dialog->Field2->setText(tr("Username")); dialog->Field3->setText(tr("Password")); dialog->Field4->setText(tr("Comment")); dialog->Field5->setText(tr("Field 4")); dialog->Field6->setText(tr("Field 5")); } #ifdef DESKTOP QDir d(iconPath); #else - QDir d(QPEApplication::qpeDir() + "/pics/"); + QDir d(QPEApplication::qpeDir() + "pics/"); #endif d.setFilter( QDir::Files); const QFileInfoList *list = d.entryInfoList(); int i=0; QFileInfoListIterator it( *list ); // create list iterator QFileInfo *fi; // pointer for traversing if (icon.isEmpty() || icon.isNull()) { dialog->IconField->setCurrentItem(0); } else { while ( (fi=it.current()) ) { // for each file... QString fileName = fi->fileName(); if(fileName.right(4) == ".png") { fileName = fileName.mid(0,fileName.length()-4); if(fileName+".png"==icon) { dialog->IconField->setCurrentItem(i+1); break; } ++i; } ++it; } } } void ZSafe::setCategoryDialogFields(CategoryDialog *dialog, QString category) { if (!dialog) return; dialog->Field1->setText(getFieldLabel (category, "1", tr("Name"))); dialog->Field2->setText(getFieldLabel (category, "2", tr("Username"))); dialog->Field3->setText(getFieldLabel (category, "3", tr("Password"))); dialog->Field4->setText(getFieldLabel (category, "4", tr("Comment"))); dialog->Field5->setText(getFieldLabel (category, "5", tr("Field 4"))); dialog->Field6->setText(getFieldLabel (category, "6", tr("Field 5"))); QString icon; Category *cat= categories.find (category); if (cat) { icon = cat->getIconName(); } else icon = conf->readEntry(APP_KEY+category); #ifdef DESKTOP QDir d(iconPath); #else - QDir d(QPEApplication::qpeDir() + "/pics/"); + QDir d(QPEApplication::qpeDir() + "pics/"); #endif d.setFilter( QDir::Files); const QFileInfoList *list = d.entryInfoList(); int i=0; QFileInfoListIterator it( *list ); // create list iterator QFileInfo *fi; // pointer for traversing if (icon.isEmpty() || icon.isNull()) { dialog->IconField->setCurrentItem(0); } else { while ( (fi=it.current()) ) { // for each file... QString fileName = fi->fileName(); if(fileName.right(4) == ".png") { fileName = fileName.mid(0,fileName.length()-4); if(fileName+".png"==icon) { dialog->IconField->setCurrentItem(i+1); break; } ++i; } ++it; } } } void ZSafe::saveCategoryDialogFields(CategoryDialog *dialog) { QString app_key = APP_KEY; #ifndef DESKTOP conf->setGroup ("fieldDefs"); #else #ifndef Q_WS_WIN app_key += "/fieldDefs/"; #endif #endif QString category = dialog->CategoryField->currentText(); // #ifndef Q_WS_WIN conf->writeEntry(app_key+category+"-field1", dialog->Field1->text()); conf->writeEntry(app_key+category+"-field2", dialog->Field2->text()); conf->writeEntry(app_key+category+"-field3", dialog->Field3->text()); conf->writeEntry(app_key+category+"-field4", dialog->Field4->text()); @@ -3151,140 +3151,140 @@ void ZSafe::editCategory() #ifndef Q_WS_WIN categ = cat->section ("-field1", 0, 0); #else int pos = cat->find ("-field1"); categ = cat->left (pos); #endif #else int pos = cat->find ("-field1"); cat->truncate(pos); categ = *cat; #endif if (!categ.isEmpty()) { dialog->CategoryField->insertItem (categ, i); if (category.compare(categ) == 0) { dialog->CategoryField->setCurrentItem(i); foundCategory = true; } i++; } } ++it; } if (!foundCategory) { dialog->CategoryField->insertItem (category, i); dialog->CategoryField->setCurrentItem(i); } QString icon; Category *cat= categories.find (selectedItem->text(0)); if (cat) { icon = cat->getIconName(); } if (initIcons) { Wait waitDialog(this, tr("Wait dialog")); waitDialog.waitLabel->setText(tr("Gathering icons...")); waitDialog.show(); qApp->processEvents(); #ifdef DESKTOP QDir d(iconPath); #else - QDir d(QPEApplication::qpeDir() + "/pics/"); + QDir d(QPEApplication::qpeDir() + "pics/"); #endif d.setFilter( QDir::Files); const QFileInfoList *list = d.entryInfoList(); int i=0; QFileInfoListIterator it( *list ); // create list iterator QFileInfo *fi; // pointer for traversing if (icon.isEmpty() || icon.isNull()) { dialog->IconField->setCurrentItem(0); } dialog->IconField->insertItem("predefined"); while ( (fi=it.current()) ) { // for each file... QString fileName = fi->fileName(); if(fileName.right(4) == ".png") { fileName = fileName.mid(0,fileName.length()-4); #ifdef DESKTOP QPixmap imageOfFile; imageOfFile.load(iconPath + fi->fileName()); #else QPixmap imageOfFile(Resource::loadPixmap(fileName)); #endif QImage foo = imageOfFile.convertToImage(); foo = foo.smoothScale(16,16); imageOfFile.convertFromImage(foo); dialog->IconField->insertItem(imageOfFile,fileName); if(fileName+".png"==icon) dialog->IconField->setCurrentItem(i+1); ++i; } ++it; } waitDialog.hide(); } else { #ifdef DESKTOP // QDir d(QDir::homeDirPath() + "/pics/"); QDir d(iconPath); #else - QDir d(QPEApplication::qpeDir() + "/pics/"); + QDir d(QPEApplication::qpeDir() + "pics/"); #endif d.setFilter( QDir::Files); const QFileInfoList *list = d.entryInfoList(); int i=0; QFileInfoListIterator it( *list ); // create list iterator QFileInfo *fi; // pointer for traversing if (icon.isEmpty() || icon.isNull()) { dialog->IconField->setCurrentItem(0); } else { while ( (fi=it.current()) ) { // for each file... QString fileName = fi->fileName(); if(fileName.right(4) == ".png") { fileName = fileName.mid(0,fileName.length()-4); if(fileName+".png"==icon) { dialog->IconField->setCurrentItem(i+1); break; } ++i; } ++it; } } } // dialog->show(); #ifndef DESKTOP // dialog->move (20, 100); #endif DialogCode result = (DialogCode) dialog->exec(); #ifdef DESKTOP result = Accepted; #endif QString fullIconPath; QPixmap *pix; if (result == Accepted) { modified = true; diff --git a/noncore/games/backgammon/backgammon.cpp b/noncore/games/backgammon/backgammon.cpp index bdb1c78..c286a36 100644 --- a/noncore/games/backgammon/backgammon.cpp +++ b/noncore/games/backgammon/backgammon.cpp @@ -12,97 +12,97 @@ #include <qpe/resource.h> using namespace Opie::Core; /* QT */ #include <qfile.h> #include <qlayout.h> #include <qmessagebox.h> #include <qtimer.h> #include <qmenubar.h> #include <stdlib.h> BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl) : QMainWindow(parent, name, fl) { if (!name) setName("BackGammon"); setCaption(tr( "Backgammon") ); setIcon( Resource::loadPixmap( "backgammon" ) ); //general counter varaible int a=0; //the game engine move=new MoveEngine(); //load the default theme Config conf("backgammon"); if(!conf.isValid()) { odebug << "config file does not exist" << oendl; conf.setGroup("general"); conf.writeEntry("theme","default"); conf.setGroup("rules"); conf.writeEntry("move_with_pieces_out",false); conf.writeEntry("nice_dice",false); conf.setGroup("display"); conf.writeEntry("small",false); conf.writeEntry("warning",true); conf.setGroup("ai"); conf.writeEntry("rescue",6); conf.writeEntry("eliminate",4); conf.writeEntry("expose",1); conf.writeEntry("protect",5); conf.writeEntry("safe",3); conf.writeEntry("empty",2); } conf.setGroup("general"); theme_name=conf.readEntry("theme","default"); - QString theme_file=QPEApplication::qpeDir()+"/backgammon/"+theme_name+".theme"; + QString theme_file=QPEApplication::qpeDir()+"backgammon/"+theme_name+".theme"; //the rules conf.setGroup("rules"); rules.move_with_pieces_out=conf.readBoolEntry("move_with_pieces_out",false); rules.generous_dice=conf.readBoolEntry("nice_dice",false); move->setRules(rules); //get the AI settings AISettings ai; conf.setGroup("ai"); ai.rescue=conf.readNumEntry("rescue",6); ai.eliminate=conf.readNumEntry("eliminate",4); ai.expose=conf.readNumEntry("expose",1); ai.protect=conf.readNumEntry("protect",5); ai.safe=conf.readNumEntry("safe",3); ai.empty=conf.readNumEntry("empty",2); move->setAISettings(ai); //get the theme component names Config theme(theme_file,Config::File); if(!theme.isValid()) { odebug << "theme file does not exist" << oendl; theme.setGroup("theme"); theme.writeEntry("board","casino_board_1"); theme.writeEntry("pieces1","casino_pieces_blue"); theme.writeEntry("pieces2","casino_pieces_white"); theme.writeEntry("dice1","casino_dice"); theme.writeEntry("dice2","casino_dice"); theme.writeEntry("table","casino_table_green"); theme.writeEntry("odds","casino_odds"); } theme.setGroup("theme"); board_name=theme.readEntry("board","casino_board_1"); piecesA_name=theme.readEntry("pieces1","casino_pieces_blue"); piecesB_name=theme.readEntry("pieces2","casino_pieces_white"); diceA_name=theme.readEntry("dice1","casino_dice"); diceB_name=theme.readEntry("dice2","casino_dice"); table_name=theme.readEntry("table","casino_table_green"); odds_name=theme.readEntry("odds","casino_odds"); //the menu QMenuBar* menuBar = new QMenuBar(this); QPopupMenu* gamemenu= new QPopupMenu(this); @@ -283,278 +283,278 @@ BackGammon::~BackGammon() { //DESTRUCTOR } void BackGammon::newgame() { gameFinished=false; QDateTime now=QDateTime::currentDateTime(); game_name=now.date().toString()+"_"+now.time().toString(); move->reset(); draw(); diceA1_value=7; diceA2_value=7; diceA3_value=7; diceA4_value=7; diceB1_value=7; diceB2_value=7; diceB3_value=7; diceB4_value=7; showdice(); player=2; dice1_played=true; dice2_played=true; dice3_played=true; dice4_played=true; dice_rolled=false; setplayer(); area->update(); } void BackGammon::playerselect() { PlayerDialog* playerdialog=new PlayerDialog(this); playerdialog->setAuto1(player1_auto); playerdialog->setAuto2(player2_auto); if(!playerdialog->exec()) return; player1_auto=playerdialog->getAuto1(); player2_auto=playerdialog->getAuto2(); } void BackGammon::loadgame() { FileDialog* file=new FileDialog(this,"Load Game",".game"); if(!file->exec()) return; game_name=file->filename(); - QString game_file=QPEApplication::qpeDir()+"/backgammon/"+game_name+".game"; + QString game_file=QPEApplication::qpeDir()+"backgammon/"+game_name+".game"; Config game(game_file,Config::File); game.setGroup("dice"); diceA1_value=game.readNumEntry("diceA1_value"); diceA2_value=game.readNumEntry("diceA2_value"); diceA3_value=game.readNumEntry("diceA3_value"); diceA4_value=game.readNumEntry("diceA4_value"); diceB1_value=game.readNumEntry("diceB1_value"); diceB2_value=game.readNumEntry("diceB2_value"); diceB3_value=game.readNumEntry("diceB3_value"); diceB4_value=game.readNumEntry("diceB4_value"); player=game.readNumEntry("player"); dice1_played=game.readBoolEntry("dice1_played"); dice2_played=game.readBoolEntry("dice2_played"); dice3_played=game.readBoolEntry("dice3_played"); dice4_played=game.readBoolEntry("dice4_played"); dice_rolled=game.readBoolEntry("dice_rolled"); player1_auto=game.readBoolEntry("player1_auto"); player2_auto=game.readBoolEntry("player2_auto"); game.setGroup("pieces"); QString label; LoadSave load; for(int a=0;a<28;a++) { label.setNum(a); load.pop[a].total = game.readNumEntry(label,0); } move->loadGame(load); setplayer(); showdice(); draw(); area->update(); } void BackGammon::savegame() { - QString game_file=QPEApplication::qpeDir()+"/backgammon/"+game_name+".game"; + QString game_file=QPEApplication::qpeDir()+"backgammon/"+game_name+".game"; Config game(game_file,Config::File); game.setGroup("dice"); game.writeEntry("diceA1_value",diceA1_value); game.writeEntry("diceA2_value",diceA2_value); game.writeEntry("diceA3_value",diceA3_value); game.writeEntry("diceA4_value",diceA4_value); game.writeEntry("diceB1_value",diceB1_value); game.writeEntry("diceB2_value",diceB3_value); game.writeEntry("diceB3_value",diceB4_value); game.writeEntry("diceB4_value",diceB4_value); game.writeEntry("player",player); game.writeEntry("dice1_played",dice1_played); game.writeEntry("dice2_played",dice2_played); game.writeEntry("dice3_played",dice3_played); game.writeEntry("dice4_played",dice4_played); game.writeEntry("dice_rolled",dice_rolled); game.writeEntry("player1_auto",player1_auto); game.writeEntry("player2_auto",player2_auto); game.setGroup("pieces"); QString label; LoadSave save=move->saveGame(); for(int a=0;a<28;a++) { label.setNum(a); game.writeEntry(label,save.pop[a].total); } QMessageBox::information(this,"Backgammon","Game saved","OK"); } void BackGammon::deletegame() { FileDialog* file=new FileDialog(this,"Delete Game",".game"); if(!file->exec()) return; game_name=file->filename(); - QString game_file=QPEApplication::qpeDir()+"/backgammon/"+game_name+".game"; + QString game_file=QPEApplication::qpeDir()+"backgammon/"+game_name+".game"; if(!QMessageBox::warning(this,"Backgammon","deleted game\n"+game_name+" ?","OK","Cancel")) { QFile(game_file).remove(); } } void BackGammon::newtheme() { ThemeDialog* theme=new ThemeDialog(this); ImageNames names; names.theme=theme_name; names.board=board_name; names.pieces1=piecesA_name; names.pieces2=piecesB_name; names.dice1=diceA_name; names.dice2=diceB_name; names.odds=odds_name; names.table=table_name; theme->setCurrent(names); if(!theme->exec()) return; names=theme->getNames(); theme_name=names.theme; board_name=names.board; piecesA_name=names.pieces1; piecesB_name=names.pieces2; diceA_name=names.dice1; diceB_name=names.dice2; odds_name=names.odds; table_name=names.table; applytheme(); } void BackGammon::loadtheme() { FileDialog* file=new FileDialog(this,"Load Theme",".theme"); if(!file->exec()) return; theme_name=file->filename(); - QString theme_file=QPEApplication::qpeDir()+"/backgammon/"+theme_name+".theme"; + QString theme_file=QPEApplication::qpeDir()+"backgammon/"+theme_name+".theme"; Config theme(theme_file,Config::File); theme.setGroup("theme"); board_name=theme.readEntry("board","board_1"); piecesA_name=theme.readEntry("pieces1","pieces_1"); piecesB_name=theme.readEntry("pieces2","pieces_2"); diceA_name=theme.readEntry("dice1","dice_1"); diceB_name=theme.readEntry("dice2","dice_2"); table_name=theme.readEntry("table","table_1"); odds_name=theme.readEntry("odds","odds_1"); applytheme(); } void BackGammon::savetheme() { if(theme_name=="default") { QMessageBox::information(this,"Backgammon","Sorry\nCannot overwrite default.theme","OK"); return; } - QString theme_file=QPEApplication::qpeDir()+"/backgammon/"+theme_name+".theme"; + QString theme_file=QPEApplication::qpeDir()+"backgammon/"+theme_name+".theme"; if(QMessageBox::information(this,"Backgammon","Save Theme\n"+theme_name,"Yes","No")) return; Config theme(theme_file,Config::File); theme.setGroup("theme"); theme.writeEntry("board",board_name); theme.writeEntry("pieces1",piecesA_name); theme.writeEntry("pieces2",piecesB_name); theme.writeEntry("dice1",diceA_name); theme.writeEntry("dice2",diceB_name); theme.writeEntry("table",table_name); theme.writeEntry("odds",odds_name); } void BackGammon::themedefault() { if(QMessageBox::information(this,"Backgammon","Make Theme\n"+theme_name+"\nthe default theme","Yes","No")) return; Config conf("backgammon"); conf.setGroup("general"); conf.writeEntry("theme",theme_name); } void BackGammon::deletetheme() { FileDialog* file=new FileDialog(this,"Delete Theme",".theme"); if(!file->exec()) return; theme_name=file->filename(); - QString theme_file=QPEApplication::qpeDir()+"/backgammon/"+theme_name+".theme"; + QString theme_file=QPEApplication::qpeDir()+"backgammon/"+theme_name+".theme"; if(!QMessageBox::warning(this,tr( "Backgammon" ),tr( "deleted theme %1?").arg(theme_name),tr( "OK" ),tr( "Cancel" ))) { QFile(theme_file).remove(); } } void BackGammon::modify_AI() { AI_Dialog* ai_mod=new AI_Dialog(this,tr( "Load Theme" ),".theme"); ai_mod->setAISettings(move->getAISettings()); if(!ai_mod->exec()) return; //get the AI settings AISettings ai=ai_mod->getAISettings(); move->setAISettings(ai); //write new settings to conf file Config conf("backgammon"); conf.setGroup("ai"); conf.writeEntry("rescue",ai.rescue); conf.writeEntry("eliminate",ai.eliminate); conf.writeEntry("expose",ai.expose); conf.writeEntry("protect",ai.protect); conf.writeEntry("safe",ai.safe); conf.writeEntry("empty",ai.empty); } void BackGammon::setrules() { RulesDialog* rulesdialog=new RulesDialog(this,tr( "Load Theme" ),".theme"); rulesdialog->setRules(rules); if(!rulesdialog->exec()) return; rules=rulesdialog->getRules(); Config conf("backgammon"); conf.setGroup("rules"); conf.writeEntry("move_with_pieces_out",rules.move_with_pieces_out); conf.writeEntry("nice_dice",rules.generous_dice); move->setRules(rules); } void BackGammon::draw() { Pieces pieces; move->position(pieces); for(int a=0;a<15;a++) diff --git a/noncore/games/backgammon/filedialog.cpp b/noncore/games/backgammon/filedialog.cpp index e0a2914..f185188 100644 --- a/noncore/games/backgammon/filedialog.cpp +++ b/noncore/games/backgammon/filedialog.cpp @@ -1,61 +1,61 @@ #include "filedialog.h"
#include <qdir.h>
#include <qpe/qpeapplication.h>
FileDialog::FileDialog(QWidget* parent,QString header,QString extension,const char* name,bool modal,WFlags f)
:QDialog(parent,name,modal,f)
{
setCaption(header);
ext=extension;
dirselector=new QListView(this);
dirselector->setGeometry(1,10,235,200);
dirselector->addColumn("Files");
connect(dirselector,SIGNAL(clicked(QListViewItem*)),this,SLOT(selectorclicked(QListViewItem*)));
getCurrentDir();
file_name="user";
fileinput=new QLineEdit(file_name,this);
fileinput->setGeometry(1,220,235,20);
QPEApplication::showDialog( this );
}
FileDialog::~FileDialog()
{}
void FileDialog::selectorclicked(QListViewItem* entry)
{
if(entry==NULL)
return;
file_name=entry->text(0);
fileinput->setText(file_name);
}
void FileDialog::getCurrentDir()
{
dirselector->clear();
- QDir dir(QPEApplication::qpeDir()+"/backgammon");
+ QDir dir(QPEApplication::qpeDir()+"backgammon");
dir.setFilter(QDir::Files);
QFileInfoListIterator it(*(dir.entryInfoList()));
QFileInfo* fi;
int ext_length=ext.length();
while((fi=it.current())) // go through all file and subdirs
{
QString file=fi->fileName();
if(file.right(ext_length)==ext && file)
{
file=file.left(file.length()-ext_length);
new QListViewItem(dirselector,file);
}
++it;
}
}
QString FileDialog::filename()
{
return file_name;
}
diff --git a/noncore/games/backgammon/themedialog.cpp b/noncore/games/backgammon/themedialog.cpp index afd6a1b..9bdb6a9 100644 --- a/noncore/games/backgammon/themedialog.cpp +++ b/noncore/games/backgammon/themedialog.cpp @@ -98,64 +98,64 @@ void ThemeDialog::setCurrent(const ImageNames& current) break; } } for(a=0;a<boxpiecesB->count();a++) { if(boxpiecesB->text(a)==current.pieces2) { boxpiecesB->setCurrentItem(a); break; } } for(a=0;a<boxdiceA->count();a++) { if(boxdiceA->text(a)==current.dice1) { boxdiceA->setCurrentItem(a); break; } } for(a=0;a<boxdiceB->count();a++) { if(boxdiceB->text(a)==current.dice2) { boxdiceB->setCurrentItem(a); break; } } for(a=0;a<boxodds->count();a++) { if(boxodds->text(a)==current.odds) { boxodds->setCurrentItem(a); break; } } for(a=0;a<boxtable->count();a++) { if(boxtable->text(a)==current.table) { boxtable->setCurrentItem(a); break; } } } void ThemeDialog::fillBox(QString dirname,QComboBox* thebox) { thebox->clear(); - QDir dir(QPEApplication::qpeDir()+"/pics/backgammon/"+dirname); + QDir dir(QPEApplication::qpeDir()+"pics/backgammon/"+dirname); dir.setFilter(QDir::Dirs | QDir::Files); QFileInfoListIterator it(*(dir.entryInfoList())); QFileInfo* fi; while((fi=it.current())) // go through all file and subdirs { QString file=fi->fileName(); if(file.right(4)==".png") { thebox->insertItem(file.left(file.find(".png"))); } ++it; } delete fi; } diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index dc2c496..2e9553f 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp @@ -904,97 +904,97 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { // playSelected(); puh break; case Key_1: tabWidget->setCurrentPage( 0 ); break; case Key_2: tabWidget->setCurrentPage( 1 ); break; case Key_3: tabWidget->setCurrentPage( 2 ); break; case Key_4: tabWidget->setCurrentPage( 3 ); break; case Key_Down: if ( !d->selectedFiles->next() ) d->selectedFiles->first(); break; case Key_Up: if ( !d->selectedFiles->prev() ) // d->selectedFiles->last(); break; } } void PlayListWidget::pmViewActivated(int index) { // odebug << "" << index << "" << oendl; switch(index) { case -16: { mediaPlayerState->toggleFullscreen(); bool b=mediaPlayerState->isFullscreen(); pmView->setItemChecked( index, b); Config cfg( "OpiePlayer" ); cfg.writeEntry( "FullScreen", b ); } break; }; } 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(unsigned int i = defaultSkinIndex; i > defaultSkinIndex - skinsMenu->count(); i-- ) { skinsMenu->setItemChecked( i, FALSE ); } skinsMenu->setItemChecked( item, TRUE ); { Config cfg( "OpiePlayer" ); cfg.setGroup("Options"); cfg.writeEntry("Skin", skinsMenu->text( item ) ); } emit skinSelected(); } PlayListWidget::TabType PlayListWidget::currentTab() const { static const TabType indexToTabType[ TabTypeCount ] = { CurrentPlayList, AudioFiles, VideoFiles, PlayLists }; int index = tabWidget->currentPageIndex(); assert( index < TabTypeCount && index >= 0 ); return indexToTabType[ index ]; } PlayListWidget::Entry PlayListWidget::currentEntry() const diff --git a/noncore/settings/language/language.cpp b/noncore/settings/language/language.cpp index 81d6717..14750ac 100644 --- a/noncore/settings/language/language.cpp +++ b/noncore/settings/language/language.cpp @@ -12,97 +12,97 @@ ** 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 "settings.h" #include <qpe/global.h> #include <qpe/fontmanager.h> #include <qpe/config.h> #include <qpe/applnk.h> #include <qpe/qpedialog.h> #include <qpe/qpeapplication.h> #if defined(Q_WS_QWS) && !defined(QT_NO_COP) #include <qpe/qcopenvelope_qws.h> #endif #include <qlabel.h> #include <qcheckbox.h> #include <qradiobutton.h> #include <qtabwidget.h> #include <qslider.h> #include <qfile.h> #include <qtextstream.h> #include <qdatastream.h> #include <qmessagebox.h> #include <qcombobox.h> #include <qspinbox.h> #include <qlistbox.h> #include <qdir.h> #if QT_VERSION >= 300 #include <qstylefactory.h> #endif #include <stdlib.h> LanguageSettings::LanguageSettings( QWidget* parent, const char* name, WFlags fl ) : LanguageSettingsBase( parent, name, TRUE, fl ) { if ( FontManager::hasUnicodeFont() ) languages->setFont(FontManager::unicodeFont(FontManager::Proportional)); - QString tfn = QPEApplication::qpeDir() + "/i18n/"; + QString tfn = QPEApplication::qpeDir() + "i18n/"; QDir langDir = tfn; QStringList list = langDir.entryList("*", QDir::Dirs ); QStringList::Iterator it; for ( it = list.begin(); it != list.end(); ++it ) { QString name = (*it); QFileInfo desktopFile( tfn + "/" + name + "/.directory" ); if ( desktopFile.exists() ) { langAvail.append(name); Config conf( desktopFile.filePath(), Config::File ); QString langName = conf.readEntry( "Name" ); QString ownName = conf.readEntryDirect( "Name[" + name + "]" ); if ( ownName.isEmpty() ) ownName = conf.readEntryDirect( "Name" ); if ( !ownName.isEmpty() && ownName != langName ) langName = langName + " [" + ownName + "]"; languages->insertItem( langName ); } } if ( langAvail. find ( "en" ) == -1 ) { langAvail. prepend ( "" ); // no tr languages-> insertItem ( QString ( "English [%1] (%2)" /* no tr (!) */ ). arg ( tr ( "English" )). arg ( tr( "default" )), 0 ); } dl = new QPEDialogListener(this); reset(); } LanguageSettings::~LanguageSettings() {} void LanguageSettings::accept() { Config c( "qpe" ); c.setGroup( "Startup" ); if ( ( c.readNumEntry( "FirstUse", 42 ) == 0 ) && ( QMessageBox::warning( this, tr("Language"), tr("<qt>Attention, all windows will be closed by changing the language\n" "without saving the Data.<br><br>Go on?</qt>"), 1, 2) ) == QMessageBox::Cancel ) return; applyLanguage(); QDialog::accept(); } void LanguageSettings::applyLanguage() { diff --git a/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp index fb7d7c9..5f23aea 100644 --- a/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp +++ b/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp @@ -243,97 +243,97 @@ void MainWindowImp::getAllInterfaces() } // now lets ask the plugins too ;) QMap<Module*, QLibrary*>::Iterator it; QList<Interface> ilist; for( it = libraries.begin(); it != libraries.end(); ++it ) { if(it.key()) { ilist = it.key()->getInterfaces(); for( i = ilist.first(); i != 0; i = ilist.next() ) { owarn << "Adding interface " << i->getInterfaceName().latin1() << " to interfaceNames\n" << oendl; interfaceNames.insert(i->getInterfaceName(), i); updateInterface(i); connect(i, SIGNAL(updateInterface(Interface*)), this, SLOT(updateInterface(Interface*))); } } } } /** * Load all modules that are found in the path * @param path a directory that is scaned for any plugins that can be loaded * and attempts to load them */ void MainWindowImp::loadModules(const QString &path) { #ifdef DEBUG odebug << "MainWindowImp::loadModules: " << path.latin1() << "" << oendl; #endif QDir d(path); if(!d.exists()) return; QString lang = ::getenv("LANG"); // Don't want sym links d.setFilter( QDir::Files | QDir::NoSymLinks ); const QFileInfoList *list = d.entryInfoList(); QFileInfoListIterator it( *list ); QFileInfo *fi; while ( (fi=it.current()) ) { if(fi->fileName().contains(".so")) { /* if loaded install translation */ if( loadPlugin(path + "/" + fi->fileName()) != 0l ){ QTranslator *trans = new QTranslator(qApp); - QString fn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+ fi->fileName().left( fi->fileName().find(".") )+".qm"; + QString fn = QPEApplication::qpeDir()+"i18n/"+lang+"/"+ fi->fileName().left( fi->fileName().find(".") )+".qm"; if( trans->load( fn ) ) qApp->installTranslator( trans ); else delete trans; } odebug << "loaded plugin: >" << QString(path + "/" + fi->fileName()).latin1() << "< " << oendl; } ++it; } } /** * Attempt to load a function and resolve a function. * @param pluginFileName - the name of the file in which to attempt to load * @param resolveString - function pointer to resolve * @return pointer to the function with name resolveString or NULL */ Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &resolveString) { #ifdef DEBUG odebug << "MainWindowImp::loadPlugin: " << pluginFileName.latin1() << ": resolving " << resolveString.latin1() << "" << oendl; #endif QLibrary *lib = new QLibrary(pluginFileName); void *functionPointer = lib->resolve(resolveString); if( !functionPointer ) { #ifdef DEBUG odebug << "MainWindowImp::loadPlugin: Warning: " << pluginFileName.latin1() << " is not a plugin" << oendl; #endif delete lib; return 0; } // Try to get an object. Module *object = ((Module* (*)()) functionPointer)(); if(object == 0) { #ifdef DEBUG odebug << "MainWindowImp: Couldn't create object, but did load library!" << oendl; #endif delete lib; return 0; } m_handledIfaces += object->handledInterfaceNames(); // Store for deletion later libraries.insert(object, lib); return object; } diff --git a/noncore/settings/sysinfo/benchmarkinfo.cpp b/noncore/settings/sysinfo/benchmarkinfo.cpp index 793fcb1..060185a 100644 --- a/noncore/settings/sysinfo/benchmarkinfo.cpp +++ b/noncore/settings/sysinfo/benchmarkinfo.cpp @@ -97,97 +97,97 @@ BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags ) vb->setMargin( 4 ); tests = new OListView( this ); QWhatsThis::add( tests->viewport(), tr( "This area shows the available tests, the results for which the tests " "have been performed, and comparison values for one selected device. " "Use the checkboxes to define which tests you want to perform." ) ); tests->setMargin( 0 ); tests->addColumn( tr( "Tests" ) ); tests->addColumn( tr( "Results" ) ); tests->addColumn( tr( "Comparison" ) ); tests->setShowSortIndicator( true ); test_alu = new OCheckListItem( tests, tr( "1. Integer Arithmetic " ), OCheckListItem::CheckBox ); test_fpu = new OCheckListItem( tests, tr( "2. Floating Point Unit " ), OCheckListItem::CheckBox ); test_txt = new OCheckListItem( tests, tr( "3. Text Rendering " ), OCheckListItem::CheckBox ); test_gfx = new OCheckListItem( tests, tr( "4. Gfx Rendering " ), OCheckListItem::CheckBox ); test_ram = new OCheckListItem( tests, tr( "5. RAM Performance " ), OCheckListItem::CheckBox ); #ifndef QT_QWS_RAMSES test_sd = new OCheckListItem( tests, tr( "6. SD Card Performance " ), OCheckListItem::CheckBox ); test_cf = new OCheckListItem( tests, tr( "7. CF Card Performance " ), OCheckListItem::CheckBox ); #endif test_alu->setText( 1, "n/a" ); test_fpu->setText( 1, "n/a" ); test_txt->setText( 1, "n/a" ); test_gfx->setText( 1, "n/a" ); test_ram->setText( 1, "n/a" ); #ifndef QT_QWS_RAMSES test_sd->setText( 1, "n/a" ); test_cf->setText( 1, "n/a" ); #endif test_alu->setText( 2, "n/a" ); test_fpu->setText( 2, "n/a" ); test_txt->setText( 2, "n/a" ); test_gfx->setText( 2, "n/a" ); test_ram->setText( 2, "n/a" ); #ifndef QT_QWS_RAMSES test_sd->setText( 2, "n/a" ); test_cf->setText( 2, "n/a" ); #endif startButton = new QPushButton( tr( "&Start Tests!" ), this ); QWhatsThis::add( startButton, tr( "Click here to perform the selected tests." ) ); connect( startButton, SIGNAL( clicked() ), this, SLOT( run() ) ); vb->addWidget( tests, 2 ); QHBoxLayout* hb = new QHBoxLayout( vb ); hb->addWidget( startButton, 2 ); - QFile f( QPEApplication::qpeDir() + "/share/sysinfo/results" ); + QFile f( QPEApplication::qpeDir() + "share/sysinfo/results" ); if ( f.open( IO_ReadOnly ) ) { machineCombo = new QComboBox( this ); QWhatsThis::add( machineCombo, tr( "Choose a model to compare your results with." ) ); QTextStream ts( &f ); while( !ts.eof() ) { QString machline = ts.readLine(); odebug << "sysinfo: parsing benchmark results for '" << machline << "'" << oendl; QString resline = ts.readLine(); machines.insert( machline, new QStringList( QStringList::split( ",", resline ) ) ); machineCombo->insertItem( machline ); } hb->addWidget( new QLabel( tr( "Compare:" ), this ) ); hb->addWidget( machineCombo, 2 ); connect( machineCombo, SIGNAL( activated(int) ), this, SLOT( machineActivated(int) ) ); } } BenchmarkInfo::~BenchmarkInfo() {} void BenchmarkInfo::machineActivated( int index ) { QStringList* results = machines[ machineCombo->text( index ) ]; if ( !results ) { odebug << "sysinfo: no results available." << oendl; return; } QStringList::Iterator it = results->begin(); test_alu->setText( 2, *(it++) ); test_fpu->setText( 2, *(it++) ); test_txt->setText( 2, *(it++) ); test_gfx->setText( 2, *(it++) ); test_ram->setText( 2, *(it++) ); #ifndef QT_QWS_RAMSES test_sd->setText( 2, *(it++) ); test_cf->setText( 2, *(it++) ); #endif } void BenchmarkInfo::run() diff --git a/noncore/settings/tabmanager/tabmanager.cpp b/noncore/settings/tabmanager/tabmanager.cpp index 3eae424..85e5814 100644 --- a/noncore/settings/tabmanager/tabmanager.cpp +++ b/noncore/settings/tabmanager/tabmanager.cpp @@ -1,72 +1,72 @@ #include "tabmanager.h" #include "app.h" #include "wait.h" #include "tabapplnk.h" #include <opie2/odebug.h> #include <qpe/applnk.h> #include <qdir.h> #include <qfile.h> #include <qtextstream.h> #include <qlistview.h> #include <qheader.h> #include <qcombobox.h> #include <qlineedit.h> #include <qlabel.h> #include <qmessagebox.h> #include <stdlib.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/qpeapplication.h> #include <qpe/resource.h> -#define HOME_APP_DIR QPEApplication::qpeDir()+"/apps" +#define HOME_APP_DIR QPEApplication::qpeDir()+"apps" #define HOME_APP_INSTALL_DIR "/usr/lib/ipkg/info" #define NEW_FOLDER "EmptyTab" #define NEW_APPLICATION "NewApp" #define APPLICATION_EXTENSION ".desktop" #define APPLICATION_EXTENSION_LENGTH 8 /** * Constructor. Sets up signals. Performs initial scan of applications * and tabs */ TabManager::TabManager( QWidget* parent, const char* name):TabManagerBase(parent, name), changed(false), application(NULL){ rescanFolder(HOME_APP_DIR); // Connect the signals and slots connect(tabList, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(editItem(QListViewItem*))); (tabList->header())->hide(); connect(tabList, SIGNAL(moveItem(QListViewItem*,QListViewItem*)), this, SLOT(moveApplication(QListViewItem*,QListViewItem*))); } /** * If anything in the tab's have been changed then update the system or alert * the user. */ TabManager::~TabManager(){ if(changed){ // Prompt. //int answer = QMessageBox::warning(this, "Message", "Should your desktop be","Yes", "Cancel", 0, 1 ); //if (answer) // return; QCopEnvelope e("QPE/System", "linkChanged(QString)"); QString link; //we'll just send an empty string e << link; } } /** * Scans root directory for any tabs or applications. Will recursivly go down, * but will not follow symlinks. * @param directory - the directory to look in. * @param parent - the parent to place any new tabs or apps into. If parent is * NULL then the item is a tab and should be placed as a child of the window. */ void TabManager::rescanFolder(QString directory, QListViewItem* parent){ //odebug << QString("rescanFolder: ") + directory.latin1() << oendl; QDir d; d.setPath(directory); // Show hidden files for .directories @@ -213,97 +213,97 @@ void TabManager::removeItem(){ QMessageBox::critical(this, tr("Message"), tr("Can't remove."), tr("Ok") ); return; } // Remove from the installer so it wont fail. // Don't need to do this sense the current install uses rm -f so no error // Remove from the gui list. itemList.remove(item); if(item->parent()) item->parent()->takeItem(item); delete item; // We have changed something. changed = true; } /** * Helper function. Edits the current item. * calls editItem with the currently selected item. */ void TabManager::editCurrentItem(){ editItem(tabList->currentItem()); } /** * Edit the item that is passed in. * Show application dialog and if anything changed * @param item the item to edit. */ void TabManager::editItem( QListViewItem * item){ if(!item) return; TabAppLnk app(itemList[item]); if(!app.isValid()){ odebug << QString("editItem: Not a valid applnk file: ") + itemList[item].latin1() << oendl; return; } // Fill with all of the icons if(!application){ Wait waitDialog(this, "Wait dialog"); waitDialog.waitLabel->setText(tr("Gathering icons...")); waitDialog.show(); qApp->processEvents(); application = new AppEdit(this, "Application edit", true); - QDir d(QPEApplication::qpeDir() + "/pics/"); + QDir d(QPEApplication::qpeDir() + "pics/"); d.setFilter( QDir::Files); const QFileInfoList *list = d.entryInfoList(); QFileInfoListIterator it( *list ); // create list iterator QFileInfo *fi; // pointer for traversing while ( (fi=it.current()) ) { // for each file... QString fileName = fi->fileName(); if(fileName.right(4) == ".png"){ fileName = fileName.mid(0,fileName.length()-4); QPixmap imageOfFile(Resource::loadPixmap(fileName)); QImage foo = imageOfFile.convertToImage(); foo = foo.smoothScale(16,16); imageOfFile.convertFromImage(foo); application->iconLineEdit->insertItem(imageOfFile,fileName); } //odebug << fi->fileName().latin1() << oendl; ++it; } waitDialog.hide(); } int pixmap = -1; QString pixmapText = app.pixmapString(); QComboBox *f = application->iconLineEdit; for(int i = 0; i < application->iconLineEdit->count(); i++){ if(f->text(i) == pixmapText){ pixmap = i; break; } } if(pixmap != -1) application->iconLineEdit->setCurrentItem(pixmap); else if(pixmapText.isEmpty()){ application->iconLineEdit->setCurrentItem(0); } else{ QPixmap imageOfFile(Resource::loadPixmap(pixmapText)); QImage foo = imageOfFile.convertToImage(); foo = foo.smoothScale(16,16); imageOfFile.convertFromImage(foo); application->iconLineEdit->insertItem(imageOfFile,pixmapText,0); application->iconLineEdit->setCurrentItem(0); } application->nameLineEdit->setText(app.name()); application->execLineEdit->setText(app.exec()); application->commentLineEdit->setText(app.comment()); diff --git a/noncore/styles/theme/othemebase.cpp b/noncore/styles/theme/othemebase.cpp index d2226e6..4275dd6 100644 --- a/noncore/styles/theme/othemebase.cpp +++ b/noncore/styles/theme/othemebase.cpp @@ -261,97 +261,97 @@ void OThemeBase::readConfig( Qt::GUIStyle /*style*/ ) cfg. setGroup ( "Appearance" ); configFileName = cfg. readEntry ( "Theme", "default" ); } Config config( configFilePath + "/themes/" + configFileName + ".themerc" , Config::File ); // Are we initalized? applyMiscResourceGroup( &config ); for ( i = 0; i < INHERIT_ITEMS; ++i ) { applyResourceGroup( &config, i, copyfrom, pixnames, brdnames ); } for ( ; i < INHERIT_ITEMS*2; ++i ) { if ( config.hasGroup( QString( widgetEntries[ i ] ) ) ) { applyResourceGroup( &config, i, copyfrom, pixnames, brdnames ); } else { copyfrom [ i ] = widgetEntries[ i - INHERIT_ITEMS ]; } } for ( ; i < WIDGETS; ++i ) { applyResourceGroup( &config, i, copyfrom, pixnames, brdnames ); } // initalize defaults that may not be read for ( i = 0; i < WIDGETS; ++i ) loaded[ i ] = false; btnXShift = btnYShift = focus3DOffset = 0; aTabLine = iTabLine = true; roundedButton = roundedCombo = roundedSlider = focus3D = false; splitterWidth = 10; for ( i = 0; i < WIDGETS; ++i ) { readResourceGroup( i, copyfrom, pixnames, brdnames, loaded ); } // misc items readMiscResourceGroup(); // Handle preblend items for ( i = 0; i < PREBLEND_ITEMS; ++i ) { if ( pixmaps[ preBlend[ i ] ] != NULL && blends[ preBlend[ i ] ] != 0.0 ) blend( preBlend[ i ] ); } } OThemeBase::OThemeBase( const QString & configFile ) : QWindowsStyle() { - configFilePath = QPEApplication::qpeDir ( ) + "/plugins/styles/"; + configFilePath = QPEApplication::qpeDir ( ) + "plugins/styles/"; configFileName = configFile; readConfig( Qt::WindowsStyle ); cache = new OThemeCache( cacheSize ); } void OThemeBase::applyConfigFile( const QString &/*file*/ ) { #if 0 // handle std color scheme Config inConfig( file, Config::File ); Config globalConfig ( "qpe" ); globalConfig. setGroup ( "Apperance" ); inConfig. setGroup( "General" ); if ( inConfig.hasKey( "foreground" ) ) globalConfig.writeEntry( "Text", inConfig.readEntry( "foreground", " " ) ); if ( inConfig.hasKey( "background" ) ) globalConfig.writeEntry( "Background", inConfig.readEntry( "background", " " ) ); if ( inConfig.hasKey( "selectForeground" ) ) globalConfig.writeEntry( "HighlightedText", inConfig.readEntry( "selectForeground", " " ) ); if ( inConfig.hasKey( "selectBackground" ) ) globalConfig.writeEntry( "Highlight", inConfig.readEntry( "selectBackground", " " ) ); if ( inConfig.hasKey( "windowForeground" ) ) globalConfig.writeEntry( "Text", inConfig.readEntry( "windowForeground", " " ) ); if ( inConfig.hasKey( "windowBackground" ) ) globalConfig.writeEntry( "Base", inConfig.readEntry( "windowBackground", " " ) ); // Keep track of the current theme so that we can select the right one // in the KControl module. globalConfig.writeEntry ( "CurrentTheme", file ); globalConfig.write(); #endif } OThemeBase::~OThemeBase() { int i; for ( i = 0; i < WIDGETS; ++i ) { if ( !duplicate[ i ] ) { if ( images[ i ] ) delete images[ i ]; if ( pixmaps[ i ] ) delete pixmaps[ i ]; } if ( !pbDuplicate[ i ] && pbPixmaps[ i ] ) diff --git a/noncore/styles/theme/themeset.cpp b/noncore/styles/theme/themeset.cpp index d4005bc..3205106 100644 --- a/noncore/styles/theme/themeset.cpp +++ b/noncore/styles/theme/themeset.cpp @@ -41,84 +41,84 @@ public: bool hasGroup ( const QString &gname ) const { QMap< QString, ConfigGroup>::ConstIterator it = groups. find ( gname ); return ( it != groups.end() ); } }; class MyItem : public QListViewItem { public: MyItem ( QListView *lv, QListViewItem *after, const QString &name, const QString &comm, const QString &theme ) : QListViewItem ( lv, after, name, comm ) { m_theme = theme; } QString m_theme; }; ThemeSettings::ThemeSettings ( QWidget* parent, const char *name, WFlags fl ) : QWidget ( parent, name, fl ) { setCaption ( tr( "Theme Style" ) ); Config config ( "qpe" ); config. setGroup ( "Appearance" ); QString active = config. readEntry ( "Theme", "default" ); QVBoxLayout *vbox = new QVBoxLayout ( this ); vbox-> setSpacing ( 3 ); vbox-> setMargin ( 6 ); vbox-> addWidget ( new QLabel ( tr( "Select the theme to be used" ), this )); m_list = new QListView ( this ); m_list-> addColumn ( tr( "Name" )); m_list-> addColumn ( tr( "Description" )); m_list-> setSelectionMode ( QListView::Single ); m_list-> setAllColumnsShowFocus ( true ); m_list-> setSorting ( -1 ); vbox-> addWidget ( m_list, 10 ); QListViewItem *item = new MyItem ( m_list, 0, tr( "[No theme]" ), "", "" ); m_list-> setSelected ( item, true ); - QString path = QPEApplication::qpeDir() + "/plugins/styles/themes"; + QString path = QPEApplication::qpeDir() + "plugins/styles/themes"; QStringList list = QDir ( path, "*.themerc" ). entryList ( ); for ( QStringList::Iterator it = list. begin(); it != list. end ( ); ++it ) { MyConfig cfg ( path + "/" + *it, Config::File ); if ( cfg. hasGroup ( "Misc" )) { cfg. setGroup ( "Misc" ); QString name = cfg. readEntry ( "Name" ); QString comm = cfg. readEntry ( "Comment" ); if ( !name. isEmpty ( )) { QString fname = (*it). left ((*it). length ( ) - 8 ); item = new MyItem ( m_list, item, name, comm, fname ); if ( active == fname ) { m_list-> setSelected ( item, true ); } } } } } bool ThemeSettings::writeConfig ( ) { Config config ( "qpe" ); config. setGroup ( "Appearance" ); MyItem *it = (MyItem *) m_list-> selectedItem ( ); config. writeEntry ( "Theme", it ? it-> m_theme : QString ( "" )); config. write ( ); return true; } diff --git a/noncore/tools/calc2/calc.cpp b/noncore/tools/calc2/calc.cpp index 3dcdf6e..c7656bf 100644 --- a/noncore/tools/calc2/calc.cpp +++ b/noncore/tools/calc2/calc.cpp @@ -15,90 +15,90 @@ ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include <qvaluelist.h> #include <qpe/qpeapplication.h> #include <qdir.h> #include <qwidgetstack.h> #include "calc.h" #include "plugininterface.h" calc::calc (QWidget * p, const char *n):QWidget (p, n) { setCaption (tr ("Calculator")); // widgets LCD = new QLCDNumber (this); LCD->setMaximumSize (QSize (240, 30)); LCD->setNumDigits(12); LCD->setSegmentStyle(QLCDNumber::Filled); pluginWidgetStack = new QWidgetStack (this); // layout widgets calculatorLayout = new QVBoxLayout (this); calculatorLayout->addWidget (LCD); calculatorLayout->addWidget (pluginWidgetStack); // no formatting of display for now connect (&engine, SIGNAL(display(double)), LCD, SLOT(display(double))); connect (&engine, SIGNAL(display(const QString&)), LCD, SLOT(display(const QString&))); connect (&engine, SIGNAL(setBinMode()), LCD, SLOT(setBinMode())); connect (&engine, SIGNAL(setOctMode()), LCD, SLOT(setOctMode())); connect (&engine, SIGNAL(setDecMode()), LCD, SLOT(setDecMode())); connect (&engine, SIGNAL(setHexMode()), LCD, SLOT(setHexMode())); #ifndef NO_PLUGINS // load plugins QValueList < Plugin >::Iterator mit; for (mit = pluginList.begin (); mit != pluginList.end (); ++mit) { (*mit).interface->release (); (*mit).library->unload (); delete (*mit).library; } pluginList.clear (); - QString path = QPEApplication::qpeDir() + "/plugins/calculator"; + QString path = QPEApplication::qpeDir() + "plugins/calculator"; QDir dir (path, "lib*.so"); QStringList list = dir.entryList (); QStringList::Iterator it; for (it = list.begin (); it != list.end (); ++it) { CalcInterface *iface = 0; QLibrary *lib = new QLibrary (path + "/" + *it); Plugin plugin; plugin.pluginWidget = 0; if (lib->queryInterface (IID_Calc, (QUnknownInterface **) & iface) == QS_OK) { plugin.library = lib; plugin.interface = iface; plugin.pluginWidget = plugin.interface->getPlugin(&engine,pluginWidgetStack); if (plugin.pluginWidget) pluginWidgetStack->addWidget (plugin.pluginWidget, pluginList.count()); pluginList.append (plugin); } else { delete lib; } } setMode (1); #else // load simple interface #endif } calc::~calc () { #ifndef NO_PLUGINS QValueList < Plugin >::Iterator mit; for (mit = pluginList.begin (); mit != pluginList.end (); ++mit) { (*mit).interface->release (); (*mit).library->unload (); delete (*mit).library; } #endif } diff --git a/x11/libqpe-x11/qpe/qpeapplication.cpp b/x11/libqpe-x11/qpe/qpeapplication.cpp index 3cb8faf..73e7ce4 100644 --- a/x11/libqpe-x11/qpe/qpeapplication.cpp +++ b/x11/libqpe-x11/qpe/qpeapplication.cpp @@ -95,118 +95,118 @@ public: Atom wm_protocols; private: QList<QCopRec> qcopq; }; QPEApplication::Private::~Private() { } QPEApplication::Private::Private() : kbgrabber(0 ), presstimer(0 ), rightpressed( FALSE ), kbregrab( FALSE ), notbusysent( FALSE ), preloaded( FALSE ), forceshow( FALSE ), nomaximize( FALSE ), keep_running( TRUE ), presswidget( 0 ), qpe_main_widget(0 ) { qcopq.setAutoDelete( TRUE ); } void QPEApplication::Private::enqueueQCop( const QCString& chan, const QCString& msg, const QByteArray& ar ) { qcopq.append( new QCopRec(chan, msg, ar ) ); } void QPEApplication::Private::sendQCopQ() { QCopRec* r; for ( r = qcopq.first(); r; r = qcopq.next() ) { QCopChannel::sendLocally( r->channel, r->message, r->data ); } qcopq.clear(); } void QPEApplication::Private::show_mx(QWidget* mw, bool nomaximize ) { if (mw->layout() && mw->inherits("QDialog") ) { QPEApplication::showDialog( (QDialog*)mw, nomaximize ); }else { if (!nomaximize ) mw->showMaximized(); else mw->show(); } } void QPEApplication::Private::show( QWidget* mw, bool nomax ) { nomaximize = nomax; qpe_main_widget = mw; sendQCopQ(); if ( preloaded ) { if (forceshow ) show_mx(mw, nomax ); }else if ( keep_running ) show_mx( mw, nomax ); } void QPEApplication::Private::loadTextCodecs() { - QString path = QPEApplication::qpeDir() + "/plugins/textcodecs"; + QString path = QPEApplication::qpeDir() + "plugins/textcodecs"; QDir dir( path, "lib*.so" ); QStringList list = dir.entryList(); QStringList::Iterator it; for ( it = list.begin(); it != list.end(); ++it ) { TextCodecInterface *iface = 0; QLibrary *lib = new QLibrary( path + "/" + *it ); if ( lib->queryInterface( IID_QtopiaTextCodec, (QUnknownInterface**)&iface ) == QS_OK && iface ) { QValueList<int> mibs = iface->mibEnums(); for (QValueList<int>::ConstIterator i = mibs.begin(); i != mibs.end(); ++i) { (void)iface->createForMib(*i); // ### it exists now; need to remember if we can delete it } } else { lib->unload(); delete lib; } } } void QPEApplication::Private::loadImageCodecs() { - QString path = QPEApplication::qpeDir() + "/plugins/imagecodecs"; + QString path = QPEApplication::qpeDir() + "plugins/imagecodecs"; QDir dir( path, "lib*.so" ); QStringList list = dir.entryList(); QStringList::Iterator it; for ( it = list.begin(); it != list.end(); ++it ) { ImageCodecInterface *iface = 0; QLibrary *lib = new QLibrary( path + "/" + *it ); if ( lib->queryInterface( IID_QtopiaImageCodec, (QUnknownInterface**)&iface ) == QS_OK && iface ) { QStringList formats = iface->keys(); for (QStringList::ConstIterator i = formats.begin(); i != formats.end(); ++i) { (void)iface->installIOHandler(*i); // ### it exists now; need to remember if we can delete it } } else { lib->unload(); delete lib; } } } // The Help System hook namespace { class ResourceMimeFactory : public QMimeSourceFactory { public: ResourceMimeFactory(); ~ResourceMimeFactory(); const QMimeSource* data( const QString& abs_name )const; }; ResourceMimeFactory::ResourceMimeFactory() { setFilePath( Global::helpPath() ); setExtensionType( "html", "text/html;charset=UTF-8" ); } ResourceMimeFactory::~ResourceMimeFactory() { } const QMimeSource* ResourceMimeFactory::data( const QString& abs_name ) const { const QMimeSource * r = QMimeSourceFactory::data( abs_name ); if ( !r ) { int sl = abs_name.length(); do { sl = abs_name.findRev( '/', sl - 1 ); QString name = sl >= 0 ? abs_name.mid( sl + 1 ) : abs_name; int dot = name.findRev( '.' ); if ( dot >= 0 ) name = name.left( dot ); |