[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:31 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=891718a
The following commit has been merged in the master branch:
commit 891718af229c5449237805020cd5401b12ff80df
Author: Dominik Schmidt <ich at dominik-schmidt.de>
Date: Sun Sep 19 17:41:56 2010 +0000
Add reader for chat theme Info.plist.
svn path=/trunk/playground/network/telepathy-chat-handler/; revision=1177188
---
app/.swp.mainwindow.cpp | Bin 6327 -> 0 bytes
lib/CMakeLists.txt | 1 +
lib/chatstyleplistfilereader.cpp | 93 +++++++++++++++++++++
...tmessageinfo.cpp => chatstyleplistfilereader.h} | 36 ++++++--
4 files changed, 124 insertions(+), 6 deletions(-)
diff --git a/app/.swp.mainwindow.cpp b/app/.swp.mainwindow.cpp
deleted file mode 100644
index afebced..0000000
Binary files a/app/.swp.mainwindow.cpp and /dev/null differ
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index fcc22ab..a9d2de6 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -7,6 +7,7 @@ set(telepathy_chat_handler_lib_SRCS
telepathychatmessageinfo.cpp
telepathychatinfo.cpp
channelcontactlist.cpp
+ chatstyleplistfilereader.cpp
)
set(telepathy_chat_handler_lib_UI
diff --git a/lib/chatstyleplistfilereader.cpp b/lib/chatstyleplistfilereader.cpp
new file mode 100644
index 0000000..f3a21e5
--- /dev/null
+++ b/lib/chatstyleplistfilereader.cpp
@@ -0,0 +1,93 @@
+/***************************************************************************
+ * Copyright (C) 2010 by Dominik Schmidt <domme at rautelinux.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
+ ***************************************************************************/
+
+
+#include "chatstyleplistfilereader.h"
+
+#include <QFile>
+#include <QDomDocument>
+#include <QVariant>
+
+ChatStylePlistFileReader::ChatStylePlistFileReader(QString fileName)
+{
+ readFile(fileName);
+}
+
+void ChatStylePlistFileReader::readFile(QString &fileName)
+{
+ QFile file(fileName);
+
+ QDomDocument document = QDomDocument();
+ if (!file.open(QIODevice::ReadOnly))
+ return;
+ if (!document.setContent(&file)) {
+ file.close();
+ return;
+ }
+ file.close();
+
+ QString key, value;
+ QDomNodeList keyElements = document.elementsByTagName("key");
+ for(int i=0;i<keyElements.size();i++) {
+ if(keyElements.at(i).nextSibling().toElement().tagName() != "key") {
+ key = keyElements.at(i).toElement().text();
+ value = keyElements.at(i).nextSibling().toElement().text();
+ data.insert(key, value);
+ }
+ }
+}
+
+ChatStylePlistFileReader::~ChatStylePlistFileReader()
+{
+}
+
+QString ChatStylePlistFileReader::CFBundleGetInfoString()
+{
+ return data.value("CFBundleGetInfoString").toString();
+}
+
+QString ChatStylePlistFileReader::CFBundleName()
+{
+ return data.value("CFBundleName").toString();
+}
+
+QString ChatStylePlistFileReader::CFBundleIdentifier()
+{
+ return data.value("CFBundleIdentifier").toString();
+}
+
+QString ChatStylePlistFileReader::defaultFontFamily()
+{
+ return data.value("DefaultFontFamily").toString();
+}
+
+int ChatStylePlistFileReader::defaultFontSize()
+{
+ return data.value("DefaultFontSize").toInt();
+}
+
+QString ChatStylePlistFileReader::defaultVariant()
+{
+ return data.value("DefaultVariant").toString();
+}
+
+int ChatStylePlistFileReader::messageViewVersion()
+{
+ return data.value("MessageViewVersion").toInt();
+}
diff --git a/lib/telepathychatmessageinfo.cpp b/lib/chatstyleplistfilereader.h
similarity index 65%
copy from lib/telepathychatmessageinfo.cpp
copy to lib/chatstyleplistfilereader.h
index 5f53c12..753cfc6 100644
--- a/lib/telepathychatmessageinfo.cpp
+++ b/lib/chatstyleplistfilereader.h
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2010 by David Edmundson <kde at davidedmundson.co.uk> *
+ * Copyright (C) 2010 by Dominik Schmidt <domme at rautelinux.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -17,11 +17,35 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#include "telepathychatmessageinfo.h"
-//can probably delete this file. I put it all in the header.
+#ifndef CHATSTYLEPLISTFILEREADER_H
+#define CHATSTYLEPLISTFILEREADER_H
-TelepathyChatMessageInfo::TelepathyChatMessageInfo(MessageType type)
+#include <QMap>
+class QString;
+class QFile;
+class QVariant;
+
+
+class ChatStylePlistFileReader
{
- m_type = type;
-}
+
+public:
+ ChatStylePlistFileReader(QString fileName);
+ virtual ~ChatStylePlistFileReader();
+
+ QString CFBundleGetInfoString();
+ QString CFBundleIdentifier();
+ QString CFBundleName();
+ QString defaultFontFamily();
+ int defaultFontSize();
+ QString defaultVariant();
+ int messageViewVersion();
+
+
+private:
+ QMap<QString, QVariant> data;
+ void readFile(QString& fileName);
+};
+
+#endif // CHATSTYLEPLISTFILEREADER_H
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list