diff options
author | Jonas Schnelli <jonas.schnelli@include7.ch> | 2013-06-03 15:18:41 +0200 |
---|---|---|
committer | Jonas Schnelli <jonas.schnelli@include7.ch> | 2013-06-03 15:18:41 +0200 |
commit | 39fe9de6b2b255969971beca8fa25a33ad2e5750 (patch) | |
tree | 6686041f6b801d0ea5185b026a480a5be61510e6 /src/qt/guiutil.cpp | |
parent | f679b2900a3a9f863f888cfb0b1a5e593628e37b (diff) | |
parent | fa9e5adddda0bee5adc040b957cf3f1a6a470802 (diff) |
Merge branch 'master' of git://github.com/bitcoin/bitcoin into prefsFix
Signed-off-by: Jonas Schnelli <jonas.schnelli@include7.ch>
Conflicts:
bitcoin-qt.pro
Diffstat (limited to 'src/qt/guiutil.cpp')
-rw-r--r-- | src/qt/guiutil.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index d7d59fc880..88a6e7226e 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -13,8 +13,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> @@ -86,7 +90,13 @@ bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out) 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; @@ -139,7 +149,11 @@ bool parseBitcoinURI(QString uri, SendCoinsRecipient *out) 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"); @@ -176,7 +190,11 @@ QString getSaveFileName(QWidget *parent, const QString &caption, 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 { |