Git commit cbea7cbc7c7104c6ef270ba71597ef4fb06d7a10 by David Edmundson. Committed on 25/02/2013 at 03:05. Pushed by davidedmundson into branch 'master'. Add a test to display the model from pinned-contacts-model from KTp declara= tive Required includes in many other files to be fixed REVIEW: 109132 M +1 -1 KTp/Declarative/contact-pin.h M +1 -1 KTp/Declarative/conversation-target.h M +1 -1 KTp/Declarative/messages-model.cpp M +1 -1 KTp/Declarative/pinned-contacts-model.h M +1 -1 KTp/Declarative/telepathy-text-observer.h M +29 -6 tests/CMakeLists.txt A +68 -0 tests/pinned-contacts-model-view-main.cpp [License: LGPL= (v2.1+)] http://commits.kde.org/telepathy-common-internals/cbea7cbc7c7104c6ef270ba71= 597ef4fb06d7a10 diff --git a/KTp/Declarative/contact-pin.h b/KTp/Declarative/contact-pin.h index ec740b6..96e4e36 100644 --- a/KTp/Declarative/contact-pin.h +++ b/KTp/Declarative/contact-pin.h @@ -20,7 +20,7 @@ #define CONTACTPIN_H = #include -#include "types.h" +#include "KTp/types.h" = class PinnedContactsModel; = diff --git a/KTp/Declarative/conversation-target.h b/KTp/Declarative/conver= sation-target.h index 1e7f159..e620cdc 100644 --- a/KTp/Declarative/conversation-target.h +++ b/KTp/Declarative/conversation-target.h @@ -23,7 +23,7 @@ #include #include = -#include "types.h" +#include "KTp/types.h" = class ConversationTarget : public QObject { diff --git a/KTp/Declarative/messages-model.cpp b/KTp/Declarative/messages-= model.cpp index 1c56e3d..dc975d0 100644 --- a/KTp/Declarative/messages-model.cpp +++ b/KTp/Declarative/messages-model.cpp @@ -27,7 +27,7 @@ #include = = -#include "message-processor.h" +#include "KTp/message-processor.h" = class MessageItem { diff --git a/KTp/Declarative/pinned-contacts-model.h b/KTp/Declarative/pinn= ed-contacts-model.h index 7f01961..2b7658c 100644 --- a/KTp/Declarative/pinned-contacts-model.h +++ b/KTp/Declarative/pinned-contacts-model.h @@ -21,7 +21,7 @@ = #include #include -#include "types.h" +#include "KTp/types.h" = struct Pin; class ConversationsModel; diff --git a/KTp/Declarative/telepathy-text-observer.h b/KTp/Declarative/te= lepathy-text-observer.h index d60b5a3..3fa20f8 100644 --- a/KTp/Declarative/telepathy-text-observer.h +++ b/KTp/Declarative/telepathy-text-observer.h @@ -21,7 +21,7 @@ #define TELEPATHY_TEXT_OBSERVER_H = #include "conversations-model.h" -#include "types.h" +#include "KTp/types.h" = #include = diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4694b75..358c4e1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -6,18 +6,18 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ) = - - -set(ktp_contact_list_model_view_SRCS - contact-list-model-view-main.cpp +set(model_view_SRCS model-view.cpp roles-proxy-model.cpp ) = -kde4_add_ui_files(ktp_contact_list_model_view_SRCS model-view.ui) +kde4_add_ui_files(model_view_SRCS model-view.ui) + +### = kde4_add_executable(ktp_contact_list_model_view - ${ktp_contact_list_model_view_SRCS} + ${model_view_SRCS} + contact-list-model-view-main.cpp ) = target_link_libraries(ktp_contact_list_model_view @@ -29,3 +29,26 @@ target_link_libraries(ktp_contact_list_model_view ktpmodelsprivate ) = +### + +kde4_add_executable(ktp_pinned-contact_list_model_view + ${model_view_SRCS} + pinned-contacts-model-view-main.cpp + ../KTp/Declarative/pinned-contacts-model.cpp + ../KTp/Declarative/telepathy-text-observer.cpp + ../KTp/Declarative/conversations-model.cpp + ../KTp/Declarative/conversation-target.cpp + ../KTp/Declarative/contact-pin.cpp + ../KTp/Declarative/messages-model.cpp + ../KTp/Declarative/conversation-queue-manager.cpp + ../KTp/Declarative/conversation.cpp +) + +target_link_libraries(ktp_pinned-contact_list_model_view + ${QT_QTTEST_LIBRARY} + ${KDE4_KDECORE_LIBS} + ${KDE4_KDEUI_LIBS} + ${TELEPATHY_QT4_LIBRARIES} + ktpcommoninternalsprivate + ktpmodelsprivate +) \ No newline at end of file diff --git a/tests/pinned-contacts-model-view-main.cpp b/tests/pinned-conta= cts-model-view-main.cpp new file mode 100644 index 0000000..e94de01 --- /dev/null +++ b/tests/pinned-contacts-model-view-main.cpp @@ -0,0 +1,68 @@ +/* + * This file is part of telepathy-kde-models-test-ui + * + * Copyright (C) 2011 Collabora Ltd. + * @Author George Goldberg + * + * 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 St, Fifth Floor, Boston, MA 02110-1301 = USA + */ + +#include "model-view.h" + +#include +#include +#include +#include + +#include +#include + +#include "KTp/Declarative/telepathy-text-observer.h" +#include "KTp/Declarative/conversations-model.h" +#include "KTp/Declarative/pinned-contacts-model.h" + +int main(int argc, char *argv[]) +{ + KAboutData aboutData("telepathy-kde-models-test-ui", + 0, + ki18n("Telepathy KDE Models Test UI"), + "0.1", + ki18n("Telepathy KDE Models Test UI"), + KAboutData::License_LGPL, + ki18n("(C) 2011 Collabora Ltd")); + + KCmdLineArgs::init(argc, argv, &aboutData); + + KApplication app; + + Tp::registerTypes(); + Tp::enableDebug(false); + Tp::enableWarnings(true); + + = + PinnedContactsModel *model =3D new PinnedContactsModel(&app); + = + TelepathyTextObserver *observer =3D new TelepathyTextObserver(&app); + model->setAccountManager(observer->accountManager()); + model->setConversationsModel(observer->conversationModel()); + = + // Set up and show the main widget + ModelView *mainWidget =3D new ModelView(model, 0); + mainWidget->show(); + + // Start event loop. + app.exec(); +} +