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


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=5166e68

The following commit has been merged in the master branch:
commit 5166e68198b1a49287b2fd54c8fcf71948acd3dc
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Fri Sep 17 15:22:12 2010 +0000

    Added support for %timeOpened% and %service% in Adium themes.
    
    svn path=/trunk/playground/network/telepathy-chat-handler/; revision=1176405
---
 lib/chatview.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/chatview.cpp b/lib/chatview.cpp
index dc8045b..c0a1455 100644
--- a/lib/chatview.cpp
+++ b/lib/chatview.cpp
@@ -190,8 +190,10 @@ void ChatView::addMessage(const TelepathyChatMessageInfo &message)
     styleHtml.replace("%messageDirection%", message.messageDirection());
     styleHtml.replace("%sender%", message.senderDisplayName()); // FIXME sender is complex: not always this
     styleHtml.replace("%time%", KGlobal::locale()->formatTime(message.time().time(), true));
+    styleHtml.replace("%shortTime%", KGlobal::locale()->formatTime(message.time().time(), false));
     styleHtml.replace("%userIconPath%", "Outgoing/buddy_icon.png");// this fallback should be done in the messageinfo
     styleHtml.replace("%messageClasses%", message.messageClasses());
+    styleHtml.replace("%service%", message.service());
 
 
     // Look for %time{X}%
@@ -219,7 +221,15 @@ QString ChatView::replaceHeaderKeywords(QString htmlTemplate, const TelepathyCha
     htmlTemplate.replace("%incomingIconPath%", info.incomingIconPath().toString());
     htmlTemplate.replace("%outgoingIconPath%", info.outgoingIconPath().toString());
     htmlTemplate.replace("%timeOpened%", KGlobal::locale()->formatDateTime(info.timeOpened()));
+
     //FIXME time fields - remember to do both, steal the complicated one from Kopete code.
+    // Look for %timeOpened{X}%
+    QRegExp timeRegExp("%timeOpened\{([^}]*)\}%");
+    int pos = 0;
+    while ((pos = timeRegExp.indexIn(htmlTemplate , pos)) != -1) {
+        QString timeKeyword = formatTime(timeRegExp.cap(1), info.timeOpened());
+        htmlTemplate.replace(pos , timeRegExp.cap(0).length() , timeKeyword);
+    }
 
 
     return htmlTemplate;

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list