(trunk, qt) #5465: restore Qt 4.6 support, patch by mike.did

This commit is contained in:
Jordan Lee 2013-08-17 16:22:56 +00:00
parent 9182c34711
commit 59abf35807
4 changed files with 25 additions and 5 deletions

View 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)

View File

@ -14,7 +14,12 @@
#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" );
}

View 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&)),

View 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)