[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:50 UTC 2016


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

The following commit has been merged in the master branch:
commit e469dfe3d6bcd02b7c0ffd8e513fa2a9d0face0e
Author: Dan Vrátil <dvratil at redhat.com>
Date:   Mon May 13 14:04:55 2013 +0200

    Strip wrapping HTML tags when importing logs from Kopete
    
    Also disable check whether the logfile already exists in TpLogger and
    just overwrite it. This allows users to reimport their Kopete logs
    
    BUG: 318751
    FIXED-IN: 0.6.2
    Reviewed-By: David Edmundson
---
 KTp/logs-importer-private.cpp | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/KTp/logs-importer-private.cpp b/KTp/logs-importer-private.cpp
index 3680c9e..7275b07 100644
--- a/KTp/logs-importer-private.cpp
+++ b/KTp/logs-importer-private.cpp
@@ -195,11 +195,6 @@ void LogsImporter::Private::saveKTpDocument()
     path += QDir::separator() + filename;
 
     QFile outFile(path);
-    if (outFile.exists()) {
-        kWarning() << path << "already exists, not importing logs";
-        return;
-    }
-
     outFile.open(QIODevice::WriteOnly);
     QTextStream stream(&outFile);
     m_ktpDocument.save(stream, 0);
@@ -315,9 +310,18 @@ void LogsImporter::Private::convertKopeteLog(const QString& filepath)
     QFile f(filepath);
     f.open(QIODevice::ReadOnly);
 
-    QByteArray ba = f.readAll();
+    const QByteArray ba = f.readAll();
+    QString content = QString::fromUtf8(ba.constData(), ba.size());
+
+    /* Strip Kopete HTML wrapping, which is always
+     * <sometag>....</sometag> - only "<" is escaped
+     * See https://bugs.kde.org/show_bug.cgi?id=318751
+     */
+    QRegExp rx(QLatin1String("\<[^>]*>"));
+    rx.setMinimal(true);
+    content = content.replace(rx, QString());
 
-    m_kopeteDocument.setContent(ba);
+    m_kopeteDocument.setContent(content);
     /* Get <history> node */
     QDomElement history = m_kopeteDocument.documentElement();
     /* Get all <msg> nodes in <history> node */

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list