[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:16:00 UTC 2016


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

The following commit has been merged in the master branch:
commit 888f146d13cff0c23b4a803b6a3ba0fedf7e5334
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Tue Aug 3 21:16:45 2010 +0000

    Ported Kopete class for listing all window styles
    Added support for variants in chat view
    Added some demo code for retreiving a list of window styles into the config tool
    
    
    
    svn path=/trunk/playground/network/telepathy-chat-handler/; revision=1158831
---
 config/CMakeLists.txt          |   1 +
 config/mainwindow.cpp          |  12 ++
 config/mainwindow.h            |   3 +
 lib/chatview.cpp               |   8 +-
 lib/chatview.h                 |   1 +
 lib/chatwindowstylemanager.cpp | 428 +++++++++++++++++++++++++++++++++++++++++
 lib/chatwindowstylemanager.h   | 153 +++++++++++++++
 7 files changed, 602 insertions(+), 4 deletions(-)

diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt
index 7f77347..ba92b1e 100644
--- a/config/CMakeLists.txt
+++ b/config/CMakeLists.txt
@@ -6,6 +6,7 @@ set(telepathy_chat_config_SRCS
         main.cpp
         mainwindow.cpp
         ../lib/chatwindowstyle.cpp
+        ../lib/chatwindowstylemanager.cpp
         ../lib/chatview.cpp
         ../lib/telepathychatmessageinfo.cpp
         ../lib/telepathychatinfo.cpp
diff --git a/config/mainwindow.cpp b/config/mainwindow.cpp
index 7c01a4a..938eb90 100644
--- a/config/mainwindow.cpp
+++ b/config/mainwindow.cpp
@@ -1,15 +1,22 @@
 #include "mainwindow.h"
 #include "ui_chatwindowconfig.h"
+#include "chatwindowstylemanager.h"
 
 #include "telepathychatinfo.h"
 #include "telepathychatmessageinfo.h"
 
+#include <QDebug>
+
 MainWindow::MainWindow(QWidget *parent) :
     QDialog(parent),
     ui(new Ui::ChatWindowConfig)
 {
     ui->setupUi(this);
 
+    ChatWindowStyleManager* manager = ChatWindowStyleManager::self();
+    manager->loadStyles();
+    connect(manager,SIGNAL(loadStylesFinished()),SLOT(debugStyleList()));
+
     //FIXME move all the demo chat code into a different file, as it will be quite long and in the way.
 
     //set up a pretend config chat.
@@ -45,6 +52,11 @@ MainWindow::~MainWindow()
     delete ui;
 }
 
+void MainWindow::debugStyleList()
+{
+    qDebug() << ChatWindowStyleManager::self()->getAvailableStyles();
+}
+
 void MainWindow::changeEvent(QEvent *e)
 {/*
     QDialog::changeEvent(e);
diff --git a/config/mainwindow.h b/config/mainwindow.h
index 9c6dfb7..008a510 100644
--- a/config/mainwindow.h
+++ b/config/mainwindow.h
@@ -18,6 +18,9 @@ public:
 protected:
     void changeEvent(QEvent *e);
 
+public slots:
+    void debugStyleList();
+
 private:
     Ui::ChatWindowConfig *ui;
 };
diff --git a/lib/chatview.cpp b/lib/chatview.cpp
index e7bfd0a..45584c6 100644
--- a/lib/chatview.cpp
+++ b/lib/chatview.cpp
@@ -47,14 +47,14 @@ ChatView::ChatView(QWidget *parent) :
     {
         KMessageBox::error(this,"Failed to load a valid Kopete theme. Note this current version reads chat window settings from your Kopete config file.");
     }
+
+    m_variantPath = appearanceConfig.readEntry("styleVariant");
 }
 
 void ChatView::initialise(const TelepathyChatInfo &chatInfo)
 {
     //Stolen from Kopete code..took out some stuff we will need in future (variants and custom Kopete style)
 
-    //Remove silly variant fudge in here at the moment.
-
     QString headerHtml = replaceHeaderKeywords(m_chatStyle->getHeaderHtml(),chatInfo);
 
 
@@ -69,7 +69,7 @@ void ChatView::initialise(const TelepathyChatInfo &chatInfo)
                         "<base href=\"file://%1\">
"
                         "<style id=\"baseStyle\" type=\"text/css\" media=\"screen,print\">
"
                         "	@import url(\"main.css\");
"
-                        "   @import url(\"Yellow on Blue Alternating.css\");
"
+                        "   @import url(\"%4\");
"
                         "	*{ word-wrap:break-word; }
"
                         "</style>
"
                         "</head>
"
@@ -79,7 +79,7 @@ void ChatView::initialise(const TelepathyChatInfo &chatInfo)
                         "%3
"
                         "</body>"
                         "</html>"
-                       ).arg(m_chatStyle->getStyleBaseHref()).arg(headerHtml).arg(m_chatStyle->getFooterHtml());
+                       ).arg(m_chatStyle->getStyleBaseHref()).arg(headerHtml).arg(m_chatStyle->getFooterHtml()).arg(m_variantPath);
 
     setHtml(xhtmlBase);
 
diff --git a/lib/chatview.h b/lib/chatview.h
index 3be6afa..bfdcbaa 100644
--- a/lib/chatview.h
+++ b/lib/chatview.h
@@ -41,6 +41,7 @@ public slots:
 
 private:
     ChatWindowStyle* m_chatStyle;
+    QString m_variantPath;
     KEmoticons m_emoticons;
     QString replaceHeaderKeywords(QString htmlTemplate, const TelepathyChatInfo&);
 //replaceMessageKeywords(QString htmlTemplate, const TelepathyChatMessageInfo&);
diff --git a/lib/chatwindowstylemanager.cpp b/lib/chatwindowstylemanager.cpp
new file mode 100644
index 0000000..11961d4
--- /dev/null
+++ b/lib/chatwindowstylemanager.cpp
@@ -0,0 +1,428 @@
+ /*
+    kopetechatwindowstylemanager.cpp - Manager all chat window styles
+
+    Copyright (c) 2005      by Michaël Larouche     <larouche at kde.org>
+
+    Kopete    (c) 2002-2005 by the Kopete developers <kopete-devel at kde.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.                                   *
+    *                                                                       *
+    *************************************************************************
+*/
+
+#include "chatwindowstylemanager.h"
+
+// Qt includes
+#include <QStack>
+#include <QFileInfo>
+
+// KDE includes
+#include <kstandarddirs.h>
+#include <kdirlister.h>
+#include <kdebug.h>
+#include <kurl.h>
+#include <kglobal.h>
+#include <karchive.h>
+#include <kzip.h>
+#include <ktar.h>
+#include <kmimetype.h>
+#include <kio/netaccess.h>
+#include <ksharedconfig.h>
+#include <kconfiggroup.h>
+
+#include "chatwindowstyle.h"
+
+class ChatWindowStyleManager::Private
+{
+public:
+	Private()
+	 : styleDirLister(0)
+	{}
+
+	~Private()
+	{
+		if(styleDirLister)
+		{
+			styleDirLister->deleteLater();
+		}
+
+		qDeleteAll(stylePool);
+	}
+
+	KDirLister *styleDirLister;
+	QStringList availableStyles;
+
+	// key = style name, value = ChatWindowStyle instance
+	QHash<QString, ChatWindowStyle*> stylePool;
+
+	QStack<KUrl> styleDirs;
+};
+
+ChatWindowStyleManager *ChatWindowStyleManager::self()
+{
+	static ChatWindowStyleManager s;
+	return &s;
+}
+
+ChatWindowStyleManager::ChatWindowStyleManager(QObject *parent)
+	: QObject(parent), d(new Private())
+{
+	kDebug(14000) ;
+	loadStyles();
+}
+
+ChatWindowStyleManager::~ChatWindowStyleManager()
+{
+	kDebug(14000) ;
+	delete d;
+}
+
+void ChatWindowStyleManager::loadStyles()
+{
+	// Make sure there exists a directory where chat styles can be installed to and it will be watched for changes
+        KStandardDirs::locateLocal( "data", QLatin1String( "kopete/styles/" ) );
+
+        QStringList chatStyles = KGlobal::dirs()->findDirs( "data", QLatin1String( "kopete/styles" ) );
+	foreach(const QString &styleDir, chatStyles)
+	{
+		kDebug(14000) << styleDir;
+		d->styleDirs.push( KUrl(styleDir) );
+	}
+
+	d->styleDirLister = new KDirLister(this);
+	d->styleDirLister->setDirOnlyMode(true);
+
+	connect(d->styleDirLister, SIGNAL(newItems(const KFileItemList &)), this, SLOT(slotNewStyles(const KFileItemList &)));
+	connect(d->styleDirLister, SIGNAL(completed()), this, SLOT(slotDirectoryFinished()));
+
+	if( !d->styleDirs.isEmpty() )
+		d->styleDirLister->openUrl(d->styleDirs.pop(), KDirLister::Keep);
+}
+
+QStringList ChatWindowStyleManager::getAvailableStyles() const
+{
+	return d->availableStyles;
+}
+
+int ChatWindowStyleManager::installStyle(const QString &styleBundlePath)
+{
+	QString localStyleDir;
+	QStringList chatStyles = KGlobal::dirs()->findDirs( "appdata", QLatin1String( "styles" ) );
+	// findDirs returns preferred paths first, let's check if one of them is writable
+	foreach(const QString& styleDir, chatStyles)
+	{
+		if(QFileInfo(styleDir).isWritable())
+		{
+			localStyleDir = styleDir;
+			break;
+		}
+	}
+	if( localStyleDir.isEmpty() ) // none of dirs is writable
+	{
+		return StyleNoDirectoryValid;
+	}
+
+	KArchiveEntry *currentEntry = 0L;
+	KArchiveDirectory* currentDir = 0L;
+	KArchive *archive = 0L;
+
+	// Find mimetype for current bundle. ZIP and KTar need separate constructor
+	QString currentBundleMimeType = KMimeType::findByPath(styleBundlePath, 0, false)->name();
+	if(currentBundleMimeType == "application/zip")
+	{
+		archive = new KZip(styleBundlePath);
+	}
+	else if( currentBundleMimeType == "application/x-compressed-tar" || currentBundleMimeType == "application/x-bzip-compressed-tar" || currentBundleMimeType == "application/x-gzip" || currentBundleMimeType == "application/x-bzip" )
+	{
+		archive = new KTar(styleBundlePath);
+	}
+	else
+	{
+		return StyleCannotOpen;
+	}
+
+	if ( !archive->open(QIODevice::ReadOnly) )
+	{
+		delete archive;
+
+		return StyleCannotOpen;
+	}
+
+	const KArchiveDirectory* rootDir = archive->directory();
+
+	// Ok where we go to check if the archive is valid.
+	// Each time we found a correspondance to a theme bundle, we add a point to validResult.
+	// A valid style bundle must have:
+	// -a Contents, Contents/Resources, Co/Res/Incoming, Co/Res/Outgoing dirs
+	// main.css, Footer.html, Header.html, Status.html files in Contents/Resources.
+	// So for a style bundle to be valid, it must have a result greather than 8, because we test for 8 required entry.
+	int validResult = 0;
+	const QStringList entries = rootDir->entries();
+	// Will be reused later.
+	QStringList::ConstIterator entriesIt, entriesItEnd = entries.end();
+	for(entriesIt = entries.begin(); entriesIt != entries.end(); ++entriesIt)
+	{
+		currentEntry = const_cast<KArchiveEntry*>(rootDir->entry(*entriesIt));
+// 		kDebug() << "Current entry name: " << currentEntry->name();
+		if (currentEntry->isDirectory())
+		{
+			currentDir = dynamic_cast<KArchiveDirectory*>( currentEntry );
+			if (currentDir)
+			{
+				if( currentDir->entry(QString::fromUtf8("Contents")) )
+				{
+// 					kDebug() << "Contents found";
+					validResult += 1;
+				}
+				if( currentDir->entry(QString::fromUtf8("Contents/Resources")) )
+				{
+// 					kDebug() << "Contents/Resources found";
+					validResult += 1;
+				}
+				if( currentDir->entry(QString::fromUtf8("Contents/Resources/Incoming")) )
+				{
+// 					kDebug() << "Contents/Resources/Incoming found";
+					validResult += 1;
+				}
+				if( currentDir->entry(QString::fromUtf8("Contents/Resources/Outgoing")) )
+				{
+// 					kDebug() << "Contents/Resources/Outgoing found";
+					validResult += 1;
+				}
+				if( currentDir->entry(QString::fromUtf8("Contents/Resources/main.css")) )
+				{
+// 					kDebug() << "Contents/Resources/main.css found";
+					validResult += 1;
+				}
+				if( currentDir->entry(QString::fromUtf8("Contents/Resources/Footer.html")) )
+				{
+// 					kDebug() << "Contents/Resources/Footer.html found";
+					validResult += 1;
+				}
+				if( currentDir->entry(QString::fromUtf8("Contents/Resources/Status.html")) )
+				{
+// 					kDebug() << "Contents/Resources/Status.html found";
+					validResult += 1;
+				}
+				if( currentDir->entry(QString::fromUtf8("Contents/Resources/Header.html")) )
+				{
+// 					kDebug() << "Contents/Resources/Header.html found";
+					validResult += 1;
+				}
+				if( currentDir->entry(QString::fromUtf8("Contents/Resources/Incoming/Content.html")) )
+				{
+// 					kDebug() << "Contents/Resources/Incoming/Content.html found";
+					validResult += 1;
+				}
+				if( currentDir->entry(QString::fromUtf8("Contents/Resources/Outgoing/Content.html")) )
+				{
+// 					kDebug() << "Contents/Resources/Outgoing/Content.html found";
+					validResult += 1;
+				}
+			}
+		}
+	}
+// 	kDebug() << "Valid result: " << QString::number(validResult);
+	// The archive is a valid style bundle.
+	if(validResult >= 8)
+	{
+		bool installOk = false;
+		for(entriesIt = entries.begin(); entriesIt != entries.end(); ++entriesIt)
+		{
+			currentEntry = const_cast<KArchiveEntry*>(rootDir->entry(*entriesIt));
+			if(currentEntry && currentEntry->isDirectory())
+			{
+				// Ignore this MacOS X "garbage" directory in zip.
+				if(currentEntry->name() == QString::fromUtf8("__MACOSX"))
+				{
+					continue;
+				}
+				else
+				{
+					currentDir = dynamic_cast<KArchiveDirectory*>(currentEntry);
+					if(currentDir)
+					{
+						currentDir->copyTo(localStyleDir + currentDir->name());
+						installOk = true;
+					}
+				}
+			}
+		}
+
+		archive->close();
+		delete archive;
+
+		if(installOk)
+			return StyleInstallOk;
+		else
+			return StyleUnknow;
+	}
+	else
+	{
+		archive->close();
+		delete archive;
+
+		return StyleNotValid;
+	}
+
+	if(archive)
+	{
+		archive->close();
+		delete archive;
+	}
+
+	return StyleUnknow;
+}
+
+bool ChatWindowStyleManager::removeStyle(const QString &styleName)
+{
+	kDebug(14000) << styleName;
+	// Find for the current style in avaiableStyles map.
+	int foundStyleIdx = d->availableStyles.indexOf(styleName);
+
+	if(foundStyleIdx != -1)
+	{
+		d->availableStyles.removeAt(foundStyleIdx);
+
+		// Remove and delete style from pool if needed.
+		if( d->stylePool.contains(styleName) )
+		{
+			ChatWindowStyle *deletedStyle = d->stylePool[styleName];
+			d->stylePool.remove(styleName);
+			delete deletedStyle;
+		}
+
+		QStringList styleDirs = KGlobal::dirs()->findDirs("appdata", QString("styles/%1").arg(styleName));
+		if(styleDirs.isEmpty())
+		{
+			kDebug(14000) << "Failed to find style" << styleName;
+			return false;
+		}
+
+		// attempt to delete all dirs with this style
+		int numDeleted = 0;
+		foreach( const QString& stylePath, styleDirs )
+		{
+			KUrl urlStyle(stylePath);
+			// Do the actual deletion of the directory style.
+			if(KIO::NetAccess::del( urlStyle, 0 ))
+				numDeleted++;
+		}
+		return numDeleted == styleDirs.count();
+	}
+	else
+	{
+		return false;
+	}
+}
+
+ChatWindowStyle *ChatWindowStyleManager::getValidStyleFromPool(const QString &styleName)
+{
+	ChatWindowStyle *style = 0;
+	style = getStyleFromPool( styleName );
+	if ( style )
+		return style;
+
+	kDebug(14000) << "Trying default style";
+	// Try default style
+	style = getStyleFromPool( "Kopete" );
+	if ( style )
+		return style;
+
+	kDebug(14000) << "Trying first valid style";
+	// Try first valid style
+	foreach ( const QString& name, d->availableStyles )
+	{
+		style = getStyleFromPool( name );
+		if ( style )
+			return style;
+	}
+
+	kDebug(14000) << "Valid style not found!";
+	return 0;
+}
+
+ChatWindowStyle *ChatWindowStyleManager::getStyleFromPool(const QString &styleName)
+{
+	if( d->stylePool.contains(styleName) )
+	{
+		kDebug(14000) << styleName << " was on the pool";
+
+		// NOTE: This is a hidden config switch for style developers
+		// Check in the config if the cache is disabled.
+		// if the cache is disabled, reload the style every time it's getted.
+		KConfigGroup config(KGlobal::config(), "KopeteStyleDebug");
+		bool disableCache = config.readEntry("disableStyleCache", false);
+		if(disableCache)
+		{
+			d->stylePool[styleName]->reload();
+		}
+
+		return d->stylePool[styleName];
+	}
+
+	// Build a chat window style and list its variants, then add it to the pool.
+	ChatWindowStyle *style = new ChatWindowStyle(styleName, ChatWindowStyle::StyleBuildNormal);
+	if ( !style->isValid() )
+	{
+		kDebug(14000) << styleName << " is invalid style!";
+		delete style;
+		return 0;
+	}
+
+	d->stylePool.insert(styleName, style);
+	kDebug(14000) << styleName << " is just created";
+
+	return style;
+}
+
+void ChatWindowStyleManager::slotNewStyles(const KFileItemList &dirList)
+{
+	foreach(const KFileItem &item, dirList)
+	{
+		// Ignore data dir(from deprecated XSLT themes)
+		if( !item.url().fileName().contains(QString::fromUtf8("data")) )
+		{
+			kDebug(14000) << "Listing: " << item.url().fileName();
+			// If the style path is already in the pool, that's mean the style was updated on disk
+			// Reload the style
+			QString styleName = item.url().fileName();
+			if( d->stylePool.contains(styleName) )
+			{
+				kDebug(14000) << "Updating style: " << styleName;
+
+				d->stylePool[styleName]->reload();
+
+				// Add to avaialble if required.
+				if( d->availableStyles.indexOf(styleName) == -1 )
+					d->availableStyles.append(styleName);
+			}
+			else
+			{
+				// TODO: Use name from Info.plist
+				d->availableStyles.append(styleName);
+			}
+		}
+	}
+}
+
+void ChatWindowStyleManager::slotDirectoryFinished()
+{
+	// Start another scanning if the directories stack is not empty
+	if( !d->styleDirs.isEmpty() )
+	{
+		kDebug(14000) << "Starting another directory.";
+		d->styleDirLister->openUrl(d->styleDirs.pop(), KDirLister::Keep);
+	}
+	else
+	{
+		emit loadStylesFinished();
+	}
+}
+
+#include "chatwindowstylemanager.moc"
diff --git a/lib/chatwindowstylemanager.h b/lib/chatwindowstylemanager.h
new file mode 100644
index 0000000..f99cd03
--- /dev/null
+++ b/lib/chatwindowstylemanager.h
@@ -0,0 +1,153 @@
+ /*
+    kopetechatwindowstylemanager.h - Manager all chat window styles
+
+    Copyright (c) 2005      by Michaël Larouche     <larouche at kde.org>
+
+    Kopete    (c) 2002-2005 by the Kopete developers <kopete-devel at kde.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.                                   *
+    *                                                                       *
+    *************************************************************************
+*/
+
+#ifndef KOPETECHATWINDOWSTYLEMANAGER_H
+#define KOPETECHATWINDOWSTYLEMANAGER_H
+
+#include <QObject>
+#include <QHash>
+
+#include <kfileitem.h>
+
+
+class ChatWindowStyle;
+/**
+ * Sigleton class that handle Chat Window styles.
+ * It use style absolute path to avoid unexpected behavior that could happen when using style name.
+ *
+ * It can install, delete styles. The styles are managed in a pool, they are only retrieved on demand.
+ *
+ * Use getStyleFromPool to retrieve a ChatWindowStyle instance. Do not delete the returned instance, it
+ * is handled by this class.
+ *
+ * When called the first time, it list all the available styles in $KDEDATADIR/kopete/styles and
+ * KDirWatch (via KDirLister) watch for new styles.
+ *
+ * If you want to keep a trace of avaiable styles, connect to loadStylesFinished() signal.
+ * It is called when KDirLister finish a job(ex: on new directory).
+ *
+ * @author Michaël Larouche <larouche at kde.org>
+ */
+class ChatWindowStyleManager : public QObject
+{
+	Q_OBJECT
+public:
+	/**
+	 * The StyleInstallStatus enum. It gives better return value for installStyle().
+	 * - StyleInstallOk : The install went fine.
+	 * - StyleNotValid : The archive didn't contain a valid Chat Window style.
+	 * - StyleNoDirectoryValid : It didn't find a suitable directory to install the theme.
+	 * - StyleCannotOpen : The archive couldn't be openned.
+	 * - StyleUnknow : Unknow error.
+	 */
+	enum StyleInstallStatus { StyleInstallOk = 0, StyleNotValid, StyleNoDirectoryValid, StyleCannotOpen, StyleUnknow };
+
+	/**
+	 * Destructor.
+	 */
+	~ChatWindowStyleManager();
+
+	/**
+	 * Singleton access to this class.
+	 * @return the single instance of this class.
+	 */
+	static ChatWindowStyleManager *self();
+
+	/**
+	 * List all availables styles.
+	 * Init KDirLister and thus KDirWatch that watch for new styles.
+	 */
+	void loadStyles();
+
+	/**
+	 * Get all available styles.
+	 */
+	QStringList getAvailableStyles() const;
+
+public slots:
+	/**
+	 * Install a new style into user style directory
+	 * Note that you must pass a path to a archive.
+	 *
+	 * @param styleBundlePath Path to the container file to install.
+	 * @return A status code from StyleInstallStatus enum.
+	 */
+	int installStyle(const QString &styleBundlePath);
+
+	/**
+	 * Remove a style from user style directory
+	 *
+	 * @param styleName the name of the style to remove.
+	 * @return true if the deletion went without problems.
+	 */
+	bool removeStyle(const QString &styleName);
+
+	/**
+	 * Get a instance of a ChatWindowStyle from the pool.
+	 * If they are no instance for the specified style, it gets created.
+	 * DO NOT DELETE the resulting pointer, it is handled by this class.
+	 *
+	 * @param styleName name for the specified style. If style with this name
+	 *        exists in both global and user directories, the user one will be returned
+	 * @return the instance of ChatWindow for the specified style or 0 if valid style
+	 *         wasn't found. DO NOT DELETE IT.
+	 */
+	ChatWindowStyle *getStyleFromPool(const QString &styleName);
+
+	/**
+	 * Get a instance of a ChatWindowStyle from the pool.
+	 * If they are no instance for the specified style, it gets created.
+	 * If the style doesn't exists or is invalid default style is returned or 0.
+	 * DO NOT DELETE the resulting pointer, it is handled by this class.
+	 *
+	 * @param styleName name for the specified style. If style with this name
+	 *        exists in both global and user directories, the user one will be returned
+	 * @return the instance of ChatWindow for the specified style or 0 if valid style
+	 *         wasn't found. DO NOT DELETE IT.
+	 */
+	ChatWindowStyle *getValidStyleFromPool(const QString &styleName);
+
+signals:
+	/**
+	 * This signal is emitted when all styles finished to list.
+	 * Used to inform and/or update GUI.
+	 */
+	void loadStylesFinished();
+
+private slots:
+	/**
+	 * KDirLister found new files.
+	 * @param dirList new files found.
+	 */
+	void slotNewStyles(const KFileItemList &dirList);
+	/**
+	 * KDirLister finished a job.
+	 * Emit loadStylesFinished() if they are no directory left in the stack.
+	 */
+	void slotDirectoryFinished();
+
+private:
+	/**
+	 * Private constructor(it's a singleton class)
+	 * Call loadStyles() to list all avaiable styles.
+	 */
+	ChatWindowStyleManager(QObject *parent = 0);
+	class Private;
+	Private * const d;
+};
+
+#endif

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list