[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:00 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=0da8c4c
The following commit has been merged in the master branch:
commit 0da8c4c297f2316168ccff271775458691e24d97
Author: Emil Sedgh <emilsedgh at kde.org>
Date: Fri Nov 23 15:53:40 2012 +0330
Add proper messageDirection depending on message.isRightToLeft()
Makes ktp-text-ui, rtl friendly.
Fun fact: I looked at Adium to see how they do it. According to their changelog, Kopete implemented the feature originally.
Circle of life? ;)
BUG:305045
---
lib/adium-theme-content-info.cpp | 10 ----------
lib/adium-theme-content-info.h | 3 ---
lib/adium-theme-message-info.cpp | 8 ++++++++
lib/adium-theme-message-info.h | 3 +++
lib/adium-theme-view.cpp | 9 ++++++---
5 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/lib/adium-theme-content-info.cpp b/lib/adium-theme-content-info.cpp
index bad23e1..08945d4 100644
--- a/lib/adium-theme-content-info.cpp
+++ b/lib/adium-theme-content-info.cpp
@@ -109,16 +109,6 @@ void AdiumThemeContentInfo::setSenderStatusIcon(const QString &senderStatusIcon)
d->senderStatusIcon = senderStatusIcon;
}
-QString AdiumThemeContentInfo::messageDirection() const
-{
- switch(type()) {
- case AdiumThemeMessageInfo::RemoteToLocal:
- return QLatin1String("trl");
- default:
- return QLatin1String("ltr");
- }
-}
-
QString AdiumThemeContentInfo::senderDisplayName() const
{
return d->senderDisplayName;
diff --git a/lib/adium-theme-content-info.h b/lib/adium-theme-content-info.h
index 4e5c437..8adb2ed 100644
--- a/lib/adium-theme-content-info.h
+++ b/lib/adium-theme-content-info.h
@@ -58,9 +58,6 @@ public:
QString senderStatusIcon() const;
void setSenderStatusIcon(const QString& senderStatusIcon);
- /** The text direction of the message (either rtl or ltr) */
- QString messageDirection() const;
-
/** The serverside (remotely set) name of the sender, such as an MSN display name.*/
QString senderDisplayName() const;
void setSenderDisplayName(const QString& senderDisplayName);
diff --git a/lib/adium-theme-message-info.cpp b/lib/adium-theme-message-info.cpp
index 052be90..cc4247a 100644
--- a/lib/adium-theme-message-info.cpp
+++ b/lib/adium-theme-message-info.cpp
@@ -147,6 +147,14 @@ QString AdiumThemeMessageInfo::messageClasses() const {
return classes.join(QLatin1String(" "));
}
+QString AdiumThemeMessageInfo::messageDirection() const
+{
+ if(message().isRightToLeft()) {
+ return QLatin1String("rtl");
+ } else {
+ return QLatin1String("ltr");
+ }
+}
void AdiumThemeMessageInfo::appendMessageClass(const QString &messageClass)
{
diff --git a/lib/adium-theme-message-info.h b/lib/adium-theme-message-info.h
index 8474ee9..35ead23 100644
--- a/lib/adium-theme-message-info.h
+++ b/lib/adium-theme-message-info.h
@@ -65,6 +65,9 @@ public:
QString messageClasses() const;
void appendMessageClass(const QString& messageClass);
+ /** The text direction of the message (either rtl or ltr) */
+ QString messageDirection() const;
+
/** The script to be run after appending the message. */
QString script() const;
void setScript(const QString& script);
diff --git a/lib/adium-theme-view.cpp b/lib/adium-theme-view.cpp
index 24b9c35..489f230 100644
--- a/lib/adium-theme-view.cpp
+++ b/lib/adium-theme-view.cpp
@@ -536,8 +536,6 @@ QString AdiumThemeView::replaceContentKeywords(QString& htmlTemplate, const Adiu
htmlTemplate.replace(QLatin1String("%senderColor%"), info.senderColor());
//senderStatusIcon
htmlTemplate.replace(QLatin1String("%senderStatusIcon%"), info.senderStatusIcon());
- //messageDirection
- htmlTemplate.replace(QLatin1String("%messageDirection%"), info.messageDirection());
//senderDisplayName
htmlTemplate.replace(QLatin1String("%senderDisplayName%"), info.senderDisplayName());
@@ -555,7 +553,9 @@ QString AdiumThemeView::replaceMessageKeywords(QString &htmlTemplate, const Adiu
{
//message
QString message = info.message();
-
+ message.prepend(QString::fromLatin1("<div dir=\"%1\">").arg(info.messageDirection()));
+ message.append(QLatin1String("</div>"));
+
htmlTemplate.replace(QLatin1String("%message%"), message);
//service
@@ -572,6 +572,9 @@ QString AdiumThemeView::replaceMessageKeywords(QString &htmlTemplate, const Adiu
htmlTemplate.replace(pos , timeRegExp.cap(0).length() , timeKeyword);
}
+ //messageDirection
+ htmlTemplate.replace(QLatin1String("%messageDirection%"), info.messageDirection());
+
htmlTemplate.replace(QLatin1String("%messageClasses%"), info.messageClasses());
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list