summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/pim/today/today.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 2e7e1a8..139c91b 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -144,97 +144,102 @@ void Today::init() {
m_allApplets = cfg.readListEntry( "AllApplets", ',' );
cfg.setGroup( "General" );
m_iconSize = cfg.readNumEntry( "IconSize", 18 );
m_hideBanner = cfg.readNumEntry( "HideBanner", 0 );
setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) );
// set the date in top label
QDate date = QDate::currentDate();
DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( date ) + "</font>" ) );
if ( m_hideBanner ) {
Opiezilla->hide();
TodayLabel->hide();
} else {
Opiezilla->show();
TodayLabel->show();
}
if ( m_big_box ) {
delete m_big_box;
}
m_big_box = new QWidget( m_sv->viewport() );
m_sv->addChild( m_big_box );
m_bblayout = new QVBoxLayout ( m_big_box );
}
/**
* Load the plugins
*/
void Today::loadPlugins() {
init();
QValueList<TodayPlugin>::Iterator tit;
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";
+#ifdef Q_OS_MACX
+ qWarning("Searching for Plugins in: %s", path.latin1());
+ 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(".") );
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();
// package the whole thing into a qwidget so it can be shown and hidden