summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-05-30 09:22:49 (UTC)
committer harlekin <harlekin>2003-05-30 09:22:49 (UTC)
commit22fff7051b1960f4ae751621c8f52e0fc732033d (patch) (side-by-side diff)
tree824f8f9ae3bfaf5a2c84f7f6703475d8380bff7a
parent66e2cf16ce2eb331cc88f8591fa07503a8ca82ce (diff)
downloadopie-22fff7051b1960f4ae751621c8f52e0fc732033d.zip
opie-22fff7051b1960f4ae751621c8f52e0fc732033d.tar.gz
opie-22fff7051b1960f4ae751621c8f52e0fc732033d.tar.bz2
small change so today works again on retail rom
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 83d8601..f213943 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -167,65 +167,71 @@ void Today::loadPlugins() {
(*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";
QDir dir( path, "lib*.so" );
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(".") );
- QStringList langs = Global::languageList();
+
+ // 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;
}
}
// 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();
// package the whole thing into a qwidget so it can be shown and hidden
plugin.guiBox = new QWidget( this );
QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox );
QPixmap plugPix;
plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 );
OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox );
plugIcon->setPixmap( plugPix );
QWhatsThis::add( plugIcon, tr("Click here to launch the associated app") );
plugIcon->setName( plugin.guiPart->appName() );
connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) );