author | eilers <eilers> | 2004-01-08 17:43:39 (UTC) |
---|---|---|
committer | eilers <eilers> | 2004-01-08 17:43:39 (UTC) |
commit | dc350f3bc1744a0bbfc230050d0d8c2817878dbb (patch) (unidiff) | |
tree | 7356378f030e0f5b160f5fec244da34ec312c463 | |
parent | eeb69efb4e0639429e5f6fd15e65b1b6fbaa5c35 (diff) | |
download | opie-dc350f3bc1744a0bbfc230050d0d8c2817878dbb.zip opie-dc350f3bc1744a0bbfc230050d0d8c2817878dbb.tar.gz opie-dc350f3bc1744a0bbfc230050d0d8c2817878dbb.tar.bz2 |
Forgotten to commit the patch for Mac OSX..
-rw-r--r-- | core/pim/today/today.cpp | 5 |
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() { | |||
144 | m_allApplets = cfg.readListEntry( "AllApplets", ',' ); | 144 | m_allApplets = cfg.readListEntry( "AllApplets", ',' ); |
145 | 145 | ||
146 | cfg.setGroup( "General" ); | 146 | cfg.setGroup( "General" ); |
147 | m_iconSize = cfg.readNumEntry( "IconSize", 18 ); | 147 | m_iconSize = cfg.readNumEntry( "IconSize", 18 ); |
148 | m_hideBanner = cfg.readNumEntry( "HideBanner", 0 ); | 148 | m_hideBanner = cfg.readNumEntry( "HideBanner", 0 ); |
149 | setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); | 149 | setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); |
150 | 150 | ||
151 | // set the date in top label | 151 | // set the date in top label |
152 | QDate date = QDate::currentDate(); | 152 | QDate date = QDate::currentDate(); |
153 | DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( date ) + "</font>" ) ); | 153 | DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( date ) + "</font>" ) ); |
154 | 154 | ||
155 | if ( m_hideBanner ) { | 155 | if ( m_hideBanner ) { |
156 | Opiezilla->hide(); | 156 | Opiezilla->hide(); |
157 | TodayLabel->hide(); | 157 | TodayLabel->hide(); |
158 | } else { | 158 | } else { |
159 | Opiezilla->show(); | 159 | Opiezilla->show(); |
160 | TodayLabel->show(); | 160 | TodayLabel->show(); |
161 | } | 161 | } |
162 | 162 | ||
163 | if ( m_big_box ) { | 163 | if ( m_big_box ) { |
164 | delete m_big_box; | 164 | delete m_big_box; |
165 | } | 165 | } |
166 | 166 | ||
167 | m_big_box = new QWidget( m_sv->viewport() ); | 167 | m_big_box = new QWidget( m_sv->viewport() ); |
168 | m_sv->addChild( m_big_box ); | 168 | m_sv->addChild( m_big_box ); |
169 | m_bblayout = new QVBoxLayout ( m_big_box ); | 169 | m_bblayout = new QVBoxLayout ( m_big_box ); |
170 | } | 170 | } |
171 | 171 | ||
172 | /** | 172 | /** |
173 | * Load the plugins | 173 | * Load the plugins |
174 | */ | 174 | */ |
175 | void Today::loadPlugins() { | 175 | void Today::loadPlugins() { |
176 | 176 | ||
177 | init(); | 177 | init(); |
178 | 178 | ||
179 | QValueList<TodayPlugin>::Iterator tit; | 179 | QValueList<TodayPlugin>::Iterator tit; |
180 | if ( !pluginList.isEmpty() ) { | 180 | if ( !pluginList.isEmpty() ) { |
181 | for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { | 181 | for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { |
182 | (*tit).guiBox->hide(); | 182 | (*tit).guiBox->hide(); |
183 | (*tit).guiBox->reparent( 0, QPoint( 0, 0 ) ); | 183 | (*tit).guiBox->reparent( 0, QPoint( 0, 0 ) ); |
184 | delete (*tit).guiBox; | 184 | delete (*tit).guiBox; |
185 | (*tit).library->unload(); | 185 | (*tit).library->unload(); |
186 | delete (*tit).library; | 186 | delete (*tit).library; |
187 | } | 187 | } |
188 | pluginList.clear(); | 188 | pluginList.clear(); |
189 | } | 189 | } |
190 | 190 | ||
191 | QString path = QPEApplication::qpeDir() + "/plugins/today"; | 191 | QString path = QPEApplication::qpeDir() + "/plugins/today"; |
192 | #ifdef Q_OS_MACX | ||
193 | qWarning("Searching for Plugins in: %s", path.latin1()); | ||
194 | QDir dir( path, "lib*.dylib" ); | ||
195 | #else | ||
192 | QDir dir( path, "lib*.so" ); | 196 | QDir dir( path, "lib*.so" ); |
197 | #endif | ||
193 | 198 | ||
194 | QStringList list = dir.entryList(); | 199 | QStringList list = dir.entryList(); |
195 | QStringList::Iterator it; | 200 | QStringList::Iterator it; |
196 | 201 | ||
197 | // QMap<QString, TodayPlugin> tempList; | 202 | // QMap<QString, TodayPlugin> tempList; |
198 | 203 | ||
199 | for ( it = list.begin(); it != list.end(); ++it ) { | 204 | for ( it = list.begin(); it != list.end(); ++it ) { |
200 | QInterfacePtr<TodayPluginInterface> iface; | 205 | QInterfacePtr<TodayPluginInterface> iface; |
201 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 206 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
202 | 207 | ||
203 | qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); | 208 | qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); |
204 | if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { | 209 | if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { |
205 | qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); | 210 | qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); |
206 | qDebug( QString(*it) ); | 211 | qDebug( QString(*it) ); |
207 | 212 | ||
208 | TodayPlugin plugin; | 213 | TodayPlugin plugin; |
209 | plugin.library = lib; | 214 | plugin.library = lib; |
210 | plugin.iface = iface; | 215 | plugin.iface = iface; |
211 | plugin.name = QString(*it); | 216 | plugin.name = QString(*it); |
212 | 217 | ||
213 | QString type = (*it).left( (*it).find(".") ); | 218 | QString type = (*it).left( (*it).find(".") ); |
214 | 219 | ||
215 | QString lang; | 220 | QString lang; |
216 | Config config("locale"); | 221 | Config config("locale"); |
217 | config.setGroup("Language"); | 222 | config.setGroup("Language"); |
218 | lang = config.readEntry( "Language", "en" ); | 223 | lang = config.readEntry( "Language", "en" ); |
219 | 224 | ||
220 | qDebug( "Languages: " + lang ); | 225 | qDebug( "Languages: " + lang ); |
221 | QTranslator * trans = new QTranslator( qApp ); | 226 | QTranslator * trans = new QTranslator( qApp ); |
222 | QString tfn = QPEApplication::qpeDir()+"/i18n/" + lang + "/" + type + ".qm"; | 227 | QString tfn = QPEApplication::qpeDir()+"/i18n/" + lang + "/" + type + ".qm"; |
223 | if ( trans->load( tfn ) ) { | 228 | if ( trans->load( tfn ) ) { |
224 | qApp->installTranslator( trans ); | 229 | qApp->installTranslator( trans ); |
225 | } else { | 230 | } else { |
226 | delete trans; | 231 | delete trans; |
227 | } | 232 | } |
228 | 233 | ||
229 | 234 | ||
230 | // find out if plugins should be shown | 235 | // find out if plugins should be shown |
231 | if ( m_excludeApplets.grep( *it ).isEmpty() ) { | 236 | if ( m_excludeApplets.grep( *it ).isEmpty() ) { |
232 | plugin.active = true; | 237 | plugin.active = true; |
233 | } else { | 238 | } else { |
234 | plugin.active = false; | 239 | plugin.active = false; |
235 | } | 240 | } |
236 | 241 | ||
237 | plugin.guiPart = plugin.iface->guiPart(); | 242 | plugin.guiPart = plugin.iface->guiPart(); |
238 | plugin.excludeRefresh = plugin.guiPart->excludeFromRefresh(); | 243 | plugin.excludeRefresh = plugin.guiPart->excludeFromRefresh(); |
239 | 244 | ||
240 | // package the whole thing into a qwidget so it can be shown and hidden | 245 | // package the whole thing into a qwidget so it can be shown and hidden |