[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:23:10 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=4021784
The following commit has been merged in the master branch:
commit 402178400be4d7548df9eeaab4cc48ea49e0e729
Author: Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
Date: Sun Jan 13 04:18:51 2013 +0100
Split backslash and escape filters
The backslash filter is now executed after that every other plugin has
run.
This fixes a weird bug that allows to write as the conversation partner
if the emoticon set installed has an emoticon associated to a string
ending in "\".
Reviewed-by: David Edmundson <kde at davidedmundson.co.uk>
BUG: 313110
FIXED-IN: 0.5.3
---
lib/CMakeLists.txt | 1 +
lib/{abstract-message-filter.cpp => backslash-filter.cpp} | 13 ++++++++-----
lib/escape-filter.cpp | 1 -
lib/filters.h | 7 +++++++
lib/message-processor.cpp | 2 ++
5 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 467c1eb..5c7ff84 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -19,6 +19,7 @@ set(ktpchat_SRCS
message-processor.cpp
url-filter.cpp
escape-filter.cpp
+ backslash-filter.cpp
plugin-config-manager.cpp
)
diff --git a/lib/abstract-message-filter.cpp b/lib/backslash-filter.cpp
similarity index 66%
copy from lib/abstract-message-filter.cpp
copy to lib/backslash-filter.cpp
index 2a3a897..b722cbd 100644
--- a/lib/abstract-message-filter.cpp
+++ b/lib/backslash-filter.cpp
@@ -1,5 +1,6 @@
/*
Copyright (C) 2012 Lasath Fernando <kde at lasath.org>
+ Copyright (C) 2013 Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -16,13 +17,15 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "abstract-message-filter.h"
+#include "filters.h"
-AbstractMessageFilter::AbstractMessageFilter(QObject* parent)
- : QObject(parent)
+BackslashFilter::BackslashFilter(QObject *parent)
+ : AbstractMessageFilter(parent)
{
}
-AbstractMessageFilter::~AbstractMessageFilter()
+void BackslashFilter::filterMessage(Message& message)
{
-}
\ No newline at end of file
+ message.setMainMessagePart(message.mainMessagePart().replace(QLatin1Char('\'), QLatin1String("\\"))); //replace a single backslash with two backslashes.
+}
+
diff --git a/lib/escape-filter.cpp b/lib/escape-filter.cpp
index 7a43151..7ce3f08 100644
--- a/lib/escape-filter.cpp
+++ b/lib/escape-filter.cpp
@@ -34,7 +34,6 @@ void EscapeFilter::filterMessage(Message& message)
escapedMessage.replace(QLatin1Char('
'), QLatin1String("<br/>"));
escapedMessage.replace(QLatin1Char(' '), QLatin1String(" ")); // replace tabs by 4 spaces
escapedMessage.replace(QLatin1String(" "), QLatin1String(" ")); // keep multiple whitespaces
- escapedMessage.replace(QLatin1Char('\'), QLatin1String("\\")); //replace a single backslash with two backslashes.
message.setMainMessagePart(escapedMessage);
}
diff --git a/lib/filters.h b/lib/filters.h
index 4e96ae0..9fc0db4 100644
--- a/lib/filters.h
+++ b/lib/filters.h
@@ -37,4 +37,11 @@ public:
virtual void filterMessage(Message& message);
};
+class BackslashFilter : public AbstractMessageFilter
+{
+public:
+ explicit BackslashFilter(QObject *parent = 0);
+ virtual void filterMessage(Message& message);
+};
+
#endif
diff --git a/lib/message-processor.cpp b/lib/message-processor.cpp
index 25e8c70..4eb214c 100644
--- a/lib/message-processor.cpp
+++ b/lib/message-processor.cpp
@@ -51,6 +51,8 @@ MessageProcessor::MessageProcessor()
m_filters.append(new UrlFilter(this));
loadFilters();
+
+ m_filters.append(new BackslashFilter(this));
}
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list