Commit 891017f0 authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

Add a couple of extra checks for sanity and remove commented code

parent 06b74c3b
......@@ -281,7 +281,11 @@ void KateCommandBar::updateBar(const QList<KActionCollection *> &actionCollectio
QVector<QPair<QString, QAction*>> actionList;
for (const auto collection : actionCollections) {
for (const auto action : collection->actions()) {
actionList.append({collection->componentDisplayName(), action});
// sanity + empty check ensures displayable actions and removes ourself
// from the action list
if (action && !action->text().isEmpty()) {
actionList.append({collection->componentDisplayName(), action});
}
}
}
......
......@@ -254,9 +254,8 @@ void KateMainWindow::setupImportantActions()
connect(a, &QAction::triggered, this, &KateMainWindow::slotQuickOpen);
a->setWhatsThis(i18n("Open a form to quick open documents."));
// kate command bar
a = actionCollection()->addAction(QStringLiteral("view_commandbar_open"));
// a->setIcon(QIcon::fromTheme(QStringLiteral("quickopen")));
// a->setText(i18n("&Quick Open"));
actionCollection()->setDefaultShortcut(a, QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_I));
connect(a, &QAction::triggered, this, &KateMainWindow::slotCommandBarOpen);
}
......@@ -1223,6 +1222,10 @@ void KateMainWindow::slotCommandBarOpen()
auto clients = guiFactory()->clients();
for (auto c : clients) {
if (!c)
continue;
if (!c->actionCollection())
continue;
actionCollections.append(c->actionCollection());
}
......
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