summaryrefslogtreecommitdiff
Unidiff
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() {
167 (*tit).guiBox->hide(); 167 (*tit).guiBox->hide();
168 (*tit).guiBox->reparent( 0, QPoint( 0, 0 ) ); 168 (*tit).guiBox->reparent( 0, QPoint( 0, 0 ) );
169 delete (*tit).guiBox; 169 delete (*tit).guiBox;
170 (*tit).library->unload(); 170 (*tit).library->unload();
171 delete (*tit).library; 171 delete (*tit).library;
172 } 172 }
173 pluginList.clear(); 173 pluginList.clear();
174 } 174 }
175 175
176 QString path = QPEApplication::qpeDir() + "/plugins/today"; 176 QString path = QPEApplication::qpeDir() + "/plugins/today";
177 QDir dir( path, "lib*.so" ); 177 QDir dir( path, "lib*.so" );
178 178
179 QStringList list = dir.entryList(); 179 QStringList list = dir.entryList();
180 QStringList::Iterator it; 180 QStringList::Iterator it;
181 181
182 QMap<QString, TodayPlugin> tempList; 182 QMap<QString, TodayPlugin> tempList;
183 183
184 for ( it = list.begin(); it != list.end(); ++it ) { 184 for ( it = list.begin(); it != list.end(); ++it ) {
185 QInterfacePtr<TodayPluginInterface> iface; 185 QInterfacePtr<TodayPluginInterface> iface;
186 QLibrary *lib = new QLibrary( path + "/" + *it ); 186 QLibrary *lib = new QLibrary( path + "/" + *it );
187 187
188 qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); 188 qDebug( "querying: %s", QString( path + "/" + *it ).latin1() );
189 if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { 189 if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) {
190 qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); 190 qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() );
191 qDebug( QString(*it) ); 191 qDebug( QString(*it) );
192 192
193 TodayPlugin plugin; 193 TodayPlugin plugin;
194 plugin.library = lib; 194 plugin.library = lib;
195 plugin.iface = iface; 195 plugin.iface = iface;
196 plugin.name = QString(*it); 196 plugin.name = QString(*it);
197 197
198 QString type = (*it).left( (*it).find(".") ); 198 QString type = (*it).left( (*it).find(".") );
199 QStringList langs = Global::languageList(); 199
200 // grr, sharp rom does not know Global::languageList();
201 // QStringList langs = Global::languageList();
202 QString tfn = QPEApplication::qpeDir() + "/i18n/";
203 QDir langDir = tfn;
204 QStringList langs = langDir.entryList("*", QDir::Dirs );
205
200 for (QStringList::ConstIterator lit = langs.begin(); lit!=langs.end(); ++lit) { 206 for (QStringList::ConstIterator lit = langs.begin(); lit!=langs.end(); ++lit) {
201 QString lang = *lit; 207 QString lang = *lit;
202 qDebug( "Languages: " + lang ); 208 qDebug( "Languages: " + lang );
203 QTranslator * trans = new QTranslator( qApp ); 209 QTranslator * trans = new QTranslator( qApp );
204 QString tfn = QPEApplication::qpeDir()+"/i18n/" + lang + "/" + type + ".qm"; 210 QString tfn = QPEApplication::qpeDir()+"/i18n/" + lang + "/" + type + ".qm";
205 if ( trans->load( tfn ) ) { 211 if ( trans->load( tfn ) ) {
206 qApp->installTranslator( trans ); 212 qApp->installTranslator( trans );
207 } else { 213 } else {
208 delete trans; 214 delete trans;
209 } 215 }
210 } 216 }
211 217
212 // find out if plugins should be shown 218 // find out if plugins should be shown
213 if ( m_excludeApplets.grep( *it ).isEmpty() ) { 219 if ( m_excludeApplets.grep( *it ).isEmpty() ) {
214 plugin.active = true; 220 plugin.active = true;
215 } else { 221 } else {
216 plugin.active = false; 222 plugin.active = false;
217 } 223 }
218 224
219 plugin.guiPart = plugin.iface->guiPart(); 225 plugin.guiPart = plugin.iface->guiPart();
220 plugin.excludeRefresh = plugin.guiPart->excludeFromRefresh(); 226 plugin.excludeRefresh = plugin.guiPart->excludeFromRefresh();
221 227
222 // package the whole thing into a qwidget so it can be shown and hidden 228 // package the whole thing into a qwidget so it can be shown and hidden
223 plugin.guiBox = new QWidget( this ); 229 plugin.guiBox = new QWidget( this );
224 QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox ); 230 QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox );
225 QPixmap plugPix; 231 QPixmap plugPix;
226 plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 ); 232 plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 );
227 OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox ); 233 OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox );
228 plugIcon->setPixmap( plugPix ); 234 plugIcon->setPixmap( plugPix );
229 QWhatsThis::add( plugIcon, tr("Click here to launch the associated app") ); 235 QWhatsThis::add( plugIcon, tr("Click here to launch the associated app") );
230 plugIcon->setName( plugin.guiPart->appName() ); 236 plugIcon->setName( plugin.guiPart->appName() );
231 connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) ); 237 connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) );