summaryrefslogtreecommitdiff
path: root/src/intent-client-lib
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@qt.io>2019-10-13 16:56:51 +0200
committerRobert Griebl <robert.griebl@qt.io>2019-10-28 14:11:42 +0100
commit495cc72c005cbb7796e557b0995f130c1d128a7b (patch)
tree9266c35d1b5851cd4b88b1856f425df0f1ca7d34 /src/intent-client-lib
parent0a1cccfccd8f76014bc697c5c9006c5ebb9723e8 (diff)
downloadqtapplicationmanager-495cc72c005cbb7796e557b0995f130c1d128a7b.tar.gz
Change intent implementation to better fit new architecture
- IntentServer is now a list model as all the other singletons. - IntentModel is the companion filter model for the IntentServer, just like the ApplicationModel is for the ApplicationManager - Intent is now a Q_OBJECT instead of a Q_GADGET Change-Id: Ifead097c543fb00b08ab21210e4526a6f65ba167 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
Diffstat (limited to 'src/intent-client-lib')
-rw-r--r--src/intent-client-lib/intentclient.cpp3
-rw-r--r--src/intent-client-lib/intentclientrequest.cpp15
-rw-r--r--src/intent-client-lib/intenthandler.cpp3
3 files changed, 11 insertions, 10 deletions
diff --git a/src/intent-client-lib/intentclient.cpp b/src/intent-client-lib/intentclient.cpp
index e88c7005..89f4b949 100644
--- a/src/intent-client-lib/intentclient.cpp
+++ b/src/intent-client-lib/intentclient.cpp
@@ -1,5 +1,6 @@
/****************************************************************************
**
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2019 Luxoft Sweden AB
** Copyright (C) 2018 Pelagicore AG
** Contact: https://www.qt.io/licensing/
@@ -253,7 +254,7 @@ void IntentClient::replyFromSystem(const QUuid &requestId, bool error, const QVa
if (it == m_waiting.cend()) {
qCWarning(LogIntents) << "IntentClient received an unexpected intent reply for request"
- << requestId << " succeeded:" << error << "error:"
+ << requestId << " succeeded:" << !error << "error:"
<< result.value(qL1S("errorMessage")).toString() << "result:" << result;
return;
}
diff --git a/src/intent-client-lib/intentclientrequest.cpp b/src/intent-client-lib/intentclientrequest.cpp
index 9c420e8c..c6cba1cb 100644
--- a/src/intent-client-lib/intentclientrequest.cpp
+++ b/src/intent-client-lib/intentclientrequest.cpp
@@ -1,5 +1,6 @@
/****************************************************************************
**
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2019 Luxoft Sweden AB
** Copyright (C) 2018 Pelagicore AG
** Contact: https://www.qt.io/licensing/
@@ -333,20 +334,18 @@ void IntentClientRequest::setRequestId(const QUuid &requestId)
void IntentClientRequest::setResult(const QVariantMap &result)
{
- if (m_result != result) {
+ if (m_result != result)
m_result = result;
- m_succeeded = true;
- doFinish();
- }
+ m_succeeded = true;
+ doFinish();
}
void IntentClientRequest::setErrorMessage(const QString &errorMessage)
{
- if (m_errorMessage != errorMessage) {
+ if (m_errorMessage != errorMessage)
m_errorMessage = errorMessage;
- m_succeeded = false;
- doFinish();
- }
+ m_succeeded = false;
+ doFinish();
}
void IntentClientRequest::doFinish()
diff --git a/src/intent-client-lib/intenthandler.cpp b/src/intent-client-lib/intenthandler.cpp
index 06b5fd15..a94b9902 100644
--- a/src/intent-client-lib/intenthandler.cpp
+++ b/src/intent-client-lib/intenthandler.cpp
@@ -1,5 +1,6 @@
/****************************************************************************
**
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2019 Luxoft Sweden AB
** Copyright (C) 2018 Pelagicore AG
** Contact: https://www.qt.io/licensing/
@@ -95,7 +96,7 @@ QT_BEGIN_NAMESPACE_AM
registered for via its intentIds property.
Handling the request can be done synchronously or asynchronously. As soon as your handler has
either produced a result or detected an error condition, it should call either
- IntentClientRequest::sendReply() or IntentClientRequest::sendErrorReply respectively to send a
+ IntentRequest::sendReply() or IntentRequest::sendErrorReply respectively to send a
reply back to the requesting party.
Only the first call to one of these functions will have any effect. Any further invocations
will be ignored.