Commit 07c343c1 authored by Christophe Courtaut's avatar Christophe Courtaut

Now collapse all but last selected path in import.

parent 7d775ce0
...@@ -271,6 +271,7 @@ ImportController::reject() ...@@ -271,6 +271,7 @@ ImportController::reject()
m_preview->stop(); m_preview->stop();
m_mediaListController->cleanAll(); m_mediaListController->cleanAll();
Library::getInstance()->deleteTemporaryMedias(); Library::getInstance()->deleteTemporaryMedias();
collapseAllButCurrentPath();
done( Rejected ); done( Rejected );
} }
...@@ -280,9 +281,24 @@ ImportController::accept() ...@@ -280,9 +281,24 @@ ImportController::accept()
m_mediaListController->cleanAll(); m_mediaListController->cleanAll();
Library::getInstance()->importDone(); Library::getInstance()->importDone();
m_preview->stop(); m_preview->stop();
collapseAllButCurrentPath();
done( Accepted ); done( Accepted );
} }
void
ImportController::collapseAllButCurrentPath()
{
m_ui->treeView->collapseAll();
QStringList paths;
for ( QDir directory( m_currentlyWatchedDir ); !directory.isRoot(); directory.cdUp() )
paths.prepend( directory.absolutePath() );
while ( paths.count() > 0 )
{
m_ui->treeView->setCurrentIndex( m_filesModel->index( paths.takeFirst() ) );
m_ui->treeView->setExpanded( m_ui->treeView->currentIndex() , true );
}
}
void void
ImportController::mediaDeletion( const QUuid& uuid ) ImportController::mediaDeletion( const QUuid& uuid )
{ {
......
...@@ -66,6 +66,7 @@ class ImportController : public QDialog ...@@ -66,6 +66,7 @@ class ImportController : public QDialog
private: private:
void saveCurrentPath(); void saveCurrentPath();
void restoreCurrentPath(); void restoreCurrentPath();
void collapseAllButCurrentPath();
Ui::ImportController* m_ui; Ui::ImportController* m_ui;
PreviewWidget* m_preview; PreviewWidget* m_preview;
StackViewController* m_stackNav; StackViewController* m_stackNav;
......
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