Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nheko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
nheko
Commits
21eb312f
Commit
21eb312f
authored
3 years ago
by
Loren Burkholder
Browse files
Options
Downloads
Patches
Plain Diff
Only run spinner while loading members
parent
a7bdbc2a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
resources/qml/RoomMembers.qml
+1
-1
1 addition, 1 deletion
resources/qml/RoomMembers.qml
src/MemberList.cpp
+6
-0
6 additions, 0 deletions
src/MemberList.cpp
src/MemberList.h
+4
-0
4 additions, 0 deletions
src/MemberList.h
with
11 additions
and
1 deletion
resources/qml/RoomMembers.qml
+
1
−
1
View file @
21eb312f
...
...
@@ -116,7 +116,7 @@ ApplicationWindow {
}
footer
:
Spinner
{
visible
:
members
.
numUsersLoaded
<
members
.
memberCount
visible
:
members
.
numUsersLoaded
<
members
.
memberCount
&&
members
.
loadingMoreMembers
// use the default height if it's visible, otherwise no height at all
height
:
visible
?
undefined
:
0
anchors.centerIn
:
parent
...
...
This diff is collapsed.
Click to expand it.
src/MemberList.cpp
+
6
−
0
View file @
21eb312f
...
...
@@ -98,8 +98,14 @@ MemberList::canFetchMore(const QModelIndex &) const
void
MemberList
::
fetchMore
(
const
QModelIndex
&
)
{
loadingMoreMembers_
=
true
;
emit
loadingMoreMembersChanged
();
auto
members
=
cache
::
getMembers
(
room_id_
.
toStdString
(),
rowCount
());
addUsers
(
members
);
numUsersLoaded_
+=
members
.
size
();
emit
numUsersLoadedChanged
();
loadingMoreMembers_
=
false
;
emit
loadingMoreMembersChanged
();
}
This diff is collapsed.
Click to expand it.
src/MemberList.h
+
4
−
0
View file @
21eb312f
...
...
@@ -16,6 +16,7 @@ class MemberList : public QAbstractListModel
Q_PROPERTY
(
QString
avatarUrl
READ
avatarUrl
NOTIFY
avatarUrlChanged
)
Q_PROPERTY
(
QString
roomId
READ
roomId
NOTIFY
roomIdChanged
)
Q_PROPERTY
(
int
numUsersLoaded
READ
numUsersLoaded
NOTIFY
numUsersLoadedChanged
)
Q_PROPERTY
(
bool
loadingMoreMembers
READ
loadingMoreMembers
NOTIFY
loadingMoreMembersChanged
)
public:
enum
Roles
...
...
@@ -39,6 +40,7 @@ public:
QString
avatarUrl
()
const
{
return
QString
::
fromStdString
(
info_
.
avatar_url
);
}
QString
roomId
()
const
{
return
room_id_
;
}
int
numUsersLoaded
()
const
{
return
numUsersLoaded_
;
}
bool
loadingMoreMembers
()
const
{
return
loadingMoreMembers_
;
}
signals
:
void
roomNameChanged
();
...
...
@@ -46,6 +48,7 @@ signals:
void
avatarUrlChanged
();
void
roomIdChanged
();
void
numUsersLoadedChanged
();
void
loadingMoreMembersChanged
();
public
slots
:
void
addUsers
(
const
std
::
vector
<
RoomMember
>
&
users
);
...
...
@@ -59,4 +62,5 @@ private:
QString
room_id_
;
RoomInfo
info_
;
int
numUsersLoaded_
{
0
};
bool
loadingMoreMembers_
{
false
};
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment