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
79081134
Commit
79081134
authored
Feb 10, 2010
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: return playlist model and views to "now playing" root if current root is deleted
parent
ea0c27c2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
10 deletions
+22
-10
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.cpp
+6
-3
modules/gui/qt4/components/playlist/playlist_model.hpp
modules/gui/qt4/components/playlist/playlist_model.hpp
+1
-0
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+6
-0
modules/gui/qt4/components/playlist/standardpanel.hpp
modules/gui/qt4/components/playlist/standardpanel.hpp
+9
-7
No files found.
modules/gui/qt4/components/playlist/playlist_model.cpp
View file @
79081134
...
@@ -700,9 +700,6 @@ void PLModel::removeItem( PLItem *item )
...
@@ -700,9 +700,6 @@ void PLModel::removeItem( PLItem *item )
if
(
item
->
i_id
==
i_cached_id
)
i_cached_id
=
-
1
;
if
(
item
->
i_id
==
i_cached_id
)
i_cached_id
=
-
1
;
i_cached_input_id
=
-
1
;
i_cached_input_id
=
-
1
;
if
(
item
==
rootItem
)
rootItem
=
NULL
;
if
(
item
->
parentItem
)
{
if
(
item
->
parentItem
)
{
int
i
=
item
->
parentItem
->
children
.
indexOf
(
item
);
int
i
=
item
->
parentItem
->
children
.
indexOf
(
item
);
beginRemoveRows
(
index
(
item
->
parentItem
,
0
),
i
,
i
);
beginRemoveRows
(
index
(
item
->
parentItem
,
0
),
i
,
i
);
...
@@ -712,6 +709,12 @@ void PLModel::removeItem( PLItem *item )
...
@@ -712,6 +709,12 @@ void PLModel::removeItem( PLItem *item )
}
}
else
delete
item
;
else
delete
item
;
if
(
item
==
rootItem
)
{
rootItem
=
NULL
;
rebuild
(
p_playlist
->
p_playing
);
emit
rootChanged
();
}
}
}
/* This function must be entered WITH the playlist lock */
/* This function must be entered WITH the playlist lock */
...
...
modules/gui/qt4/components/playlist/playlist_model.hpp
View file @
79081134
...
@@ -150,6 +150,7 @@ private:
...
@@ -150,6 +150,7 @@ private:
signals:
signals:
void
currentChanged
(
const
QModelIndex
&
);
void
currentChanged
(
const
QModelIndex
&
);
void
rootChanged
();
public
slots
:
public
slots
:
void
activateItem
(
const
QModelIndex
&
index
);
void
activateItem
(
const
QModelIndex
&
index
);
...
...
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
79081134
...
@@ -79,6 +79,7 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
...
@@ -79,6 +79,7 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
locationBar
=
new
LocationBar
(
model
);
locationBar
=
new
LocationBar
(
model
);
layout
->
addWidget
(
locationBar
,
0
,
0
);
layout
->
addWidget
(
locationBar
,
0
,
0
);
CONNECT
(
model
,
rootChanged
(),
locationBar
,
setRootIndex
()
);
/* A Spacer and the search possibilities */
/* A Spacer and the search possibilities */
layout
->
setColumnStretch
(
1
,
10
);
layout
->
setColumnStretch
(
1
,
10
);
...
@@ -499,6 +500,11 @@ void LocationBar::setIndex( const QModelIndex &index )
...
@@ -499,6 +500,11 @@ void LocationBar::setIndex( const QModelIndex &index )
}
}
}
}
void
LocationBar
::
setRootIndex
()
{
setIndex
(
QModelIndex
()
);
}
void
LocationBar
::
invoke
(
int
i_id
)
void
LocationBar
::
invoke
(
int
i_id
)
{
{
QModelIndex
index
=
model
->
index
(
i_id
,
0
);
QModelIndex
index
=
model
->
index
(
i_id
,
0
);
...
...
modules/gui/qt4/components/playlist/standardpanel.hpp
View file @
79081134
...
@@ -118,6 +118,8 @@ public:
...
@@ -118,6 +118,8 @@ public:
void
setIndex
(
const
QModelIndex
&
);
void
setIndex
(
const
QModelIndex
&
);
signals:
signals:
void
invoked
(
const
QModelIndex
&
);
void
invoked
(
const
QModelIndex
&
);
public
slots
:
void
setRootIndex
();
private
slots
:
private
slots
:
void
invoke
(
int
i_item_id
);
void
invoke
(
int
i_item_id
);
private:
private:
...
@@ -129,13 +131,13 @@ private:
...
@@ -129,13 +131,13 @@ private:
class
LocationButton
:
public
QPushButton
class
LocationButton
:
public
QPushButton
{
{
public:
public:
LocationButton
(
const
QString
&
,
bool
bold
,
bool
arrow
);
LocationButton
(
const
QString
&
,
bool
bold
,
bool
arrow
);
private:
private:
void
paintEvent
(
QPaintEvent
*
event
);
void
paintEvent
(
QPaintEvent
*
event
);
QSize
sizeHint
()
const
;
QSize
sizeHint
()
const
;
QFontMetrics
*
metrics
;
QFontMetrics
*
metrics
;
bool
b_arrow
;
bool
b_arrow
;
};
};
#endif
#endif
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