Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
e7aff502
Commit
e7aff502
authored
Jun 24, 2010
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: constify
parent
568e5555
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
17 deletions
+17
-17
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.cpp
+11
-11
modules/gui/qt4/components/playlist/playlist_model.hpp
modules/gui/qt4/components/playlist/playlist_model.hpp
+6
-6
No files found.
modules/gui/qt4/components/playlist/playlist_model.cpp
View file @
e7aff502
...
...
@@ -115,7 +115,7 @@ Qt::ItemFlags PLModel::flags( const QModelIndex &index ) const
{
Qt
::
ItemFlags
flags
=
QAbstractItemModel
::
flags
(
index
);
PLItem
*
item
=
index
.
isValid
()
?
getItem
(
index
)
:
rootItem
;
const
PLItem
*
item
=
index
.
isValid
()
?
getItem
(
index
)
:
rootItem
;
if
(
canEdit
()
)
{
...
...
@@ -301,7 +301,7 @@ void PLModel::removeItem( int i_id )
void
PLModel
::
activateItem
(
const
QModelIndex
&
index
)
{
assert
(
index
.
isValid
()
);
PLItem
*
item
=
getItem
(
index
);
const
PLItem
*
item
=
getItem
(
index
);
assert
(
item
);
PL_LOCK
;
playlist_item_t
*
p_item
=
playlist_ItemGetById
(
p_playlist
,
item
->
i_id
);
...
...
@@ -325,10 +325,10 @@ void PLModel::activateItem( playlist_item_t *p_item )
}
/****************** Base model mandatory implementations *****************/
QVariant
PLModel
::
data
(
const
QModelIndex
&
index
,
int
role
)
const
QVariant
PLModel
::
data
(
const
QModelIndex
&
index
,
const
int
role
)
const
{
if
(
!
index
.
isValid
()
)
return
QVariant
();
PLItem
*
item
=
getItem
(
index
);
const
PLItem
*
item
=
getItem
(
index
);
if
(
role
==
Qt
::
DisplayRole
)
{
int
metadata
=
columnToMeta
(
index
.
column
()
);
...
...
@@ -420,7 +420,7 @@ QVariant PLModel::headerData( int section, Qt::Orientation orientation,
return
QVariant
(
qfu
(
psz_column_title
(
meta_col
)
)
);
}
QModelIndex
PLModel
::
index
(
int
row
,
int
column
,
const
QModelIndex
&
parent
)
QModelIndex
PLModel
::
index
(
const
int
row
,
const
int
column
,
const
QModelIndex
&
parent
)
const
{
PLItem
*
parentItem
=
parent
.
isValid
()
?
getItem
(
parent
)
:
rootItem
;
...
...
@@ -432,7 +432,7 @@ QModelIndex PLModel::index( int row, int column, const QModelIndex &parent )
return
QModelIndex
();
}
QModelIndex
PLModel
::
index
(
int
i_id
,
int
c
)
QModelIndex
PLModel
::
index
(
const
int
i_id
,
const
int
c
)
{
return
index
(
findById
(
rootItem
,
i_id
),
c
);
}
...
...
@@ -485,7 +485,7 @@ int PLModel::columnCount( const QModelIndex &i) const
int
PLModel
::
rowCount
(
const
QModelIndex
&
parent
)
const
{
PLItem
*
parentItem
=
parent
.
isValid
()
?
getItem
(
parent
)
:
rootItem
;
const
PLItem
*
parentItem
=
parent
.
isValid
()
?
getItem
(
parent
)
:
rootItem
;
return
parentItem
->
childCount
();
}
...
...
@@ -494,7 +494,7 @@ QStringList PLModel::selectedURIs()
QStringList
lst
;
for
(
int
i
=
0
;
i
<
current_selection
.
size
();
i
++
)
{
PLItem
*
item
=
getItem
(
current_selection
[
i
]
);
const
PLItem
*
item
=
getItem
(
current_selection
[
i
]
);
if
(
item
)
{
PL_LOCK
;
...
...
@@ -637,7 +637,7 @@ void PLModel::processItemAppend( int i_item, int i_parent )
PLItem
*
nodeItem
=
findById
(
rootItem
,
i_parent
);
if
(
!
nodeItem
)
return
;
foreach
(
PLItem
*
existing
,
nodeItem
->
children
)
foreach
(
const
PLItem
*
existing
,
nodeItem
->
children
)
if
(
existing
->
i_id
==
i_item
)
return
;
PL_LOCK
;
...
...
@@ -810,12 +810,12 @@ void PLModel::recurseDelete( QList<PLItem*> children, QModelIndexList *fullList
}
/******* Volume III: Sorting and searching ********/
void
PLModel
::
sort
(
int
column
,
Qt
::
SortOrder
order
)
void
PLModel
::
sort
(
const
int
column
,
Qt
::
SortOrder
order
)
{
sort
(
rootItem
->
i_id
,
column
,
order
);
}
void
PLModel
::
sort
(
int
i_root_id
,
int
column
,
Qt
::
SortOrder
order
)
void
PLModel
::
sort
(
const
int
i_root_id
,
const
int
column
,
Qt
::
SortOrder
order
)
{
msg_Dbg
(
p_intf
,
"Sorting by column %i, order %i"
,
column
,
order
);
...
...
modules/gui/qt4/components/playlist/playlist_model.hpp
View file @
e7aff502
...
...
@@ -70,13 +70,13 @@ public:
/*** QModel subclassing ***/
/* Data structure */
QVariant
data
(
const
QModelIndex
&
index
,
int
role
)
const
;
QVariant
data
(
const
QModelIndex
&
index
,
const
int
role
)
const
;
QVariant
headerData
(
int
section
,
Qt
::
Orientation
orientation
,
int
role
=
Qt
::
DisplayRole
)
const
;
int
rowCount
(
const
QModelIndex
&
parent
=
QModelIndex
()
)
const
;
int
columnCount
(
const
QModelIndex
&
parent
=
QModelIndex
()
)
const
;
Qt
::
ItemFlags
flags
(
const
QModelIndex
&
index
)
const
;
QModelIndex
index
(
int
r
,
int
c
,
const
QModelIndex
&
parent
)
const
;
QModelIndex
index
(
const
int
r
,
const
int
c
,
const
QModelIndex
&
parent
)
const
;
QModelIndex
parent
(
const
QModelIndex
&
index
)
const
;
/* Drag and Drop */
...
...
@@ -90,8 +90,8 @@ public:
/* Lookups */
QStringList
selectedURIs
();
QModelIndex
index
(
PLItem
*
,
int
c
)
const
;
QModelIndex
index
(
int
i_id
,
int
c
);
QModelIndex
index
(
PLItem
*
,
const
int
c
)
const
;
QModelIndex
index
(
const
int
i_id
,
const
int
c
);
QModelIndex
currentIndex
()
const
;
bool
isParent
(
const
QModelIndex
&
index
,
const
QModelIndex
&
current
)
const
;
bool
isCurrent
(
const
QModelIndex
&
index
)
const
;
...
...
@@ -103,8 +103,8 @@ public:
bool
popup
(
const
QModelIndex
&
index
,
const
QPoint
&
point
,
const
QModelIndexList
&
list
);
void
doDelete
(
QModelIndexList
selected
);
void
search
(
const
QString
&
search_text
,
const
QModelIndex
&
root
,
bool
b_recursive
);
void
sort
(
int
column
,
Qt
::
SortOrder
order
);
void
sort
(
int
i_root_id
,
int
column
,
Qt
::
SortOrder
order
);
void
sort
(
const
int
column
,
Qt
::
SortOrder
order
);
void
sort
(
const
int
i_root_id
,
const
int
column
,
Qt
::
SortOrder
order
);
void
rebuild
();
void
rebuild
(
playlist_item_t
*
);
...
...
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