From 4c371517e608e8fd1645d8ca7c20a0e30f38dab5 Mon Sep 17 00:00:00 2001 From: Jadon Fowler Date: Sun, 7 Oct 2018 20:17:20 -0700 Subject: [PATCH] Add installation instructions and fix compile issues By changing the call to QString#chopped to QString#left, we remove the Qt 10 dependency. I also changed the C++ version to C++11 as that's what the code is using my compiler (and others) didn't default to it. Ref #2 Signed-off-by: Jadon Fowler --- .gitignore | 7 +++++-- INSTALL.md | 15 +++++++++++++++ porymap.pro | 2 +- src/core/parseutil.cpp | 2 +- src/ui/tileseteditor.cpp | 1 + 5 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 INSTALL.md diff --git a/.gitignore b/.gitignore index cbf9ee0d..3d265d53 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,9 @@ porymap.pro.user moc_* qrc_* porymap.app* +porymap Makefile -ui_mainwindow.h -ui_objectpropertiesframe.h + +# Generated UI header +ui_*.h + diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 00000000..0f566a63 --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,15 @@ +# Installation + +porymap requires Qt 5 & C++11. + +## Ubuntu + +You need to install Qt 5. Qt 5.5 should be enough. You can check you Qt version +with `qtdiag`. + +``` +sudo apt-get install qt5-default +qmake +make +./porymap +``` diff --git a/porymap.pro b/porymap.pro index 4fac7ee0..031868da 100644 --- a/porymap.pro +++ b/porymap.pro @@ -12,7 +12,7 @@ TARGET = porymap TEMPLATE = app RC_ICONS = resources/icons/porymap-icon-1.ico ICON = resources/icons/porymap-icon-1.ico - +QMAKE_CXXFLAGS += -std=c++11 SOURCES += src/core/block.cpp \ src/core/blockdata.cpp \ diff --git a/src/core/parseutil.cpp b/src/core/parseutil.cpp index a64ce33c..fef26e6b 100644 --- a/src/core/parseutil.cpp +++ b/src/core/parseutil.cpp @@ -77,7 +77,7 @@ QList* ParseUtil::parseHealLocs(QString text) { int i = 1; for (auto line : lines){ if (line.contains("MAP_GROUP")){ - QList li = line.replace(" ","").chopped(2).remove('{').split(','); + QList li = line.remove(QRegExp("[{|} ]")).split(","); HealLocation hloc = HealLocation(li[1].remove("MAP_NUM(").remove(")"), i, li[2].toUShort(), li[3].toUShort()); parsed->append(hloc); i++; diff --git a/src/ui/tileseteditor.cpp b/src/ui/tileseteditor.cpp index 56adc6a5..710771cb 100644 --- a/src/ui/tileseteditor.cpp +++ b/src/ui/tileseteditor.cpp @@ -5,6 +5,7 @@ #include #include #include +#include TilesetEditor::TilesetEditor(Project *project, QString primaryTilesetLabel, QString secondaryTilesetLabel, QWidget *parent) : QMainWindow(parent),