mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
Remove redundant "struct" keyword use in C++ code (Qt client)
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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 ();
|
||||
};
|
||||
|
||||
|
||||
@@ -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 *);
|
||||
|
||||
@@ -146,7 +146,7 @@ class Prefs: public QObject
|
||||
QSet<int> 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; }
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
26
qt/session.h
26
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<int>& 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<int>& 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;
|
||||
};
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user