From: Mike Gelfand Date: Fri, 12 Dec 2014 23:21:04 +0000 (+0000) Subject: Remove redundant "struct" keyword use in C++ code (Qt client) X-Git-Tag: 2.90~314 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9605bfc36ab3ac027efdd55e37f6bfb673d5e3d2;p=transmission Remove redundant "struct" keyword use in C++ code (Qt client) --- diff --git a/qt/freespace-label.cc b/qt/freespace-label.cc index b09dbf7e4..20b3d4636 100644 --- a/qt/freespace-label.cc +++ b/qt/freespace-label.cc @@ -33,8 +33,8 @@ FreespaceLabel::FreespaceLabel (Session & session, connect (&myTimer, SIGNAL(timeout()), this, SLOT(onTimer())); - connect (&mySession, SIGNAL(executed(int64_t, const QString&, struct tr_variant*)), - this, SLOT(onSessionExecuted(int64_t, const QString&, struct tr_variant*))); + connect (&mySession, SIGNAL(executed(int64_t, const QString&, tr_variant *)), + this, SLOT(onSessionExecuted(int64_t, const QString&, tr_variant *))); setPath (path); } @@ -68,7 +68,7 @@ FreespaceLabel::onTimer () } void -FreespaceLabel::onSessionExecuted (int64_t tag, const QString& result, struct tr_variant * arguments) +FreespaceLabel::onSessionExecuted (int64_t tag, const QString& result, tr_variant * arguments) { Q_UNUSED (result); diff --git a/qt/freespace-label.h b/qt/freespace-label.h index b97af2709..0aab72186 100644 --- a/qt/freespace-label.h +++ b/qt/freespace-label.h @@ -18,6 +18,11 @@ class Session; +extern "C" +{ + struct tr_variant; +} + class FreespaceLabel: public QLabel { Q_OBJECT @@ -34,7 +39,7 @@ class FreespaceLabel: public QLabel QTimer myTimer; private slots: - void onSessionExecuted (int64_t tag, const QString& result, struct tr_variant * arguments); + void onSessionExecuted (int64_t tag, const QString& result, tr_variant * arguments); void onTimer (); }; diff --git a/qt/make-dialog.h b/qt/make-dialog.h index bb6d5ec4d..494bab865 100644 --- a/qt/make-dialog.h +++ b/qt/make-dialog.h @@ -80,7 +80,7 @@ class MakeDialog: public QDialog QLabel * myNewLabel; QDialogButtonBox * myNewButtonBox; QDialog * myNewDialog; - struct tr_metainfo_builder * myBuilder; + tr_metainfo_builder * myBuilder; protected: virtual void dragEnterEvent (QDragEnterEvent *); diff --git a/qt/prefs.h b/qt/prefs.h index d8fcb9dba..48de0df0e 100644 --- a/qt/prefs.h +++ b/qt/prefs.h @@ -146,7 +146,7 @@ class Prefs: public QObject QSet myTemporaryPrefs; QString myConfigDir; mutable QVariant myValues[PREFS_COUNT]; - void initDefaults (struct tr_variant*); + void initDefaults (tr_variant *); public: bool isCore (int key) const { return FIRST_CORE_PREF<=key && key<=LAST_CORE_PREF; } diff --git a/qt/session.cc b/qt/session.cc index 985bd4855..84f7f7ad8 100644 --- a/qt/session.cc +++ b/qt/session.cc @@ -89,7 +89,7 @@ namespace ***/ void -FileAdded::executed (int64_t tag, const QString& result, struct tr_variant * arguments) +FileAdded::executed (int64_t tag, const QString& result, tr_variant * arguments) { Q_UNUSED (arguments); @@ -700,7 +700,7 @@ Session::exec (const tr_variant * request) } void -Session::localSessionCallback (tr_session * s, struct evbuffer * json, void * vself) +Session::localSessionCallback (tr_session * s, evbuffer * json, void * vself) { Q_UNUSED (s); @@ -920,7 +920,7 @@ Session::parseResponse (const char * json, size_t jsonLength) } void -Session::updateStats (tr_variant * d, struct tr_session_stats * stats) +Session::updateStats (tr_variant * d, tr_session_stats * stats) { int64_t i; @@ -1106,8 +1106,8 @@ Session::addTorrent (const AddData& addMe, tr_variant& top, bool trashOriginal) FileAdded * fileAdded = new FileAdded (tag, addMe.readableName ()); if (trashOriginal && addMe.type == AddData::FILENAME) fileAdded->setFileToDelete (addMe.filename); - connect (this, SIGNAL (executed (int64_t, QString, struct tr_variant *)), - fileAdded, SLOT (executed (int64_t, QString, struct tr_variant *))); + connect (this, SIGNAL (executed (int64_t, QString, tr_variant *)), + fileAdded, SLOT (executed (int64_t, QString, tr_variant *))); exec (&top); } diff --git a/qt/session.h b/qt/session.h index 3452af60d..f91ad7284 100644 --- a/qt/session.h +++ b/qt/session.h @@ -45,7 +45,7 @@ class FileAdded: public QObject void setFileToDelete (const QString& file) { myDelFile = file; } public slots: - void executed (int64_t tag, const QString& result, struct tr_variant * arguments); + void executed (int64_t tag, const QString& result, tr_variant * arguments); private: const int64_t myTag; @@ -70,8 +70,8 @@ class Session: public QObject public: const QUrl& getRemoteUrl () const { return myUrl; } - const struct tr_session_stats& getStats () const { return myStats; } - const struct tr_session_stats& getCumulativeStats () const { return myCumulativeStats; } + const tr_session_stats& getStats () const { return myStats; } + const tr_session_stats& getCumulativeStats () const { return myCumulativeStats; } const QString& sessionVersion () const { return mySessionVersion; } public: @@ -90,14 +90,14 @@ class Session: public QObject bool isLocal () const; private: - void updateStats (struct tr_variant * args); - void updateInfo (struct tr_variant * args); + void updateStats (tr_variant * args); + void updateInfo (tr_variant * args); void parseResponse (const char * json, size_t len); - static void localSessionCallback (tr_session *, struct evbuffer *, void *); + static void localSessionCallback (tr_session *, evbuffer *, void *); public: void exec (const char * json); - void exec (const struct tr_variant * request); + void exec (const tr_variant * request); public: int64_t getUniqueTag () { return nextUniqueTag++; } @@ -106,7 +106,7 @@ class Session: public QObject void sessionSet (const tr_quark key, const QVariant& variant); void pumpRequests (); void sendTorrentRequest (const char * request, const QSet& torrentIds); - static void updateStats (struct tr_variant * d, struct tr_session_stats * stats); + static void updateStats (tr_variant * d, tr_session_stats * stats); void refreshTorrents (const QSet& torrentIds); QNetworkAccessManager * networkAccessManager (); @@ -151,14 +151,14 @@ class Session: public QObject signals: void responseReceived (const QByteArray& json); - void executed (int64_t tag, const QString& result, struct tr_variant * arguments); + void executed (int64_t tag, const QString& result, tr_variant * arguments); void sourceChanged (); void portTested (bool isOpen); void statsUpdated (); void sessionUpdated (); void blocklistUpdated (int); - void torrentsUpdated (struct tr_variant * torrentList, bool completeList); - void torrentsRemoved (struct tr_variant * torrentList); + void torrentsUpdated (tr_variant * torrentList, bool completeList); + void torrentsRemoved (tr_variant * torrentList); void dataReadProgress (); void dataSendProgress (); void error (QNetworkReply::NetworkError); @@ -175,8 +175,8 @@ class Session: public QObject QStringList myIdleJSON; QUrl myUrl; QNetworkAccessManager * myNAM; - struct tr_session_stats myStats; - struct tr_session_stats myCumulativeStats; + tr_session_stats myStats; + tr_session_stats myCumulativeStats; QString mySessionVersion; }; diff --git a/qt/stats-dialog.cc b/qt/stats-dialog.cc index 42be5fa41..0931e21b8 100644 --- a/qt/stats-dialog.cc +++ b/qt/stats-dialog.cc @@ -79,8 +79,8 @@ StatsDialog::onTimer () void StatsDialog::updateStats () { - const struct tr_session_stats& current (mySession.getStats ()); - const struct tr_session_stats& total (mySession.getCumulativeStats ()); + const tr_session_stats& current (mySession.getStats ()); + const tr_session_stats& total (mySession.getCumulativeStats ()); myCurrentUp->setText (Formatter::sizeToString (current.uploadedBytes)); myCurrentDown->setText (Formatter::sizeToString (current.downloadedBytes));