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
a4a89127
Commit
a4a89127
authored
Jun 06, 2012
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: PL: Request missing art for visible items
parent
2d6e1751
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
44 additions
and
6 deletions
+44
-6
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.cpp
+15
-1
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
+1
-0
modules/gui/qt4/components/playlist/views.cpp
modules/gui/qt4/components/playlist/views.cpp
+7
-0
modules/gui/qt4/components/playlist/views.hpp
modules/gui/qt4/components/playlist/views.hpp
+1
-0
modules/gui/qt4/components/playlist/vlc_model.cpp
modules/gui/qt4/components/playlist/vlc_model.cpp
+10
-5
modules/gui/qt4/components/playlist/vlc_model.hpp
modules/gui/qt4/components/playlist/vlc_model.hpp
+1
-0
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+8
-0
No files found.
modules/gui/qt4/components/playlist/playlist_model.cpp
View file @
a4a89127
...
@@ -688,7 +688,6 @@ void PLModel::rebuild( playlist_item_t *p_root )
...
@@ -688,7 +688,6 @@ void PLModel::rebuild( playlist_item_t *p_root )
/* And signal the view */
/* And signal the view */
reset
();
reset
();
if
(
p_root
)
emit
rootIndexChanged
();
if
(
p_root
)
emit
rootIndexChanged
();
}
}
...
@@ -910,6 +909,21 @@ void PLModel::clearPlaylist()
...
@@ -910,6 +909,21 @@ void PLModel::clearPlaylist()
doDelete
(
l
);
doDelete
(
l
);
}
}
void
PLModel
::
ensureArtRequested
(
const
QModelIndex
&
index
)
{
if
(
index
.
isValid
()
&&
hasChildren
(
index
)
)
{
int
nbnodes
=
rowCount
(
index
);
QModelIndex
child
;
for
(
int
row
=
0
;
row
<
nbnodes
;
row
++
)
{
child
=
index
.
child
(
row
,
0
);
if
(
child
.
isValid
()
&&
getArtUrl
(
child
).
isEmpty
()
)
THEMIM
->
getIM
()
->
requestArtUpdate
(
getItem
(
child
)
->
inputItem
()
);
}
}
}
/*********** Popup *********/
/*********** Popup *********/
bool
PLModel
::
popup
(
const
QModelIndex
&
index
,
const
QPoint
&
point
,
const
QModelIndexList
&
list
)
bool
PLModel
::
popup
(
const
QModelIndex
&
index
,
const
QPoint
&
point
,
const
QModelIndexList
&
list
)
{
{
...
...
modules/gui/qt4/components/playlist/playlist_model.hpp
View file @
a4a89127
...
@@ -121,6 +121,7 @@ signals:
...
@@ -121,6 +121,7 @@ signals:
public
slots
:
public
slots
:
virtual
void
activateItem
(
const
QModelIndex
&
index
);
virtual
void
activateItem
(
const
QModelIndex
&
index
);
void
clearPlaylist
();
void
clearPlaylist
();
void
ensureArtRequested
(
const
QModelIndex
&
index
);
private:
private:
/* General */
/* General */
PLItem
*
rootItem
;
PLItem
*
rootItem
;
...
...
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
a4a89127
...
@@ -216,6 +216,7 @@ void StandardPLPanel::browseInto( const QModelIndex &index )
...
@@ -216,6 +216,7 @@ void StandardPLPanel::browseInto( const QModelIndex &index )
/* Store new rootindexid*/
/* Store new rootindexid*/
currentRootIndexId
=
model
->
itemId
(
index
);
currentRootIndexId
=
model
->
itemId
(
index
);
model
->
ensureArtRequested
(
index
);
}
}
emit
viewChanged
(
index
);
emit
viewChanged
(
index
);
...
...
modules/gui/qt4/components/playlist/views.cpp
View file @
a4a89127
...
@@ -350,6 +350,13 @@ void PlListView::keyPressEvent( QKeyEvent *event )
...
@@ -350,6 +350,13 @@ void PlListView::keyPressEvent( QKeyEvent *event )
QListView
::
keyPressEvent
(
event
);
QListView
::
keyPressEvent
(
event
);
}
}
void
PlTreeView
::
setModel
(
QAbstractItemModel
*
model
)
{
QTreeView
::
setModel
(
model
);
CONNECT
(
this
,
expanded
(
const
QModelIndex
&
),
model
,
ensureArtRequested
(
const
QModelIndex
&
)
);
}
void
PlTreeView
::
startDrag
(
Qt
::
DropActions
supportedActions
)
void
PlTreeView
::
startDrag
(
Qt
::
DropActions
supportedActions
)
{
{
plViewStartDrag
(
this
,
supportedActions
);
plViewStartDrag
(
this
,
supportedActions
);
...
...
modules/gui/qt4/components/playlist/views.hpp
View file @
a4a89127
...
@@ -93,6 +93,7 @@ protected:
...
@@ -93,6 +93,7 @@ protected:
virtual
void
startDrag
(
Qt
::
DropActions
supportedActions
);
virtual
void
startDrag
(
Qt
::
DropActions
supportedActions
);
virtual
void
dragMoveEvent
(
QDragMoveEvent
*
event
);
virtual
void
dragMoveEvent
(
QDragMoveEvent
*
event
);
virtual
void
keyPressEvent
(
QKeyEvent
*
event
);
virtual
void
keyPressEvent
(
QKeyEvent
*
event
);
virtual
void
setModel
(
QAbstractItemModel
*
);
};
};
class
PicFlowView
:
public
QAbstractItemView
class
PicFlowView
:
public
QAbstractItemView
...
...
modules/gui/qt4/components/playlist/vlc_model.cpp
View file @
a4a89127
...
@@ -38,13 +38,18 @@ QString VLCModel::getMeta( const QModelIndex & index, int meta )
...
@@ -38,13 +38,18 @@ QString VLCModel::getMeta( const QModelIndex & index, int meta )
data
().
toString
();
data
().
toString
();
}
}
QString
VLCModel
::
getArtUrl
(
const
QModelIndex
&
index
)
{
return
index
.
model
()
->
index
(
index
.
row
(),
columnFromMeta
(
COLUMN_COVER
),
index
.
parent
()
)
.
data
().
toString
();
}
QPixmap
VLCModel
::
getArtPixmap
(
const
QModelIndex
&
index
,
const
QSize
&
size
)
QPixmap
VLCModel
::
getArtPixmap
(
const
QModelIndex
&
index
,
const
QSize
&
size
)
{
{
QString
artUrl
;
QString
artUrl
=
VLCModel
::
getArtUrl
(
index
)
;
artUrl
=
index
.
model
()
->
index
(
index
.
row
(),
columnFromMeta
(
COLUMN_COVER
),
index
.
parent
()
)
.
data
().
toString
();
QPixmap
artPix
;
QPixmap
artPix
;
QString
key
=
artUrl
+
QString
(
"%1%2"
).
arg
(
size
.
width
()).
arg
(
size
.
height
());
QString
key
=
artUrl
+
QString
(
"%1%2"
).
arg
(
size
.
width
()).
arg
(
size
.
height
());
...
...
modules/gui/qt4/components/playlist/vlc_model.hpp
View file @
a4a89127
...
@@ -58,6 +58,7 @@ public:
...
@@ -58,6 +58,7 @@ public:
virtual
~
VLCModel
();
virtual
~
VLCModel
();
static
QString
getMeta
(
const
QModelIndex
&
index
,
int
meta
);
static
QString
getMeta
(
const
QModelIndex
&
index
,
int
meta
);
static
QPixmap
getArtPixmap
(
const
QModelIndex
&
index
,
const
QSize
&
size
);
static
QPixmap
getArtPixmap
(
const
QModelIndex
&
index
,
const
QSize
&
size
);
static
QString
getArtUrl
(
const
QModelIndex
&
index
);
static
int
columnToMeta
(
int
_column
)
static
int
columnToMeta
(
int
_column
)
{
{
...
...
modules/gui/qt4/input_manager.cpp
View file @
a4a89127
...
@@ -639,6 +639,14 @@ void InputManager::requestArtUpdate( input_item_t *p_item )
...
@@ -639,6 +639,14 @@ void InputManager::requestArtUpdate( input_item_t *p_item )
if
(
p_item
)
if
(
p_item
)
{
{
/* check if it has already been enqueued */
if
(
p_item
->
p_meta
)
{
int
status
=
vlc_meta_GetStatus
(
p_item
->
p_meta
);
if
(
status
&
(
ITEM_ART_NOTFOUND
|
ITEM_ART_FETCHED
|
ITEM_ARTURL_FETCHED
|
ITEM_PREPARSED
)
)
return
;
}
playlist_AskForArtEnqueue
(
pl_Get
(
p_intf
),
p_item
);
playlist_AskForArtEnqueue
(
pl_Get
(
p_intf
),
p_item
);
/* No input will signal the cover art to update,
/* No input will signal the cover art to update,
* let's do it ourself */
* let's do it ourself */
...
...
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