From 893886487663b92cacf28f1c147b396d208b8774 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 13 Oct 2021 09:03:02 +0200 Subject: [PATCH] FakeVim: Use setEnabler for the vimrc path aspect This fixes the enabling/disabling of the line edit and triggers the (re-)read of the .vimrc at the right times. Change-Id: I13a022aafc23ea761d3c1c4d0359cc5f137695d5 Reviewed-by: Lukas Holecek Reviewed-by: Christian Stenger --- src/plugins/fakevim/fakevimplugin.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index 8be735072dc..fae4f7c835d 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -380,7 +380,6 @@ private: void copyTextEditorSettings(); void setQtStyle(); void setPlainStyle(); - void updateVimRcWidgets(); }; void FakeVimOptionPage::layoutPage(QWidget *widget) @@ -449,15 +448,14 @@ void FakeVimOptionPage::layoutPage(QWidget *widget) }.attachTo(widget, true); + s.vimRcPath.setEnabler(&s.readVimRc); + connect(copyTextEditorSettings, &QAbstractButton::clicked, this, &FakeVimOptionPage::copyTextEditorSettings); connect(setQtStyle, &QAbstractButton::clicked, this, &FakeVimOptionPage::setQtStyle); connect(setPlainStyle, &QAbstractButton::clicked, this, &FakeVimOptionPage::setPlainStyle); - connect(&s.readVimRc, &FvBaseAspect::changed, - this, &FakeVimOptionPage::updateVimRcWidgets); - updateVimRcWidgets(); } void FakeVimOptionPage::copyTextEditorSettings() @@ -503,13 +501,6 @@ void FakeVimOptionPage::setPlainStyle() s.passKeys.setVolatileValue(false); } -void FakeVimOptionPage::updateVimRcWidgets() -{ - FakeVimSettings &s = *fakeVimSettings(); - s.vimRcPath.setEnabled(s.readVimRc.value()); -} - - /////////////////////////////////////////////////////////////////////// // // FakeVimPluginPrivate