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
8716719a
Commit
8716719a
authored
Feb 14, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: plugins: check after casts.
Really unlikely cid #1174897 cid #1174898 cid #1174899
parent
75911f54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
modules/gui/qt4/dialogs/plugins.cpp
modules/gui/qt4/dialogs/plugins.cpp
+14
-5
No files found.
modules/gui/qt4/dialogs/plugins.cpp
View file @
8716719a
...
...
@@ -398,6 +398,7 @@ bool AddonsTab::eventFilter( QObject *obj, QEvent *event )
if
(
spinnerAnimation
->
state
()
==
PixmapAnimator
::
Running
)
{
QWidget
*
viewport
=
qobject_cast
<
QWidget
*>
(
obj
);
if
(
!
viewport
)
break
;
QStylePainter
painter
(
viewport
);
QPixmap
*
spinner
=
spinnerAnimation
->
getPixmap
();
QPoint
point
=
viewport
->
geometry
().
center
();
...
...
@@ -412,6 +413,7 @@ bool AddonsTab::eventFilter( QObject *obj, QEvent *event )
else
if
(
addonsModel
->
rowCount
()
==
0
)
{
QWidget
*
viewport
=
qobject_cast
<
QWidget
*>
(
obj
);
if
(
!
viewport
)
break
;
QStylePainter
painter
(
viewport
);
QString
text
=
qtr
(
"No addons found"
);
QSize
size
=
fontMetrics
().
size
(
0
,
text
);
...
...
@@ -433,7 +435,8 @@ bool AddonsTab::eventFilter( QObject *obj, QEvent *event )
break
;
case
QEvent
:
:
DragEnter
:
{
QDragEnterEvent
*
dragEvent
=
dynamic_cast
<
QDragEnterEvent
*>
(
event
);
QDragEnterEvent
*
dragEvent
=
static_cast
<
QDragEnterEvent
*>
(
event
);
if
(
!
dragEvent
)
break
;
QList
<
QUrl
>
urls
=
dragEvent
->
mimeData
()
->
urls
();
if
(
dragEvent
->
proposedAction
()
!=
Qt
::
CopyAction
||
urls
.
count
()
!=
1
...
...
@@ -445,7 +448,8 @@ bool AddonsTab::eventFilter( QObject *obj, QEvent *event )
}
case
QEvent
:
:
DragMove
:
{
QDragMoveEvent
*
moveEvent
=
dynamic_cast
<
QDragMoveEvent
*>
(
event
);
QDragMoveEvent
*
moveEvent
=
static_cast
<
QDragMoveEvent
*>
(
event
);
if
(
!
moveEvent
)
break
;
if
(
moveEvent
->
proposedAction
()
!=
Qt
::
CopyAction
)
return
false
;
moveEvent
->
acceptProposedAction
();
...
...
@@ -453,7 +457,8 @@ bool AddonsTab::eventFilter( QObject *obj, QEvent *event )
}
case
QEvent
:
:
Drop
:
{
QDropEvent
*
dropEvent
=
dynamic_cast
<
QDropEvent
*>
(
event
);
QDropEvent
*
dropEvent
=
static_cast
<
QDropEvent
*>
(
event
);
if
(
!
dropEvent
)
break
;
if
(
dropEvent
->
proposedAction
()
!=
Qt
::
CopyAction
)
return
false
;
if
(
dropEvent
->
mimeData
()
->
urls
().
count
()
)
...
...
@@ -481,6 +486,7 @@ void AddonsTab::moreInformation()
void
AddonsTab
::
typeChanged
(
int
i
)
{
QComboBox
*
combo
=
qobject_cast
<
QComboBox
*>
(
sender
()
);
if
(
!
combo
)
return
;
int
i_type
=
combo
->
itemData
(
i
,
Qt
::
UserRole
).
toInt
();
addonsModel
->
setTypeFilter
(
i_type
);
QString
help
;
...
...
@@ -640,8 +646,10 @@ QVariant ExtensionListModel::data( const QModelIndex& index, int role ) const
ExtensionCopy
*
extension
=
static_cast
<
ExtensionCopy
*>
(
index
.
internalPointer
());
return
extension
->
data
(
role
);
if
(
!
extension
)
return
QVariant
();
else
return
extension
->
data
(
role
);
}
QModelIndex
ExtensionListModel
::
index
(
int
row
,
int
column
,
...
...
@@ -1163,6 +1171,7 @@ void AddonItemDelegate::setAnimator( DelegateAnimationHelper *animator_ )
void
AddonItemDelegate
::
editButtonClicked
()
{
QWidget
*
editor
=
qobject_cast
<
QWidget
*>
(
sender
()
->
parent
());
if
(
!
editor
)
return
;
int
value
=
editor
->
property
(
"Addon::state"
).
toInt
();
if
(
(
value
==
ADDON_INSTALLED
)
)
/* uninstall */
...
...
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