Ticket #5465: build-against-qt-4-and-5.patch

File build-against-qt-4-and-5.patch, 2.5 KB (added by mike.dld, 8 years ago)
  • README.txt

     
    3636
    3737BUILDING ON UNIX
    3838
    39    1. Prerequisites: Qt >= 5 and its development packages
     39   1. Prerequisites: Qt >= 4.6 and its development packages
    4040   2. Build Transmission as normal
    41    3. In the qt/ directory, type "qmake qtr.pro" or "qmake-qt5 qtr.pro"
     41   3. In the qt/ directory, type "qmake qtr.pro" (or "qmake-qt4 qtr.pro", or "qmake-qt5 qtr.pro")
    4242   4. In the qt/ directory, type "make"
    4343   5. In the qt/ directory, as root, type "INSTALL_ROOT=/usr make install"
    4444      (Feel free to replace /usr with /usr/local or /opt or whatever)
  • favicon.cc

     
    1414#include <QNetworkAccessManager>
    1515#include <QNetworkReply>
    1616#include <QNetworkRequest>
     17
     18#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
     19#include <QDesktopServices>
     20#else
    1721#include <QStandardPaths>
     22#endif
    1823
    1924#include "favicon.h"
    2025
     
    4045QString
    4146Favicons :: getCacheDir( )
    4247{
    43     const QString base = QStandardPaths::writableLocation (QStandardPaths::CacheLocation);
     48    const QString base =
     49#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
     50        QDesktopServices::storageLocation( QDesktopServices::CacheLocation );
     51#else
     52        QStandardPaths::writableLocation( QStandardPaths::CacheLocation );
     53#endif
     54
    4455    return QDir( base ).absoluteFilePath( "favicons" );
    4556}
    4657
  • file-tree.cc

     
    885885  for (int i=0; i<NUM_COLUMNS; ++i)
    886886    {
    887887      setColumnHidden (i, (i<FIRST_VISIBLE_COLUMN) || (LAST_VISIBLE_COLUMN<i));
     888
     889#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
     890      header()->setResizeMode(i, QHeaderView::Interactive);
     891#else
    888892      header()->setSectionResizeMode(i, QHeaderView::Interactive);
     893#endif
    889894    }
    890895
    891896  connect (this, SIGNAL(clicked(const QModelIndex&)),
  • qtr.pro

     
    1212man.files = transmission-qt.1
    1313
    1414CONFIG += qt thread debug link_pkgconfig
    15 QT += network dbus widgets
     15QT += network dbus
    1616PKGCONFIG = fontconfig libcurl openssl libevent
    1717
     18greaterThan(QT_MAJOR_VERSION, 4) {
     19    QT += widgets
     20}
     21
    1822TRANSMISSION_TOP = ..
    1923
    2024include(config.pri)