author | brad <brad> | 2004-06-17 12:03:55 (UTC) |
---|---|---|
committer | brad <brad> | 2004-06-17 12:03:55 (UTC) |
commit | 36c12db68a3caddee0c3385a1838222e9ab596aa (patch) (side-by-side diff) | |
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 | 15 |
1 files changed, 15 insertions, 0 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 @@ -319,56 +319,71 @@ void LauncherTabWidget::paletteChange( const QPalette &p ) { QVBox::paletteChange( p ); QPalette pal = palette(); pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); categoryBar->setPalette( pal ); categoryBar->update(); } void LauncherTabWidget::styleChange( QStyle & ) { QTimer::singleShot( 0, this, SLOT(setProgressStyle()) ); } void LauncherTabWidget::setProgressStyle() { if (docLoadingWidgetProgress) { docLoadingWidgetProgress->setFrameShape( QProgressBar::Box ); docLoadingWidgetProgress->setFrameShadow( QProgressBar::Plain ); docLoadingWidgetProgress->setMargin( 1 ); docLoadingWidgetProgress->setLineWidth( 1 ); } } +/* + * FIXME + * The following NULL check is triggered by inserting, then removing a tab on the fly + * as you would if you had removable media (which I do). Without this check + * the first app launched after a tab removal causes qpe to Segfault. + * This obviously has a more sinister cause, but this works around it with no + * obvious adverse effects. Please FIXME + * bkc - 17/6/2004 + * + */ + void LauncherTabWidget::setBusy(bool on) { if ( on ) currentView()->setBusy(TRUE); else { for ( int i = 0; i < categoryBar->count(); i++ ) { + if (categoryBar->tab(i)) { LauncherView *view = ((LauncherTab *)categoryBar->tab(i))->view; view->setBusy( FALSE ); + } else { + odebug << "Averting Disaster with tab " << i << " == NULL! " << oendl; + } } } } void LauncherTabWidget::setBusyIndicatorType( const QString& str ) { for (int i = 0; i < categoryBar->count(); i++ ) { LauncherView* view = static_cast<LauncherTab*>( categoryBar->tab(i) )->view; view->setBusyIndicatorType( str ); } } LauncherView *LauncherTabWidget::currentView(void) { return (LauncherView*)stack->visibleWidget(); } void LauncherTabWidget::launcherMessage( const QCString &msg, const QByteArray &data) { QDataStream stream( data, IO_ReadOnly ); if ( msg == "setTabView(QString,int)" ) { QString id; stream >> id; |