[nostalgia/studio] Add project path to file name function

This commit is contained in:
Gary Talent 2020-03-31 21:10:40 -05:00
parent 680881003c
commit 5cec2cf819
2 changed files with 9 additions and 0 deletions

View File

@ -13,6 +13,13 @@
namespace nostalgia::studio { 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()) { Project::Project(QString path): m_fs(path.toUtf8()) {
qDebug() << "Project:" << path; qDebug() << "Project:" << path;
m_path = path; m_path = path;

View File

@ -30,6 +30,8 @@ enum class ProjectEvent {
FileUpdated, FileUpdated,
}; };
[[nodiscard]] QString filePathToName(QString path, QString prefix, QString suffix);
class NOSTALGIASTUDIO_EXPORT Project: public QObject { class NOSTALGIASTUDIO_EXPORT Project: public QObject {
Q_OBJECT Q_OBJECT