Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
C-Fu
qtTsOverlay
Commits
a85c25c3
Commit
a85c25c3
authored
Mar 05, 2017
by
Carsten Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
everything in correct order now
parent
49efc53a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
30 deletions
+28
-30
Release/x64/qtTsOverlay_x64.dll
Release/x64/qtTsOverlay_x64.dll
+0
-0
Release/x64/qtTsOverlay_x64.exp
Release/x64/qtTsOverlay_x64.exp
+0
-0
Release/x64/qtTsOverlay_x64.lib
Release/x64/qtTsOverlay_x64.lib
+0
-0
overlaycontroller.cpp
overlaycontroller.cpp
+28
-30
No files found.
Release/x64/qtTsOverlay_x64.dll
View file @
a85c25c3
No preview for this file type
Release/x64/qtTsOverlay_x64.exp
View file @
a85c25c3
No preview for this file type
Release/x64/qtTsOverlay_x64.lib
View file @
a85c25c3
No preview for this file type
overlaycontroller.cpp
View file @
a85c25c3
...
...
@@ -11,7 +11,7 @@
//#pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" )
//#endif
struct
c
hannelInfo
{
struct
C
hannelInfo
{
uint64
id
;
QString
name
;
uint64
parent
;
...
...
@@ -230,11 +230,11 @@ void OverlayController::displayChannelList()
return
;
// get a list of all channels containing name, id, parent,..
QVector
<
c
hannelInfo
>
channelList
;
QVector
<
C
hannelInfo
>
channelList
;
int
i
(
0
);
while
(
channelIDList
[
i
]
!=
NULL
)
{
c
hannelInfo
tmp
;
C
hannelInfo
tmp
;
tmp
.
id
=
channelIDList
[
i
];
tmp
.
name
=
channelID2Name
(
m_SCHID
,
channelIDList
[
i
]);
ts3
.
getChannelVariableAsInt
(
m_SCHID
,
tmp
.
id
,
CHANNEL_ORDER
,
&
tmp
.
order
);
...
...
@@ -255,13 +255,36 @@ void OverlayController::displayChannelList()
i
++
;
}
// for every channel
for
(
auto
&
parent
:
channelList
)
{
// collect all childs
QVector
<
ChannelInfo
>
childs
;
for
(
auto
&
child
:
channelList
)
if
(
child
.
parent
==
parent
.
id
)
childs
.
push_back
(
child
);
// add childs in correct order
int
prevID
(
0
);
while
(
!
childs
.
isEmpty
())
{
int
i
;
for
(
i
=
0
;
i
<
childs
.
size
();
i
++
)
if
(
childs
[
i
].
order
==
prevID
)
break
;
prevID
=
childs
[
i
].
id
;
parent
.
entry
->
addChild
(
childs
.
takeAt
(
i
).
entry
);
}
}
// get all toplvl channels
QVector
<
c
hannelInfo
>
topLvlList
;
QVector
<
C
hannelInfo
>
topLvlList
;
for
(
auto
&
it
:
channelList
)
if
(
it
.
parent
==
0
)
topLvlList
.
push_back
(
it
);
//
sort the toplvl channels
//
add toplvl to tree in correct order
int
prevID
=
0
;
while
(
!
topLvlList
.
isEmpty
())
{
...
...
@@ -274,31 +297,6 @@ void OverlayController::displayChannelList()
m_tree
->
getTree
()
->
addTopLevelItem
(
topLvlList
.
takeAt
(
i
).
entry
);
}
// build tree structure
for
(
auto
&
it
:
channelList
)
{
if
(
it
.
parent
==
0
)
continue
;
else
{
bool
found
(
false
);
for
(
auto
&
it2
:
channelList
)
{
if
(
it
.
parent
==
it2
.
id
)
{
it2
.
entry
->
addChild
(
it
.
entry
);
found
=
true
;
break
;
}
}
if
(
!
found
)
{
debugPrint
(
QString
(
"%1: parent %2 not found"
).
arg
(
it
.
name
).
arg
(
it
.
parent
));
delete
it
.
entry
;
}
}
}
// insert clients
for
(
auto
&
it
:
channelList
)
{
...
...
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