mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-24 10:52:51 +00:00
libs: remove widgets from the correct layout in Plasma::WidgetExplorer destructor
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
b72ab513b0
commit
556d902f09
1 changed files with 14 additions and 15 deletions
|
@ -215,7 +215,7 @@ public:
|
|||
containment(nullptr),
|
||||
mainLayout(nullptr),
|
||||
filterEdit(nullptr),
|
||||
spacer(nullptr),
|
||||
topSpacer(nullptr),
|
||||
closeButton(nullptr),
|
||||
scrollWidget(nullptr),
|
||||
appletsFrame(nullptr),
|
||||
|
@ -246,7 +246,7 @@ public:
|
|||
|
||||
QGraphicsGridLayout* mainLayout;
|
||||
Plasma::LineEdit* filterEdit;
|
||||
Plasma::Label* spacer;
|
||||
Plasma::Label* topSpacer;
|
||||
Plasma::ToolButton* closeButton;
|
||||
Plasma::ScrollWidget* scrollWidget;
|
||||
Plasma::Frame* appletsFrame;
|
||||
|
@ -281,10 +281,10 @@ void WidgetExplorerPrivate::init(Plasma::Location loc)
|
|||
);
|
||||
mainLayout->addItem(filterEdit, 0, 0);
|
||||
|
||||
spacer = new Plasma::Label(q);
|
||||
spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
spacer->setMinimumSize(1, 1);
|
||||
mainLayout->addItem(spacer, 0, 1);
|
||||
topSpacer = new Plasma::Label(q);
|
||||
topSpacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
topSpacer->setMinimumSize(1, 1);
|
||||
mainLayout->addItem(topSpacer, 0, 1);
|
||||
|
||||
closeButton = new Plasma::ToolButton(q);
|
||||
closeButton->setIcon(KIcon("window-close"));
|
||||
|
@ -402,9 +402,9 @@ void WidgetExplorerPrivate::updateOrientation(const Qt::Orientation orientation)
|
|||
appletsLayout->setOrientation(orientation);
|
||||
if (orientation == Qt::Horizontal) {
|
||||
filterEdit->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
|
||||
spacer->setVisible(true);
|
||||
topSpacer->setVisible(true);
|
||||
} else {
|
||||
spacer->setVisible(false);
|
||||
topSpacer->setVisible(false);
|
||||
filterEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
}
|
||||
}
|
||||
|
@ -502,15 +502,14 @@ WidgetExplorer::~WidgetExplorer()
|
|||
}
|
||||
qDeleteAll(d->appletFrames);
|
||||
d->appletFrames.clear();
|
||||
d->appletsLayout->removeItem(d->filterEdit);
|
||||
delete d->filterEdit;
|
||||
d->appletsLayout->removeItem(d->spacer);
|
||||
delete d->spacer;
|
||||
d->appletsLayout->removeItem(d->closeButton);
|
||||
delete d->closeButton;
|
||||
d->appletsLayout->removeItem(d->appletsPlaceholder);
|
||||
delete d->appletsPlaceholder;
|
||||
d->appletsLayout->removeItem(d->appletsFrame);
|
||||
d->mainLayout->removeItem(d->filterEdit);
|
||||
delete d->filterEdit;
|
||||
d->mainLayout->removeItem(d->topSpacer);
|
||||
delete d->topSpacer;
|
||||
d->mainLayout->removeItem(d->closeButton);
|
||||
delete d->closeButton;
|
||||
delete d->appletsFrame;
|
||||
delete d;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue