Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Ensure parentWidget is set for autodetection cmds

Some commands expect the parent Widget and might behave
unexpectedly if nothing is set.
parent 8a1e8f47
......@@ -384,7 +384,18 @@ QString KleopatraApplication::newInstance(const QCommandLineParser &parser,
}
}
Q_FOREACH (Command *cmd, Command::commandsForFiles(files)) {
cmd->setParentWId(parentId);
if (parentId) {
cmd->setParentWId(parentId);
} else {
MainWindow *mw = mainWindow();
if (!mw) {
mw = new MainWindow;
mw->setAttribute(Qt::WA_DeleteOnClose);
setMainWindow(mw);
d->connectConfigureDialog();
}
cmd->setParentWidget(mw);
}
cmd->start();
}
return errors.join('\n');
......
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