Skip to content

Commit

Permalink
clean up in Q_INVOKABLE methods in UserModel class
Browse files Browse the repository at this point in the history
removed Q_INVOKABEl from signals

declare slots where invokable methods could be slots

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
  • Loading branch information
mgallien committed May 4, 2022
1 parent aa87771 commit edd73ed
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/gui/tray/usermodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,18 +170,10 @@ class UserModel : public QAbstractListModel

int findUserIdForAccount(AccountState *account) const;

Q_INVOKABLE void fetchCurrentActivityModel();
Q_INVOKABLE void openCurrentAccountLocalFolder();
Q_INVOKABLE void openCurrentAccountTalk();
Q_INVOKABLE void openCurrentAccountServer();
Q_INVOKABLE int numUsers();
Q_INVOKABLE QString currentUserServer();
int currentUserId() const;
Q_INVOKABLE bool isUserConnected(const int &id);
Q_INVOKABLE void switchCurrentUser(const int &id);
Q_INVOKABLE void login(const int &id);
Q_INVOKABLE void logout(const int &id);
Q_INVOKABLE void removeAccount(const int &id);

Q_INVOKABLE std::shared_ptr<OCC::UserStatusConnector> userStatusConnector(int id);

Expand All @@ -199,14 +191,24 @@ class UserModel : public QAbstractListModel
AvatarRole,
IsCurrentUserRole,
IsConnectedRole,
IdRole
IdRole,
};

AccountAppList appList() const;

signals:
Q_INVOKABLE void addAccount();
Q_INVOKABLE void newUserSelected();
void addAccount();
void newUserSelected();

public slots:
void fetchCurrentActivityModel();
void openCurrentAccountLocalFolder();
void openCurrentAccountTalk();
void openCurrentAccountServer();
void switchCurrentUser(const int &id);
void login(const int &id);
void logout(const int &id);
void removeAccount(const int &id);

protected:
QHash<int, QByteArray> roleNames() const override;
Expand Down

0 comments on commit edd73ed

Please sign in to comment.