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
eb2da50b
Commit
eb2da50b
authored
Jun 24, 2010
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: don't cache current
reverts
0455f985
and
7cdb0761
parent
f9fe9f29
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
17 deletions
+7
-17
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.cpp
+7
-15
modules/gui/qt4/components/playlist/playlist_model.hpp
modules/gui/qt4/components/playlist/playlist_model.hpp
+0
-2
No files found.
modules/gui/qt4/components/playlist/playlist_model.cpp
View file @
eb2da50b
...
...
@@ -73,7 +73,6 @@ PLModel::PLModel( playlist_t *_p_playlist, /* THEPL */
i_cached_input_id
=
-
1
;
i_popup_item
=
i_popup_parent
=
-
1
;
sortingMenu
=
NULL
;
current_index
=
QModelIndex
();
rootItem
=
NULL
;
/* PLItem rootItem, will be set in rebuild( ) */
...
...
@@ -99,8 +98,6 @@ PLModel::PLModel( playlist_t *_p_playlist, /* THEPL */
this
,
processItemAppend
(
int
,
int
)
);
CONNECT
(
THEMIM
,
playlistItemRemoved
(
int
),
this
,
processItemRemoval
(
int
)
);
CONNECT
(
this
,
currentChanged
(
const
QModelIndex
&
)
,
this
,
cacheCurrent
(
const
QModelIndex
&
)
);
}
PLModel
::~
PLModel
()
...
...
@@ -380,7 +377,7 @@ QVariant PLModel::data( const QModelIndex &index, int role ) const
}
else
if
(
role
==
IsCurrentsParentNodeRole
)
{
return
QVariant
(
isParent
(
index
,
current
_index
)
);
return
QVariant
(
isParent
(
index
,
current
Index
()
)
);
}
return
QVariant
();
}
...
...
@@ -402,7 +399,7 @@ bool PLModel::isParent( const QModelIndex &index, const QModelIndex ¤t ) c
bool
PLModel
::
isCurrent
(
const
QModelIndex
&
index
)
const
{
return
index
==
current_index
;
return
getItem
(
index
)
->
p_input
==
THEMIM
->
currentInputItem
()
;
}
int
PLModel
::
itemId
(
const
QModelIndex
&
index
)
const
...
...
@@ -451,14 +448,12 @@ QModelIndex PLModel::index( PLItem *item, int column ) const
return
QModelIndex
();
}
void
PLModel
::
cacheCurrent
(
const
QModelIndex
&
current
)
QModelIndex
PLModel
::
currentIndex
()
const
{
current_index
=
current
;
}
QModelIndex
PLModel
::
currentIndex
()
{
return
current_index
;
input_thread_t
*
p_input_thread
=
THEMIM
->
getInput
();
if
(
!
p_input_thread
)
return
QModelIndex
();
PLItem
*
item
=
findByInput
(
rootItem
,
input_GetItem
(
p_input_thread
)
->
i_id
);
return
index
(
item
,
0
);
}
QModelIndex
PLModel
::
parent
(
const
QModelIndex
&
index
)
const
...
...
@@ -703,7 +698,6 @@ void PLModel::rebuild( playlist_item_t *p_root )
/* Invalidate cache */
i_cached_id
=
i_cached_input_id
=
-
1
;
current_index
=
QModelIndex
();
if
(
rootItem
)
rootItem
->
removeChildren
();
...
...
@@ -756,7 +750,6 @@ void PLModel::removeItem( PLItem *item )
i_cached_id
=
-
1
;
i_cached_input_id
=
-
1
;
current_index
=
QModelIndex
();
if
(
item
->
parentItem
)
{
int
i
=
item
->
parentItem
->
children
.
indexOf
(
item
);
...
...
@@ -879,7 +872,6 @@ void PLModel::sort( int i_root_id, int column, Qt::SortOrder order )
}
i_cached_id
=
i_cached_input_id
=
-
1
;
current_index
=
QModelIndex
();
if
(
count
)
{
...
...
modules/gui/qt4/components/playlist/playlist_model.hpp
View file @
eb2da50b
...
...
@@ -163,7 +163,6 @@ private:
PLItem
*
p_cached_item_bi
;
int
i_cached_id
;
int
i_cached_input_id
;
QModelIndex
current_index
;
private
slots
:
void
popupPlay
();
...
...
@@ -178,7 +177,6 @@ private slots:
void
processInputItemUpdate
(
input_thread_t
*
p_input
);
void
processItemRemoval
(
int
i_id
);
void
processItemAppend
(
int
item
,
int
parent
);
void
cacheCurrent
(
const
QModelIndex
&
);
};
class
PlMimeData
:
public
QMimeData
...
...
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