author | harlekin <harlekin> | 2002-10-31 21:24:44 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-31 21:24:44 (UTC) |
commit | 5409ca99206235961e964b42f5b7826bae95a42e (patch) (side-by-side diff) | |
tree | 85904bd8eaffcffac2e65a2a8c3a0ca1234df318 | |
parent | 9453519728734e52aac9ea81a4ca3a867f013bda (diff) | |
download | opie-5409ca99206235961e964b42f5b7826bae95a42e.zip opie-5409ca99206235961e964b42f5b7826bae95a42e.tar.gz opie-5409ca99206235961e964b42f5b7826bae95a42e.tar.bz2 |
fixes for the new exclude from refresh system
-rw-r--r-- | core/pim/today/today.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 3eda5c0..01ef02d 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp @@ -149,13 +149,13 @@ void Today::loadPlugins() { QValueList<TodayPlugin>::Iterator tit; if ( !pluginList.isEmpty() ) { for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { if ( (*tit).excludeRefresh ) { pluginListRefreshExclude.insert( (*tit).name , (*tit) ); - qDebug( "Found an plug that does not want refresh feature" ); + qDebug( "Found an plugin that does not want refresh feature" ); } else { (*tit).library->unload(); delete (*tit).library; } } pluginList.clear(); @@ -179,14 +179,22 @@ void Today::loadPlugins() { qDebug( "loading: %s", QString( path + "/" + *it ).latin1() ); qDebug( QString(*it) ); // If plugin is exludes from refresh, get it in the list again here. if ( pluginListRefreshExclude.contains( (*it) ) ) { - tempList.insert( pluginListRefreshExclude[(*it)].name, pluginListRefreshExclude[(*it)] ); - qDebug( "TEST2 " + pluginListRefreshExclude[(*it)].name ); + + // if its not in allApplets list, add it to a layout + if ( !m_allApplets.contains( pluginListRefreshExclude[(*it)].name ) ) { + qDebug( "NUGASDA" ); + layout->addWidget( pluginListRefreshExclude[(*it)].guiBox ); + pluginList.append( pluginListRefreshExclude[(*it)] ); + } else { + tempList.insert( pluginListRefreshExclude[(*it)].name, pluginListRefreshExclude[(*it)] ); + qDebug( "TEST2 " + pluginListRefreshExclude[(*it)].name ); + } } else { TodayPlugin plugin; plugin.library = lib; plugin.iface = iface; plugin.name = QString(*it); @@ -194,12 +202,13 @@ void Today::loadPlugins() { // 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 ); @@ -229,12 +238,18 @@ void Today::loadPlugins() { // on first start the list is off course empty if ( m_allApplets.isEmpty() ) { layout->addWidget( plugin.guiBox ); pluginList.append( plugin ); } + + // if plugin is not yet in the list, add it to the layout too + if ( !m_allApplets.contains( plugin.name ) ) { + layout->addWidget( plugin.guiBox ); + pluginList.append( plugin ); + } } } else { qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); delete lib; } } |