[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:21:35 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=14554b3
The following commit has been merged in the master branch:
commit 14554b3f976c7f2dbe58d0e6d852c1dea5d75ef1
Author: Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
Date: Wed Mar 21 00:10:55 2012 +0100
Add methods to chech if a theme has a custom Template.html file
---
lib/chat-window-style.cpp | 11 ++++++++++-
lib/chat-window-style.h | 5 +++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/lib/chat-window-style.cpp b/lib/chat-window-style.cpp
index ef01fc2..fcd2692 100644
--- a/lib/chat-window-style.cpp
+++ b/lib/chat-window-style.cpp
@@ -42,6 +42,7 @@ public:
int defaultFontSize;
bool disableCombineConsecutive;
int messageViewVersion;
+ bool hasCustomTemplateHtml;
QHash<int, QString> templateContents;
QHash<QString, bool> compactVariants;
@@ -266,6 +267,11 @@ QString ChatWindowStyle::getOutgoingStateUnknownHtml() const
return content(OutgoingStateUnknown);
}
+bool ChatWindowStyle::hasCustomTemplateHtml() const
+{
+ return d->hasCustomTemplateHtml;
+}
+
bool ChatWindowStyle::hasActionTemplate() const
{
return (!content(ActionIncoming).isEmpty() && !content(ActionOutgoing).isEmpty());
@@ -415,9 +421,10 @@ void ChatWindowStyle::readStyleFiles()
// Load template file fallback
if (content(Template).isEmpty())
{
+ d->hasCustomTemplateHtml = false;
QString templateFileName(KGlobal::dirs()->findResource("data", QLatin1String("ktelepathy/template.html")));
- if (! templateFileName.isEmpty() && QFile::exists(templateFileName)) {
+ if (!templateFileName.isEmpty() && QFile::exists(templateFileName)) {
fileAccess.setFileName(templateFileName);
fileAccess.open(QIODevice::ReadOnly);
QTextStream headerStream(&fileAccess);
@@ -425,6 +432,8 @@ void ChatWindowStyle::readStyleFiles()
setContent(Template, headerStream.readAll());
fileAccess.close();
}
+ } else {
+ d->hasCustomTemplateHtml = true;
}
//FIXME: do we have anything like this in telepathy?!
diff --git a/lib/chat-window-style.h b/lib/chat-window-style.h
index 3474941..6a72cb1 100644
--- a/lib/chat-window-style.h
+++ b/lib/chat-window-style.h
@@ -126,6 +126,11 @@ public:
QString getOutgoingStateUnknownHtml() const;
/**
+ * Check if the style is using a custom Template.html file
+ */
+ bool hasCustomTemplateHtml() const;
+
+ /**
* Check if the style has the support for Kopete Action template (Kopete extension)
* @return true if the style has Action template.
*/
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list