Commit 01a9f7ee authored by Philipp Erhardt's avatar Philipp Erhardt
Browse files

Remove unnecessary defines

parent 44cffe47
......@@ -10,7 +10,6 @@ greaterThan(QT_MAJOR_VERSION, 4) {
DEFINES += QT_DEPRECATED_WARNINGS
}
POPPLER = poppler-qt$$QT_MAJOR_VERSION
DEFINES += POPPLER_QT=$$QT_MAJOR_VERSION
unix {
CONFIG += link_pkgconfig
......
......@@ -3,10 +3,10 @@
#include <QImage>
#include <QMutex>
#if POPPLER_QT >= 5
#include <poppler-qt5.h>
#if QT_VERSION >= 0x050000
# include <poppler-qt5.h>
#else
#include <poppler-qt4.h>
# include <poppler-qt4.h>
#endif
......
......@@ -4,10 +4,10 @@
#include <QPainter>
#include <QList>
#include <QClipboard>
#if POPPLER_QT >= 5
#include <poppler-qt5.h>
#if QT_VERSION >= 0x050000
# include <poppler-qt5.h>
#else
#include <poppler-qt4.h>
# include <poppler-qt4.h>
#endif
#include <map>
#include "../selection.h"
......
#ifndef RESOURCEMANAGER_H
#define RESOURCEMANAGER_H
#if POPPLER_QT >= 5
#include <poppler-qt5.h>
#else
#include <poppler-qt4.h>
#endif
#include <QObject>
#include <QString>
#include <QImage>
#include <QThread>
#include <QMutex>
#include <QSemaphore>
#if QT_VERSION >= 0x050000
# include <poppler-qt5.h>
#else
# include <poppler-qt4.h>
#endif
#include <list>
#include <set>
......
#ifndef SEARCH_H
#define SEARCH_H
#if POPPLER_QT >= 5
#include <poppler-qt5.h>
#else
#include <poppler-qt4.h>
#endif
#include <QString>
#include <QThread>
#include <QMutex>
......@@ -16,6 +11,11 @@
#include <QRect>
#include <QEvent>
#include <QList>
#if QT_VERSION >= 0x050000
# include <poppler-qt5.h>
#else
# include <poppler-qt4.h>
#endif
class SearchBar;
......
......@@ -59,11 +59,7 @@ QRectF SelectionLine::get_bbox() const {
}
void SelectionLine::sort() {
#if QT_VERSION >= 0x050000
std::stable_sort(parts.begin(), parts.end(), selection_less_x);
#else
qStableSort(parts.begin(), parts.end(), selection_less_x);
#endif
stable_sort(parts.begin(), parts.end(), selection_less_x);
}
bool selection_less_x(const SelectionPart *a, const SelectionPart *b) {
......
#ifndef SELECTIONPART_H
#define SELECTIONPART_H
#if POPPLER_QT >= 5
#include <poppler-qt5.h>
#include <QRectF>
#if QT_VERSION >= 0x050000
# include <poppler-qt5.h>
#else
#include <poppler-qt4.h>
# include <poppler-qt4.h>
#endif
#include <QRectF>
namespace Selection {
......
......@@ -7,10 +7,10 @@
#include "config.h"
#include <list>
#include <iostream>
#if POPPLER_QT >= 5
#include <poppler-qt5.h>
#if QT_VERSION >= 0x050000
# include <poppler-qt5.h>
#else
#include <poppler-qt4.h>
# include <poppler-qt4.h>
#endif
using namespace std;
......@@ -195,11 +195,7 @@ void Worker::run() {
}
// sort by y coordinate
#if QT_VERSION >= 0x050000
std::stable_sort(selection_parts.begin(), selection_parts.end(), selection_less_y);
#else
qStableSort(selection_parts.begin(), selection_parts.end(), selection_less_y);
#endif
stable_sort(selection_parts.begin(), selection_parts.end(), selection_less_y);
QRectF line_box;
QList<SelectionLine *> *lines = new QList<SelectionLine *>();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment