From 87c272207f6f3bfd98317c5ec8e4dbd775bbfaf9 Mon Sep 17 00:00:00 2001 From: David Christenson Date: Wed, 28 Jan 2015 03:22:36 -0700 Subject: [PATCH 1/4] Add libc++ flags on OS X QT5 on OS X apparently does not add '-stdlib=libc++' to CXXFLAGS or LFLAGS, so they must be added by us for compilation to succeed. --- macxconf.pri | 2 ++ 1 file changed, 2 insertions(+) diff --git a/macxconf.pri b/macxconf.pri index 876af0850..4afd638c2 100644 --- a/macxconf.pri +++ b/macxconf.pri @@ -10,6 +10,8 @@ exists($$OUT_PWD/../conf.pri) { } LIBS += -framework Carbon -framework IOKit +QMAKE_CXXFLAGS += -stdlib=libc++ +QMAKE_LFLAGS += -stdlib=libc++ document_icon.path = Contents/Resources document_icon.files = mac/qBitTorrentDocument.icns From 1506999968ac94368d7b86b500fabc7cedbcf205 Mon Sep 17 00:00:00 2001 From: David Christenson Date: Thu, 29 Jan 2015 15:57:08 -0700 Subject: [PATCH 2/4] Fix OS X packaging Remove erroneous Prefix entry from the Mac qt.conf, change translation install location. --- macxconf.pri | 2 +- src/mac/qt.conf | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/macxconf.pri b/macxconf.pri index 4afd638c2..3f7bc6cae 100644 --- a/macxconf.pri +++ b/macxconf.pri @@ -21,7 +21,7 @@ qt_conf.path = Contents/Resources qt_conf.files = mac/qt.conf QMAKE_BUNDLE_DATA += qt_conf -qt_translations.path = Contents/MacOS/translations +qt_translations.path = Contents/translations qt_translations.files = qt-translations/qt_ar.qm \ qt-translations/qt_bg.qm \ qt-translations/qt_ca.qm \ diff --git a/src/mac/qt.conf b/src/mac/qt.conf index 47e7d450f..4c8277466 100644 --- a/src/mac/qt.conf +++ b/src/mac/qt.conf @@ -1,4 +1,3 @@ [Paths] - Prefix = MacOS Translations = translations Plugins = PlugIns From 3f22bf1186b9da64e3d7a1d951b578293866098b Mon Sep 17 00:00:00 2001 From: David Christenson Date: Sun, 1 Feb 2015 13:26:00 -0700 Subject: [PATCH 3/4] Use c++11 config instead of hard coding flags Tell qtmake to use c++11 and let it handle the configuration changes. --- macxconf.pri | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/macxconf.pri b/macxconf.pri index 3f7bc6cae..653a9ec43 100644 --- a/macxconf.pri +++ b/macxconf.pri @@ -10,8 +10,7 @@ exists($$OUT_PWD/../conf.pri) { } LIBS += -framework Carbon -framework IOKit -QMAKE_CXXFLAGS += -stdlib=libc++ -QMAKE_LFLAGS += -stdlib=libc++ +CONFIG += c++11 document_icon.path = Contents/Resources document_icon.files = mac/qBitTorrentDocument.icns From bdb722893fd8992cf9281790e97d55b8b249dc8b Mon Sep 17 00:00:00 2001 From: David Christenson Date: Sun, 1 Feb 2015 13:27:44 -0700 Subject: [PATCH 4/4] Fix C++11 compliance Fix compiler error when compiling with -std=c++11 "invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]" --- src/about_imp.h | 2 +- src/dnsupdater.cpp | 4 ++-- src/qtlibtorrent/qbtsession.cpp | 2 +- src/torrentcreator/torrentcreatorthread.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/about_imp.h b/src/about_imp.h index 1dc97e492..4990f528a 100644 --- a/src/about_imp.h +++ b/src/about_imp.h @@ -69,7 +69,7 @@ class about : public QDialog, private Ui::AboutDlg{ // Set icons logo->setPixmap(QPixmap(QString::fromUtf8(":/Icons/skin/qbittorrent22.png"))); //Title - lb_name->setText(QString::fromUtf8("

qBittorrent")+QString::fromUtf8(" "VERSION"

")); + lb_name->setText(QString::fromUtf8("

qBittorrent")+QString::fromUtf8(" " VERSION"

")); // Thanks QString thanks_txt; thanks_txt += QString::fromUtf8("

I would first like to thank sourceforge.net for hosting qBittorrent project and for their support.

"); diff --git a/src/dnsupdater.cpp b/src/dnsupdater.cpp index af9795ceb..b7d1a0d9c 100644 --- a/src/dnsupdater.cpp +++ b/src/dnsupdater.cpp @@ -76,7 +76,7 @@ void DNSUpdater::checkPublicIP() m_lastIPCheckTime = QDateTime::currentDateTime(); QNetworkRequest request; request.setUrl(QUrl("http://checkip.dyndns.org")); - request.setRawHeader("User-Agent", "qBittorrent/"VERSION" chris@qbittorrent.org"); + request.setRawHeader("User-Agent", "qBittorrent/" VERSION" chris@qbittorrent.org"); manager->get(request); } @@ -123,7 +123,7 @@ void DNSUpdater::updateDNSService() m_lastIPCheckTime = QDateTime::currentDateTime(); QNetworkRequest request; request.setUrl(getUpdateUrl()); - request.setRawHeader("User-Agent", "qBittorrent/"VERSION" chris@qbittorrent.org"); + request.setRawHeader("User-Agent", "qBittorrent/" VERSION" chris@qbittorrent.org"); manager->get(request); } diff --git a/src/qtlibtorrent/qbtsession.cpp b/src/qtlibtorrent/qbtsession.cpp index 238b556dd..9eb86b620 100755 --- a/src/qtlibtorrent/qbtsession.cpp +++ b/src/qtlibtorrent/qbtsession.cpp @@ -421,7 +421,7 @@ void QBtSession::configureSession() { } // * Session settings session_settings sessionSettings = s->settings(); - sessionSettings.user_agent = "qBittorrent "VERSION; + sessionSettings.user_agent = "qBittorrent " VERSION; //std::cout << "HTTP user agent is " << sessionSettings.user_agent << std::endl; logger->addMessage(tr("HTTP user agent is %1").arg(misc::toQString(sessionSettings.user_agent))); diff --git a/src/torrentcreator/torrentcreatorthread.cpp b/src/torrentcreator/torrentcreatorthread.cpp index a87b19fc6..88f9666d1 100644 --- a/src/torrentcreator/torrentcreatorthread.cpp +++ b/src/torrentcreator/torrentcreatorthread.cpp @@ -83,7 +83,7 @@ void TorrentCreatorThread::sendProgressSignal(int progress) { void TorrentCreatorThread::run() { emit updateProgress(0); - QString creator_str("qBittorrent "VERSION); + QString creator_str("qBittorrent " VERSION); try { file_storage fs; // Adding files to the torrent