[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:24:18 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=376a50d
The following commit has been merged in the master branch:
commit 376a50dea1dd21220cfcfd078efc04ae47c819e4
Author: Dan Vrátil <dvratil at redhat.com>
Date: Tue Oct 15 09:33:32 2013 +0200
Clear sent message history when clearing chat view
When user clicks Action->Clear View, clear the sent message history
in ChatTextEdit too - when you want to delete a sensitive conversation,
keeping sent messages is not a good thing to do :)
Also fix the actual Clear View action by setting d->exchangeMessageCount
to 0 in clear(), otherwise last X messages from backlog are loaded after
re-initialization of the chat view.
REVIEW: 113255
---
lib/chat-text-edit.cpp | 10 ++++++++--
lib/chat-text-edit.h | 2 ++
lib/chat-widget.cpp | 2 ++
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/lib/chat-text-edit.cpp b/lib/chat-text-edit.cpp
index 684ecd1..79d49a1 100644
--- a/lib/chat-text-edit.cpp
+++ b/lib/chat-text-edit.cpp
@@ -52,8 +52,7 @@ ChatTextEdit::ChatTextEdit(QWidget *parent) :
setAcceptRichText(false);
// Initialize the history
- m_history.prepend(QString());
- m_historyPos = 0;
+ clearHistory();
connect(this, SIGNAL(textChanged()), SLOT(recalculateSize()));
}
@@ -90,6 +89,13 @@ QSize ChatTextEdit::sizeHint() const
return sh;
}
+void ChatTextEdit::clearHistory()
+{
+ m_history.clear();
+ m_history.prepend(QString());
+ m_historyPos = 0;
+}
+
void ChatTextEdit::keyPressEvent(QKeyEvent *e)
{
if (e->matches(QKeySequence::Copy)) {
diff --git a/lib/chat-text-edit.h b/lib/chat-text-edit.h
index a14d716..bc3720e 100644
--- a/lib/chat-text-edit.h
+++ b/lib/chat-text-edit.h
@@ -39,6 +39,8 @@ public:
QSize minimumSizeHint() const;
QSize sizeHint() const;
+ void clearHistory();
+
protected:
void keyPressEvent(QKeyEvent *e);
diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index 71650c2..c2b5a97 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -931,6 +931,8 @@ void ChatWidget::clear()
{
// Don't reload logs when re-initializing */
d->logsLoaded = true;
+ d->exchangedMessagesCount = 0;
+ d->ui.sendMessageBox->clearHistory();
initChatArea();
}
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list