Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qtTsOverlay
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
C-Fu
qtTsOverlay
Commits
730008ac
Commit
730008ac
authored
Mar 04, 2017
by
Carsten Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed order problem
parent
7e76e934
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
9 deletions
+30
-9
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
+29
-9
plugin.h
plugin.h
+1
-0
No files found.
Release/x64/qtTsOverlay_x64.dll
View file @
730008ac
No preview for this file type
Release/x64/qtTsOverlay_x64.exp
View file @
730008ac
No preview for this file type
Release/x64/qtTsOverlay_x64.lib
View file @
730008ac
No preview for this file type
overlaycontroller.cpp
View file @
730008ac
...
...
@@ -4,6 +4,7 @@
#include "plugin.h"
#include <qdebug.h>
#include "teamspeak\public_errors.h"
#include <QRegExp>
//#ifndef _DEBUG
...
...
@@ -43,6 +44,7 @@ OverlayController::OverlayController(const struct TS3Functions funcs, quint64 se
m_SCHID
=
serverConnectionHandlerID
;
m_tree
=
new
ChannelListWidget
;
connect
(
m_tree
->
getTree
(),
&
QTreeWidget
::
itemDoubleClicked
,
this
,
&
OverlayController
::
treeItemClicked
);
}
OverlayController
::~
OverlayController
()
...
...
@@ -218,20 +220,17 @@ void OverlayController::updateChannelList()
void
OverlayController
::
displayChannelList
()
{
// remove old stuff
while
(
int
nb
=
m_tree
->
getTree
()
->
topLevelItemCount
())
{
auto
item
=
m_tree
->
getTree
()
->
takeTopLevelItem
(
nb
-
1
);
disconnect
(
m_tree
->
getTree
(),
&
QTreeWidget
::
itemDoubleClicked
,
this
,
&
OverlayController
::
treeItemClicked
);
delete
item
;
}
delete
m_tree
->
getTree
()
->
takeTopLevelItem
(
nb
-
1
);
// get list of all channelIDs
uint64
*
channelIDList
;
if
(
ts3
.
getChannelList
(
m_SCHID
,
&
channelIDList
)
!=
ERROR_ok
)
return
;
// get a list of all channels containing name, id, parent,..
QVector
<
channelInfo
>
channelList
;
// get Channels
int
i
(
0
);
while
(
channelIDList
[
i
]
!=
NULL
)
{
...
...
@@ -246,7 +245,10 @@ void OverlayController::displayChannelList()
tmp
.
entry
->
setData
(
0
,
Qt
::
DisplayRole
,
tmp
.
name
);
tmp
.
entry
->
setData
(
1
,
Qt
::
UserRole
,
tmp
.
id
);
if
(
tmp
.
name
.
startsWith
(
'['
)
&&
tmp
.
name
.
contains
(
"spacer"
))
{
tmp
.
entry
->
setData
(
2
,
Qt
::
UserRole
,
spacer
);
tmp
.
name
=
tmp
.
name
.
remove
(
QRegularExpression
(
""
));
}
else
tmp
.
entry
->
setData
(
2
,
Qt
::
UserRole
,
channel
);
...
...
@@ -254,13 +256,31 @@ void OverlayController::displayChannelList()
i
++
;
}
// sort the list
qSort
(
channelList
.
begin
(),
channelList
.
end
(),
[](
const
channelInfo
&
a
,
const
channelInfo
&
b
)
{
return
a
.
order
<
b
.
order
;
});
QVector
<
channelInfo
>
topLvlList
;
for
(
int
i
=
0
;
i
<
channelList
.
size
();
i
++
)
if
(
channelList
[
i
].
parent
==
0
)
topLvlList
.
push_back
(
channelList
[
i
]);
int
next
=
0
;
while
(
!
topLvlList
.
isEmpty
())
{
int
i
;
for
(
i
=
0
;
i
<
topLvlList
.
size
();
i
++
)
if
(
topLvlList
[
i
].
order
==
next
)
break
;
next
=
topLvlList
[
i
].
id
;
m_tree
->
getTree
()
->
addTopLevelItem
(
topLvlList
.
takeAt
(
i
).
entry
);
}
// build tree structure
for
(
auto
&
it
:
channelList
)
{
if
(
it
.
parent
==
0
)
m_tree
->
getTree
()
->
addTopLevelItem
(
it
.
entry
)
;
continue
;
else
{
bool
found
(
false
);
...
...
@@ -300,8 +320,8 @@ void OverlayController::displayChannelList()
}
}
// display everything
m_tree
->
getTree
()
->
expandAll
();
connect
(
m_tree
->
getTree
(),
&
QTreeWidget
::
itemDoubleClicked
,
this
,
&
OverlayController
::
treeItemClicked
);
m_tree
->
getTree
()
->
adjustSize
();
m_tree
->
adjustSize
();
m_tree
->
show
();
...
...
plugin.h
View file @
730008ac
...
...
@@ -8,6 +8,7 @@
#define PLUGIN_H
#include <qstring.h>
#include "overlaycontroller.h"
#include <Windows.h>
#ifdef WIN32
#define PLUGINS_EXPORTDLL __declspec(dllexport)
...
...
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