Navigation Menu

Skip to content

Commit

Permalink
[connectionagent] send serviceName in requestBrowser signal. JB#51549
Browse files Browse the repository at this point in the history
  • Loading branch information
NotKit committed Nov 13, 2020
1 parent 9bc2a72 commit f6f2913
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions connd/com.jollamobile.Connectiond.xml
Expand Up @@ -14,6 +14,7 @@
</signal>
<signal name="requestBrowser">
<arg name="url" type="s" direction="out"/>
<arg name="serviceName" type="s" direction="out"/>
</signal>
<signal name="userInputCanceled">
</signal>
Expand Down
18 changes: 13 additions & 5 deletions connd/qconnectionagent.cpp
Expand Up @@ -135,6 +135,18 @@ void QConnectionAgent::onConnectionRequest()
}
}

void QConnectionAgent::onBrowserRequested(const QString &servicePath, const QString &url)
{
QString serviceName;
for (const Service &elem : orderedServicesList) {
if (elem.service->path() == servicePath) {
serviceName = elem.service->name();
break;
}
}
Q_EMIT requestBrowser(url, serviceName);
}

void QConnectionAgent::sendConnectReply(const QString &in0, int in1)
{
ua->sendConnectReply(in0, in1);
Expand Down Expand Up @@ -401,11 +413,7 @@ void QConnectionAgent::setup()
connect(ua, &UserAgent::errorReported, this, &QConnectionAgent::onErrorReported);
connect(ua, &UserAgent::userInputCanceled, this, &QConnectionAgent::userInputCanceled);
connect(ua, &UserAgent::userInputRequested, this, &QConnectionAgent::userInputRequested);
connect(ua, &UserAgent::browserRequested,
this, [=](const QString &servicePath, const QString &url) {
Q_UNUSED(servicePath);
Q_EMIT requestBrowser(url);
});
connect(ua, &UserAgent::browserRequested, this, &QConnectionAgent::onBrowserRequested);

updateServices();
offlineModeChanged(netman->offlineMode());
Expand Down
3 changes: 2 additions & 1 deletion connd/qconnectionagent.h
Expand Up @@ -46,13 +46,14 @@ class QConnectionAgent : public QObject
void connectionState(const QString &state, const QString &type);
void connectNow(const QString &path);

void requestBrowser(const QString &url);
void requestBrowser(const QString &url, const QString &serviceName);
void tetheringFinished(bool);

public Q_SLOTS:
void onErrorReported(const QString &servicePath, const QString &error);

void onConnectionRequest();
void onBrowserRequested(const QString &url, const QString &serviceName);

void sendConnectReply(const QString &in0, int in1);
void sendUserReply(const QVariantMap &input);
Expand Down
2 changes: 1 addition & 1 deletion connectionagentplugin/declarativeconnectionagent.h
Expand Up @@ -79,7 +79,7 @@ public slots:
void connectionRequest();
void configurationNeeded(const QString &type);
void connectionState(const QString &state, const QString &type);
void browserRequested(const QString &url);
void browserRequested(const QString &url, const QString &serviceName);
void tetheringFinished(bool);

private:
Expand Down

0 comments on commit f6f2913

Please sign in to comment.