[vlc-commits] [Git][videolan/vlc][master] 2 commits: qt: fixup url from openurl dialog

Romain Vimont (@rom1v) gitlab at videolan.org
Mon Aug 30 09:37:28 UTC 2021



Romain Vimont pushed to branch master at VideoLAN / VLC


Commits:
02836796 by Marvin Scholz at 2021-08-30T09:14:21+00:00
qt: fixup url from openurl dialog

Fixes #21661

- - - - -
50728ae6 by Marvin Scholz at 2021-08-30T09:14:21+00:00
qt: fixup url from open network panel

Fixes #21661

- - - - -


2 changed files:

- modules/gui/qt/dialogs/dialogs_provider.cpp
- modules/gui/qt/dialogs/open/open_panels.cpp


Changes:

=====================================
modules/gui/qt/dialogs/dialogs_provider.cpp
=====================================
@@ -576,14 +576,19 @@ void DialogsProvider::openUrlDialog()
     if( url.isEmpty() )
         return;
 
+    char *uri;
     if( !url.contains( qfu( "://" ) ) )
     {
-        char *uri = vlc_path2uri( qtu( url ), NULL );
-        if( uri == NULL )
-            return;
-        url = qfu(uri);
-        free( uri );
+        uri = vlc_path2uri( qtu( url ), NULL );
+    } else {
+        uri = vlc_uri_fixup( qtu( url ) );
     }
+
+    if( uri == NULL )
+        return;
+    url = qfu(uri);
+    free( uri );
+
     QVector<vlc::playlist::Media> medias = { {url, QString {}} };
     THEMPL->append(medias, !oud.shouldEnqueue());
 }


=====================================
modules/gui/qt/dialogs/open/open_panels.cpp
=====================================
@@ -744,7 +744,19 @@ void NetOpenPanel::updateMRL()
     emit methodChanged( qfu( "network-caching" ) );
 
     QStringList qsl;
-    if( !url.isEmpty() ) qsl << url;
+    if( url.isEmpty() )
+        return;
+
+    if( url.contains( QLatin1String( "://" ) ) )
+    {
+        char *uri = vlc_uri_fixup( qtu( url ) );
+        if( uri == NULL )
+            return;
+        url = qfu(uri);
+        free( uri );
+    }
+
+    qsl << url;
     emit mrlUpdated( qsl, "" );
 }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6f47656dfe7a1ef77c01abba09d401420a443bde...50728ae64510294784371335fafe8f7d575251fb

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6f47656dfe7a1ef77c01abba09d401420a443bde...50728ae64510294784371335fafe8f7d575251fb
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list