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
9b60fdd6
Commit
9b60fdd6
authored
7 years ago
by
Konstantinos Sideris
Browse files
Options
Downloads
Patches
Plain Diff
Remove sync timer
parent
3205e5fd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/ChatPage.h
+0
-3
0 additions, 3 deletions
include/ChatPage.h
src/ChatPage.cc
+5
-20
5 additions, 20 deletions
src/ChatPage.cc
with
5 additions
and
23 deletions
include/ChatPage.h
+
0
−
3
View file @
9b60fdd6
...
...
@@ -37,7 +37,6 @@
constexpr
int
CONSENSUS_TIMEOUT
=
1000
;
constexpr
int
SHOW_CONTENT_TIMEOUT
=
3000
;
constexpr
int
SYNC_INTERVAL
=
2000
;
class
ChatPage
:
public
QWidget
{
...
...
@@ -66,7 +65,6 @@ private slots:
void
syncCompleted
(
const
SyncResponse
&
response
);
void
syncFailed
(
const
QString
&
msg
);
void
changeTopRoomInfo
(
const
QString
&
room_id
);
void
startSync
();
void
logout
();
void
addRoom
(
const
QString
&
room_id
);
void
removeRoom
(
const
QString
&
room_id
);
...
...
@@ -106,7 +104,6 @@ private:
// Safety net if consensus is not possible or too slow.
QTimer
*
showContentTimer_
;
QTimer
*
consensusTimer_
;
QTimer
*
syncTimer_
;
QString
current_room_
;
QMap
<
QString
,
QPixmap
>
room_avatars_
;
...
...
This diff is collapsed.
Click to expand it.
src/ChatPage.cc
+
5
−
20
View file @
9b60fdd6
...
...
@@ -111,10 +111,6 @@ ChatPage::ChatPage(QSharedPointer<MatrixClient> client, QWidget *parent)
user_info_widget_
=
new
UserInfoWidget
(
sideBarTopWidget_
);
sideBarTopWidgetLayout_
->
addWidget
(
user_info_widget_
);
syncTimer_
=
new
QTimer
(
this
);
syncTimer_
->
setSingleShot
(
true
);
connect
(
syncTimer_
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
startSync
()));
connect
(
user_info_widget_
,
SIGNAL
(
logout
()),
client_
.
data
(),
SLOT
(
logout
()));
connect
(
client_
.
data
(),
SIGNAL
(
loggedOut
()),
this
,
SLOT
(
logout
()));
...
...
@@ -243,8 +239,6 @@ ChatPage::ChatPage(QSharedPointer<MatrixClient> client, QWidget *parent)
void
ChatPage
::
logout
()
{
syncTimer_
->
stop
();
// Delete all config parameters.
QSettings
settings
;
settings
.
beginGroup
(
"auth"
);
...
...
@@ -302,12 +296,6 @@ ChatPage::bootstrap(QString userid, QString homeserver, QString token)
client_
->
initialSync
();
}
void
ChatPage
::
startSync
()
{
client_
->
sync
();
}
void
ChatPage
::
setOwnAvatar
(
const
QPixmap
&
img
)
{
...
...
@@ -322,7 +310,7 @@ ChatPage::syncFailed(const QString &msg)
return
;
qWarning
()
<<
"Sync error:"
<<
msg
;
syncTimer_
->
start
(
SYNC_INTERVAL
);
client_
->
sync
(
);
}
// TODO: Should be moved in another class that manages this global list.
...
...
@@ -419,7 +407,7 @@ ChatPage::syncCompleted(const SyncResponse &response)
room_list_
->
sync
(
state_manager_
);
view_manager_
->
sync
(
response
.
rooms
());
syncTimer_
->
start
(
SYNC_INTERVAL
);
client_
->
sync
(
);
}
void
...
...
@@ -472,7 +460,7 @@ ChatPage::initialSyncCompleted(const SyncResponse &response)
// Initialize room list.
room_list_
->
setInitialRooms
(
settingsManager_
,
state_manager_
);
syncTimer_
->
start
(
SYNC_INTERVAL
);
client_
->
sync
(
);
emit
contentLoaded
();
}
...
...
@@ -585,7 +573,7 @@ ChatPage::loadStateFromCache()
showContentTimer_
->
start
(
SHOW_CONTENT_TIMEOUT
);
// Start receiving events.
syncTimer_
->
start
(
SYNC_INTERVAL
);
client_
->
sync
(
);
}
void
...
...
@@ -682,7 +670,4 @@ ChatPage::updateTypingUsers(const QString &roomid, const QList<QString> &user_id
typingUsers_
.
insert
(
roomid
,
users
);
}
ChatPage
::~
ChatPage
()
{
syncTimer_
->
stop
();
}
ChatPage
::~
ChatPage
()
{}
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