Commit a370d339 authored by Scott Petrovic's avatar Scott Petrovic

fix memory leak with save dialog widget

parent 8370bfaa
......@@ -433,7 +433,9 @@ KisPaintopBox::KisPaintopBox(KisViewManager *view, QWidget *parent, const char *
}
m_presetsPopup = new KisPaintOpPresetsPopup(m_resourceProvider, m_favoriteResourceManager);
m_savePresetWidget = new KisPresetSaveWidget(this);
m_presetsPopup = new KisPaintOpPresetsPopup(m_resourceProvider, m_favoriteResourceManager, m_savePresetWidget);
m_brushEditorPopupButton->setPopupWidget(m_presetsPopup);
m_presetsPopup->parentWidget()->setWindowTitle(i18n("Brush Editor"));
......
......@@ -60,6 +60,7 @@ class KisCompositeOpComboBox;
class KisWidgetChooser;
class KisFavoriteResourceManager;
class KisAction;
class KisPresetSaveWidget;
/**
* This widget presents all paintops that a user can paint with.
......@@ -178,6 +179,8 @@ private:
QWidget* m_paintopWidget;
KisPaintOpConfigWidget* m_optionWidget;
KisPopupButton* m_toolOptionsPopupButton;
KisPresetSaveWidget* m_savePresetWidget;
KisPopupButton* m_brushEditorPopupButton;
KisPopupButton* m_presetSelectorPopupButton;
KisCompositeOpComboBox* m_cmbCompositeOp;
......
......@@ -84,6 +84,7 @@ public:
KisPaintOpPresetsPopup::KisPaintOpPresetsPopup(KisCanvasResourceProvider * resourceProvider,
KisFavoriteResourceManager* favoriteResourceManager,
KisPresetSaveWidget* savePresetWidget,
QWidget * parent)
: QWidget(parent)
, m_d(new Private())
......@@ -118,12 +119,11 @@ KisPaintOpPresetsPopup::KisPaintOpPresetsPopup(KisCanvasResourceProvider * resou
// overwrite existing preset and saving a new preset use the same dialog
saveDialog = new KisPresetSaveWidget(this->parentWidget());
saveDialog = savePresetWidget;
saveDialog->scratchPadSetup(resourceProvider);
saveDialog->setFavoriteResourceManager(m_d->favoriteResManager); // this is needed when saving the preset
saveDialog->hide();
// the area on the brush editor for renaming the brush. make sure edit fields are hidden by default
toggleBrushRenameUIActive(false);
......
......@@ -28,6 +28,7 @@
#include <brushengine/kis_paintop_factory.h>
#include "../kis_paint_ops_model.h"
#include <widgets/kis_paintop_presets_save.h>
#include "widgets/kis_paintop_presets_popup.h"
#include "kis_favorite_resource_manager.h"
class QString;
......@@ -46,6 +47,7 @@ public:
KisPaintOpPresetsPopup(KisCanvasResourceProvider * resourceProvider,
KisFavoriteResourceManager* favoriteResourceManager,
KisPresetSaveWidget* savePresetWidget,
QWidget * parent = 0);
~KisPaintOpPresetsPopup() override;
......
......@@ -35,7 +35,7 @@ class KisPaintOpPresetSaveDialog : public QDialog , public Ui::WdgSaveBrushPrese
public:
KisPaintOpPresetSaveDialog(QWidget* parent) : QDialog(parent) {
setupUi(this);
}
}
};
......
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