Skip to content

Commit 87f5f58

Browse files
committed
#3294 command-bar: fix bar not showing up
Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
1 parent 2a4d57e commit 87f5f58

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# QOwnNotes Changelog
22

3+
## 25.6.2
4+
5+
- The _Find action_ dialog is now working again
6+
(for [#3294](https://github.com/pbek/QOwnNotes/issues/3294))
7+
38
## 25.6.1
49

510
- A segmentation fault when quitting the application on ARM macOS was fixed

src/mainwindow.cpp

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
462462
QString::number(schemaCount) + QStringLiteral(" schemas"), schemaCount);
463463

464464
_actionDialog = nullptr;
465+
_commandBar = nullptr;
465466
_todoDialog = nullptr;
466467
_storedImagesDialog = nullptr;
467468
_storedAttachmentsDialog = nullptr;
@@ -10983,10 +10984,29 @@ void MainWindow::on_actionFind_action_triggered() {
1098310984
}
1098410985
}
1098510986

10986-
CommandBar commandBar(this);
10987-
commandBar.updateBar(actions);
10988-
commandBar.setFocus();
10989-
commandBar.exec();
10987+
if (_commandBar != nullptr) {
10988+
delete _commandBar;
10989+
}
10990+
10991+
// We need to instantiate the class every time, otherwise no and then it's not drawn correctly
10992+
_commandBar = new CommandBar(this);
10993+
10994+
_commandBar->updateBar(actions);
10995+
_commandBar->setFocus();
10996+
10997+
// Keep in mind this call is not synchronous anymore for some reason, so we can't delete the
10998+
// instance
10999+
_commandBar->exec();
11000+
11001+
// QPointer<CommandBar> commandBar = new CommandBar(this);
11002+
//
11003+
// commandBar->updateBar(actions);
11004+
// commandBar->setFocus();
11005+
// QAction *action = commandBar->exec();
11006+
//
11007+
// delete commandBar;
11008+
//
11009+
// qDebug() << __func__ << " - 'action': " << action;
1099011010
}
1099111011

1099211012
/**

src/mainwindow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,7 @@ class MainWindow : public QMainWindow {
841841
bool _noteSubFolderDockWidgetVisible;
842842
bool _closeEventWasFired;
843843
ActionDialog *_actionDialog;
844+
CommandBar *_commandBar;
844845
TodoDialog *_todoDialog;
845846
IssueAssistantDialog *_issueAssistantDialog;
846847
StoredImagesDialog *_storedImagesDialog;

0 commit comments

Comments
 (0)