Attempt to fix crash in the ticket 515.

preferencesAboutTextFull
Anatoly Mihalchenko 13 years ago
parent b9c2e8d6bc
commit 8fb0036b2a
  1. 3
      src/gui/UBLibNavigatorWidget.cpp
  2. 5
      src/gui/UBLibPathViewer.cpp
  3. 3
      src/gui/UBLibraryWidget.cpp
  4. 3
      src/gui/UBLibraryWidget.h

@ -125,6 +125,8 @@ void UBLibNavigatorWidget::onNavigbarUpate(UBLibElement *pElem)
* @param elem as the clicked element
*/
void UBLibNavigatorWidget::onPathItemClicked(UBChainedLibElement *elem)
{
if (!this->libraryWidget()->isLoadingLibraryItems())
{
// If this element has some subelement, remove them
removeNextChainedElements(elem);
@ -132,6 +134,7 @@ void UBLibNavigatorWidget::onPathItemClicked(UBChainedLibElement *elem)
// The refresh the view
mLibWidget->setCurrentElemsAndRefresh(elem);
}
}
/**
* \brief Remove the next chained elements

@ -405,9 +405,10 @@ void UBPathScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
if(NULL != pView)
{
int iClickedItem = pView->widgetAt(event->scenePos());
if(-1 != iClickedItem)
QGraphicsLayout* wgtLayout = pGWidget->layout();
if(iClickedItem != -1 && wgtLayout != NULL)
{
QGraphicsWidget* pFolderW = dynamic_cast<QGraphicsWidget*>(pGWidget->layout()->itemAt(iClickedItem));
QGraphicsWidget* pFolderW = dynamic_cast<QGraphicsWidget*>(wgtLayout->itemAt(iClickedItem));
if(NULL != pFolderW)
{
UBChainedLibElement* chElem = mMapWidgetToChainedElem[pFolderW];

@ -43,6 +43,7 @@ UBLibraryWidget::UBLibraryWidget(QWidget *parent, const char *name):UBThumbnailW
, mpCrntDir(NULL)
, mpCrntElem(NULL)
, mpTmpElem(NULL)
, mLoadingLibraryItems(false)
{
setObjectName(name);
setSpacing(5);
@ -147,6 +148,7 @@ void UBLibraryWidget::onItemClicked(QGraphicsItem *item, int index)
Q_UNUSED(index);
if(NULL != item)
{
mLoadingLibraryItems = true;
int iItem = mGraphicItems.indexOf(item);
if(0 <= iItem)
{
@ -183,6 +185,7 @@ void UBLibraryWidget::onItemClicked(QGraphicsItem *item, int index)
}
emit itemClicked();
}
mLoadingLibraryItems = false;
}
}

@ -48,6 +48,7 @@ public:
void init();
UBLibraryController* libraryController() {return mLibraryController;}
bool isLoadingLibraryItems() const { return mLoadingLibraryItems; }
public slots:
void onRefreshCurrentFolder();
@ -92,7 +93,7 @@ private:
QList<UBLibElement*> mCurrentElems;
QList<UBLibElement*> mOrigCurrentElems;
QList<QGraphicsItem*> mItems;
bool mLoadingLibraryItems;
};
class UBNewFolderDlg : public QDialog

Loading…
Cancel
Save