1
Fork 0
mirror of https://github.com/redstrate/Novus.git synced 2025-04-25 05:17:44 +00:00
novus/sagasu/include/filetreewindow.h

36 lines
967 B
C
Raw Normal View History

// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <QMdiSubWindow>
#include <physis.hpp>
struct PathPart {
uint32_t crcHash;
QMap<QString, PathPart> children;
};
2023-10-10 18:02:13 -04:00
class FileTreeWindow : public QWidget
{
Q_OBJECT
public:
2023-10-10 18:02:13 -04:00
explicit FileTreeWindow(GameData *data, QWidget *parent = nullptr);
private:
2023-10-10 18:02:13 -04:00
GameData *data = nullptr;
void addPath(QString path);
void addUnknownPath(QString knownDirectory, uint32_t crcHash);
2023-10-10 18:02:13 -04:00
void traversePart(QList<QString> tokens, PathPart &part, QString pathSoFar);
std::tuple<bool, QString> traverseUnknownPath(uint32_t crcHash, PathPart &part, QString pathSoFar);
QMap<QString, PathPart> rootParts;
void addPaths(QTreeWidget *pWidget);
2023-10-10 18:02:13 -04:00
QTreeWidgetItem *addPartAndChildren(const QString &qString, const PathPart &part, const QString &pathSoFar);
2023-09-26 00:37:55 -04:00
Q_SIGNALS:
void openFileProperties(QString path);
};