Changeset 79a7671


Ignore:
Timestamp:
08/30/17 21:15:52 (4 years ago)
Author:
gregor herrmann <gregor@…>
Branches:
master, qt5
Children:
30edeb7
Parents:
809b5e5
Message:

ifdef qt4 and qt5

Files:
10 edited

Legend:

Unmodified
Added
Removed
  • confclerk.pro

    r809b5e5 r79a7671  
    44ISQT4 = $$find(QMAKEVERSION, ^[2-9])
    55isEmpty( ISQT4 ) {
    6         error("Use the qmake include with Qt4.4 or greater, on Debian that is qmake-qt4");
     6        error("Use the qmake include with Qt4.7 or greater, on Debian that is qmake-qt4");
    77}
    88
  • src/app/app.pro

    r809b5e5 r79a7671  
    33TARGET = confclerk
    44DESTDIR = ../bin
    5 QT += sql xml network widgets
     5QT += sql xml network
     6greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    67CONFIG(maemo5) {
    78    QT += maemo5
  • src/gui/eventdialog.cpp

    r809b5e5 r79a7671  
    2828#endif
    2929
     30QString toHtmlEscaped(const QString& string) {
     31#if QT_VERSION >= 0x050000
     32    return string.toHtmlEscaped();
     33#else
     34    return Qt::escape(string);
     35#endif
     36}
     37
    3038EventDialog::EventDialog(int conferenceId, int eventId, QWidget *parent): QDialog(parent), mConferenceId(conferenceId), mEventId(eventId) {
    3139    setupUi(this);
     
    3947    QString info;
    4048    // title
    41     info.append(QString("<h1>%1</h1>\n").arg(event.title().toHtmlEscaped()));
     49    info.append(QString("<h1>%1</h1>\n").arg(toHtmlEscaped(event.title())));
    4250
    4351    // persons
    4452    info += QString("<h2>%1</h2>\n").arg(tr("Persons"));
    4553    QStringList persons = event.persons();
    46     for (int i = 0; i != persons.size(); ++i) persons[i] = persons[i].toHtmlEscaped();
     54    for (int i = 0; i != persons.size(); ++i) persons[i] = toHtmlEscaped(persons[i]);
    4755    info += QString("<p>%1</p>\n").arg(persons.join(", "));
    4856
     
    7280        if (url.isEmpty() || url == "http://") continue;
    7381        if (name.isEmpty()) name = url;
    74         info += QString("<li><a href=\"%1\">%2</a></li>\n").arg(url.toHtmlEscaped(), name.toHtmlEscaped());
     82        info += QString("<li><a href=\"%1\">%2</a></li>\n").arg(toHtmlEscaped(url), toHtmlEscaped(name));
    7583    }
    7684    info += QString("</ul>\n");
  • src/gui/gui.pro

    r809b5e5 r79a7671  
    66QT += sql \
    77    xml \
    8     network \
    9     widgets
     8    network
     9greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    1010QMAKE_CLEAN += ../bin/libgui.a
    1111
  • src/gui/mainwindow.h

    r809b5e5 r79a7671  
    2121#define MAINWINDOW_H
    2222
     23#include "qglobal.h"
     24#if QT_VERSION >= 0x050000
    2325#include <QtWidgets>
     26#else
     27#include <QtGui/QMainWindow>
     28#endif
    2429#include <QSslError>
    2530
  • src/gui/searchhead.h

    r809b5e5 r79a7671  
    2121#define SEARCHHEAD_H
    2222
     23#include "qglobal.h"
     24#if QT_VERSION >= 0x050000
    2325#include <QtWidgets>
     26#else
     27#include <QtGui/QWidget>
     28#endif
    2429#include <QDebug>
    2530#include "ui_searchhead.h"
  • src/mvc/delegate.h

    r809b5e5 r79a7671  
    2121#define DELEGATE_H
    2222
     23#include "qglobal.h"
     24#if QT_VERSION >= 0x050000
    2325#include <QtWidgets>
     26#else
     27#include <QtGui>
     28#endif
    2429
    2530class Delegate : public QItemDelegate
  • src/mvc/eventmodel.cpp

    r809b5e5 r79a7671  
    177177    if (!parent.isValid())
    178178    {
    179         return createIndex(row, column, (quintptr) 0);
     179        return createIndex(row, column);
    180180    }
    181181    else if (parent.internalId() == 0)
     
    202202        Event * event = static_cast<Event*>(index.internalPointer());
    203203
    204         return createIndex(mParents[event->id()], 0, (quintptr) 0);
     204        return createIndex(mParents[event->id()], 0);
    205205    }
    206206
  • src/mvc/mvc.pro

    r809b5e5 r79a7671  
    44DESTDIR = ../bin
    55CONFIG += static
    6 QT += sql \
    7     widgets
     6QT += sql
     7greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    88QMAKE_CLEAN += ../bin/libmvc.a
    99
  • src/sql/sqlengine.cpp

    r809b5e5 r79a7671  
    2424#include <QVariant>
    2525#include <QDateTime>
     26#include "qglobal.h"
     27#if QT_VERSION >= 0x050000
    2628#include <QStandardPaths>
     29#else
     30#include <QDesktopServices>
     31#endif
    2732
    2833#include <QDir>
     
    3742
    3843SqlEngine::SqlEngine(QObject *aParent): QObject(aParent) {
     44#if QT_VERSION >= 0x050000
    3945    QDir dbPath(QStandardPaths::writableLocation(QStandardPaths::DataLocation));
     46#else
     47    QDir dbPath(QDesktopServices::storageLocation(QDesktopServices::DataLocation));
     48#endif
    4049    dbFilename = dbPath.absoluteFilePath("ConfClerk.sqlite");
    4150}
Note: See TracChangeset for help on using the changeset viewer.