[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9

Maximiliano Curia maxy at moszumanska.debian.org
Mon May 9 09:06:12 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=f4e0dda

The following commit has been merged in the master branch:
commit f4e0ddacbee10be94de0f7880f144b6cd1849772
Author: Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
Date:   Mon Jan 14 09:04:01 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 "\".
    
    Cherry-picked from 402178400be4d7548df9eeaab4cc48ea49e0e729 (ktp-text-ui)
    
    Reviewed-by: David Edmundson <kde at davidedmundson.co.uk>
    CCBUG: 313110
---
 KTp/CMakeLists.txt                                 |  1 +
 ...ters-private.h => message-backslash-filter.cpp} | 26 +++++++---------------
 KTp/message-escape-filter.cpp                      |  2 --
 KTp/message-filters-private.h                      |  7 ++++++
 KTp/message-processor.cpp                          |  2 ++
 5 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/KTp/CMakeLists.txt b/KTp/CMakeLists.txt
index 12d0654..ac75572 100644
--- a/KTp/CMakeLists.txt
+++ b/KTp/CMakeLists.txt
@@ -12,6 +12,7 @@ set (ktp_common_internals_private_SRCS
      logs-importer.cpp
      logs-importer-private.cpp
      message.cpp
+     message-backslash-filter.cpp
      message-escape-filter.cpp
      message-filter-config-manager.cpp
      message-processor.cpp
diff --git a/KTp/message-filters-private.h b/KTp/message-backslash-filter.cpp
similarity index 62%
copy from KTp/message-filters-private.h
copy to KTp/message-backslash-filter.cpp
index cc3d565..c91522e 100644
--- a/KTp/message-filters-private.h
+++ b/KTp/message-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,25 +17,14 @@
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-#ifndef MESSAGE_FILTERS_PRIVATE_H
-#define MESSAGE_FILTERS_PRIVATE_H
+#include "message-filters-private.h"
 
-#include "abstract-message-filter.h"
-
-#include <QObject>
-
-class MessageUrlFilter : public KTp::AbstractMessageFilter
+MessageBackslashFilter::MessageBackslashFilter(QObject *parent)
+    : AbstractMessageFilter(parent)
 {
-  public:
-    explicit MessageUrlFilter(QObject *parent = 0);
-    void filterMessage(KTp::Message &message);
-};
+}
 
-class MessageEscapeFilter : public KTp::AbstractMessageFilter
+void MessageBackslashFilter::filterMessage(KTp::Message& message)
 {
-  public:
-    explicit MessageEscapeFilter(QObject *parent = 0);
-    virtual void filterMessage(KTp::Message& message);
-};
-
-#endif
+    message.setMainMessagePart(message.mainMessagePart().replace(QLatin1Char('\'), QLatin1String("\\"))); //replace a single backslash with two backslashes.
+}
diff --git a/KTp/message-escape-filter.cpp b/KTp/message-escape-filter.cpp
index fe310b7..696389b 100644
--- a/KTp/message-escape-filter.cpp
+++ b/KTp/message-escape-filter.cpp
@@ -34,8 +34,6 @@ void MessageEscapeFilter::filterMessage(KTp::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/KTp/message-filters-private.h b/KTp/message-filters-private.h
index cc3d565..02e2230 100644
--- a/KTp/message-filters-private.h
+++ b/KTp/message-filters-private.h
@@ -37,4 +37,11 @@ class MessageEscapeFilter : public KTp::AbstractMessageFilter
     virtual void filterMessage(KTp::Message& message);
 };
 
+class MessageBackslashFilter : public KTp::AbstractMessageFilter
+{
+public:
+    explicit MessageBackslashFilter(QObject *parent = 0);
+    virtual void filterMessage(KTp::Message& message);
+};
+
 #endif
diff --git a/KTp/message-processor.cpp b/KTp/message-processor.cpp
index 12ea12d..760e369 100644
--- a/KTp/message-processor.cpp
+++ b/KTp/message-processor.cpp
@@ -93,6 +93,8 @@ MessageProcessor::MessageProcessor():
     d->filters.append(new MessageUrlFilter(this));
 
     d->loadFilters();
+
+    d->filters.append(new MessageBackslashFilter(this));
 }
 
 

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list