Attempt to fix crash in the ticket 515.

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

@ -126,11 +126,14 @@ void UBLibNavigatorWidget::onNavigbarUpate(UBLibElement *pElem)
*/
void UBLibNavigatorWidget::onPathItemClicked(UBChainedLibElement *elem)
{
// If this element has some subelement, remove them
removeNextChainedElements(elem);
// The refresh the view
mLibWidget->setCurrentElemsAndRefresh(elem);
if (!this->libraryWidget()->isLoadingLibraryItems())
{
// If this element has some subelement, remove them
removeNextChainedElements(elem);
// The refresh the view
mLibWidget->setCurrentElemsAndRefresh(elem);
}
}
/**

@ -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,7 +148,8 @@ void UBLibraryWidget::onItemClicked(QGraphicsItem *item, int index)
Q_UNUSED(index);
if(NULL != item)
{
int iItem = mGraphicItems.indexOf(item);
mLoadingLibraryItems = true;
int iItem = mGraphicItems.indexOf(item);
if(0 <= iItem)
{
UBLibElement* pElem = mCurrentElems.at(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