Skip to content

Commit

Permalink
settings: store window geometry in ~/.config/nvim-qt/window_geometry.…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
davvid committed Feb 6, 2024
1 parent f5c95b1 commit cb30de2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand All @@ -324,7 +324,7 @@ void MainWindow::restoreWindowGeometry()
qRegisterMetaTypeStreamOperators<QList<int>>("QList<int>");
#endif

QSettings settings{ "window-geometry" };
QSettings settings("nvim-qt", "window-geometry");
restoreGeometry(settings.value("window_geometry").toByteArray());
restoreState(settings.value("window_state").toByteArray());
}
Expand Down

0 comments on commit cb30de2

Please sign in to comment.