From: Jordan Lee Date: Sat, 17 Aug 2013 16:22:56 +0000 (+0000) Subject: (trunk, qt) #5465: restore Qt 4.6 support, patch by mike.did X-Git-Tag: 2.83~117 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=59abf35807adc53f9a02bac7b8ad7d0f5c53f5fd;p=transmission (trunk, qt) #5465: restore Qt 4.6 support, patch by mike.did --- diff --git a/qt/README.txt b/qt/README.txt index b0efa35c8..fee494942 100644 --- a/qt/README.txt +++ b/qt/README.txt @@ -36,9 +36,9 @@ BUILDING ON OS X BUILDING ON UNIX - 1. Prerequisites: Qt >= 5 and its development packages + 1. Prerequisites: Qt >= 4.6 and its development packages 2. Build Transmission as normal - 3. In the qt/ directory, type "qmake qtr.pro" or "qmake-qt5 qtr.pro" + 3. In the qt/ directory, type "qmake qtr.pro" (or "qmake-qt4 qtr.pro", or "qmake-qt5 qtr.pro") 4. In the qt/ directory, type "make" 5. In the qt/ directory, as root, type "INSTALL_ROOT=/usr make install" (Feel free to replace /usr with /usr/local or /opt or whatever) diff --git a/qt/favicon.cc b/qt/favicon.cc index 6390bea1f..d1a31f87c 100644 --- a/qt/favicon.cc +++ b/qt/favicon.cc @@ -14,7 +14,12 @@ #include #include #include -#include + +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + #include +#else + #include +#endif #include "favicon.h" @@ -40,7 +45,13 @@ Favicons :: ~Favicons( ) QString Favicons :: getCacheDir( ) { - const QString base = QStandardPaths::writableLocation (QStandardPaths::CacheLocation); + const QString base = +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + QDesktopServices::storageLocation( QDesktopServices::CacheLocation ); +#else + QStandardPaths::writableLocation( QStandardPaths::CacheLocation ); +#endif + return QDir( base ).absoluteFilePath( "favicons" ); } diff --git a/qt/file-tree.cc b/qt/file-tree.cc index 62cf870ea..8075aa259 100644 --- a/qt/file-tree.cc +++ b/qt/file-tree.cc @@ -885,7 +885,12 @@ FileTreeView :: FileTreeView (QWidget * parent, bool isEditable): for (int i=0; isetResizeMode(i, QHeaderView::Interactive); +#else header()->setSectionResizeMode(i, QHeaderView::Interactive); +#endif } connect (this, SIGNAL(clicked(const QModelIndex&)), diff --git a/qt/qtr.pro b/qt/qtr.pro index 27dc22b9d..221a34bc2 100644 --- a/qt/qtr.pro +++ b/qt/qtr.pro @@ -12,9 +12,13 @@ man.path = /share/man/man1/ man.files = transmission-qt.1 CONFIG += qt thread debug link_pkgconfig -QT += network dbus widgets +QT += network dbus PKGCONFIG = fontconfig libcurl openssl libevent +greaterThan(QT_MAJOR_VERSION, 4) { + QT += widgets +} + TRANSMISSION_TOP = .. include(config.pri)