1
Fork 0
mirror of https://github.com/redstrate/Novus.git synced 2025-04-27 14:17:45 +00:00
novus/explorer/include/filetreewindow.h
Joshua Goins 05dfd81581 Overhaul file explorer
File Explorer is still in functionality limbo, but this at least removes
the libxiv dependency and will make it easier to use the new GUI parts
system in the future.
2023-04-09 15:32:09 -04:00

33 lines
No EOL
854 B
C++

#pragma once
#include <QMdiSubWindow>
#include <physis.hpp>
struct PathPart {
uint32_t crcHash;
QMap<QString, PathPart> children;
};
class FileTreeWindow : public QWidget {
Q_OBJECT
public:
explicit FileTreeWindow(GameData* data, QWidget *parent = nullptr);
private:
GameData* data = nullptr;
void addPath(QString path);
void addUnknownPath(QString knownDirectory, uint32_t crcHash);
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);
QTreeWidgetItem* addPartAndChildren(const QString& qString, const PathPart& part, const QString& pathSoFar);
signals:
void openFileProperties(QString path);
};