[nostalgia] Make almost everyting noexcept
This commit is contained in:
@@ -41,8 +41,7 @@ void Project::mkdir(QString path) const {
|
||||
}
|
||||
|
||||
ox::FileStat Project::stat(QString path) const {
|
||||
auto [s, e] = m_fs.stat(path.toUtf8().data());
|
||||
oxThrowError(e);
|
||||
oxRequireT(s, m_fs.stat(path.toUtf8().data()));
|
||||
return s;
|
||||
}
|
||||
|
||||
|
@@ -95,22 +95,20 @@ class NOSTALGIASTUDIO_EXPORT Project: public QObject {
|
||||
template<typename T>
|
||||
void Project::writeObj(QString path, T *obj) const {
|
||||
// write MetalClaw
|
||||
auto [buff, err] = ox::writeClaw(obj, ox::ClawFormat::Metal);
|
||||
oxThrowError(err);
|
||||
oxRequireMT(buff, ox::writeClaw(obj, ox::ClawFormat::Metal));
|
||||
// write to FS
|
||||
writeBuff(path, ox::bit_cast<uint8_t*>(buff.data()), buff.size());
|
||||
|
||||
// write type descriptor
|
||||
const auto type = ox::buildTypeDef(obj);
|
||||
auto typeOut = ox::writeClaw(type.value, ox::ClawFormat::Organic);
|
||||
oxThrowError(typeOut);
|
||||
oxRequireMT(typeOut, ox::writeClaw(type.value, ox::ClawFormat::Organic));
|
||||
// replace garbage last character with new line
|
||||
typeOut.value.back().value = '\n';
|
||||
typeOut.back().value = '\n';
|
||||
// write to FS
|
||||
QString descPath = "/.nostalgia/type_descriptors/";
|
||||
const auto typePath = descPath + type.value->typeName.c_str();
|
||||
mkdir(descPath);
|
||||
writeBuff(typePath, ox::bit_cast<uint8_t*>(typeOut.value.data()), typeOut.value.size());
|
||||
writeBuff(typePath, ox::bit_cast<uint8_t*>(typeOut.data()), typeOut.size());
|
||||
emit fileUpdated(path);
|
||||
}
|
||||
|
||||
|
@@ -258,7 +258,7 @@ void MainWindow::addDockWidget(Qt::DockWidgetArea area, QDockWidget *dockWidget)
|
||||
QAction *MainWindow::addAction(QMenu *menu, QString text, QString toolTip, const QObject *tgt, const char *cb) {
|
||||
auto action = menu->addAction(text);
|
||||
action->setStatusTip(toolTip);
|
||||
auto conn = connect(action, SIGNAL(triggered()), tgt, cb);
|
||||
connect(action, SIGNAL(triggered()), tgt, cb);
|
||||
return action;
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ QAction *MainWindow::addAction(QMenu *menu, QString text, QString toolTip,
|
||||
auto action = menu->addAction(text);
|
||||
action->setShortcuts(key);
|
||||
action->setStatusTip(toolTip);
|
||||
auto conn = connect(action, SIGNAL(triggered()), tgt, cb);
|
||||
connect(action, SIGNAL(triggered()), tgt, cb);
|
||||
return action;
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ QAction *MainWindow::addAction(QMenu *menu, QString text, QString toolTip,
|
||||
auto action = menu->addAction(text);
|
||||
action->setShortcuts(key);
|
||||
action->setStatusTip(toolTip);
|
||||
auto conn = connect(action, &QAction::triggered, cb);
|
||||
connect(action, &QAction::triggered, cb);
|
||||
return action;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user