Verified Commit b2b8bf57 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Do not restore Projects tool view when no project exists

The plugins do not have a property/method which signals that
it should not be restored in its current state. That is
why we wait for one iteration of the event loop and then
hide our tool view.

BUG: 432296
parent 47dd3ff0
......@@ -27,6 +27,7 @@
#include <QDialog>
#include <QHBoxLayout>
#include <QMenu>
#include <QTimer>
#include <QVBoxLayout>
K_PLUGIN_FACTORY_WITH_JSON(KateProjectPluginFactory, "kateprojectplugin.json", registerPlugin<KateProjectPlugin>();)
......@@ -88,6 +89,13 @@ KateProjectPluginView::KateProjectPluginView(KateProjectPlugin *plugin, KTextEdi
for (KateProject *project : projectList) {
// If the list of projects is empty we do not want to restore the tool view from the last session, BUG: 432296
if (projectList.isEmpty()) {
// We have to call this in the next iteration of the event loop, after the session is restored
QTimer::singleShot(0, [this]() {
* connect to important signals, e.g. for auto project view creation
Supports Markdown
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