Implement simpler fix for emote completion bug

This commit implements a simpler fix for the problem described in #1209.
The setting's signal is connected to a reset of `completionInProgress_`
so that the completion model is updated on the next word already.

This commit also removes the older approach tackling this issue.
This commit is contained in:
Leon Richardt
2019-08-18 21:37:20 +02:00
parent 23a5f0bfb2
commit f2b2e3142f
5 changed files with 9 additions and 41 deletions
+2 -16
View File
@@ -8,12 +8,10 @@
#include "singletons/Fonts.hpp"
#include "singletons/Paths.hpp"
#include "singletons/Theme.hpp"
#include "singletons/WindowManager.hpp"
#include "util/FuzzyConvert.hpp"
#include "util/Helpers.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/Window.hpp"
#include "widgets/helper/Line.hpp"
#include "widgets/splits/Split.hpp"
#define CHROME_EXTENSION_LINK \
"https://chrome.google.com/webstore/detail/chatterino-native-host/" \
@@ -286,22 +284,10 @@ void GeneralPage::initLayout(SettingsLayout &layout)
[](int index) { return index; }, [](auto args) { return args.index; },
false);
auto emoteCompletionCheckbox = layout.addCheckbox(
layout.addCheckbox(
"Only search for emote autocompletion at the start of emote names",
s.prefixOnlyEmoteCompletion);
// Get the currently active split
// XXX: Is there a better way to do this?
auto selectedSplit =
static_cast<SplitContainer *>(
getApp()->windows->getMainWindow().getNotebook().getSelectedPage())
->getBaseNode()
->getSplit();
// Update emote completion mode when checkbox state is changed
QObject::connect(emoteCompletionCheckbox, &QCheckBox::stateChanged,
selectedSplit, &Split::updateEmoteCompletion);
layout.addSpacing(16);
layout.addSeperator();