Skip to content

Commit 9bfac61

Browse files
author
ron
committed
Linux and Qt 5.3.x build fixes
1 parent 8886991 commit 9bfac61

6 files changed

+22
-4
lines changed

TTWatcherMain.pro

+3
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ qhttpserver.file=qhttpserver/src/src.pro
1010

1111
ttwatcher.file=src/ttwatcher.pro
1212
ttwatcher.depends += qhttpserver
13+
ttwatcher.depends += quazip
14+
15+

src/SlippyMap.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ void SlippyMap::processTile(QPoint &tp, QByteArray &data)
267267
}
268268
}
269269

270-
QByteArray SlippyMap::loadEmptyTile()
270+
QByteArray & SlippyMap::loadEmptyTile()
271271
{
272272
if ( m_EmptyTileData.length() == 0 )
273273
{

src/SlippyMap.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class SlippyMap: public QObject
5454
QNetworkDiskCache * m_Cache;
5555
void processTile(QPoint & tp, QByteArray & data );
5656
QByteArray m_EmptyTileData;
57-
QByteArray loadEmptyTile();
57+
QByteArray & loadEmptyTile();
5858
public:
5959
int width;
6060
int height;

src/bridge.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "bridge.h"
22
#include <QDebug>
3-
#include <QlineF>
3+
#include <QLineF>
44
#include <QMarginsF>
55
#include <QMap>
66
#include <QPolygonF>
@@ -380,7 +380,12 @@ bool Bridge::loadBridgeFiles(BridgeList &bridgeList)
380380
#endif
381381
allOk &= loadBridgeFiles(dir, bridgeList);
382382

383-
dir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QDir::separator();
383+
#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
384+
dir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QDir::separator() ;
385+
#else
386+
dir = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QDir::separator();
387+
#endif
388+
384389
allOk &= loadBridgeFiles(dir, bridgeList);
385390
return allOk;
386391
}

src/elevation.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ Elevation::Elevation(const QString &basePath) :
1313
{
1414
if ( m_BasePath.length() == 0 )
1515
{
16+
17+
#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
1618
m_BasePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QDir::separator() + "data/";
19+
#else
20+
m_BasePath = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QDir::separator() + "data/";
21+
#endif
22+
1723
qDebug() << "Elevation using " << m_BasePath;
1824
}
1925

src/settingsdialog.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -283,5 +283,9 @@ void SettingsDialog::on_SettingsDialog_rejected()
283283

284284
void SettingsDialog::on_openElevationCacheButton_clicked()
285285
{
286+
#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
286287
QDesktopServices::openUrl(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/data/");
288+
#else
289+
QDesktopServices::openUrl(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/data/");
290+
#endif
287291
}

0 commit comments

Comments
 (0)