Remove ox subtree
This commit is contained in:
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user