[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=c6dfac3
The following commit has been merged in the master branch:
commit c6dfac3184c66d517ced6475d8cbd6512763d431
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
Conflicts:
lib/adium-theme-message-info.h
---
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 6fbb676..175bf7d 100644
--- a/lib/adium-theme-content-info.cpp
+++ b/lib/adium-theme-content-info.cpp
@@ -110,16 +110,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 e32910f..428febc 100644
--- a/lib/adium-theme-message-info.cpp
+++ b/lib/adium-theme-message-info.cpp
@@ -146,6 +146,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 7b7587e..3ecb19e 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;
+
private:
AdiumThemeMessageInfoPrivate *d;
};
diff --git a/lib/adium-theme-view.cpp b/lib/adium-theme-view.cpp
index 744e471..fec0b59 100644
--- a/lib/adium-theme-view.cpp
+++ b/lib/adium-theme-view.cpp
@@ -525,8 +525,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());
@@ -544,7 +542,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
@@ -561,6 +561,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