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


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

The following commit has been merged in the master branch:
commit fc99e9a5e2835de0113f407b2c3d28bb807cc4e7
Author: Daniele E. Domenichelli <daniele.domenichelli at iit.it>
Date:   Fri Apr 11 00:37:29 2014 +0200

    Implement %senderColor% replacement for Adium themes
---
 lib/adium-theme-content-info.cpp | 28 ++++++++++++++++++++++++++++
 lib/adium-theme-content-info.h   |  3 +--
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/lib/adium-theme-content-info.cpp b/lib/adium-theme-content-info.cpp
index 08945d4..6db9f9a 100644
--- a/lib/adium-theme-content-info.cpp
+++ b/lib/adium-theme-content-info.cpp
@@ -19,6 +19,31 @@
 
 #include "adium-theme-content-info.h"
 #include <QString>
+#include <QStringList>
+#include <QHash>
+
+
+// List of colors used by %senderColor%. Copied from
+// adium/Frameworks/AIUtilities\ Framework/Source/AIColorAdditions.m
+static const QString defaultColors(QLatin1String("aqua:aquamarine:blue:"
+    "blueviolet:brown:burlywood:cadetblue:chartreuse:chocolate:coral:"
+    "cornflowerblue:crimson:cyan:darkblue:darkcyan:darkgoldenrod:darkgreen:"
+    "darkgrey:darkkhaki:darkmagenta:darkolivegreen:darkorange:darkorchid:"
+    "darkred:darksalmon:darkseagreen:darkslateblue:darkslategrey:darkturquoise:"
+    "darkviolet:deeppink:deepskyblue:dimgrey:dodgerblue:firebrick:forestgreen:"
+    "fuchsia:gold:goldenrod:green:greenyellow:grey:hotpink:indianred:indigo:"
+    "lawngreen:lightblue:lightcoral:lightgreen:lightgrey:lightpink:lightsalmon:"
+    "lightseagreen:lightskyblue:lightslategrey:lightsteelblue:lime:limegreen:"
+    "magenta:maroon:mediumaquamarine:mediumblue:mediumorchid:mediumpurple:"
+    "mediumseagreen:mediumslateblue:mediumspringgreen:mediumturquoise:"
+    "mediumvioletred:midnightblue:navy:olive:olivedrab:orange:orangered:orchid:"
+    "palegreen:paleturquoise:palevioletred:peru:pink:plum:powderblue:purple:"
+    "red:rosybrown:royalblue:saddlebrown:salmon:sandybrown:seagreen:sienna:"
+    "silver:skyblue:slateblue:slategrey:springgreen:steelblue:tan:teal:thistle:"
+    "tomato:turquoise:violet:yellowgreen"));
+
+static const QStringList defaultColorList(defaultColors.split(QLatin1Char(':')));
+
 
 class AdiumThemeContentInfoPrivate
 {
@@ -117,4 +142,7 @@ QString AdiumThemeContentInfo::senderDisplayName() const
 void AdiumThemeContentInfo::setSenderDisplayName(const QString &senderDisplayName)
 {
     d->senderDisplayName = senderDisplayName;
+    // FIXME Themes can have a SenderColors.txt file to specify which colors to
+    //       use instead of the default ones.
+    d->senderColor = defaultColorList.at(qHash(senderDisplayName) % defaultColorList.size());
 }
diff --git a/lib/adium-theme-content-info.h b/lib/adium-theme-content-info.h
index 8adb2ed..e339c91 100644
--- a/lib/adium-theme-content-info.h
+++ b/lib/adium-theme-content-info.h
@@ -49,8 +49,7 @@ public:
     /** The name of the sender of this message as the user's preferences request it.*/
     QString sender() const;
 
-    /** A color derived from the user's name*/
-    //FIXME what is this talking about...?
+    /** A color derived from the user's name.*/
     QString senderColor() const;
     void setSenderColor(const QString& senderColor);
 

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list