From cb30de26ed428c1f4fc44da6298a86870570f0b6 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Tue, 6 Feb 2024 03:19:21 -0800 Subject: [PATCH] settings: store window geometry in ~/.config/nvim-qt/window_geometry.conf The single-argument QSettings constructor sets the organization name. nvim-qt is passing "window-geometry" as the organization name, which results in QSettings using `~/.config/window-geometry.conf`. This is undesirable because the file is written to the root of `~/.config` without any indication about which application created or uses the file. Set the organization name to "nvim-qt" when writing window geometry so that `~/.config/nvim-qt/window-geometry.conf` is used instead. --- src/gui/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 7fa1f8d1f..7892e2b5a 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -311,7 +311,7 @@ Shell* MainWindow::shell() void MainWindow::saveWindowGeometry() { - QSettings settings{ "window-geometry" }; + QSettings settings("nvim-qt", "window-geometry"); settings.setValue("window_geometry", saveGeometry()); settings.setValue("window_state", saveState()); } @@ -324,7 +324,7 @@ void MainWindow::restoreWindowGeometry() qRegisterMetaTypeStreamOperators>("QList"); #endif - QSettings settings{ "window-geometry" }; + QSettings settings("nvim-qt", "window-geometry"); restoreGeometry(settings.value("window_geometry").toByteArray()); restoreState(settings.value("window_state").toByteArray()); }