summaryrefslogtreecommitdiff
path: root/core/pim/today/today.cpp
authorharlekin <harlekin>2003-12-05 11:20:37 (UTC)
committer harlekin <harlekin>2003-12-05 11:20:37 (UTC)
commit2b37759fc317b5efd9b371210b16117f7d346455 (patch) (side-by-side diff)
treef99beb5ff1c886f9b41a2d3a34300f8f121cf738 /core/pim/today/today.cpp
parent1ef5137234e2b7cd0be2a220a86d848503196269 (diff)
downloadopie-2b37759fc317b5efd9b371210b16117f7d346455.zip
opie-2b37759fc317b5efd9b371210b16117f7d346455.tar.gz
opie-2b37759fc317b5efd9b371210b16117f7d346455.tar.bz2
today in HEAD up to date
Diffstat (limited to 'core/pim/today/today.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp33
1 files changed, 12 insertions, 21 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index dd8d59b..d4a0ae6 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -183,68 +183,59 @@ void Today::loadPlugins() {
if ( !pluginList.isEmpty() ) {
for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) {
(*tit).guiBox->hide();
(*tit).guiBox->reparent( 0, QPoint( 0, 0 ) );
delete (*tit).guiBox;
(*tit).library->unload();
delete (*tit).library;
}
pluginList.clear();
}
QString path = QPEApplication::qpeDir() + "/plugins/today";
- qWarning("Searching for Plugins in: %s", path.latin1());
-#ifdef Q_OS_MACX
- QDir dir( path, "lib*.dylib" );
-#else
QDir dir( path, "lib*.so" );
-#endif
QStringList list = dir.entryList();
QStringList::Iterator it;
// QMap<QString, TodayPlugin> tempList;
for ( it = list.begin(); it != list.end(); ++it ) {
QInterfacePtr<TodayPluginInterface> iface;
QLibrary *lib = new QLibrary( path + "/" + *it );
qDebug( "querying: %s", QString( path + "/" + *it ).latin1() );
if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) {
qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() );
qDebug( QString(*it) );
TodayPlugin plugin;
plugin.library = lib;
plugin.iface = iface;
plugin.name = QString(*it);
QString type = (*it).left( (*it).find(".") );
- // grr, sharp rom does not know Global::languageList();
- // QStringList langs = Global::languageList();
- QString tfn = QPEApplication::qpeDir() + "/i18n/";
- QDir langDir = tfn;
- QStringList langs = langDir.entryList("*", QDir::Dirs );
-
- for (QStringList::ConstIterator lit = langs.begin(); lit!=langs.end(); ++lit) {
- QString lang = *lit;
- qDebug( "Languages: " + lang );
- QTranslator * trans = new QTranslator( qApp );
- QString tfn = QPEApplication::qpeDir()+"/i18n/" + lang + "/" + type + ".qm";
- if ( trans->load( tfn ) ) {
- qApp->installTranslator( trans );
- } else {
- delete trans;
- }
+ QString lang;
+ Config config("locale");
+ config.setGroup("Language");
+ lang = config.readEntry( "Language", "en" );
+
+ qDebug( "Languages: " + lang );
+ QTranslator * trans = new QTranslator( qApp );
+ QString tfn = QPEApplication::qpeDir()+"/i18n/" + lang + "/" + type + ".qm";
+ if ( trans->load( tfn ) ) {
+ qApp->installTranslator( trans );
+ } else {
+ delete trans;
}
// find out if plugins should be shown
if ( m_excludeApplets.grep( *it ).isEmpty() ) {
plugin.active = true;
} else {
plugin.active = false;
}
plugin.guiPart = plugin.iface->guiPart();
plugin.excludeRefresh = plugin.guiPart->excludeFromRefresh();