History

cleanup username API from GlobalServicesScriptingInterface

Stephen Birarda committed 11 years ago

Commit 2f22c0c1 parent 2de19ec3 files · +10 −12Browse files

Showing the changes to interface/src/scripting/GlobalServicesScriptingInterface.h (1 of 3 files). Show all

Unified · Split

interface/src/scripting/GlobalServicesScriptingInterface.h+9−7
@@ -31,20 +31,21 @@ Q_DECLARE_METATYPE(DownloadInfoResult) · 30 unmodified lines
31QScriptValue DownloadInfoResultToScriptValue(QScriptEngine* engine, const DownloadInfoResult& result);31QScriptValue DownloadInfoResultToScriptValue(QScriptEngine* engine, const DownloadInfoResult& result);
32void DownloadInfoResultFromScriptValue(const QScriptValue& object, DownloadInfoResult& result);32void DownloadInfoResultFromScriptValue(const QScriptValue& object, DownloadInfoResult& result);
33 33
34
35class GlobalServicesScriptingInterface : public QObject {34class GlobalServicesScriptingInterface : public QObject {
36 Q_OBJECT35 Q_OBJECT
37 Q_PROPERTY(QString myUsername READ getMyUsername)36
38 GlobalServicesScriptingInterface();37 Q_PROPERTY(QString username READ getUsername)
39 ~GlobalServicesScriptingInterface();38
40public:39public:
41 static GlobalServicesScriptingInterface* getInstance();40 static GlobalServicesScriptingInterface* getInstance();
42 41
43 QString getMyUsername();42 const QString& getUsername() const { return AccountManager::getInstance().getAccountInfo().getUsername(); }
44 43
45public slots:44public slots:
46 DownloadInfoResult getDownloadInfo();45 DownloadInfoResult getDownloadInfo();
47 void updateDownloadInfo();46 void updateDownloadInfo();
47
48 void setDiscoverability(const QString& discoverability);
48 49
49private slots:50private slots:
50 void loggedOut();51 void loggedOut();
@@ -53,12 +54,13 @@ private slots: · 2 unmodified lines
53signals:54signals:
54 void connected();55 void connected();
55 void disconnected(const QString& reason);56 void disconnected(const QString& reason);
56 void incomingMessage(const QString& username, const QString& message);
57 void onlineUsersChanged(const QStringList& usernames);
58 void myUsernameChanged(const QString& username);57 void myUsernameChanged(const QString& username);
59 void downloadInfoChanged(DownloadInfoResult info);58 void downloadInfoChanged(DownloadInfoResult info);
60 59
61private:60private:
61 GlobalServicesScriptingInterface();
62 ~GlobalServicesScriptingInterface();
63
62 bool _downloading;64 bool _downloading;
63};65};
64 66

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t