Skip to content

Commit 9b44b5d

Browse files
committed
#3425 workspace: fix switching to different layout in Layout settings under Qt6
Signed-off-by: Patrizio Bekerle <[email protected]>
1 parent 3659f94 commit 9b44b5d

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
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+
## 26.1.5
4+
5+
- Fixed switching to different layout in the _Layout settings_ for Qt6 builds
6+
(for [#3425](https://github.com/pbek/QOwnNotes/issues/3425))
7+
38
## 26.1.4
49

510
- **Improved HTML to Markdown conversion** with better handling of various HTML elements

src/mainwindow.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -767,9 +767,8 @@ MainWindow::~MainWindow() {
767767
storeSettings();
768768
}
769769

770-
if (!isInDistractionFreeMode() && !forceQuit && !_closeEventWasFired) {
771-
storeCurrentWorkspace();
772-
}
770+
// Checks will be done in the method
771+
storeCurrentWorkspace();
773772

774773
MetricsService::instance()->sendVisitIfEnabled(QStringLiteral("app/end"),
775774
QStringLiteral("app end"));
@@ -4322,9 +4321,8 @@ void MainWindow::closeEvent(QCloseEvent *event) {
43224321
// because in the destructor the layout will be destroyed in dark mode
43234322
// when the window was closed
43244323
// https://github.com/pbek/QOwnNotes/issues/1015
4325-
if (!isInDistractionFreeMode()) {
4326-
storeCurrentWorkspace();
4327-
}
4324+
// Checks will be done in the method
4325+
storeCurrentWorkspace();
43284326

43294327
QMainWindow::closeEvent(event);
43304328
}
@@ -11115,6 +11113,12 @@ void MainWindow::setCurrentWorkspace(const QString &uuid) {
1111511113
* Stores the current workspace
1111611114
*/
1111711115
void MainWindow::storeCurrentWorkspace() {
11116+
const bool forceQuit = qApp->property("clearAppDataAndExit").toBool();
11117+
if (isInDistractionFreeMode() || forceQuit || _closeEventWasFired) {
11118+
return;
11119+
}
11120+
11121+
qDebug() << __func__;
1111811122
SettingsService settings;
1111911123
QString uuid = currentWorkspaceUuid();
1112011124

0 commit comments

Comments
 (0)