source: trunk/qt/qtr.pro

Last change on this file was 14732, checked in by mikedld, 6 years ago

Refactor RPC requests code for proper queueing (patch by intelfx @ GH-10)

This refactoring is driven by the need to be able to do true queued RPC calls
(where each successive call uses the result of the previous).

Currently, such queueing of requests is done by assigning them special "magic"
tag numbers, which are then intercepted in one big switch() statement and acted
upon. This (aside from making code greatly unclear) effectively makes each such
queue a singleton, because state passing is restricted to global variables.

We refactor RpcClient? to assign an unique tag to each remote call, and then
abstract all the call<->response matching with Qt's future/promise mechanism.

Finally, we introduce a "RPC request queue" class (RpcQueue?) which is built on
top of QFutureWatcher and C++11's <functional> library. This class maintains
a queue of functions, where each function receives an RPC response, does
necessary processing, performs another call and finally returns its future.

File size: 3.6 KB
Line 
1TARGET = transmission-qt
2NAME = "Transmission"
3DESCRIPTION = "Transmission: a fast, easy, and free BitTorrent client"
4VERSION = 2.81
5LICENSE = "GPL"
6
7target.path = /bin
8INSTALLS += target
9
10unix: INSTALLS += man
11man.path = /share/man/man1/
12man.files = transmission-qt.1
13
14CONFIG += qt thread debug link_pkgconfig c++11 warn_on
15QT += network dbus
16PKGCONFIG = fontconfig libcurl openssl libevent
17
18greaterThan(QT_MAJOR_VERSION, 4) {
19    QT += widgets
20}
21
22DEFINES += QT_NO_CAST_FROM_ASCII ENABLE_DBUS_INTEROP
23win32:DEFINES += QT_DBUS
24
25TRANSMISSION_TOP = ..
26
27include(config.pri)
28
29INCLUDEPATH = $${EVENT_TOP}/include $${INCLUDEPATH}
30INCLUDEPATH += $${TRANSMISSION_TOP}
31LIBS += $${TRANSMISSION_TOP}/libtransmission/libtransmission.a
32LIBS += $${LIBUTP_LIBS}
33LIBS += $${DHT_LIBS}
34LIBS += $${LIBB64_LIBS}
35LIBS += $${LIBUPNP_LIBS}
36LIBS += $${LIBNATPMP_LIBS}
37unix: LIBS += -L$${EVENT_TOP}/lib -lz -lrt
38win32:LIBS += -levent-2.0 -lws2_32 -lintl
39win32:LIBS += -lidn -liconv -lwldap32 -liphlpapi
40
41lessThan(QT_MAJOR_VERSION, 5) : *-g++* | *-clang* : QMAKE_CXXFLAGS += -std=gnu++11
42
43TRANSLATIONS += translations/transmission_de.ts \
44                translations/transmission_en.ts \
45                translations/transmission_es.ts \
46                translations/transmission_eu.ts \
47                translations/transmission_fr.ts \
48                translations/transmission_hu.ts \
49                translations/transmission_id.ts \
50                translations/transmission_it_IT.ts \
51                translations/transmission_kk.ts \
52                translations/transmission_ko.ts \
53                translations/transmission_lt.ts \
54                translations/transmission_pl_PL.ts \
55                translations/transmission_pt_BR.ts \
56                translations/transmission_ru.ts \
57                translations/transmission_uk.ts \
58                translations/transmission_zh_CN.ts
59
60FORMS += AboutDialog.ui \
61         DetailsDialog.ui \
62         LicenseDialog.ui \
63         MainWindow.ui \
64         MakeDialog.ui \
65         MakeProgressDialog.ui \
66         OptionsDialog.ui \
67         PrefsDialog.ui \
68         RelocateDialog.ui \
69         SessionDialog.ui \
70         StatsDialog.ui
71RESOURCES += application.qrc
72win32|macx:RESOURCES += icons/Faenza/Faenza.qrc
73SOURCES += AboutDialog.cc \
74           AddData.cc \
75           Application.cc \
76           ColumnResizer.cc \
77           DBusInteropHelper.cc \
78           DetailsDialog.cc \
79           FaviconCache.cc \
80           FileTreeDelegate.cc \
81           FileTreeItem.cc \
82           FileTreeModel.cc \
83           FileTreeView.cc \
84           FilterBar.cc \
85           FilterBarComboBox.cc \
86           FilterBarComboBoxDelegate.cc \
87           FilterBarLineEdit.cc \
88           Filters.cc \
89           Formatter.cc \
90           FreeSpaceLabel.cc \
91           IconToolButton.cc \
92           InteropHelper.cc \
93           InteropObject.cc \
94           LicenseDialog.cc \
95           MainWindow.cc \
96           MakeDialog.cc \
97           OptionsDialog.cc \
98           PathButton.cc \
99           Prefs.cc \
100           PrefsDialog.cc \
101           RelocateDialog.cc \
102           RpcClient.cc \
103           RpcQueue.cc \
104           Session.cc \
105           SessionDialog.cc \
106           SqueezeLabel.cc \
107           StatsDialog.cc \
108           Torrent.cc \
109           TorrentDelegate.cc \
110           TorrentDelegateMin.cc \
111           TorrentFilter.cc \
112           TorrentModel.cc \
113           TorrentView.cc \
114           TrackerDelegate.cc \
115           TrackerModel.cc \
116           TrackerModelFilter.cc \
117           Utils.cc \
118           WatchDir.cc
119HEADERS += $$replace(SOURCES, .cc, .h)
120HEADERS += BaseDialog.h CustomVariantType.h Speed.h
121
122win32:RC_FILE = qtr.rc
Note: See TracBrowser for help on using the repository browser.