summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-07-04 19:22:42 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-07-07 12:54:57 +0200
commit02cbb1d1bb306e04548ae6a4fb4a7157e39e0f84 (patch)
treea269d412191ef80709f8e4ab7fab5f98ea4b80ec /src
parent20d47714395809f600346ccfdfb5c3a4ad617449 (diff)
Fix requests for audio and video permissions
Requesting MediaAudioCapture would unconditionally ask for QQuickWebEngineViewExperimental::MediaAudioVideoDevices instead of MediaAudioDevices since the if wrongly tested for the same condition twice. In addition fix a warning: variable 'feature' is used uninitialized whenever 'if' condition is false api/qquickwebengineview.cpp:369:13: warning: variable 'feature' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] else if (requestFlags.testFlag(WebContentsAdapterClient::MediaVideoCapture)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ api/qquickwebengineview.cpp:371:57: note: uninitialized use occurs here Q_EMIT e->featurePermissionRequested(securityOrigin, feature); ^~~~~~~ api/qquickwebengineview.cpp:369:9: note: remove the 'if' if its condition is always true else if (requestFlags.testFlag(WebContentsAdapterClient::MediaVideoCapture)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ api/qquickwebengineview.cpp:364:4: note: variable 'feature' is declared here QQuickWebEngineViewExperimental::Feature feature; ^ Change-Id: If63fbb5a59a71dede1d1829695f66c22849a4dcd Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/webengine/api/qquickwebengineview.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index a11a57cdf..ce41db7c1 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -354,11 +354,11 @@ void QQuickWebEngineViewPrivate::runMediaAccessPermissionRequest(const QUrl &sec
if (!requestFlags)
return;
QQuickWebEngineViewExperimental::Feature feature;
- if (requestFlags.testFlag(WebContentsAdapterClient::MediaAudioCapture) && requestFlags.testFlag(WebContentsAdapterClient::MediaAudioCapture))
+ if (requestFlags.testFlag(WebContentsAdapterClient::MediaAudioCapture) && requestFlags.testFlag(WebContentsAdapterClient::MediaVideoCapture))
feature = QQuickWebEngineViewExperimental::MediaAudioVideoDevices;
else if (requestFlags.testFlag(WebContentsAdapterClient::MediaAudioCapture))
feature = QQuickWebEngineViewExperimental::MediaAudioDevices;
- else if (requestFlags.testFlag(WebContentsAdapterClient::MediaVideoCapture))
+ else // WebContentsAdapterClient::MediaVideoCapture
feature = QQuickWebEngineViewExperimental::MediaVideoDevices;
Q_EMIT e->featurePermissionRequested(securityOrigin, feature);
}