[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:17:04 UTC 2016


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

The following commit has been merged in the master branch:
commit f98106712278912885177cd4e11641f12cd8c611
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Sun Sep 19 11:43:08 2010 +0000

    Support loading Template.html from theme
    
    
    svn path=/trunk/playground/network/telepathy-chat-handler/; revision=1177088
---
 app/mainwindow.cpp      |  5 +----
 lib/chatwindow.cpp      |  3 ++-
 lib/chatwindowstyle.cpp | 21 ++++++++++++++++++++-
 lib/chatwindowstyle.h   |  3 +++
 4 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp
index 19b7b34..532f9fa 100644
--- a/app/mainwindow.cpp
+++ b/app/mainwindow.cpp
@@ -24,7 +24,6 @@ inline ChannelClassList channelClassList()
 {
     ChannelClassList filters;
     QMap<QString, QDBusVariant> filter;
-
     filter.insert(QLatin1String(TELEPATHY_INTERFACE_CHANNEL ".ChannelType"),
                   QDBusVariant(TELEPATHY_INTERFACE_CHANNEL_TYPE_TEXT));
     filter.insert(QLatin1String(TELEPATHY_INTERFACE_CHANNEL ".TargetHandleType"),
@@ -37,8 +36,6 @@ inline ChannelClassList channelClassList()
     filter.insert(QLatin1String(TELEPATHY_INTERFACE_CHANNEL ".TargetHandleType"),
                   QDBusVariant((uint) Tp::HandleTypeRoom));
     filters.append(filter);
-
-
     return filters;
 }
 
@@ -63,7 +60,7 @@ void MainWindow::handleChannels(const MethodInvocationContextPtr<> &context,
 
     connect(newWindow, SIGNAL(titleChanged(QString)), SLOT(updateTabText(QString)));
     addTab(newWindow, "");
-    resize(newWindow->sizeHint());// FUDGE
+    resize(newWindow->sizeHint() - QSize(50,50));// FUDGE
 
     context->setFinished();
 }
diff --git a/lib/chatwindow.cpp b/lib/chatwindow.cpp
index d0bdedd..0aff46a 100644
--- a/lib/chatwindow.cpp
+++ b/lib/chatwindow.cpp
@@ -25,7 +25,8 @@
 
 #include <QKeyEvent>
 
-
+//FIXME once TP::Factory stuff is in, remove all of ChatConnection, replace this with
+//ChatWindow::ChatWindow(ConnectionPtr,TextChannelPtr, QWidget* parent) :...
 ChatWindow::ChatWindow(ChatConnection* chat, QWidget *parent) :
         QWidget(parent),
         ui(new Ui::ChatWindow),
diff --git a/lib/chatwindowstyle.cpp b/lib/chatwindowstyle.cpp
index bbdc961..b3a091c 100644
--- a/lib/chatwindowstyle.cpp
+++ b/lib/chatwindowstyle.cpp
@@ -38,6 +38,7 @@ public:
     QString baseHref;
     QString currentVariantPath;
 
+    QString templateHtml;
     QString headerHtml;
     QString footerHtml;
     QString incomingHtml;
@@ -134,6 +135,11 @@ bool ChatWindowStyle::hasHeader() const
    return ! d->headerHtml.isEmpty();
 }
 
+QString ChatWindowStyle::getTemplateHtml() const
+{
+    return d->templateHtml;
+}
+
 QString ChatWindowStyle::getHeaderHtml() const
 {
     return d->headerHtml;
@@ -245,6 +251,7 @@ void ChatWindowStyle::listVariants()
 
 void ChatWindowStyle::readStyleFiles()
 {
+    QString templateFile = d->baseHref + QString("Template.html");
     QString headerFile = d->baseHref + QString("Header.html");
     QString footerFile = d->baseHref + QString("Footer.html");
     QString incomingFile = d->baseHref + QString("Incoming/Content.html");
@@ -262,7 +269,19 @@ void ChatWindowStyle::readStyleFiles()
     QString outgoingStateErrorFile = d->baseHref + QString("Outgoing/StateError.html");
 
     QFile fileAccess;
-    // First load header file.
+
+    //Load template file
+    if (QFile::exists(templateFile))
+    {
+        fileAccess.setFileName(templateFile);
+        fileAccess.open(QIODevice::ReadOnly);
+        QTextStream headerStream(&fileAccess);
+        headerStream.setCodec(QTextCodec::codecForName("UTF-8"));
+        d->templateHtml = headerStream.readAll();
+        fileAccess.close();
+    }
+
+    // Load header file.
     if (QFile::exists(headerFile)) {
         fileAccess.setFileName(headerFile);
         fileAccess.open(QIODevice::ReadOnly);
diff --git a/lib/chatwindowstyle.h b/lib/chatwindowstyle.h
index 752fd83..6177027 100644
--- a/lib/chatwindowstyle.h
+++ b/lib/chatwindowstyle.h
@@ -95,6 +95,9 @@ public:
     /** Returns true if this style supports showing a header at the top of the chat window*/
 
     bool hasHeader() const;
+
+
+    QString getTemplateHtml() const;
     QString getHeaderHtml() const;
     QString getFooterHtml() const;
     QString getIncomingHtml() const;

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list