Commit 54b87b5d authored by Anakin's avatar Anakin

fixed things i've broken by the merge conflict

parent 68387fe7
...@@ -26,7 +26,6 @@ private: ...@@ -26,7 +26,6 @@ private:
FileInfoWindow* m_infoWindow; FileInfoWindow* m_infoWindow;
QStringList m_filters; QStringList m_filters;
QStringList m_Paths;
// functions // functions
private: private:
...@@ -48,7 +47,7 @@ public slots: ...@@ -48,7 +47,7 @@ public slots:
// private slots // private slots
private slots: private slots:
void setupAssetLibrary(); void setupAssetLibrary();
void on_fileListWidget_doubleClicked(const QModelIndex &index); void on_fileTreeWidget_doubleClicked();
void on_dirDropDownList_currentTextChanged(const QString &arg1); void on_dirDropDownList_currentTextChanged(const QString &arg1);
// signals // signals
......
...@@ -171,14 +171,15 @@ void MainWindow::setupWidgets() ...@@ -171,14 +171,15 @@ void MainWindow::setupWidgets()
void MainWindow::updateAssetTree(QString path) void MainWindow::updateAssetTree(QString path)
{ {
ui->fileListWidget->clear();
m_Paths.clear(); ui->fileTreeWidget->clear();
QDirIterator itterator(path, QStringList() << "*.msh" << "*.MSH" << "*.mesh" << "*.MESH", QDirIterator itterator(path, QStringList() << "*.msh" << "*.MSH" << "*.mesh" << "*.MESH",
QDir::Files, QDirIterator::Subdirectories); QDir::Files, QDirIterator::Subdirectories);
while (itterator.hasNext()) { while (itterator.hasNext()) {
ui->fileListWidget->insertItem(0, new QListWidgetItem(itterator.fileName())); QTreeWidgetItem* sub = new QTreeWidgetItem(ui->fileTreeWidget);
m_Paths.prepend(itterator.fileInfo().absoluteFilePath()); sub->setData(0, Qt::DisplayRole, itterator.fileName());
sub->setData(1, Qt::DisplayRole, itterator.fileInfo().absoluteFilePath());
itterator.next(); itterator.next();
} }
} }
...@@ -247,10 +248,9 @@ void MainWindow::setupAssetLibrary() ...@@ -247,10 +248,9 @@ void MainWindow::setupAssetLibrary()
updateAssetTree(ui->dirDropDownList->currentData().toString()); updateAssetTree(ui->dirDropDownList->currentData().toString());
} }
void MainWindow::on_fileListWidget_doubleClicked(const QModelIndex &index) void MainWindow::on_fileTreeWidget_doubleClicked()
{ {
int slotVal = index.row(); QString clickedFile = ui->fileTreeWidget->currentItem()->text(1);
QString clickedFile = m_Paths.at(slotVal);
openFile(clickedFile); openFile(clickedFile);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment