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 <jadonflower@gmail.com>
This commit is contained in:
Jadon Fowler 2018-10-07 20:17:20 -07:00
parent 2d3a10fdd8
commit 4c371517e6
No known key found for this signature in database
GPG key ID: B98B526268287A29
5 changed files with 23 additions and 4 deletions

7
.gitignore vendored
View file

@ -5,6 +5,9 @@ porymap.pro.user
moc_* moc_*
qrc_* qrc_*
porymap.app* porymap.app*
porymap
Makefile Makefile
ui_mainwindow.h
ui_objectpropertiesframe.h # Generated UI header
ui_*.h

15
INSTALL.md Normal file
View file

@ -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
```

View file

@ -12,7 +12,7 @@ TARGET = porymap
TEMPLATE = app TEMPLATE = app
RC_ICONS = resources/icons/porymap-icon-1.ico RC_ICONS = resources/icons/porymap-icon-1.ico
ICON = resources/icons/porymap-icon-1.ico ICON = resources/icons/porymap-icon-1.ico
QMAKE_CXXFLAGS += -std=c++11
SOURCES += src/core/block.cpp \ SOURCES += src/core/block.cpp \
src/core/blockdata.cpp \ src/core/blockdata.cpp \

View file

@ -77,7 +77,7 @@ QList<HealLocation>* ParseUtil::parseHealLocs(QString text) {
int i = 1; int i = 1;
for (auto line : lines){ for (auto line : lines){
if (line.contains("MAP_GROUP")){ if (line.contains("MAP_GROUP")){
QList<QString> li = line.replace(" ","").chopped(2).remove('{').split(','); QList<QString> li = line.remove(QRegExp("[{|} ]")).split(",");
HealLocation hloc = HealLocation(li[1].remove("MAP_NUM(").remove(")"), i, li[2].toUShort(), li[3].toUShort()); HealLocation hloc = HealLocation(li[1].remove("MAP_NUM(").remove(")"), i, li[2].toUShort(), li[3].toUShort());
parsed->append(hloc); parsed->append(hloc);
i++; i++;

View file

@ -5,6 +5,7 @@
#include <QDebug> #include <QDebug>
#include <QMessageBox> #include <QMessageBox>
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QCloseEvent>
TilesetEditor::TilesetEditor(Project *project, QString primaryTilesetLabel, QString secondaryTilesetLabel, QWidget *parent) : TilesetEditor::TilesetEditor(Project *project, QString primaryTilesetLabel, QString secondaryTilesetLabel, QWidget *parent) :
QMainWindow(parent), QMainWindow(parent),