Commit 57d595b3 authored by Martin Klapetek's avatar Martin Klapetek
Browse files

[owncloud] Close the ownCloud dialog first before deleting it

parent 2c2b7963
......@@ -59,9 +59,15 @@ void OwnCloudWizard::init(KAccountsUiPlugin::UiType type)
m_object->setInitializationDelayed(true);
m_object->loadPackage(packagePath);
QmlHelper *helper = new QmlHelper(this);
QmlHelper *helper = new QmlHelper(m_object);
connect(helper, &QmlHelper::wizardFinished, this, &OwnCloudWizard::success);
connect(helper, &QmlHelper::wizardFinished, m_object, &QObject::deleteLater);
connect(helper, &QmlHelper::wizardFinished, [=] {
QWindow *window = qobject_cast<QWindow *>(m_object->rootObject());
if (window) {
window->close();
}
m_object->deleteLater();
});
m_object->engine()->rootContext()->setContextProperty("helper", helper);
m_object->completeInitialization();
......
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