From 3b92b0de1d57f409c14132960d06c9abecf13eda Mon Sep 17 00:00:00 2001 From: Simon Redman Date: Thu, 24 Jan 2019 10:39:45 -0700 Subject: [PATCH] Add dependency on kirigami to SMS app Summary: Resolves Bug 401255 Bonus: Disable some very noisy debugging from the SMS app Test Plan: - Build KDE Connect with or without Kirigami - Verify successful build with no complaints about Kirigami - Build KDE Connect's Messenger: - Without Kirigami: Verify that CMake warns that Kirigami is not found - With Kirigami: Verify that app launches successfully Reviewers: #kde_connect, nicolasfella Reviewed By: #kde_connect, nicolasfella Subscribers: apol, kdeconnect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D17572 --- CMakeLists.txt | 14 ++++++++------ smsapp/conversationlistmodel.cpp | 4 ++-- smsapp/qml/ConversationDisplay.qml | 3 +-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4379d1840..c92584265 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,13 @@ set_package_properties(Phonon4Qt5 PROPERTIES PURPOSE "Required for Find My Device plugin" ) +set_package_properties(KF5Kirigami2 PROPERTIES + DESCRIPTION "QtQuick plugins to build user interfaces based on KDE UX guidelines" + PURPOSE "Required for KDE Connect's QML-based GUI applications" + URL "https://www.kde.org/products/kirigami/" + TYPE RUNTIME +) + include_directories(${CMAKE_SOURCE_DIR}) configure_file(kdeconnect-version.h.in ${CMAKE_CURRENT_BINARY_DIR}/kdeconnect-version.h) @@ -86,12 +93,6 @@ add_subdirectory(data) option(EXPERIMENTALAPP_ENABLED OFF) if(EXPERIMENTALAPP_ENABLED) find_package(KF5Kirigami2) - set_package_properties(KF5Kirigami2 PROPERTIES - DESCRIPTION "QtQuick plugins to build user interfaces based on KDE UX guidelines" - PURPOSE "Required for kcapp" - URL "https://www.kde.org/products/kirigami/" - TYPE RUNTIME -) add_subdirectory(app) endif() add_subdirectory(plugins) @@ -108,6 +109,7 @@ endif() option(SMSAPP_ENABLED OFF) if(SMSAPP_ENABLED) + find_package(KF5Kirigami2) find_package(KF5People REQUIRED) find_package(KF5PeopleVCard) set_package_properties(KF5PeopleVCard PROPERTIES diff --git a/smsapp/conversationlistmodel.cpp b/smsapp/conversationlistmodel.cpp index cc8c0e93a..ade64d485 100644 --- a/smsapp/conversationlistmodel.cpp +++ b/smsapp/conversationlistmodel.cpp @@ -31,7 +31,7 @@ ConversationListModel::ConversationListModel(QObject* parent) : QStandardItemModel(parent) , m_conversationsInterface(nullptr) { - qCDebug(KDECONNECT_SMS_CONVERSATIONS_LIST_MODEL) << "Constructing" << this; + //qCDebug(KDECONNECT_SMS_CONVERSATIONS_LIST_MODEL) << "Constructing" << this; auto roles = roleNames(); roles.insert(FromMeRole, "fromMe"); roles.insert(AddressRole, "address"); @@ -191,7 +191,7 @@ KPeople::PersonData* ConversationListModel::lookupPersonByAddress(const QString& bool matchingPhoneNumber = longerNumber.endsWith(shorterNumber) && shorterNumber.length() * 2 >= longerNumber.length(); if (address == email || matchingPhoneNumber) { - qCDebug(KDECONNECT_SMS_CONVERSATIONS_LIST_MODEL) << "Matched" << address << "to" << person->name(); + //qCDebug(KDECONNECT_SMS_CONVERSATIONS_LIST_MODEL) << "Matched" << address << "to" << person->name(); return person; } diff --git a/smsapp/qml/ConversationDisplay.qml b/smsapp/qml/ConversationDisplay.qml index cc6b056b3..3b0ec9d8b 100644 --- a/smsapp/qml/ConversationDisplay.qml +++ b/smsapp/qml/ConversationDisplay.qml @@ -21,7 +21,7 @@ */ import QtQuick 2.1 -import QtQuick.Controls 2.4 +import QtQuick.Controls 2.2 import QtQuick.Layouts 1.1 import org.kde.people 1.0 import org.kde.kirigami 2.4 as Kirigami @@ -56,7 +56,6 @@ Kirigami.ScrollablePage } function sendMessage() { - console.log("sending sms", page.phoneNumber) model.sourceModel.sendReplyToConversation(message.text) message.text = "" }