Commit ac9d6197 authored by shibakaneki's avatar shibakaneki

Resolved a crash when opening the Document view

parent d523a654
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "frameworks/UBPlatformUtils.h" #include "frameworks/UBPlatformUtils.h"
#include "core/UBApplication.h" #include "core/UBApplication.h"
#include "core/UBPreferencesController.h" #include "core/UBPreferencesController.h"
#include "core/UBDownloadManager.h"
#include "core/memcheck.h" #include "core/memcheck.h"
...@@ -80,6 +81,7 @@ UBDockPalette::UBDockPalette(QWidget *parent, const char *name) ...@@ -80,6 +81,7 @@ UBDockPalette::UBDockPalette(QWidget *parent, const char *name)
// Set the position of the tab // Set the position of the tab
onToolbarPosUpdated(); onToolbarPosUpdated();
connect(UBSettings::settings()->appToolBarPositionedAtTop, SIGNAL(changed(QVariant)), this, SLOT(onToolbarPosUpdated())); connect(UBSettings::settings()->appToolBarPositionedAtTop, SIGNAL(changed(QVariant)), this, SLOT(onToolbarPosUpdated()));
connect(UBDownloadManager::downloadManager(), SIGNAL(allDownloadsFinished()), this, SLOT(onAllDownloadsFinished()));
} }
/** /**
...@@ -480,6 +482,12 @@ void UBDockPalette::showTabWidget(int tabIndex) ...@@ -480,6 +482,12 @@ void UBDockPalette::showTabWidget(int tabIndex)
{ {
toggleCollapseExpand(); toggleCollapseExpand();
} }
// Update the current tab index
if(NULL != (dynamic_cast<UBDockPaletteWidget*>(mpStackWidget->widget(tabIndex)))){
mCrntTabWidget = dynamic_cast<UBDockPaletteWidget*>(mpStackWidget->widget(tabIndex))->name();
}
} }
/** /**
...@@ -651,3 +659,16 @@ void UBDockPalette::registerWidget(UBDockPaletteWidget *widget) ...@@ -651,3 +659,16 @@ void UBDockPalette::registerWidget(UBDockPaletteWidget *widget)
widget->hide(); widget->hide();
} }
} }
/**
* \brief Handles the 'all download finished' notification
*/
void UBDockPalette::onAllDownloadsFinished()
{
for(int i=0; i<mTabWidgets.size(); i++){
UBDockPaletteWidget* pW = mTabWidgets.at(i);
if(NULL != pW && mCrntTabWidget == pW->name()){
mpStackWidget->setCurrentWidget(pW);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment