summaryrefslogtreecommitdiffstats
path: root/testing/namecoin/40-build-qt5.patch
blob: 1232e1d95288b931b7e88565d94399a5d3792e54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
--- namecoin-nc0.3.75/namecoin-qt.pro
+++ namecoin-nc0.3.75/namecoin-qt.pro
@@ -3,7 +3,8 @@
 macx:TARGET = "Namecoin-Qt"
 VERSION = 0.3.75
 INCLUDEPATH += src src/json src/qt
-QT += network
+QT += core gui network
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
 DEFINES += GUI QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
 CONFIG += no_include_pwd
 CONFIG += thread
@@ -118,30 +119,27 @@
 # Input
 DEPENDPATH += src src/json src/cryptopp src/qt
 
-NAMECOIN_HEADERS = headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
-    script.h allocators.h db.h walletdb.h crypter.h net.h irc.h keystore.h main.h wallet.h bitcoinrpc.h uibase.h ui.h noui.h init.h auxpow.h
+HEADERS += src/headers.h src/strlcpy.h src/serialize.h src/uint256.h src/util.h src/key.h src/bignum.h src/base58.h \
+    src/script.h src/allocators.h src/db.h src/walletdb.h src/crypter.h src/net.h src/irc.h src/keystore.h src/main.h src/wallet.h src/bitcoinrpc.h src/uibase.h src/ui.h src/noui.h src/init.h src/auxpow.h
 
-NAMECOIN_SOURCES = \
-    auxpow.cpp \
-    util.cpp \
-    key.cpp \
-    script.cpp \
-    db.cpp \
-    walletdb.cpp \
-    crypter.cpp \
-    net.cpp \
-    irc.cpp \
-    keystore.cpp \
-    main.cpp \
-    wallet.cpp \
-    bitcoinrpc.cpp \
-    init.cpp \
-    cryptopp/sha.cpp \
-    cryptopp/cpu.cpp \
-    namecoin.cpp
-
-HEADERS += $$join(NAMECOIN_HEADERS, " src/", " src/",)
-SOURCES += $$join(NAMECOIN_SOURCES, " src/", " src/",)
+SOURCES += \
+    src/auxpow.cpp \
+    src/util.cpp \
+    src/key.cpp \
+    src/script.cpp \
+    src/db.cpp \
+    src/walletdb.cpp \
+    src/crypter.cpp \
+    src/net.cpp \
+    src/irc.cpp \
+    src/keystore.cpp \
+    src/main.cpp \
+    src/wallet.cpp \
+    src/bitcoinrpc.cpp \
+    src/init.cpp \
+    src/cryptopp/sha.cpp \
+    src/cryptopp/cpu.cpp \
+    src/namecoin.cpp
 
 HEADERS += \
     src/qt/netbase.h \
--- namecoin-nc0.3.75/src/qt/addressbookpage.cpp
+++ namecoin-nc0.3.75.new/src/qt/addressbookpage.cpp
@@ -140,8 +140,13 @@
     // Set column widths
     ui->tableView->horizontalHeader()->resizeSection(
             AddressTableModel::Address, 320);
+#if QT_VERSION < 0x050000
     ui->tableView->horizontalHeader()->setResizeMode(
             AddressTableModel::Label, QHeaderView::Stretch);
+#else
+    ui->tableView->horizontalHeader()->setSectionResizeMode(
+            AddressTableModel::Label, QHeaderView::Stretch);
+#endif
 
     connect(ui->tableView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
             this, SLOT(selectionChanged()));
--- namecoin-nc0.3.75/src/qt/bitcoin.cpp
+++ namecoin-nc0.3.75.new/src/qt/bitcoin.cpp
@@ -20,7 +20,9 @@
 #include <boost/filesystem.hpp>
 
 #include <QMessageBox>
+#if QT_VERSION < 0x050000
 #include <QTextCodec>
+#endif
 #include <QLocale>
 #include <QTimer>
 #include <QTranslator>
@@ -122,16 +124,14 @@
 #ifndef BITCOIN_QT_TEST
 int main(int argc, char *argv[])
 {
-    #ifndef WIN32
-	SetupEnvironment();
-    #endif
-
     // Command-line options take precedence:
     ParseParameters(argc, argv);
 
+#if QT_VERSION < 0x050000
     // Internal string conversion is all UTF-8
     QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
     QTextCodec::setCodecForCStrings(QTextCodec::codecForTr());
+#endif
 
     Q_INIT_RESOURCE(bitcoin);
     QApplication app(argc, argv);
--- namecoin-nc0.3.75/src/qt/bitcoingui.cpp
+++ namecoin-nc0.3.75.new/src/qt/bitcoingui.cpp
@@ -49,10 +49,16 @@
 #include <QDateTime>
 #include <QMovie>
 #include <QFileDialog>
+#if QT_VERSION < 0x050000
 #include <QDesktopServices>
+#else
+#include <QStandardPaths>
+#endif
 #include <QTimer>
 #include <QDragEnterEvent>
+#if QT_VERSION < 0x050000
 #include <QUrl>
+#endif
 #include <QMimeData>
 #include <QStyle>
 
@@ -933,7 +939,11 @@
 
 void BitcoinGUI::backupWallet()
 {
+#if QT_VERSION < 0x050000
     QString saveDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
+#else
+    QString saveDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
+#endif
     QString filename = QFileDialog::getSaveFileName(this, tr("Backup Wallet"), saveDir, tr("Wallet Data (*.dat)"));
     if(!filename.isEmpty()) {
         if(!walletModel->backupWallet(filename)) {
--- namecoin-nc0.3.75/src/qt/guiutil.cpp
+++ namecoin-nc0.3.75.new/src/qt/guiutil.cpp
@@ -14,8 +14,12 @@
 #include <QDoubleValidator>
 #include <QFont>
 #include <QLineEdit>
+#if QT_VERSION >= 0x050000
+#include <QUrlQuery>
+#else
 #include <QUrl>
-#include <QTextDocument> // For Qt::escape
+#endif
+#include <QTextDocument> // For Qt::mightBeRichText
 #include <QAbstractItemView>
 #include <QClipboard>
 #include <QFileDialog>
@@ -87,7 +91,12 @@
     SendCoinsRecipient rv;
     rv.address = uri.path();
     rv.amount = 0;
+#if QT_VERSION < 0x050000
     QList<QPair<QString, QString> > items = uri.queryItems();
+#else
+    QUrlQuery uriQuery(uri);
+    QList<QPair<QString, QString> > items = uriQuery.queryItems();
+#endif
     for (QList<QPair<QString, QString> >::iterator i = items.begin(); i != items.end(); i++)
     {
         bool fShouldReturnFalse = false;
@@ -140,7 +149,11 @@
 
 QString HtmlEscape(const QString& str, bool fMultiLine)
 {
+#if QT_VERSION < 0x050000
     QString escaped = Qt::escape(str);
+#else
+    QString escaped = str.toHtmlEscaped();
+#endif
     if(fMultiLine)
     {
         escaped = escaped.replace("\n", "<br>\n");
@@ -175,7 +188,11 @@
     QString myDir;
     if(dir.isEmpty()) // Default to user documents location
     {
+#if QT_VERSION < 0x050000
         myDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
+#else
+	myDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
+#endif
     }
     else
     {
@@ -474,4 +491,4 @@
     printf("SHGetSpecialFolderPathA() failed, could not obtain requested path.\n");
     return fs::path("");
 }
-#endif  
\ No newline at end of file
+#endif  
--- namecoin-nc0.3.75/src/qt/managenamespage.cpp
+++ namecoin-nc0.3.75.new/src/qt/managenamespage.cpp
@@ -162,8 +162,13 @@
     // Set column widths
     ui->tableView->horizontalHeader()->resizeSection(
             NameTableModel::Name, COLUMN_WIDTH_NAME);
+#if QT_VERSION < 0x050000
     ui->tableView->horizontalHeader()->setResizeMode(
             NameTableModel::Value, QHeaderView::Stretch);
+#else
+    ui->tableView->horizontalHeader()->setSectionResizeMode(
+            NameTableModel::Value, QHeaderView::Stretch);
+#endif
     ui->tableView->horizontalHeader()->resizeSection(
             NameTableModel::Address, COLUMN_WIDTH_ADDRESS);
     ui->tableView->horizontalHeader()->resizeSection(
--- namecoin-nc0.3.75/src/qt/overviewpage.cpp
+++ namecoin-nc0.3.75.new/src/qt/overviewpage.cpp
@@ -46,7 +46,11 @@
         bool confirmed = index.data(TransactionTableModel::ConfirmedRole).toBool();
         QVariant value = index.data(Qt::ForegroundRole);
         QColor foreground = option.palette.color(QPalette::Text);
+#if QT_VERSION < 0x050000
         if(qVariantCanConvert<QColor>(value))
+#else
+	if(value.canConvert(QMetaType::QColor))
+#endif
         {
             foreground = qvariant_cast<QColor>(value);
         }
--- namecoin-nc0.3.75/src/qt/sendcoinsdialog.cpp
+++ namecoin-nc0.3.75.new/src/qt/sendcoinsdialog.cpp
@@ -94,7 +94,11 @@
     QStringList formatted;
     foreach(const SendCoinsRecipient &rcp, recipients)
     {
+#if QT_VERSION < 0x050000
         formatted.append(tr("<b>%1</b> to %2 (%3)").arg(BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, rcp.amount), Qt::escape(rcp.label), rcp.address));
+#else
+        formatted.append(tr("<b>%1</b> to %2 (%3)").arg(BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, rcp.amount), rcp.label.toHtmlEscaped(), rcp.address));
+#endif
     }
 
     fNewRecipientAllowed = false;
--- namecoin-nc0.3.75/src/qt/transactionview.cpp
+++ namecoin-nc0.3.75.new/src/qt/transactionview.cpp
@@ -174,7 +174,11 @@
         transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Status, 23);
         transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Date, 120);
         transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Type, 120);
+#if QT_VERSION < 0x050000
         transactionView->horizontalHeader()->setResizeMode(TransactionTableModel::ToAddress, QHeaderView::Stretch);
+#else
+        transactionView->horizontalHeader()->setSectionResizeMode(TransactionTableModel::ToAddress, QHeaderView::Stretch);
+#endif
         transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Amount, 100);
     }
 }