Remove ox subtree

This commit is contained in:
2017-10-11 19:17:48 -05:00
parent 5923f3f0cf
commit f0efe2f9e0
61 changed files with 6 additions and 5426 deletions

View File

@ -6,6 +6,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <QDebug>
#include <QFile>
#include "import_tilesheet_wizard.hpp"
@ -54,8 +55,8 @@ int ImportTilesheetWizardPage::importImage(QFile &srcFile, QString tilesheetName
if (srcFile.read((char*) buff, buffSize) > 0) {
int err = 0;
m_project->mkdir(TILESHEET_DIR);
err |= m_project->write(TILESHEET_DIR + tilesheetName, buff, buffSize);
err |= m_project->saveRomFs();
qInfo() << "write:" << (err |= m_project->write(TILESHEET_DIR + tilesheetName, buff, buffSize));
qInfo() << "save: " << (err |= m_project->saveRomFs());
return err;
} else {
return 1;

View File

@ -43,7 +43,6 @@ void OxFSFile::appendChild(OxFSModel *model, QStringList pathItems, QString curr
if (pathItems.size()) {
auto target = pathItems[0];
currentPath += "/" + target;
OxFSFile *nextItem = nullptr;
int index = m_childItems.size();
for (int i = 0; i < m_childItems.size(); i++) {
if (m_childItems[i]->name() >= target) {
@ -55,14 +54,11 @@ void OxFSFile::appendChild(OxFSModel *model, QStringList pathItems, QString curr
if (m_childItems.size() == index || m_childItems[index]->name() != target) {
auto idx = model->createIndex(row(), 0, this);
model->beginInsertRows(idx, index, index);
nextItem = new OxFSFile(nullptr, currentPath, this);
m_childItems.insert(index, nextItem);
m_childItems.insert(index, new OxFSFile(nullptr, currentPath, this));
model->endInsertRows();
}
nextItem = m_childItems[index];
nextItem->appendChild(model, pathItems.mid(1), currentPath);
m_childItems[index]->appendChild(model, pathItems.mid(1), currentPath);
}
}

View File

@ -142,7 +142,7 @@ void MainWindow::setupMenu() {
void MainWindow::setupProjectExplorer() {
// setup dock
auto dock = new QDockWidget(tr("&Project"), this);
auto dock = new QDockWidget(tr("Project"), this);
dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
addDockWidget(Qt::LeftDockWidgetArea, dock);
resizeDocks({dock}, {(int) (width() * 0.25)}, Qt::Horizontal);