Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
4e65194e
Commit
4e65194e
authored
Feb 02, 2010
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: cleanup and adjust to playlist changes
parent
8927c888
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
33 deletions
+20
-33
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.cpp
+11
-19
modules/gui/qt4/components/playlist/selector.cpp
modules/gui/qt4/components/playlist/selector.cpp
+3
-3
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+5
-10
modules/gui/qt4/dialogs_provider.cpp
modules/gui/qt4/dialogs_provider.cpp
+1
-1
No files found.
modules/gui/qt4/components/playlist/playlist_model.cpp
View file @
4e65194e
...
@@ -57,8 +57,6 @@ QIcon PLModel::icons[ITEM_TYPE_NUMBER];
...
@@ -57,8 +57,6 @@ QIcon PLModel::icons[ITEM_TYPE_NUMBER];
PLModel
::
PLModel
(
playlist_t
*
_p_playlist
,
/* THEPL */
PLModel
::
PLModel
(
playlist_t
*
_p_playlist
,
/* THEPL */
intf_thread_t
*
_p_intf
,
/* main Qt p_intf */
intf_thread_t
*
_p_intf
,
/* main Qt p_intf */
playlist_item_t
*
p_root
,
playlist_item_t
*
p_root
,
/*playlist_GetPreferredNode( THEPL, THEPL->p_local_category );
and THEPL->p_root_category for SelectPL */
QObject
*
parent
)
/* Basic Qt parent */
QObject
*
parent
)
/* Basic Qt parent */
:
QAbstractItemModel
(
parent
)
:
QAbstractItemModel
(
parent
)
{
{
...
@@ -178,13 +176,13 @@ bool PLModel::dropMimeData( const QMimeData *data, Qt::DropAction action,
...
@@ -178,13 +176,13 @@ bool PLModel::dropMimeData( const QMimeData *data, Qt::DropAction action,
}
}
bool
copy
=
false
;
bool
copy
=
false
;
playlist_item_t
*
p_pl
=
p_playlist
->
p_
local_category
;
playlist_item_t
*
p_pl
=
p_playlist
->
p_
playing
;
playlist_item_t
*
p_ml
=
p_playlist
->
p_m
l_catego
ry
;
playlist_item_t
*
p_ml
=
p_playlist
->
p_m
edia_libra
ry
;
if
if
(
(
row
==
-
1
&&
(
row
==
-
1
&&
(
(
p_pl
&&
p_parent
->
p_input
==
p_pl
->
p_input
)
||
(
p_pl
&&
p_parent
==
p_pl
)
||
(
p_ml
&&
p_parent
->
p_input
==
p_ml
->
p_input
)
)
(
p_ml
&&
p_parent
==
p_ml
)
)
)
)
copy
=
true
;
copy
=
true
;
PL_UNLOCK
;
PL_UNLOCK
;
...
@@ -217,8 +215,7 @@ void PLModel::dropAppendCopy( QByteArray& data, PLItem *target )
...
@@ -217,8 +215,7 @@ void PLModel::dropAppendCopy( QByteArray& data, PLItem *target )
PLAYLIST_APPEND
|
PLAYLIST_SPREPARSE
,
PLAYLIST_END
,
PLAYLIST_APPEND
|
PLAYLIST_SPREPARSE
,
PLAYLIST_END
,
p_input
->
i_duration
,
p_input
->
i_duration
,
p_input
->
i_options
,
p_input
->
ppsz_options
,
p_input
->
optflagc
,
p_input
->
i_options
,
p_input
->
ppsz_options
,
p_input
->
optflagc
,
(
p_parent
==
p_playlist
->
p_local_category
||
p_parent
==
p_playlist
->
p_playing
,
p_parent
==
p_playlist
->
p_local_onelevel
),
true
);
true
);
}
}
PL_UNLOCK
;
PL_UNLOCK
;
...
@@ -563,10 +560,10 @@ bool PLModel::canEdit() const
...
@@ -563,10 +560,10 @@ bool PLModel::canEdit() const
return
(
return
(
rootItem
!=
NULL
&&
rootItem
!=
NULL
&&
(
(
rootItem
->
p_input
==
p_playlist
->
p_
local_category
->
p_input
||
rootItem
->
p_input
==
p_playlist
->
p_
playing
->
p_input
||
(
(
p_playlist
->
p_m
l_catego
ry
&&
p_playlist
->
p_m
edia_libra
ry
&&
rootItem
->
p_input
==
p_playlist
->
p_m
l_catego
ry
->
p_input
rootItem
->
p_input
==
p_playlist
->
p_m
edia_libra
ry
->
p_input
)
)
)
)
);
);
...
@@ -898,14 +895,9 @@ void PLModel::popup( const QModelIndex & index, const QPoint &point, const QMode
...
@@ -898,14 +895,9 @@ void PLModel::popup( const QModelIndex & index, const QPoint &point, const QMode
(
p_item
->
p_parent
?
p_item
->
p_parent
->
i_id
:
-
1
)
:
(
p_item
->
p_parent
?
p_item
->
p_parent
->
i_id
:
-
1
)
:
(
p_item
->
i_id
);
(
p_item
->
i_id
);
i_popup_column
=
index
.
column
();
i_popup_column
=
index
.
column
();
/* check whether we are in tree view */
bool
tree
=
false
;
bool
tree
=
var_InheritBool
(
p_intf
,
"playlist-tree"
);
playlist_item_t
*
p_up
=
p_item
;
while
(
p_up
)
{
if
(
p_up
==
p_playlist
->
p_root_category
)
tree
=
true
;
p_up
=
p_up
->
p_parent
;
}
PL_UNLOCK
;
PL_UNLOCK
;
current_selection
=
list
;
current_selection
=
list
;
...
...
modules/gui/qt4/components/playlist/selector.cpp
View file @
4e65194e
...
@@ -173,7 +173,7 @@ void PLSelector::setSource( QTreeWidgetItem *item )
...
@@ -173,7 +173,7 @@ void PLSelector::setSource( QTreeWidgetItem *item )
if
(
i_type
==
SD_TYPE
)
if
(
i_type
==
SD_TYPE
)
{
{
pl_item
=
playlist_ChildSearchName
(
THEPL
->
p_root
_category
,
qtu
(
item
->
data
(
0
,
LONGNAME_ROLE
).
toString
()
)
);
pl_item
=
playlist_ChildSearchName
(
THEPL
->
p_root
,
qtu
(
item
->
data
(
0
,
LONGNAME_ROLE
).
toString
()
)
);
if
(
item
->
data
(
0
,
SPECIAL_ROLE
).
toInt
()
==
IS_PODCAST
)
if
(
item
->
data
(
0
,
SPECIAL_ROLE
).
toInt
()
==
IS_PODCAST
)
{
{
if
(
pl_item
&&
!
sd_loaded
)
if
(
pl_item
&&
!
sd_loaded
)
...
@@ -241,11 +241,11 @@ PLSelItem *PLSelector::addPodcastItem( playlist_item_t *p_item )
...
@@ -241,11 +241,11 @@ PLSelItem *PLSelector::addPodcastItem( playlist_item_t *p_item )
void
PLSelector
::
createItems
()
void
PLSelector
::
createItems
()
{
{
PLSelItem
*
pl
=
putPLData
(
addItem
(
PL_ITEM_TYPE
,
qtr
(
"Playlist"
),
true
),
PLSelItem
*
pl
=
putPLData
(
addItem
(
PL_ITEM_TYPE
,
qtr
(
"Playlist"
),
true
),
THEPL
->
p_
local_category
);
THEPL
->
p_
playing
);
pl
->
treeItem
()
->
setData
(
0
,
SPECIAL_ROLE
,
QVariant
(
IS_PL
)
);
pl
->
treeItem
()
->
setData
(
0
,
SPECIAL_ROLE
,
QVariant
(
IS_PL
)
);
PLSelItem
*
ml
=
putPLData
(
addItem
(
PL_ITEM_TYPE
,
qtr
(
"Media Library"
),
true
),
PLSelItem
*
ml
=
putPLData
(
addItem
(
PL_ITEM_TYPE
,
qtr
(
"Media Library"
),
true
),
THEPL
->
p_m
l_catego
ry
);
THEPL
->
p_m
edia_libra
ry
);
ml
->
treeItem
()
->
setData
(
0
,
SPECIAL_ROLE
,
QVariant
(
IS_ML
)
);
ml
->
treeItem
()
->
setData
(
0
,
SPECIAL_ROLE
,
QVariant
(
IS_ML
)
);
QTreeWidgetItem
*
msrc
=
addItem
(
CATEGORY_TYPE
,
qtr
(
"Media Sources"
),
QTreeWidgetItem
*
msrc
=
addItem
(
CATEGORY_TYPE
,
qtr
(
"Media Sources"
),
...
...
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
4e65194e
...
@@ -162,17 +162,14 @@ void StandardPLPanel::handleExpansion( const QModelIndex& index )
...
@@ -162,17 +162,14 @@ void StandardPLPanel::handleExpansion( const QModelIndex& index )
void
StandardPLPanel
::
popupAdd
()
void
StandardPLPanel
::
popupAdd
()
{
{
QMenu
popup
;
QMenu
popup
;
if
(
currentRootId
==
THEPL
->
p_local_category
->
i_id
||
if
(
currentRootId
==
THEPL
->
p_playing
->
i_id
)
currentRootId
==
THEPL
->
p_local_onelevel
->
i_id
)
{
{
popup
.
addAction
(
qtr
(
I_PL_ADDF
),
THEDP
,
SLOT
(
simplePLAppendDialog
())
);
popup
.
addAction
(
qtr
(
I_PL_ADDF
),
THEDP
,
SLOT
(
simplePLAppendDialog
())
);
popup
.
addAction
(
qtr
(
I_PL_ADDDIR
),
THEDP
,
SLOT
(
PLAppendDir
())
);
popup
.
addAction
(
qtr
(
I_PL_ADDDIR
),
THEDP
,
SLOT
(
PLAppendDir
())
);
popup
.
addAction
(
qtr
(
I_OP_ADVOP
),
THEDP
,
SLOT
(
PLAppendDialog
())
);
popup
.
addAction
(
qtr
(
I_OP_ADVOP
),
THEDP
,
SLOT
(
PLAppendDialog
())
);
}
}
else
if
(
(
THEPL
->
p_ml_category
&&
else
if
(
THEPL
->
p_media_library
&&
currentRootId
==
THEPL
->
p_ml_category
->
i_id
)
||
currentRootId
==
THEPL
->
p_media_library
->
i_id
)
(
THEPL
->
p_ml_onelevel
&&
currentRootId
==
THEPL
->
p_ml_onelevel
->
i_id
)
)
{
{
popup
.
addAction
(
qtr
(
I_PL_ADDF
),
THEDP
,
SLOT
(
simpleMLAppendDialog
())
);
popup
.
addAction
(
qtr
(
I_PL_ADDF
),
THEDP
,
SLOT
(
simpleMLAppendDialog
())
);
popup
.
addAction
(
qtr
(
I_PL_ADDDIR
),
THEDP
,
SLOT
(
MLAppendDir
()
)
);
popup
.
addAction
(
qtr
(
I_PL_ADDDIR
),
THEDP
,
SLOT
(
MLAppendDir
()
)
);
...
@@ -246,14 +243,12 @@ void StandardPLPanel::setRoot( playlist_item_t *p_item )
...
@@ -246,14 +243,12 @@ void StandardPLPanel::setRoot( playlist_item_t *p_item )
locationBar
->
setIndex
(
QModelIndex
()
);
locationBar
->
setIndex
(
QModelIndex
()
);
/* enable/disable adding */
/* enable/disable adding */
if
(
p_item
==
THEPL
->
p_local_category
||
if
(
p_item
==
THEPL
->
p_playing
)
p_item
==
THEPL
->
p_local_onelevel
)
{
{
addButton
->
setEnabled
(
true
);
addButton
->
setEnabled
(
true
);
addButton
->
setToolTip
(
qtr
(
I_PL_ADDPL
)
);
addButton
->
setToolTip
(
qtr
(
I_PL_ADDPL
)
);
}
}
else
if
(
(
THEPL
->
p_ml_category
&&
p_item
==
THEPL
->
p_ml_category
)
||
else
if
(
THEPL
->
p_media_library
&&
p_item
==
THEPL
->
p_media_library
)
(
THEPL
->
p_ml_onelevel
&&
p_item
==
THEPL
->
p_ml_onelevel
)
)
{
{
addButton
->
setEnabled
(
true
);
addButton
->
setEnabled
(
true
);
addButton
->
setToolTip
(
qtr
(
I_PL_ADDML
)
);
addButton
->
setToolTip
(
qtr
(
I_PL_ADDML
)
);
...
...
modules/gui/qt4/dialogs_provider.cpp
View file @
4e65194e
...
@@ -565,7 +565,7 @@ void DialogsProvider::saveAPlaylist()
...
@@ -565,7 +565,7 @@ void DialogsProvider::saveAPlaylist()
if
(
selected
==
qfu
(
vlc_gettext
(
types
[
i
].
filter
)
)
)
if
(
selected
==
qfu
(
vlc_gettext
(
types
[
i
].
filter
)
)
)
{
{
playlist_Export
(
THEPL
,
qtu
(
toNativeSeparators
(
file
)
),
playlist_Export
(
THEPL
,
qtu
(
toNativeSeparators
(
file
)
),
THEPL
->
p_
local_category
,
types
[
i
].
module
);
THEPL
->
p_
playing
,
types
[
i
].
module
);
break
;
break
;
}
}
}
}
...
...
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