From f29e948bed15e0b3fea7de30cb8154f5cee3e99f Mon Sep 17 00:00:00 2001 From: Anthony Bilinski Date: Sat, 4 Apr 2020 22:59:09 -0700 Subject: [PATCH] revert(chatlog): "add action "Go to current date"" This reverts commit 2a9648d12c2f71efa8f9722f1c0fa6e39e701c47. --- src/widget/form/genericchatform.cpp | 19 ------------------- src/widget/form/genericchatform.h | 2 -- 2 files changed, 21 deletions(-) diff --git a/src/widget/form/genericchatform.cpp b/src/widget/form/genericchatform.cpp index 032bcbbfa..393c0319c 100644 --- a/src/widget/form/genericchatform.cpp +++ b/src/widget/form/genericchatform.cpp @@ -316,13 +316,6 @@ GenericChatForm::GenericChatForm(const Core& _core, const Contact* contact, ICha quoteAction = menu.addAction(QIcon(), QString(), this, SLOT(quoteSelectedText()), QKeySequence(Qt::ALT + Qt::Key_Q)); addAction(quoteAction); - - menu.addSeparator(); - - goCurrentDateAction = menu.addAction(QIcon(), QString(), this, SLOT(goToCurrentDate()), - QKeySequence(Qt::CTRL + Qt::Key_G)); - addAction(goCurrentDateAction); - menu.addSeparator(); searchAction = menu.addAction(QIcon(), QString(), this, SLOT(searchFormShow()), @@ -1060,17 +1053,6 @@ void GenericChatForm::renderMessages(ChatLogIdx begin, ChatLogIdx end, } } -void GenericChatForm::goToCurrentDate() -{ - chatWidget->clear(); - messages.clear(); - auto end = chatLog.getNextIdx(); - auto numMessages = std::min(DEF_NUM_MSG_TO_LOAD, chatLog.getNextIdx() - chatLog.getFirstIdx()); - auto begin = end - numMessages; - - renderMessages(begin, end); -} - void GenericChatForm::loadHistoryLower() { auto end = messages.begin()->first; @@ -1122,7 +1104,6 @@ void GenericChatForm::retranslateUi() quoteAction->setText(tr("Quote selected text")); copyLinkAction->setText(tr("Copy link address")); searchAction->setText(tr("Search in text")); - goCurrentDateAction->setText(tr("Go to current date")); loadHistoryAction->setText(tr("Load chat history...")); exportChatAction->setText(tr("Export to file")); } diff --git a/src/widget/form/genericchatform.h b/src/widget/form/genericchatform.h index f78de8357..7f5598c42 100644 --- a/src/widget/form/genericchatform.h +++ b/src/widget/form/genericchatform.h @@ -119,7 +119,6 @@ protected slots: void renderMessage(ChatLogIdx idx); void renderMessages(ChatLogIdx begin, ChatLogIdx end, std::function onCompletion = std::function()); - void goToCurrentDate(); void loadHistoryLower(); void loadHistoryUpper(); @@ -159,7 +158,6 @@ protected: QAction* searchAction; QAction* loadHistoryAction; QAction* exportChatAction; - QAction* goCurrentDateAction; QMenu menu;