author | brad <brad> | 2004-06-17 12:03:55 (UTC) |
---|---|---|
committer | brad <brad> | 2004-06-17 12:03:55 (UTC) |
commit | 36c12db68a3caddee0c3385a1838222e9ab596aa (patch) (unidiff) | |
tree | c861d988d3e6e8754ae217c1e69420c7798f8675 | |
parent | 9875d0391f21f4d7518dba946455d844f04c1668 (diff) | |
download | opie-36c12db68a3caddee0c3385a1838222e9ab596aa.zip opie-36c12db68a3caddee0c3385a1838222e9ab596aa.tar.gz opie-36c12db68a3caddee0c3385a1838222e9ab596aa.tar.bz2 |
A hack workaround to prevent the launcher segfaulting after adding/removing
a launcher tab. This only appears to happen if you insert/remove removable media
that contains apps that would insert a tab (like games perhaps). It has a deeper
root cause but for the moment this works around it.
-rw-r--r-- | core/launcher/launcher.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index 779fe54..87a54bf 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp | |||
@@ -337,20 +337,35 @@ void LauncherTabWidget::setProgressStyle() | |||
337 | docLoadingWidgetProgress->setFrameShadow( QProgressBar::Plain ); | 337 | docLoadingWidgetProgress->setFrameShadow( QProgressBar::Plain ); |
338 | docLoadingWidgetProgress->setMargin( 1 ); | 338 | docLoadingWidgetProgress->setMargin( 1 ); |
339 | docLoadingWidgetProgress->setLineWidth( 1 ); | 339 | docLoadingWidgetProgress->setLineWidth( 1 ); |
340 | } | 340 | } |
341 | } | 341 | } |
342 | 342 | ||
343 | /* | ||
344 | * FIXME | ||
345 | * The following NULL check is triggered by inserting, then removing a tab on the fly | ||
346 | * as you would if you had removable media (which I do). Without this check | ||
347 | * the first app launched after a tab removal causes qpe to Segfault. | ||
348 | * This obviously has a more sinister cause, but this works around it with no | ||
349 | * obvious adverse effects. Please FIXME | ||
350 | * bkc - 17/6/2004 | ||
351 | * | ||
352 | */ | ||
353 | |||
343 | void LauncherTabWidget::setBusy(bool on) | 354 | void LauncherTabWidget::setBusy(bool on) |
344 | { | 355 | { |
345 | if ( on ) | 356 | if ( on ) |
346 | currentView()->setBusy(TRUE); | 357 | currentView()->setBusy(TRUE); |
347 | else { | 358 | else { |
348 | for ( int i = 0; i < categoryBar->count(); i++ ) { | 359 | for ( int i = 0; i < categoryBar->count(); i++ ) { |
349 | LauncherView *view = ((LauncherTab *)categoryBar->tab(i))->view; | 360 | if (categoryBar->tab(i)) { |
350 | view->setBusy( FALSE ); | 361 | LauncherView *view = ((LauncherTab *)categoryBar->tab(i))->view; |
362 | view->setBusy( FALSE ); | ||
363 | } else { | ||
364 | odebug << "Averting Disaster with tab " << i << " == NULL! " << oendl; | ||
365 | } | ||
351 | } | 366 | } |
352 | } | 367 | } |
353 | } | 368 | } |
354 | 369 | ||
355 | void LauncherTabWidget::setBusyIndicatorType( const QString& str ) { | 370 | void LauncherTabWidget::setBusyIndicatorType( const QString& str ) { |
356 | for (int i = 0; i < categoryBar->count(); i++ ) { | 371 | for (int i = 0; i < categoryBar->count(); i++ ) { |