[nostalgia] Update nested namespaces for C++17
This commit is contained in:
@@ -8,10 +8,8 @@
|
||||
|
||||
#include "consts.hpp"
|
||||
|
||||
namespace nostalgia {
|
||||
namespace world {
|
||||
namespace nostalgia::world {
|
||||
|
||||
QString PATH_ZONES = "/World/Zones/";
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -10,10 +10,8 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace nostalgia {
|
||||
namespace world {
|
||||
namespace nostalgia::world {
|
||||
|
||||
extern QString PATH_ZONES;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -11,8 +11,7 @@
|
||||
#include "consts.hpp"
|
||||
#include "newworldwizard.hpp"
|
||||
|
||||
namespace nostalgia {
|
||||
namespace world {
|
||||
namespace nostalgia::world {
|
||||
|
||||
using namespace studio;
|
||||
|
||||
@@ -21,15 +20,14 @@ const QString NewWorldWizard::FIELD_WORLD_PATH = "World.WorldPath";
|
||||
NewWorldWizard::NewWorldWizard(const Context *ctx) {
|
||||
addLineEdit(tr("&Name:"), FIELD_WORLD_PATH, "", [this, ctx](QString worldName) {
|
||||
worldName = PATH_ZONES + worldName;
|
||||
if (ctx->project->stat(worldName).inode == 0) {
|
||||
return 0;
|
||||
} else {
|
||||
auto [stat, err] = ctx->project->stat(worldName);
|
||||
if (err) {
|
||||
this->showValidationError(tr("World already exists: %1").arg(worldName));
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -12,8 +12,7 @@
|
||||
|
||||
#include <nostalgia/studio/studio.hpp>
|
||||
|
||||
namespace nostalgia {
|
||||
namespace world {
|
||||
namespace nostalgia::world {
|
||||
|
||||
struct NewWorldWizard: public studio::WizardFormPage {
|
||||
|
||||
@@ -24,4 +23,3 @@ struct NewWorldWizard: public studio::WizardFormPage {
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -10,8 +10,7 @@
|
||||
|
||||
#include <nostalgia/studio/studio.hpp>
|
||||
|
||||
namespace nostalgia {
|
||||
namespace world {
|
||||
namespace nostalgia::world {
|
||||
|
||||
class WorldEditor: public QWidget {
|
||||
|
||||
@@ -21,4 +20,3 @@ class WorldEditor: public QWidget {
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -16,8 +16,7 @@
|
||||
|
||||
#include "worldstudioplugin.hpp"
|
||||
|
||||
namespace nostalgia {
|
||||
namespace world {
|
||||
namespace nostalgia::world {
|
||||
|
||||
using namespace studio;
|
||||
|
||||
@@ -32,11 +31,10 @@ QVector<WizardMaker> WorldEditorPlugin::newWizards(const Context *ctx) {
|
||||
qDebug() << "creating Region";
|
||||
auto path = PATH_ZONES + w->field(NewWorldWizard::FIELD_WORLD_PATH).toString();
|
||||
Region rgn;
|
||||
auto err = ctx->project->mkdir(PATH_ZONES);
|
||||
oxReturnError(ctx->project->mkdir(PATH_ZONES));
|
||||
ctx->project->saveRomFs();
|
||||
qDebug() << "err:" << err;
|
||||
err |= ctx->project->writeObj(path, &rgn);
|
||||
return err;
|
||||
oxReturnError(ctx->project->writeObj(path, &rgn));
|
||||
return OxError(0);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -51,4 +49,3 @@ QWidget *WorldEditorPlugin::makeEditor(QString path, const Context *ctx) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -12,8 +12,7 @@
|
||||
|
||||
#include <nostalgia/studio/studio.hpp>
|
||||
|
||||
namespace nostalgia {
|
||||
namespace world {
|
||||
namespace nostalgia::world {
|
||||
|
||||
class WorldEditorPlugin: public QObject, public studio::Plugin {
|
||||
Q_OBJECT
|
||||
@@ -28,4 +27,3 @@ class WorldEditorPlugin: public QObject, public studio::Plugin {
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user