]> granicus.if.org Git - transmission/commitdiff
(trunk, qt) #5465: restore Qt 4.6 support, patch by mike.did
authorJordan Lee <jordan@transmissionbt.com>
Sat, 17 Aug 2013 16:22:56 +0000 (16:22 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sat, 17 Aug 2013 16:22:56 +0000 (16:22 +0000)
qt/README.txt
qt/favicon.cc
qt/file-tree.cc
qt/qtr.pro

index b0efa35c8829091eac65384672e9186b86dcc24f..fee49494202f4f6b6b511bfab4c795ad25597ecd 100644 (file)
@@ -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)
index 6390bea1fd636d73529282497524d02407eac8d4..d1a31f87c08319484f8598dbe84c01dcdd97df7c 100644 (file)
 #include <QNetworkAccessManager>
 #include <QNetworkReply>
 #include <QNetworkRequest>
-#include <QStandardPaths>
+
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+ #include <QDesktopServices>
+#else
+ #include <QStandardPaths>
+#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" );
 }
 
index 62cf870eab45c1b32d260de330103e24b52fc344..8075aa25968497f07149e52f28b1713f0bace2ea 100644 (file)
@@ -885,7 +885,12 @@ FileTreeView :: FileTreeView (QWidget * parent, bool isEditable):
   for (int i=0; i<NUM_COLUMNS; ++i)
     {
       setColumnHidden (i, (i<FIRST_VISIBLE_COLUMN) || (LAST_VISIBLE_COLUMN<i));
+
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+      header()->setResizeMode(i, QHeaderView::Interactive);
+#else
       header()->setSectionResizeMode(i, QHeaderView::Interactive);
+#endif
     }
 
   connect (this, SIGNAL(clicked(const QModelIndex&)),
index 27dc22b9d6e9ef0ad90ec51a02fdd0057f9aaaff..221a34bc2ce4623fe6554b880437c6b15bd4a51c 100644 (file)
@@ -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)