[nostalgia] Update nested namespaces for C++17
This commit is contained in:
parent
8cd38dccbf
commit
32b345ed0b
@ -7,8 +7,7 @@
|
||||
*/
|
||||
#include "bounds.hpp"
|
||||
|
||||
namespace nostalgia {
|
||||
namespace common {
|
||||
namespace nostalgia::common {
|
||||
|
||||
Bounds::Bounds(int x, int y, int w, int h) {
|
||||
this->x = x;
|
||||
@ -42,4 +41,3 @@ Point Bounds::pt2() {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -9,8 +9,7 @@
|
||||
|
||||
#include "point.hpp"
|
||||
|
||||
namespace nostalgia {
|
||||
namespace common {
|
||||
namespace nostalgia::common {
|
||||
|
||||
class Bounds {
|
||||
public:
|
||||
@ -48,4 +47,3 @@ ox::Error model(T *io, Bounds *obj) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -7,8 +7,7 @@
|
||||
*/
|
||||
#include "point.hpp"
|
||||
|
||||
namespace nostalgia {
|
||||
namespace common {
|
||||
namespace nostalgia::common {
|
||||
|
||||
Point::Point() {
|
||||
}
|
||||
@ -122,4 +121,3 @@ Point Point::operator/=(int i) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -10,8 +10,7 @@
|
||||
|
||||
#include <ox/std/error.hpp>
|
||||
|
||||
namespace nostalgia {
|
||||
namespace common {
|
||||
namespace nostalgia::common {
|
||||
|
||||
class Point {
|
||||
public:
|
||||
@ -68,4 +67,3 @@ ox::Error model(T *io, Point *obj) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -8,8 +8,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace nostalgia {
|
||||
namespace studio {
|
||||
namespace nostalgia::studio {
|
||||
|
||||
enum {
|
||||
JSON_ERR_FIELD_MISSING = 1,
|
||||
@ -17,4 +16,3 @@ enum {
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -8,8 +8,7 @@
|
||||
|
||||
#include "json_read.hpp"
|
||||
|
||||
namespace nostalgia {
|
||||
namespace studio {
|
||||
namespace nostalgia::studio {
|
||||
|
||||
JsonReader::JsonReader(QJsonObject &obj): m_src(obj) {
|
||||
}
|
||||
@ -86,4 +85,3 @@ ox::Error JsonReader::field(QJsonValueRef src, QString *dest) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -14,8 +14,7 @@
|
||||
|
||||
#include <ox/fs/fs.hpp>
|
||||
|
||||
namespace nostalgia {
|
||||
namespace studio {
|
||||
namespace nostalgia::studio {
|
||||
|
||||
class OxFSFile {
|
||||
private:
|
||||
@ -82,4 +81,3 @@ class OxFSModel: public QAbstractItemModel {
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -8,8 +8,7 @@
|
||||
|
||||
#include "plugin.hpp"
|
||||
|
||||
namespace nostalgia {
|
||||
namespace studio {
|
||||
namespace nostalgia::studio {
|
||||
|
||||
QVector<WizardMaker> Plugin::newWizards(const Context*) {
|
||||
return {};
|
||||
@ -24,4 +23,3 @@ QWidget *Plugin::makeEditor(QString, const Context*) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -19,8 +19,7 @@
|
||||
#include "project.hpp"
|
||||
#include "wizard.hpp"
|
||||
|
||||
namespace nostalgia {
|
||||
namespace studio {
|
||||
namespace nostalgia::studio {
|
||||
|
||||
struct Context {
|
||||
QWidget *tabParent = nullptr;
|
||||
@ -46,7 +45,6 @@ class Plugin {
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#define PluginInterface_iid "net.drinkingtea.nostalgia.studio.Plugin"
|
||||
|
@ -15,8 +15,7 @@
|
||||
#include <ox/fs/fs.hpp>
|
||||
#include <ox/mc/mc.hpp>
|
||||
|
||||
namespace nostalgia {
|
||||
namespace studio {
|
||||
namespace nostalgia::studio {
|
||||
|
||||
class Project: public QObject {
|
||||
Q_OBJECT
|
||||
@ -75,4 +74,3 @@ ox::Error Project::writeObj(QString path, T *obj) const {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -18,8 +18,7 @@
|
||||
#include "plugin.hpp"
|
||||
#include "wizard.hpp"
|
||||
|
||||
namespace nostalgia {
|
||||
namespace studio {
|
||||
namespace nostalgia::studio {
|
||||
|
||||
using std::function;
|
||||
|
||||
@ -343,4 +342,3 @@ void Wizard::accept() {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -19,8 +19,7 @@
|
||||
#include <QVector>
|
||||
#include <QWizard>
|
||||
|
||||
namespace nostalgia {
|
||||
namespace studio {
|
||||
namespace nostalgia::studio {
|
||||
|
||||
struct WizardMaker {
|
||||
QString name;
|
||||
@ -132,4 +131,3 @@ class Wizard: public QWizard {
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -29,8 +29,7 @@
|
||||
|
||||
#include "mainwindow.hpp"
|
||||
|
||||
namespace nostalgia {
|
||||
namespace studio {
|
||||
namespace nostalgia::studio {
|
||||
|
||||
const QString MainWindow::StateFilePath = "studio_state.json";
|
||||
|
||||
@ -375,4 +374,3 @@ void MainWindow::refreshProjectExplorer(QString path) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -27,8 +27,7 @@
|
||||
#include "lib/plugin.hpp"
|
||||
#include "lib/project.hpp"
|
||||
|
||||
namespace nostalgia {
|
||||
namespace studio {
|
||||
namespace nostalgia::studio {
|
||||
|
||||
struct NostalgiaStudioState {
|
||||
QString projectPath;
|
||||
@ -145,4 +144,3 @@ class MainWindow: public QMainWindow {
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user