Update directory when scene switched
This commit is contained in:
parent
3b4c982719
commit
de14e3161a
2 changed files with 18 additions and 0 deletions
|
@ -241,6 +241,15 @@ SceneBrowser::SceneBrowser(QWidget *parent, Qt::WFlags flags, bool noContextMenu
|
|||
ret = ret && connect(MyFileSystemWatcher::instance(),
|
||||
SIGNAL(directoryChanged(const QString &)), this,
|
||||
SLOT(onFileSystemChanged(const QString &)));
|
||||
|
||||
// when the scene switched, update the path of the scene location node
|
||||
TSceneHandle *sceneHandle = TApp::instance()->getCurrentScene();
|
||||
//ret = ret && connect(sceneHandle, SIGNAL(sceneSwitched()), this,
|
||||
// SLOT(onSceneSwitched()));
|
||||
ret = ret && connect(sceneHandle, SIGNAL(nameSceneChanged()), this,
|
||||
SLOT(onSceneSwitched()));
|
||||
|
||||
//onSceneSwitched();
|
||||
|
||||
// store the first item("Root") in the history
|
||||
m_indexHistoryList.append(m_folderTreeView->currentIndex());
|
||||
|
@ -1901,6 +1910,14 @@ void SceneBrowser::convertToPaintedTlv() {
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void SceneBrowser::onSceneSwitched() {
|
||||
//TSceneHandle *sceneHandle = TApp::instance()->getCurrentScene();
|
||||
TFilePath scenesFolder = TProjectManager::instance()->getCurrentProject()->getScenesPath();
|
||||
setFolder(scenesFolder, true);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void SceneBrowser::onSelectedItems(const std::set<int> &indexes) {
|
||||
std::set<TFilePath> filePaths;
|
||||
std::set<int>::const_iterator it;
|
||||
|
|
|
@ -140,6 +140,7 @@ protected slots:
|
|||
void onClickedItem(int index);
|
||||
void onDoubleClickedItem(int index);
|
||||
void onSelectedItems(const std::set<int> &indexes);
|
||||
void onSceneSwitched();
|
||||
void folderUp();
|
||||
void newFolder();
|
||||
|
||||
|
|
Loading…
Reference in a new issue