Fix OxFSTreeView to properly list added files

This commit is contained in:
2017-08-19 12:31:53 -05:00
parent d8a3cd5dfb
commit 7a6174953d
9 changed files with 95 additions and 30 deletions
+8 -2
View File
@@ -19,7 +19,6 @@ namespace studio {
class OxFSFile {
private:
ox::FileSystem *m_fs = nullptr;
OxFSFile *m_parentItem = nullptr;
QString m_path;
QVector<OxFSFile*> m_childItems;
@@ -29,7 +28,7 @@ class OxFSFile {
~OxFSFile();
void appendChild(OxFSFile *child);
void appendChild(class OxFSModel *model, QStringList pathItems, QString fullPath);
OxFSFile *child(int row);
@@ -42,11 +41,15 @@ class OxFSFile {
int row() const;
OxFSFile *parentItem();
QString name() const;
};
class OxFSModel: public QAbstractItemModel {
Q_OBJECT
friend OxFSFile;
private:
OxFSFile *m_rootItem = nullptr;
@@ -71,6 +74,9 @@ class OxFSModel: public QAbstractItemModel {
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
public slots:
void updateFile(QString path);
private:
void setupModelData(const QStringList &lines, OxFSFile *parent);
};