From bd818d1647407910da5ed5c461fd7b75a106ed8d Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Mon, 22 Oct 2012 16:54:45 +0200 Subject: [PATCH] fixed issue 1253 --- src/board/UBBoardPaletteManager.cpp | 13 ++++++------- src/board/UBFeaturesController.cpp | 2 +- src/board/UBFeaturesController.h | 2 +- src/gui/UBFeaturesWidget.cpp | 20 ++++++++++---------- src/gui/UBFeaturesWidget.h | 2 +- 5 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index 78f3241a..bf28d3e0 100644 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -94,13 +94,12 @@ UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardControll UBBoardPaletteManager::~UBBoardPaletteManager() { - delete mAddItemPalette; - if(NULL != mStylusPalette) - { - delete mStylusPalette; - mStylusPalette = NULL; - } +// mAddedItemPalette is delete automatically because of is parent +// that changes depending on the mode + +// mMainWindow->centralWidget is the parent of mStylusPalette +// do not delete this here. } void UBBoardPaletteManager::initPalettesPosAtStartup() @@ -958,8 +957,8 @@ void UBBoardPaletteManager::changeStylusPaletteOrientation(QVariant var) // Clean the old palette if(NULL != mStylusPalette) { - // TODO : check why this line creates a crash in the application. delete mStylusPalette; + mStylusPalette = NULL; } // Create the new palette diff --git a/src/board/UBFeaturesController.cpp b/src/board/UBFeaturesController.cpp index fa5cbb74..43ce18e1 100644 --- a/src/board/UBFeaturesController.cpp +++ b/src/board/UBFeaturesController.cpp @@ -1089,7 +1089,7 @@ UBFeaturesController::~UBFeaturesController() } } -void UBFeaturesController::assignFeaturesListVeiw(UBFeaturesListView *pList) +void UBFeaturesController::assignFeaturesListView(UBFeaturesListView *pList) { pList->setDragDropMode( QAbstractItemView::DragDrop ); pList->setSelectionMode( QAbstractItemView::ContiguousSelection ); diff --git a/src/board/UBFeaturesController.h b/src/board/UBFeaturesController.h index 61bee3ec..161b5179 100644 --- a/src/board/UBFeaturesController.h +++ b/src/board/UBFeaturesController.h @@ -187,7 +187,7 @@ public: static const QString virtualRootName; - void assignFeaturesListVeiw(UBFeaturesListView *pList); + void assignFeaturesListView(UBFeaturesListView *pList); void assignPathListView(UBFeaturesListView *pList); public: diff --git a/src/gui/UBFeaturesWidget.cpp b/src/gui/UBFeaturesWidget.cpp index 096ee58f..272bb84c 100644 --- a/src/gui/UBFeaturesWidget.cpp +++ b/src/gui/UBFeaturesWidget.cpp @@ -42,7 +42,7 @@ UBFeaturesWidget::UBFeaturesWidget(QWidget *parent, const char *name) controller->assignPathListView(pathListView); centralWidget = new UBFeaturesCentralWidget(this); - controller->assignFeaturesListVeiw(centralWidget->listView()); + controller->assignFeaturesListView(centralWidget->listView()); centralWidget->setSliderPosition(UBSettings::settings()->featureSliderPosition->get().toInt()); //Bottom actionbar for DnD, quick search etc @@ -430,7 +430,7 @@ void UBFeaturesListView::thumbnailSizeChanged( int value ) } UBFeaturesNavigatorWidget::UBFeaturesNavigatorWidget(QWidget *parent, const char *name) : - QWidget(parent), mListView(0), mListSlder(0) + QWidget(parent), mListView(0), mListSlider(0) { name = "UBFeaturesNavigatorWidget"; @@ -440,26 +440,26 @@ UBFeaturesNavigatorWidget::UBFeaturesNavigatorWidget(QWidget *parent, const char mListView = new UBFeaturesListView(this, UBFeaturesWidget::objNameFeatureList); - mListSlder = new QSlider(Qt::Horizontal, this); + mListSlider = new QSlider(Qt::Horizontal, this); - mListSlder->setMinimum(UBFeaturesWidget::minThumbnailSize); - mListSlder->setMaximum(UBFeaturesWidget::maxThumbnailSize); - mListSlder->setValue(UBFeaturesWidget::minThumbnailSize); - mListSlder->setMinimumHeight(20); + mListSlider->setMinimum(UBFeaturesWidget::minThumbnailSize); + mListSlider->setMaximum(UBFeaturesWidget::maxThumbnailSize); + mListSlider->setValue(UBFeaturesWidget::minThumbnailSize); + mListSlider->setMinimumHeight(20); mListView->setParent(this); QVBoxLayout *mainLayer = new QVBoxLayout(this); mainLayer->addWidget(mListView, 1); - mainLayer->addWidget(mListSlder, 0); + mainLayer->addWidget(mListSlider, 0); mainLayer->setMargin(0); - connect(mListSlder, SIGNAL(valueChanged(int)), mListView, SLOT(thumbnailSizeChanged(int))); + connect(mListSlider, SIGNAL(valueChanged(int)), mListView, SLOT(thumbnailSizeChanged(int))); } void UBFeaturesNavigatorWidget::setSliderPosition(int pValue) { - mListSlder->setValue(pValue); + mListSlider->setValue(pValue); } UBFeaturesCentralWidget::UBFeaturesCentralWidget(QWidget *parent) : QWidget(parent) diff --git a/src/gui/UBFeaturesWidget.h b/src/gui/UBFeaturesWidget.h index 7363ffcb..e8d18589 100644 --- a/src/gui/UBFeaturesWidget.h +++ b/src/gui/UBFeaturesWidget.h @@ -154,7 +154,7 @@ public: private: UBFeaturesListView *mListView; - QSlider *mListSlder; + QSlider *mListSlider; };