Commit 8c4ce455 authored by Tomi Leppänen's avatar Tomi Leppänen

[usb-moded-qt5] Filter restricted modes. JB#48441

Return filtered list of modes from availableModes. Handle available
modes signal so that it uses filtered list.
Signed-off-by: Tomi Leppänen's avatarTomi Leppänen <tomi.leppanen@jolla.com>
parent 5a73b0da
......@@ -10,8 +10,8 @@ Source0: %{name}-%{version}.tar.bz2
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
Requires: usb-moded >= 0.86.0+mer29
BuildRequires: usb-moded-devel >= 0.86.0+mer29
Requires: usb-moded >= 0.86.0+mer39
BuildRequires: usb-moded-devel >= 0.86.0+mer39
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(usb_moded)
......
......@@ -224,7 +224,7 @@ void QUsbModed::setup()
connect(iPrivate->iInterface,
&QUsbModedInterface::sig_usb_available_modes_ind,
this,
&QUsbModed::updateAvailableModes);
&QUsbModed::checkAvailableModesForUser);
connect(iPrivate->iInterface,
SIGNAL(sig_usb_hidden_modes_ind(QString)),
SLOT(onUsbHiddenModesChanged(QString)));
......@@ -241,7 +241,7 @@ void QUsbModed::setup()
iPrivate->iPendingCalls |= USB_MODED_CALL_GET_AVAILABLE_MODES;
connect(new QDBusPendingCallWatcher(
iPrivate->iInterface->get_available_modes(), iPrivate->iInterface),
iPrivate->iInterface->get_available_modes_for_user(), iPrivate->iInterface),
&QDBusPendingCallWatcher::finished,
this,
&QUsbModed::onGetAvailableModesFinished);
......@@ -412,6 +412,15 @@ void QUsbModed::updateAvailableModes(const QString &aModes)
}
}
void QUsbModed::checkAvailableModesForUser()
{
connect(new QDBusPendingCallWatcher(
iPrivate->iInterface->get_available_modes_for_user(), iPrivate->iInterface),
&QDBusPendingCallWatcher::finished,
this,
&QUsbModed::onGetAvailableModesFinished);
}
void QUsbModed::setupCallFinished(int aCallId)
{
ASSERT_(iPrivate->iPendingCalls & aCallId);
......
......@@ -109,6 +109,7 @@ private:
void setupCallFinished(int callId);
void updateSupportedModes(QString modes);
void updateAvailableModes(const QString &modes);
void checkAvailableModesForUser();
void updateHiddenModes(QString modes);
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment