From 8870455f9dd6463f9b8ef04516d69efef3c6287d Mon Sep 17 00:00:00 2001 From: Jedi18 Date: Sun, 7 Mar 2021 00:18:24 +0530 Subject: change allowed mistakes, fix minor style issues, remove old completer function from inputbar --- src/timeline/InputBar.cpp | 22 ---------------------- src/timeline/InputBar.h | 2 -- src/timeline/TimelineViewManager.cpp | 2 +- 3 files changed, 1 insertion(+), 25 deletions(-) (limited to 'src/timeline') diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp index 5ef38ac7..ab0fc3d7 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp @@ -174,28 +174,6 @@ InputBar::nextText() return text(); } -QObject * -InputBar::completerFor(QString completerName) -{ - if (completerName == "user") { - auto userModel = new UsersModel(room->roomId().toStdString()); - auto proxy = new CompletionProxyModel(userModel); - userModel->setParent(proxy); - return proxy; - } else if (completerName == "emoji") { - auto emojiModel = new emoji::EmojiModel(); - auto proxy = new CompletionProxyModel(emojiModel); - emojiModel->setParent(proxy); - return proxy; - } else if (completerName == "room") { - auto roomModel = new RoomsModel(true); - auto proxy = new CompletionProxyModel(roomModel); - roomModel->setParent(proxy); - return proxy; - } - return nullptr; -} - void InputBar::send() { diff --git a/src/timeline/InputBar.h b/src/timeline/InputBar.h index 696a0dd9..678d953d 100644 --- a/src/timeline/InputBar.h +++ b/src/timeline/InputBar.h @@ -51,8 +51,6 @@ public slots: bool uploading() const { return uploading_; } void message(QString body, MarkdownOverride useMarkdown = MarkdownOverride::NOT_SPECIFIED); - QObject *completerFor(QString completerName); - private slots: void startTyping(); void stopTyping(); diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp index 7d74496d..04af7060 100644 --- a/src/timeline/TimelineViewManager.cpp +++ b/src/timeline/TimelineViewManager.cpp @@ -577,7 +577,7 @@ TimelineViewManager::completerFor(QString completerName, QString roomId) return proxy; } else if (completerName == "room") { auto roomModel = new RoomsModel(false); - auto proxy = new CompletionProxyModel(roomModel); + auto proxy = new CompletionProxyModel(roomModel, 4); roomModel->setParent(proxy); return proxy; } else if (completerName == "roomAliases") { -- cgit 1.5.1