[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9
Maximiliano Curia
maxy at moszumanska.debian.org
Mon May 9 09:06:10 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=bf06a93
The following commit has been merged in the master branch:
commit bf06a93f68a6f4bd908025317861c8c9070c296e
Author: Dan Vrátil <dvratil at redhat.com>
Date: Tue Jan 8 11:15:14 2013 +0100
Add CMakeLists and qmlplugin to register all classes to QML type system
---
KTp/CMakeLists.txt | 1 +
KTp/Declarative/CMakeLists.txt | 32 ++++++++++++++
KTp/Declarative/qml-plugins.cpp | 50 ++++++++++++++++++++++
.../{hide-window-component.cpp => qml-plugins.h} | 21 ++++-----
KTp/Declarative/qmldir | 1 +
5 files changed, 95 insertions(+), 10 deletions(-)
diff --git a/KTp/CMakeLists.txt b/KTp/CMakeLists.txt
index 41d09a6..12d0654 100644
--- a/KTp/CMakeLists.txt
+++ b/KTp/CMakeLists.txt
@@ -72,5 +72,6 @@ install (FILES ${ktp_common_internals_private_HDRS}
DESTINATION ${INCLUDE_INSTALL_DIR}/KTp
)
+add_subdirectory(Declarative)
add_subdirectory(Models)
add_subdirectory(Widgets)
diff --git a/KTp/Declarative/CMakeLists.txt b/KTp/Declarative/CMakeLists.txt
new file mode 100644
index 0000000..17fea5a
--- /dev/null
+++ b/KTp/Declarative/CMakeLists.txt
@@ -0,0 +1,32 @@
+
+include_directories (${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+set (ktp_qml_plugin_SRCS
+ contact-list.cpp
+ conversation-queue-manager.cpp
+ conversation-target.cpp
+ conversation.cpp
+ conversations-model.cpp
+ hide-window-component.cpp
+ messages-model.cpp
+ telepathy-text-observer.cpp
+
+ qml-plugins.cpp
+)
+
+kde4_add_library (ktpqmlplugin SHARED ${ktp_qml_plugin_SRCS})
+
+target_link_libraries (ktpqmlplugin
+ ${QT_QTSCRIPT_LIBRARY}
+ ${QT_QTDECLARATIVE_LIBRARY}
+ ${KDE4_KDECORE_LIBS}
+ ${TELEPATHY_QT4_LIBRARIES}
+ ${KDE4_KDEUI_LIBS}
+ ktpcommoninternalsprivate
+ ktpmodelsprivate
+)
+
+install (TARGETS ktpqmlplugin DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/telepathy)
+install (FILES qmldir DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/telepathy)
diff --git a/KTp/Declarative/qml-plugins.cpp b/KTp/Declarative/qml-plugins.cpp
new file mode 100644
index 0000000..d1dfbea
--- /dev/null
+++ b/KTp/Declarative/qml-plugins.cpp
@@ -0,0 +1,50 @@
+/*
+ Copyright (C) 2013 Dan Vrátil <dvratil at redhat.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+
+#include "qml-plugins.h"
+
+#include <QtDeclarative/QDeclarativeItem>
+
+#include "contact-list.h"
+#include "conversation.h"
+#include "conversations-model.h"
+#include "conversation-target.h"
+#include "hide-window-component.h"
+#include "messages-model.h"
+#include "telepathy-text-observer.h"
+
+#include "Models/accounts-filter-model.h"
+
+void QmlPlugins::registerTypes(const char *uri)
+{
+ qmlRegisterType<ContactList> (uri, 0, 1, "ContactList");
+ qmlRegisterUncreatableType<AccountsFilterModel> (uri, 0, 1, "AccountsFilterModel",
+ QLatin1String("Filter cannot be created. Access through ContactList.filter"));
+
+ qmlRegisterType<TelepathyTextObserver> (uri, 0, 1, "TelepathyTextObserver");
+ qmlRegisterType<Conversation>(uri, 0, 1, "Conversation");
+ qmlRegisterType<HideWindowComponent>(uri, 0, 1, "HideWindowComponent");
+
+ //needed for MessageType enum
+ qmlRegisterUncreatableType<MessagesModel>(uri, 0, 1, "MessagesModel",
+ QLatin1String("MessagesModel can not be instanitized directly. Use a TelepathyTextObserver instead"));
+}
+
+Q_EXPORT_PLUGIN2(conversation, QmlPlugins);
+
diff --git a/KTp/Declarative/hide-window-component.cpp b/KTp/Declarative/qml-plugins.h
similarity index 67%
copy from KTp/Declarative/hide-window-component.cpp
copy to KTp/Declarative/qml-plugins.h
index 2cf2796..5efc4fd 100644
--- a/KTp/Declarative/hide-window-component.cpp
+++ b/KTp/Declarative/qml-plugins.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012 Aleix Pol Gonzalez <aleixpol at blue-systems.com>
+ Copyright (C) 2013 Dan Vrátil <dvratil at redhat.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -16,15 +16,16 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "hidewindowcomponent.h"
-#include <kwindowsystem.h>
-#include <QDebug>
-HideWindowComponent::HideWindowComponent(QObject* parent)
- : QObject(parent)
-{}
+#ifndef QML_PLUGINS_H
+#define QML_PLUGINS_H
-void HideWindowComponent::hideWindowFromTaskbar(qulonglong winId)
+#include <QtDeclarative/QDeclarativeExtensionPlugin>
+
+class QmlPlugins : public QDeclarativeExtensionPlugin
{
- KWindowSystem::setState(winId, NET::SkipTaskbar | NET::SkipPager);
-}
+ public:
+ virtual void registerTypes(const char *uri);
+};
+
+#endif // QML_PLUGINS_H
diff --git a/KTp/Declarative/qmldir b/KTp/Declarative/qmldir
new file mode 100644
index 0000000..f24d4d6
--- /dev/null
+++ b/KTp/Declarative/qmldir
@@ -0,0 +1 @@
+plugin ktpqmlplugin
\ No newline at end of file
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list