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
255acda2
Commit
255acda2
authored
May 10, 2011
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt, playlist view: code simplification
parent
0b90ef31
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
31 deletions
+21
-31
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+21
-30
modules/gui/qt4/components/playlist/standardpanel.hpp
modules/gui/qt4/components/playlist/standardpanel.hpp
+0
-1
No files found.
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
255acda2
...
...
@@ -74,13 +74,7 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
lastActivatedId
=
-
1
;
/* Saved Settings */
getSettings
()
->
beginGroup
(
"Playlist"
);
int
i_savedViewMode
=
getSettings
()
->
value
(
"view-mode"
,
TREE_VIEW
).
toInt
();
getSettings
()
->
endGroup
();
/* Limit the saved value to a possible one inside [0, VIEW_COUNT[ */
if
(
i_savedViewMode
<
0
||
i_savedViewMode
>=
VIEW_COUNT
)
i_savedViewMode
=
0
;
int
i_savedViewMode
=
getSettings
()
->
value
(
"Playlist/view-mode"
,
TREE_VIEW
).
toInt
();
showView
(
i_savedViewMode
);
DCONNECT
(
THEMIM
,
leafBecameParent
(
input_item_t
*
),
...
...
@@ -88,7 +82,7 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
CONNECT
(
model
,
currentChanged
(
const
QModelIndex
&
),
this
,
handleExpansion
(
const
QModelIndex
&
)
);
CONNECT
(
model
,
rootChanged
(),
this
,
handleRootChange
()
);
CONNECT
(
model
,
rootChanged
(),
this
,
browseInto
()
);
setRoot
(
p_root
,
false
);
}
...
...
@@ -123,11 +117,6 @@ void StandardPLPanel::handleExpansion( const QModelIndex& index )
currentView
->
scrollTo
(
index
);
}
void
StandardPLPanel
::
handleRootChange
()
{
browseInto
();
}
void
StandardPLPanel
::
popupPlView
(
const
QPoint
&
point
)
{
QModelIndex
index
=
currentView
->
indexAt
(
point
);
...
...
@@ -145,9 +134,8 @@ void StandardPLPanel::popupSelectColumn( QPoint pos )
assert
(
treeView
);
/* We do not offer the option to hide index 0 column, or
* QTreeView will behave weird */
int
i
,
j
;
for
(
i
=
1
<<
1
,
j
=
1
;
i
<
COLUMN_END
;
i
<<=
1
,
j
++
)
* QTreeView will behave weird */
for
(
int
i
=
1
<<
1
,
j
=
1
;
i
<
COLUMN_END
;
i
<<=
1
,
j
++
)
{
QAction
*
option
=
menu
.
addAction
(
qfu
(
psz_column_title
(
i
)
)
);
option
->
setCheckable
(
true
);
...
...
@@ -171,7 +159,9 @@ void StandardPLPanel::search( const QString& searchText )
p_selector
->
getCurrentSelectedItem
(
&
type
,
&
name
);
if
(
type
!=
SD_TYPE
)
{
bool
flat
=
currentView
==
iconView
||
currentView
==
listView
||
currentView
==
picFlowView
;
bool
flat
=
(
currentView
==
iconView
||
currentView
==
listView
||
currentView
==
picFlowView
);
model
->
search
(
searchText
,
flat
?
currentView
->
rootIndex
()
:
QModelIndex
(),
!
flat
);
...
...
@@ -187,7 +177,8 @@ void StandardPLPanel::searchDelayed( const QString& searchText )
if
(
type
==
SD_TYPE
)
{
if
(
!
name
.
isEmpty
()
&&
!
searchText
.
isEmpty
()
)
playlist_ServicesDiscoveryControl
(
THEPL
,
qtu
(
name
),
SD_CMD_SEARCH
,
qtu
(
searchText
)
);
playlist_ServicesDiscoveryControl
(
THEPL
,
qtu
(
name
),
SD_CMD_SEARCH
,
qtu
(
searchText
)
);
}
}
...
...
@@ -222,11 +213,11 @@ void StandardPLPanel::browseInto( const QModelIndex &index )
emit
viewChanged
(
index
);
}
void
StandardPLPanel
::
browseInto
(
)
void
StandardPLPanel
::
browseInto
()
{
browseInto
(
currentRootIndexId
!=
-
1
&&
currentView
!=
treeView
?
model
->
index
(
currentRootIndexId
,
0
)
:
QModelIndex
()
);
browseInto
(
(
currentRootIndexId
!=
-
1
&&
currentView
!=
treeView
)
?
model
->
index
(
currentRootIndexId
,
0
)
:
QModelIndex
()
);
}
void
StandardPLPanel
::
wheelEvent
(
QWheelEvent
*
e
)
...
...
@@ -372,13 +363,6 @@ void StandardPLPanel::showView( int i_view )
switch
(
i_view
)
{
case
TREE_VIEW
:
{
if
(
treeView
==
NULL
)
createTreeView
();
currentView
=
treeView
;
break
;
}
case
ICON_VIEW
:
{
if
(
iconView
==
NULL
)
...
...
@@ -400,7 +384,14 @@ void StandardPLPanel::showView( int i_view )
currentView
=
picFlowView
;
break
;
}
default:
return
;
default:
case
TREE_VIEW
:
{
if
(
treeView
==
NULL
)
createTreeView
();
currentView
=
treeView
;
break
;
}
}
changeModel
(
false
);
...
...
modules/gui/qt4/components/playlist/standardpanel.hpp
View file @
255acda2
...
...
@@ -109,7 +109,6 @@ public slots:
private
slots
:
void
deleteSelection
();
void
handleExpansion
(
const
QModelIndex
&
);
void
handleRootChange
();
void
activate
(
const
QModelIndex
&
);
void
browseInto
();
...
...
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