Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
f8d56527
Commit
f8d56527
authored
Jul 07, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: do not allow spaces in network URLs (fix #3870)
parent
852f0db9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
modules/gui/qt4/components/open_panels.cpp
modules/gui/qt4/components/open_panels.cpp
+16
-0
modules/gui/qt4/components/open_panels.hpp
modules/gui/qt4/components/open_panels.hpp
+9
-0
No files found.
modules/gui/qt4/components/open_panels.cpp
View file @
f8d56527
...
...
@@ -551,6 +551,8 @@ NetOpenPanel::NetOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
}
else
mrlList
=
NULL
;
ui
.
urlText
->
setValidator
(
new
UrlValidator
(
this
)
);
}
NetOpenPanel
::~
NetOpenPanel
()
...
...
@@ -624,6 +626,20 @@ void NetOpenPanel::updateCompleter()
mrlList
->
setStringList
(
tempL
);
}
void
UrlValidator
::
fixup
(
QString
&
str
)
const
{
str
=
str
.
trimmed
();
}
QValidator
::
State
UrlValidator
::
validate
(
QString
&
str
,
int
&
pos
)
const
{
if
(
str
.
contains
(
' '
)
)
return
QValidator
::
Invalid
;
if
(
!
str
.
contains
(
"://"
)
)
return
QValidator
::
Intermediate
;
return
QValidator
::
Acceptable
;
}
/**************************************************************************
* Open Capture device ( DVB, PVR, V4L, and similar ) *
**************************************************************************/
...
...
modules/gui/qt4/components/open_panels.hpp
View file @
f8d56527
...
...
@@ -149,6 +149,15 @@ private slots:
void
updateCompleter
();
};
class
UrlValidator
:
public
QValidator
{
Q_OBJECT
public:
UrlValidator
(
QObject
*
parent
)
:
QValidator
(
parent
)
{
}
void
fixup
(
QString
&
)
const
;
QValidator
::
State
validate
(
QString
&
,
int
&
)
const
;
};
class
DiscOpenPanel
:
public
OpenPanel
{
Q_OBJECT
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment