Fix editing metadata in a nested folder causing back button to stop working.

This commit is contained in:
Aloshi 2014-06-02 14:33:27 -05:00
parent fac09b6fac
commit 135ad755b1

View file

@ -58,6 +58,26 @@ void BasicGameListView::setCursor(FileData* cursor)
{
populateList(cursor->getParent()->getChildren());
mList.setCursor(cursor);
// update our cursor stack in case our cursor just got set to some folder we weren't in before
if(mCursorStack.empty() || mCursorStack.top() != cursor->getParent())
{
std::stack<FileData*> tmp;
FileData* ptr = cursor->getParent();
while(ptr && ptr != mRoot)
{
tmp.push(ptr);
ptr = ptr->getParent();
}
// flip the stack and put it in mCursorStack
mCursorStack = std::stack<FileData*>();
while(!tmp.empty())
{
mCursorStack.push(tmp.top());
tmp.pop();
}
}
}
}