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
36f82683
Commit
36f82683
authored
Jan 19, 2011
by
Erwan Tulou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skins2(playlist): cosmetics + avoid objects passed as value if not needed
parent
7647873a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
19 deletions
+14
-19
modules/gui/skins2/utils/var_tree.cpp
modules/gui/skins2/utils/var_tree.cpp
+8
-10
modules/gui/skins2/utils/var_tree.hpp
modules/gui/skins2/utils/var_tree.hpp
+6
-9
No files found.
modules/gui/skins2/utils/var_tree.cpp
View file @
36f82683
...
...
@@ -39,8 +39,7 @@ VarTree::VarTree( intf_thread_t *pIntf )
VarTree
::
VarTree
(
intf_thread_t
*
pIntf
,
VarTree
*
pParent
,
int
id
,
const
UStringPtr
&
rcString
,
bool
selected
,
bool
playing
,
bool
expanded
,
bool
readonly
,
void
*
pData
)
bool
expanded
,
bool
readonly
,
void
*
pData
)
:
Variable
(
pIntf
),
m_id
(
id
),
m_cString
(
rcString
),
m_selected
(
selected
),
m_playing
(
playing
),
m_expanded
(
expanded
),
m_deleted
(
false
),
m_pData
(
pData
),
m_pParent
(
pParent
),
...
...
@@ -57,8 +56,7 @@ VarTree::~VarTree()
}
void
VarTree
::
add
(
int
id
,
const
UStringPtr
&
rcString
,
bool
selected
,
bool
playing
,
bool
expanded
,
bool
readonly
,
void
*
pData
)
bool
playing
,
bool
expanded
,
bool
readonly
,
void
*
pData
)
{
m_children
.
push_back
(
VarTree
(
getIntf
(),
this
,
id
,
rcString
,
selected
,
playing
,
expanded
,
readonly
,
...
...
@@ -268,7 +266,7 @@ VarTree::Iterator VarTree::getNextVisibleItem( Iterator it )
}
else
{
VarTree
::
Iterator
it_old
=
it
;
Iterator
it_old
=
it
;
++
it
;
// Was 'it' the last brother? If so, look for uncles
if
(
it_old
->
parent
()
&&
it_old
->
parent
()
->
end
()
==
it
)
...
...
@@ -281,7 +279,7 @@ VarTree::Iterator VarTree::getNextVisibleItem( Iterator it )
VarTree
::
Iterator
VarTree
::
getPrevVisibleItem
(
Iterator
it
)
{
VarTree
::
Iterator
it_old
=
it
;
Iterator
it_old
=
it
;
if
(
it
==
root
()
->
begin
()
||
it
==
++
(
root
()
->
begin
())
)
return
it
;
/* Was it the first child of its parent ? */
...
...
@@ -310,7 +308,7 @@ VarTree::Iterator VarTree::getNextItem( Iterator it )
}
else
{
VarTree
::
Iterator
it_old
=
it
;
Iterator
it_old
=
it
;
++
it
;
// Was 'it' the last brother? If so, look for uncles
if
(
it_old
->
parent
()
&&
it_old
->
parent
()
->
end
()
==
it
)
...
...
@@ -323,7 +321,7 @@ VarTree::Iterator VarTree::getNextItem( Iterator it )
VarTree
::
Iterator
VarTree
::
getPrevItem
(
Iterator
it
)
{
VarTree
::
Iterator
it_old
=
it
;
Iterator
it_old
=
it
;
if
(
it
==
root
()
->
begin
()
||
it
==
++
(
root
()
->
begin
())
)
return
it
;
/* Was it the first child of its parent ? */
...
...
@@ -380,7 +378,7 @@ VarTree::Iterator VarTree::findById( int id )
}
void
VarTree
::
ensureExpanded
(
VarTree
::
Iterator
it
)
void
VarTree
::
ensureExpanded
(
const
Iterator
&
it
)
{
/// Don't expand ourselves, only our parents
VarTree
*
current
=
&
(
*
it
);
...
...
@@ -422,7 +420,7 @@ void VarTree::cascadeDelete()
}
}
int
VarTree
::
getRank
(
Iterator
item
,
bool
flat
)
int
VarTree
::
getRank
(
const
Iterator
&
item
,
bool
flat
)
{
int
index
=
1
;
Iterator
it
;
...
...
modules/gui/skins2/utils/var_tree.hpp
View file @
36f82683
...
...
@@ -57,7 +57,7 @@ public:
VarTree
(
intf_thread_t
*
pIntf
,
VarTree
*
pParent
,
int
id
,
const
UStringPtr
&
rcString
,
bool
selected
,
bool
playing
,
bool
expanded
,
bool
readonly
,
void
*
pData
);
bool
expanded
,
bool
readonly
,
void
*
pData
);
virtual
~
VarTree
();
...
...
@@ -66,8 +66,7 @@ public:
/// Add a pointer on string in the children's list
virtual
void
add
(
int
id
,
const
UStringPtr
&
rcString
,
bool
selected
,
bool
playing
,
bool
expanded
,
bool
readonly
,
void
*
pData
);
bool
playing
,
bool
expanded
,
bool
readonly
,
void
*
pData
);
/// Remove the selected item from the children's list
virtual
void
delSelected
();
...
...
@@ -128,10 +127,8 @@ public:
/// Get first leaf
Iterator
firstLeaf
();
void
removeChild
(
VarTree
::
Iterator
item
)
{
m_children
.
erase
(
item
);
}
/// Remove a child
void
removeChild
(
Iterator
it
)
{
m_children
.
erase
(
it
);
}
/// Execute the action associated to this item
virtual
void
action
(
VarTree
*
pItem
)
{
}
...
...
@@ -175,13 +172,13 @@ public:
Iterator
getPrevLeaf
(
Iterator
it
);
/// return rank of visible item starting from 1
int
getRank
(
Iterator
it
,
bool
flat
);
int
getRank
(
const
Iterator
&
it
,
bool
flat
);
/// Find a children node with the given id
Iterator
findById
(
int
id
);
/// Ensure an item is expanded
void
ensureExpanded
(
VarTree
::
Iterator
);
void
ensureExpanded
(
const
Iterator
&
it
);
/// flag a whole subtree for deletion
void
cascadeDelete
();
...
...
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