summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-10-22 19:03:55 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-10-22 19:03:55 +0300
commitc0e55378c31321e2ab7a117cefb3bd63a609e474 (patch)
treeef6f08864d713a4fc6dc49b24018156abfdec048 /include
parent160fe1d668d9c1fa8f089cec34df29c2ba31a56f (diff)
Remove extra inline keywords
Diffstat (limited to 'include')
-rw-r--r--include/Cache.h19
-rw-r--r--include/EmojiCategory.h11
-rw-r--r--include/Login.h40
-rw-r--r--include/MatrixClient.h51
-rw-r--r--include/Profile.h16
-rw-r--r--include/Register.h40
-rw-r--r--include/RoomInfoListItem.h44
-rw-r--r--include/RoomMessages.h24
-rw-r--r--include/RoomState.h24
-rw-r--r--include/Sync.h160
-rw-r--r--include/TextInputWidget.h8
-rw-r--r--include/TimelineItem.h8
-rw-r--r--include/TimelineView.h16
-rw-r--r--include/TopRoomBar.h36
-rw-r--r--include/events/AliasesEventContent.h7
-rw-r--r--include/events/AvatarEventContent.h7
-rw-r--r--include/events/CanonicalAliasEventContent.h7
-rw-r--r--include/events/CreateEventContent.h7
-rw-r--r--include/events/Event.h4
-rw-r--r--include/events/HistoryVisibilityEventContent.h7
-rw-r--r--include/events/JoinRulesEventContent.h7
-rw-r--r--include/events/MemberEventContent.h23
-rw-r--r--include/events/MessageEvent.h2
-rw-r--r--include/events/MessageEventContent.h7
-rw-r--r--include/events/NameEventContent.h7
-rw-r--r--include/events/PowerLevelsEventContent.h55
-rw-r--r--include/events/RoomEvent.h8
-rw-r--r--include/events/StateEvent.h4
-rw-r--r--include/events/TopicEventContent.h7
-rw-r--r--include/events/messages/Audio.h16
-rw-r--r--include/events/messages/File.h25
-rw-r--r--include/events/messages/Image.h16
-rw-r--r--include/events/messages/Location.h16
-rw-r--r--include/events/messages/Video.h16
34 files changed, 106 insertions, 639 deletions
diff --git a/include/Cache.h b/include/Cache.h
index 3a98fddc..69d880f5 100644
--- a/include/Cache.h
+++ b/include/Cache.h
@@ -33,8 +33,8 @@ public:
QString nextBatchToken() const;
QMap<QString, RoomState> states();
- inline void deleteData();
- inline void unmount();
+ void deleteData();
+ void unmount() { isMounted_ = false; };
void removeRoom(const QString &roomid);
void setup();
@@ -52,18 +52,3 @@ private:
QString userId_;
QString cacheDirectory_;
};
-
-inline void
-Cache::unmount()
-{
- isMounted_ = false;
-}
-
-inline void
-Cache::deleteData()
-{
- qInfo() << "Deleting cache data";
-
- if (!cacheDirectory_.isEmpty())
- QDir(cacheDirectory_).removeRecursively();
-}
diff --git a/include/EmojiCategory.h b/include/EmojiCategory.h
index e17b110b..154ad8f4 100644
--- a/include/EmojiCategory.h
+++ b/include/EmojiCategory.h
@@ -39,7 +39,10 @@ signals:
void emojiSelected(const QString &emoji);
private slots:
- inline void clickIndex(const QModelIndex &);
+ void clickIndex(const QModelIndex &index)
+ {
+ emit emojiSelected(index.data(Qt::UserRole).toString());
+ };
private:
QVBoxLayout *mainLayout_;
@@ -52,9 +55,3 @@ private:
QLabel *category_;
};
-
-inline void
-EmojiCategory::clickIndex(const QModelIndex &index)
-{
- emit emojiSelected(index.data(Qt::UserRole).toString());
-}
diff --git a/include/Login.h b/include/Login.h
index ceca4ebf..2f74fab2 100644
--- a/include/Login.h
+++ b/include/Login.h
@@ -29,55 +29,25 @@ public:
QByteArray serialize() noexcept;
- inline void setPassword(QString password);
- inline void setUser(QString username);
+ void setPassword(QString password) { password_ = password; };
+ void setUser(QString username) { user_ = username; };
private:
QString user_;
QString password_;
};
-inline void
-LoginRequest::setPassword(QString password)
-{
- password_ = password;
-}
-
-inline void
-LoginRequest::setUser(QString username)
-{
- user_ = username;
-}
-
class LoginResponse : public Deserializable
{
public:
void deserialize(const QJsonDocument &data) override;
- inline QString getAccessToken();
- inline QString getHomeServer();
- inline QString getUserId();
+ QString getAccessToken() { return access_token_; };
+ QString getHomeServer() { return home_server_; };
+ QString getUserId() { return user_id_; };
private:
QString access_token_;
QString home_server_;
QString user_id_;
};
-
-inline QString
-LoginResponse::getAccessToken()
-{
- return access_token_;
-}
-
-inline QString
-LoginResponse::getHomeServer()
-{
- return home_server_;
-}
-
-inline QString
-LoginResponse::getUserId()
-{
- return user_id_;
-}
diff --git a/include/MatrixClient.h b/include/MatrixClient.h
index 0185bf64..7596cf4e 100644
--- a/include/MatrixClient.h
+++ b/include/MatrixClient.h
@@ -55,9 +55,9 @@ public:
void joinRoom(const QString &roomIdOrAlias);
void leaveRoom(const QString &roomId);
- inline QUrl getHomeServer();
- inline int transactionId();
- inline void incrementTransactionId();
+ QUrl getHomeServer() { return server_; };
+ int transactionId() { return txn_id_; };
+ void incrementTransactionId() { txn_id_ += 1; };
void reset() noexcept;
@@ -65,9 +65,12 @@ public slots:
void getOwnProfile() noexcept;
void logout() noexcept;
- inline void setServer(const QString &server);
- inline void setAccessToken(const QString &token);
- inline void setNextBatchToken(const QString &next_batch);
+ void setServer(const QString &server)
+ {
+ server_ = QUrl(QString("https://%1").arg(server));
+ };
+ void setAccessToken(const QString &token) { token_ = token; };
+ void setNextBatchToken(const QString &next_batch) { next_batch_ = next_batch; };
signals:
void loginError(const QString &error);
@@ -162,39 +165,3 @@ private:
// Token to be used for the next sync.
QString next_batch_;
};
-
-inline QUrl
-MatrixClient::getHomeServer()
-{
- return server_;
-}
-
-inline int
-MatrixClient::transactionId()
-{
- return txn_id_;
-}
-
-inline void
-MatrixClient::setServer(const QString &server)
-{
- server_ = QUrl(QString("https://%1").arg(server));
-}
-
-inline void
-MatrixClient::setAccessToken(const QString &token)
-{
- token_ = token;
-}
-
-inline void
-MatrixClient::setNextBatchToken(const QString &next_batch)
-{
- next_batch_ = next_batch;
-}
-
-inline void
-MatrixClient::incrementTransactionId()
-{
- txn_id_ += 1;
-}
diff --git a/include/Profile.h b/include/Profile.h
index c460efbb..e2868e62 100644
--- a/include/Profile.h
+++ b/include/Profile.h
@@ -27,22 +27,10 @@ class ProfileResponse : public Deserializable
public:
void deserialize(const QJsonDocument &data) override;
- inline QUrl getAvatarUrl();
- inline QString getDisplayName();
+ QUrl getAvatarUrl() { return avatar_url_; };
+ QString getDisplayName() { return display_name_; };
private:
QUrl avatar_url_;
QString display_name_;
};
-
-inline QUrl
-ProfileResponse::getAvatarUrl()
-{
- return avatar_url_;
-}
-
-inline QString
-ProfileResponse::getDisplayName()
-{
- return display_name_;
-}
diff --git a/include/Register.h b/include/Register.h
index eb3a3d81..83f538b9 100644
--- a/include/Register.h
+++ b/include/Register.h
@@ -29,55 +29,25 @@ public:
QByteArray serialize() noexcept;
- inline void setPassword(QString password);
- inline void setUser(QString username);
+ void setPassword(QString password) { password_ = password; };
+ void setUser(QString username) { user_ = username; };
private:
QString user_;
QString password_;
};
-inline void
-RegisterRequest::setPassword(QString password)
-{
- password_ = password;
-}
-
-inline void
-RegisterRequest::setUser(QString username)
-{
- user_ = username;
-}
-
class RegisterResponse : public Deserializable
{
public:
void deserialize(const QJsonDocument &data) override;
- inline QString getAccessToken();
- inline QString getHomeServer();
- inline QString getUserId();
+ QString getAccessToken() { return access_token_; };
+ QString getHomeServer() { return home_server_; };
+ QString getUserId() { return user_id_; };
private:
QString access_token_;
QString home_server_;
QString user_id_;
};
-
-inline QString
-RegisterResponse::getAccessToken()
-{
- return access_token_;
-}
-
-inline QString
-RegisterResponse::getHomeServer()
-{
- return home_server_;
-}
-
-inline QString
-RegisterResponse::getUserId()
-{
- return user_id_;
-}
diff --git a/include/RoomInfoListItem.h b/include/RoomInfoListItem.h
index d7009a85..8975af79 100644
--- a/include/RoomInfoListItem.h
+++ b/include/RoomInfoListItem.h
@@ -50,11 +50,12 @@ public:
void clearUnreadMessageCount();
void setState(const RoomState &state);
- inline bool isPressed() const;
- inline RoomState state() const;
- inline void setAvatar(const QImage &avatar_image);
- inline int unreadMessageCount() const;
- inline void setDescriptionMessage(const DescInfo &info);
+ bool isPressed() const { return isPressed_; };
+ RoomState state() const { return state_; };
+ int unreadMessageCount() const { return unreadMsgCount_; };
+
+ void setAvatar(const QImage &avatar_image);
+ void setDescriptionMessage(const DescInfo &info);
signals:
void clicked(const QString &room_id);
@@ -97,36 +98,3 @@ private:
int maxHeight_;
int unreadMsgCount_ = 0;
};
-
-inline int
-RoomInfoListItem::unreadMessageCount() const
-{
- return unreadMsgCount_;
-}
-
-inline bool
-RoomInfoListItem::isPressed() const
-{
- return isPressed_;
-}
-
-inline RoomState
-RoomInfoListItem::state() const
-{
- return state_;
-}
-
-inline void
-RoomInfoListItem::setAvatar(const QImage &img)
-{
- roomAvatar_ = QPixmap::fromImage(
- img.scaled(IconSize, IconSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
- update();
-}
-
-inline void
-RoomInfoListItem::setDescriptionMessage(const DescInfo &info)
-{
- lastMsgInfo_ = info;
- update();
-}
diff --git a/include/RoomMessages.h b/include/RoomMessages.h
index 89d546a8..7aee2e24 100644
--- a/include/RoomMessages.h
+++ b/include/RoomMessages.h
@@ -27,30 +27,12 @@ class RoomMessages : public Deserializable
public:
void deserialize(const QJsonDocument &data) override;
- inline QString start() const;
- inline QString end() const;
- inline QJsonArray chunk() const;
+ QString start() const { return start_; };
+ QString end() const { return end_; };
+ QJsonArray chunk() const { return chunk_; };
private:
QString start_;
QString end_;
QJsonArray chunk_;
};
-
-inline QString
-RoomMessages::start() const
-{
- return start_;
-}
-
-inline QString
-RoomMessages::end() const
-{
- return end_;
-}
-
-inline QJsonArray
-RoomMessages::chunk() const
-{
- return chunk_;
-}
diff --git a/include/RoomState.h b/include/RoomState.h
index a07fcbed..57955e56 100644
--- a/include/RoomState.h
+++ b/include/RoomState.h
@@ -49,9 +49,9 @@ public:
void resolveAvatar();
void parse(const QJsonObject &object);
- inline QUrl getAvatar() const;
- inline QString getName() const;
- inline QString getTopic() const;
+ QUrl getAvatar() const { return avatar_; };
+ QString getName() const { return name_; };
+ QString getTopic() const { return topic.content().topic().simplified(); };
void removeLeaveMemberships();
void update(const RoomState &state);
@@ -81,21 +81,3 @@ private:
// avatar event this should be empty.
QString userAvatar_;
};
-
-inline QString
-RoomState::getTopic() const
-{
- return topic.content().topic().simplified();
-}
-
-inline QString
-RoomState::getName() const
-{
- return name_;
-}
-
-inline QUrl
-RoomState::getAvatar() const
-{
- return avatar_;
-}
diff --git a/include/Sync.h b/include/Sync.h
index c49d7101..ae61015e 100644
--- a/include/Sync.h
+++ b/include/Sync.h
@@ -27,15 +27,15 @@
class Event : public Deserializable
{
public:
- inline QJsonObject content() const;
- inline QJsonObject unsigned_content() const;
+ QJsonObject content() const { return content_; };
+ QJsonObject unsigned_content() const { return unsigned_; };
- inline QString sender() const;
- inline QString state_key() const;
- inline QString type() const;
- inline QString eventId() const;
+ QString sender() const { return sender_; };
+ QString state_key() const { return state_key_; };
+ QString type() const { return type_; };
+ QString eventId() const { return event_id_; };
- inline uint64_t timestamp() const;
+ uint64_t timestamp() const { return origin_server_ts_; };
void deserialize(const QJsonValue &data) override;
@@ -51,70 +51,22 @@ private:
uint64_t origin_server_ts_;
};
-inline QJsonObject
-Event::content() const
-{
- return content_;
-}
-
-inline QJsonObject
-Event::unsigned_content() const
-{
- return unsigned_;
-}
-
-inline QString
-Event::sender() const
-{
- return sender_;
-}
-
-inline QString
-Event::state_key() const
-{
- return state_key_;
-}
-
-inline QString
-Event::type() const
-{
- return type_;
-}
-
-inline QString
-Event::eventId() const
-{
- return event_id_;
-}
-
-inline uint64_t
-Event::timestamp() const
-{
- return origin_server_ts_;
-}
-
class State : public Deserializable
{
public:
void deserialize(const QJsonValue &data) override;
- inline QJsonArray events() const;
+ QJsonArray events() const { return events_; };
private:
QJsonArray events_;
};
-inline QJsonArray
-State::events() const
-{
- return events_;
-}
-
class Timeline : public Deserializable
{
public:
- inline QJsonArray events() const;
- inline QString previousBatch() const;
- inline bool limited() const;
+ QJsonArray events() const { return events_; };
+ QString previousBatch() const { return prev_batch_; };
+ bool limited() const { return limited_; };
void deserialize(const QJsonValue &data) override;
@@ -124,31 +76,13 @@ private:
bool limited_;
};
-inline QJsonArray
-Timeline::events() const
-{
- return events_;
-}
-
-inline QString
-Timeline::previousBatch() const
-{
- return prev_batch_;
-}
-
-inline bool
-Timeline::limited() const
-{
- return limited_;
-}
-
// TODO: Add support for account_data, undread_notifications
class JoinedRoom : public Deserializable
{
public:
- inline State state() const;
- inline Timeline timeline() const;
- inline QList<QString> typingUserIDs() const;
+ State state() const { return state_; };
+ Timeline timeline() const { return timeline_; };
+ QList<QString> typingUserIDs() const { return typingUserIDs_; };
void deserialize(const QJsonValue &data) override;
@@ -160,29 +94,11 @@ private:
/* UnreadNotifications unread_notifications_; */
};
-inline QList<QString>
-JoinedRoom::typingUserIDs() const
-{
- return typingUserIDs_;
-}
-
-inline State
-JoinedRoom::state() const
-{
- return state_;
-}
-
-inline Timeline
-JoinedRoom::timeline() const
-{
- return timeline_;
-}
-
class LeftRoom : public Deserializable
{
public:
- inline State state() const;
- inline Timeline timeline() const;
+ State state() const { return state_; };
+ Timeline timeline() const { return timeline_; };
void deserialize(const QJsonValue &data) override;
@@ -191,24 +107,12 @@ private:
Timeline timeline_;
};
-inline State
-LeftRoom::state() const
-{
- return state_;
-}
-
-inline Timeline
-LeftRoom::timeline() const
-{
- return timeline_;
-}
-
// TODO: Add support for invited and left rooms.
class Rooms : public Deserializable
{
public:
- inline QMap<QString, JoinedRoom> join() const;
- inline QMap<QString, LeftRoom> leave() const;
+ QMap<QString, JoinedRoom> join() const { return join_; };
+ QMap<QString, LeftRoom> leave() const { return leave_; };
void deserialize(const QJsonValue &data) override;
private:
@@ -216,38 +120,14 @@ private:
QMap<QString, LeftRoom> leave_;
};
-inline QMap<QString, JoinedRoom>
-Rooms::join() const
-{
- return join_;
-}
-
-inline QMap<QString, LeftRoom>
-Rooms::leave() const
-{
- return leave_;
-}
-
class SyncResponse : public Deserializable
{
public:
void deserialize(const QJsonDocument &data) override;
- inline QString nextBatch() const;
- inline Rooms rooms() const;
+ QString nextBatch() const { return next_batch_; };
+ Rooms rooms() const { return rooms_; };
private:
QString next_batch_;
Rooms rooms_;
};
-
-inline Rooms
-SyncResponse::rooms() const
-{
- return rooms_;
-}
-
-inline QString
-SyncResponse::nextBatch() const
-{
- return next_batch_;
-}
diff --git a/include/TextInputWidget.h b/include/TextInputWidget.h
index 772bdd46..08b62f45 100644
--- a/include/TextInputWidget.h
+++ b/include/TextInputWidget.h
@@ -55,7 +55,7 @@ public slots:
void onSendButtonClicked();
void openFileSelection();
void hideUploadSpinner();
- inline void focusLineEdit();
+ void focusLineEdit() { input_->setFocus(); };
private slots:
void addSelectedEmoji(const QString &emoji);
@@ -80,9 +80,3 @@ private:
FlatButton *sendMessageBtn_;
EmojiPickButton *emojiBtn_;
};
-
-inline void
-TextInputWidget::focusLineEdit()
-{
- input_->setFocus();
-}
diff --git a/include/TimelineItem.h b/include/TimelineItem.h
index 0a0538f9..ef021cfe 100644
--- a/include/TimelineItem.h
+++ b/include/TimelineItem.h
@@ -65,7 +65,7 @@ public:
QWidget *parent);
void setUserAvatar(const QImage &pixmap);
- inline DescInfo descriptionMessage() const;
+ DescInfo descriptionMessage() const { return descriptionMsg_; };
~TimelineItem();
@@ -98,9 +98,3 @@ private:
QLabel *userName_;
QLabel *body_;
};
-
-inline DescInfo
-TimelineItem::descriptionMessage() const
-{
- return descriptionMsg_;
-}
diff --git a/include/TimelineView.h b/include/TimelineView.h
index f25bc570..55f25687 100644
--- a/include/TimelineView.h
+++ b/include/TimelineView.h
@@ -99,7 +99,7 @@ public slots:
void addBackwardsEvents(const QString &room_id, const RoomMessages &msgs);
// Whether or not the initial batch has been loaded.
- bool hasLoaded();
+ bool hasLoaded() { return scroll_layout_->count() > 1 || isTimelineFinished; };
signals:
void updateLastTimelineMessage(const QString &user, const DescInfo &info);
@@ -120,7 +120,7 @@ private:
const QString &userid);
void removePendingMessage(const QString &eventid, const QString &body);
- inline bool isDuplicate(const QString &event_id);
+ bool isDuplicate(const QString &event_id) { return eventIds_.contains(event_id); };
// Return nullptr if the event couldn't be parsed.
TimelineItem *parseMessageEvent(const QJsonObject &event, TimelineDirection direction);
@@ -160,15 +160,3 @@ private:
QList<PendingMessage> pending_msgs_;
QSharedPointer<MatrixClient> client_;
};
-
-inline bool
-TimelineView::isDuplicate(const QString &event_id)
-{
- return eventIds_.contains(event_id);
-}
-
-inline bool
-TimelineView::hasLoaded()
-{
- return scroll_layout_->count() > 1 || isTimelineFinished;
-}
diff --git a/include/TopRoomBar.h b/include/TopRoomBar.h
index 1b1d148c..eb941b3b 100644
--- a/include/TopRoomBar.h
+++ b/include/TopRoomBar.h
@@ -45,10 +45,10 @@ public:
TopRoomBar(QWidget *parent = 0);
~TopRoomBar();
- inline void updateRoomAvatar(const QImage &avatar_image);
- inline void updateRoomAvatar(const QIcon &icon);
- inline void updateRoomName(const QString &name);
- inline void updateRoomTopic(QString topic);
+ void updateRoomAvatar(const QImage &avatar_image);
+ void updateRoomAvatar(const QIcon &icon);
+ void updateRoomName(const QString &name);
+ void updateRoomTopic(QString topic);
void updateRoomAvatarFromName(const QString &name);
void setRoomSettings(QSharedPointer<RoomSettings> settings);
@@ -89,31 +89,3 @@ private:
QString roomName_;
QString roomTopic_;
};
-
-inline void
-TopRoomBar::updateRoomAvatar(const QImage &avatar_image)
-{
- avatar_->setImage(avatar_image);
- update();
-}
-
-inline void
-TopRoomBar::updateRoomAvatar(const QIcon &icon)
-{
- avatar_->setIcon(icon);
- update();
-}
-
-inline void
-TopRoomBar::updateRoomName(const QString &name)
-{
- roomName_ = name;
- update();
-}
-
-inline void
-TopRoomBar::updateRoomTopic(QString topic)
-{
- roomTopic_ = topic;
- update();
-}
diff --git a/include/events/AliasesEventContent.h b/include/events/AliasesEventContent.h
index 49e51275..7784fad7 100644
--- a/include/events/AliasesEventContent.h
+++ b/include/events/AliasesEventContent.h
@@ -32,16 +32,11 @@ public:
void deserialize(const QJsonValue &data) override;
QJsonObject serialize() const override;
- inline QList<QString> aliases() const;
+ QList<QString> aliases() const { return aliases_; };
private:
QList<QString> aliases_;
};
-inline QList<QString>
-AliasesEventContent::aliases() const
-{
- return aliases_;
-}
} // namespace events
} // namespace matrix
diff --git a/include/events/AvatarEventContent.h b/include/events/AvatarEventContent.h
index 98e2f12d..55284aa4 100644
--- a/