author | harlekin <harlekin> | 2002-10-31 21:24:44 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-31 21:24:44 (UTC) |
commit | 5409ca99206235961e964b42f5b7826bae95a42e (patch) (unidiff) | |
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 | 17 |
1 files changed, 16 insertions, 1 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() { | |||
149 | 149 | ||
150 | QValueList<TodayPlugin>::Iterator tit; | 150 | QValueList<TodayPlugin>::Iterator tit; |
151 | if ( !pluginList.isEmpty() ) { | 151 | if ( !pluginList.isEmpty() ) { |
152 | for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { | 152 | for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { |
153 | if ( (*tit).excludeRefresh ) { | 153 | if ( (*tit).excludeRefresh ) { |
154 | pluginListRefreshExclude.insert( (*tit).name , (*tit) ); | 154 | pluginListRefreshExclude.insert( (*tit).name , (*tit) ); |
155 | qDebug( "Found an plug that does not want refresh feature" ); | 155 | qDebug( "Found an plugin that does not want refresh feature" ); |
156 | } else { | 156 | } else { |
157 | (*tit).library->unload(); | 157 | (*tit).library->unload(); |
158 | delete (*tit).library; | 158 | delete (*tit).library; |
159 | } | 159 | } |
160 | } | 160 | } |
161 | pluginList.clear(); | 161 | pluginList.clear(); |
@@ -179,14 +179,22 @@ void Today::loadPlugins() { | |||
179 | qDebug( "loading: %s", QString( path + "/" + *it ).latin1() ); | 179 | qDebug( "loading: %s", QString( path + "/" + *it ).latin1() ); |
180 | qDebug( QString(*it) ); | 180 | qDebug( QString(*it) ); |
181 | 181 | ||
182 | // If plugin is exludes from refresh, get it in the list again here. | 182 | // If plugin is exludes from refresh, get it in the list again here. |
183 | 183 | ||
184 | if ( pluginListRefreshExclude.contains( (*it) ) ) { | 184 | if ( pluginListRefreshExclude.contains( (*it) ) ) { |
185 | |||
186 | // if its not in allApplets list, add it to a layout | ||
187 | if ( !m_allApplets.contains( pluginListRefreshExclude[(*it)].name ) ) { | ||
188 | qDebug( "NUGASDA" ); | ||
189 | layout->addWidget( pluginListRefreshExclude[(*it)].guiBox ); | ||
190 | pluginList.append( pluginListRefreshExclude[(*it)] ); | ||
191 | } else { | ||
185 | tempList.insert( pluginListRefreshExclude[(*it)].name, pluginListRefreshExclude[(*it)] ); | 192 | tempList.insert( pluginListRefreshExclude[(*it)].name, pluginListRefreshExclude[(*it)] ); |
186 | qDebug( "TEST2 " + pluginListRefreshExclude[(*it)].name ); | 193 | qDebug( "TEST2 " + pluginListRefreshExclude[(*it)].name ); |
194 | } | ||
187 | } else { | 195 | } else { |
188 | 196 | ||
189 | TodayPlugin plugin; | 197 | TodayPlugin plugin; |
190 | plugin.library = lib; | 198 | plugin.library = lib; |
191 | plugin.iface = iface; | 199 | plugin.iface = iface; |
192 | plugin.name = QString(*it); | 200 | plugin.name = QString(*it); |
@@ -194,12 +202,13 @@ void Today::loadPlugins() { | |||
194 | // find out if plugins should be shown | 202 | // find out if plugins should be shown |
195 | if ( m_excludeApplets.grep( *it ).isEmpty() ) { | 203 | if ( m_excludeApplets.grep( *it ).isEmpty() ) { |
196 | plugin.active = true; | 204 | plugin.active = true; |
197 | } else { | 205 | } else { |
198 | plugin.active = false; | 206 | plugin.active = false; |
199 | } | 207 | } |
208 | |||
200 | plugin.guiPart = plugin.iface->guiPart(); | 209 | plugin.guiPart = plugin.iface->guiPart(); |
201 | plugin.excludeRefresh = plugin.guiPart->excludeFromRefresh(); | 210 | plugin.excludeRefresh = plugin.guiPart->excludeFromRefresh(); |
202 | 211 | ||
203 | // package the whole thing into a qwidget so it can be shown and hidden | 212 | // package the whole thing into a qwidget so it can be shown and hidden |
204 | plugin.guiBox = new QWidget( this ); | 213 | plugin.guiBox = new QWidget( this ); |
205 | QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox ); | 214 | QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox ); |
@@ -229,12 +238,18 @@ void Today::loadPlugins() { | |||
229 | 238 | ||
230 | // on first start the list is off course empty | 239 | // on first start the list is off course empty |
231 | if ( m_allApplets.isEmpty() ) { | 240 | if ( m_allApplets.isEmpty() ) { |
232 | layout->addWidget( plugin.guiBox ); | 241 | layout->addWidget( plugin.guiBox ); |
233 | pluginList.append( plugin ); | 242 | pluginList.append( plugin ); |
234 | } | 243 | } |
244 | |||
245 | // if plugin is not yet in the list, add it to the layout too | ||
246 | if ( !m_allApplets.contains( plugin.name ) ) { | ||
247 | layout->addWidget( plugin.guiBox ); | ||
248 | pluginList.append( plugin ); | ||
249 | } | ||
235 | } | 250 | } |
236 | } else { | 251 | } else { |
237 | qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); | 252 | qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); |
238 | delete lib; | 253 | delete lib; |
239 | } | 254 | } |
240 | } | 255 | } |