don't manually delete applets

applets will be deleted by the parent, as they are
acontainment's children. by not deleting them by hand
also every signal will be disconnected, not causing appletRemoved
to be emitted, so not causing removal of config
pieces at shutdown, this removes the need of the
explicit disconnect in aboutToQuit from contaiment interface

Change-Id: Iddf6ded60ae849ca03c363be6e736da496310b82
reviewed-by: David Edmundson
This commit is contained in:
Marco Martin 2016-08-08 15:03:37 +02:00
parent 8abeceaffd
commit e1a0299a46
3 changed files with 0 additions and 18 deletions

View File

@ -61,11 +61,6 @@ ContainmentPrivate::ContainmentPrivate(Containment *c):
Plasma::ContainmentPrivate::~ContainmentPrivate()
{
//FIXME: For some reason, qDeleteAll crashes, while deleting applets one by one is fine
foreach (Plasma::Applet *applet, applets) {
delete applet;
}
//qDeleteAll(applets);
applets.clear();
}

View File

@ -73,18 +73,6 @@ ContainmentInterface::ContainmentInterface(DeclarativeAppletScript *parent, cons
if (!m_appletInterfaces.isEmpty()) {
emit appletsChanged();
}
connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit,
this, &ContainmentInterface::slotAboutToQuit);
}
void ContainmentInterface::slotAboutToQuit()
{
if (!m_containment) {
return;
}
disconnect(m_containment.data(), &Plasma::Containment::appletRemoved,
this, &ContainmentInterface::appletRemovedForward);
}
void ContainmentInterface::init()

View File

@ -205,7 +205,6 @@ protected Q_SLOTS:
private Q_SLOTS:
Plasma::Applet *createApplet(const QString &plugin, const QVariantList &args, const QRectF &geom);
void slotAboutToQuit();
private:
void clearDataForMimeJob(KIO::Job *job);