summary refs log tree commit diff
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-10-23 00:19:35 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-10-23 00:19:35 +0300
commitc6e1068e0e1cb8ff5d5982ccd1683b1900dd7114 (patch)
treeb819b0664f4e95004237d00a4ea3a16e0a4677d6
parentUse callbacks on MatrixClient (diff)
downloadnheko-c6e1068e0e1cb8ff5d5982ccd1683b1900dd7114.tar.xz
Lint
-rw-r--r--include/RoomSettings.h5
-rw-r--r--include/ui/LoadingIndicator.h20
-rw-r--r--src/ChatPage.cc3
-rw-r--r--src/EmojiItemDelegate.cc5
-rw-r--r--src/ui/ThemeManager.cc5
5 files changed, 9 insertions, 29 deletions
diff --git a/include/RoomSettings.h b/include/RoomSettings.h

index d9ecff99..d67e406a 100644 --- a/include/RoomSettings.h +++ b/include/RoomSettings.h
@@ -35,10 +35,7 @@ public: settings.setValue(path_, isNotificationsEnabled_); }; - bool isNotificationsEnabled() - { - return isNotificationsEnabled_; - }; + bool isNotificationsEnabled() { return isNotificationsEnabled_; }; void toggleNotifications() { diff --git a/include/ui/LoadingIndicator.h b/include/ui/LoadingIndicator.h
index 2641955a..75920dd8 100644 --- a/include/ui/LoadingIndicator.h +++ b/include/ui/LoadingIndicator.h
@@ -19,23 +19,11 @@ public: void start(); void stop(); - QColor color() - { - return color_; - } - void setColor(QColor color) - { - color_ = color; - } + QColor color() { return color_; } + void setColor(QColor color) { color_ = color; } - int interval() - { - return interval_; - } - void setInterval(int interval) - { - interval_ = interval; - } + int interval() { return interval_; } + void setInterval(int interval) { interval_ = interval; } private slots: void onTimeout(); diff --git a/src/ChatPage.cc b/src/ChatPage.cc
index 65fef9de..d087c3f3 100644 --- a/src/ChatPage.cc +++ b/src/ChatPage.cc
@@ -32,6 +32,7 @@ #include "StateEvent.h" constexpr int MAX_INITIAL_SYNC_FAILURES = 5; +constexpr int SYNC_RETRY_TIMEOUT = 10000; namespace events = matrix::events; @@ -347,7 +348,7 @@ ChatPage::syncFailed(const QString &msg) return; qWarning() << "Sync error:" << msg; - client_->sync(); + QTimer::singleShot(SYNC_RETRY_TIMEOUT, this, [=]() { client_->sync(); }); } // TODO: Should be moved in another class that manages this global list. diff --git a/src/EmojiItemDelegate.cc b/src/EmojiItemDelegate.cc
index 9fd4600d..691bee17 100644 --- a/src/EmojiItemDelegate.cc +++ b/src/EmojiItemDelegate.cc
@@ -26,10 +26,7 @@ EmojiItemDelegate::EmojiItemDelegate(QObject *parent) data_ = new Emoji; } -EmojiItemDelegate::~EmojiItemDelegate() -{ - delete data_; -} +EmojiItemDelegate::~EmojiItemDelegate() { delete data_; } void EmojiItemDelegate::paint(QPainter *painter, diff --git a/src/ui/ThemeManager.cc b/src/ui/ThemeManager.cc
index 172ddc41..7baed1f3 100644 --- a/src/ui/ThemeManager.cc +++ b/src/ui/ThemeManager.cc
@@ -2,10 +2,7 @@ #include "ThemeManager.h" -ThemeManager::ThemeManager() -{ - setTheme(new Theme); -} +ThemeManager::ThemeManager() { setTheme(new Theme); } void ThemeManager::setTheme(Theme *theme)