diff --git a/src/nostalgia/studio/lib/project.cpp b/src/nostalgia/studio/lib/project.cpp index bf48744e..2a407f3c 100644 --- a/src/nostalgia/studio/lib/project.cpp +++ b/src/nostalgia/studio/lib/project.cpp @@ -13,6 +13,13 @@ namespace nostalgia::studio { +QString filePathToName(QString path, QString prefix, QString suffix) { + const auto begin = prefix.size(); + const auto end = path.size() - (suffix.size() + prefix.size()); + return path.mid(begin, end); +} + + Project::Project(QString path): m_fs(path.toUtf8()) { qDebug() << "Project:" << path; m_path = path; diff --git a/src/nostalgia/studio/lib/project.hpp b/src/nostalgia/studio/lib/project.hpp index 4d4235c7..6e00fd77 100644 --- a/src/nostalgia/studio/lib/project.hpp +++ b/src/nostalgia/studio/lib/project.hpp @@ -30,6 +30,8 @@ enum class ProjectEvent { FileUpdated, }; +[[nodiscard]] QString filePathToName(QString path, QString prefix, QString suffix); + class NOSTALGIASTUDIO_EXPORT Project: public QObject { Q_OBJECT