Cleanup magic strings in tilesheet importer

This commit is contained in:
Gary Talent 2017-09-10 09:20:40 -05:00
parent 89a7ffd45f
commit 21be39e2c9
2 changed files with 4 additions and 2 deletions

View File

@ -13,6 +13,7 @@
namespace nostalgia {
namespace core {
const QString ImportTilesheetWizardPage::TILESHEET_DIR = "/TileSheets/";
const QString ImportTilesheetWizardPage::TILESHEET_NAME = "projectName";
const QString ImportTilesheetWizardPage::IMPORT_PATH = "projectPath";
const QString ImportTilesheetWizardPage::BPP = "bpp";
@ -52,8 +53,8 @@ int ImportTilesheetWizardPage::importImage(QFile &srcFile, QString tilesheetName
srcFile.open(QIODevice::ReadOnly);
if (srcFile.read((char*) buff, buffSize) > 0) {
int err = 0;
m_project->mkdir("/TileSheets");
err |= m_project->write("/TileSheets/" + tilesheetName, buff, buffSize);
m_project->mkdir(TILESHEET_DIR);
err |= m_project->write(TILESHEET_DIR + tilesheetName, buff, buffSize);
err |= m_project->saveRomFs();
return err;
} else {

View File

@ -15,6 +15,7 @@ namespace core {
class ImportTilesheetWizardPage: public studio::WizardFormPage {
private:
static const QString TILESHEET_DIR;
static const QString TILESHEET_NAME;
static const QString IMPORT_PATH;
static const QString BPP;