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);
}
}
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);
class Session;
+extern "C"
+{
+ struct tr_variant;
+}
+
class FreespaceLabel: public QLabel
{
Q_OBJECT
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 ();
};
QLabel * myNewLabel;
QDialogButtonBox * myNewButtonBox;
QDialog * myNewDialog;
- struct tr_metainfo_builder * myBuilder;
+ tr_metainfo_builder * myBuilder;
protected:
virtual void dragEnterEvent (QDragEnterEvent *);
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; }
***/
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);
}
void
-Session::localSessionCallback (tr_session * s, struct evbuffer * json, void * vself)
+Session::localSessionCallback (tr_session * s, evbuffer * json, void * vself)
{
Q_UNUSED (s);
}
void
-Session::updateStats (tr_variant * d, struct tr_session_stats * stats)
+Session::updateStats (tr_variant * d, tr_session_stats * stats)
{
int64_t i;
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);
}
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;
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:
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++; }
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 ();
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);
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;
};
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));