fix issue in column view that the wrong root directory is taken because of keeping old directories in KDirLister

svn path=/trunk/KDE/kdebase/apps/; revision=662658
This commit is contained in:
Peter Penz 2007-05-08 20:40:46 +00:00
parent dfe4a7598a
commit 13b3676857
2 changed files with 13 additions and 1 deletions

View file

@ -67,6 +67,7 @@ DolphinView::DolphinView(DolphinMainWindow* mainWindow,
QWidget(parent), QWidget(parent),
m_showProgress(false), m_showProgress(false),
m_blockContentsMovedSignal(false), m_blockContentsMovedSignal(false),
m_initializeColumnView(false),
m_mode(mode), m_mode(mode),
m_iconSize(0), m_iconSize(0),
m_folderCount(0), m_folderCount(0),
@ -650,6 +651,14 @@ void DolphinView::changeDirectory(const KUrl& url)
m_mode = mode; m_mode = mode;
createView(); createView();
emit modeChanged(); emit modeChanged();
if (m_mode == ColumnView) {
// The mode has been changed to the Column View. When starting the dir
// lister with DolphinView::startDirLister() it is important to give a
// hint that the dir lister may not keep the current directory
// although this is the default for showing a hierarchy.
m_initializeColumnView = true;
}
} }
const bool showHiddenFiles = props.showHiddenFiles(); const bool showHiddenFiles = props.showHiddenFiles();
@ -896,7 +905,9 @@ void DolphinView::startDirLister(const KUrl& url, bool reload)
m_dirLister->stop(); m_dirLister->stop();
bool openDir = true; bool openDir = true;
bool keepOldDirs = isColumnViewActive(); bool keepOldDirs = isColumnViewActive() && !m_initializeColumnView;
m_initializeColumnView = false;
if (keepOldDirs) { if (keepOldDirs) {
if (reload) { if (reload) {
keepOldDirs = false; keepOldDirs = false;

View file

@ -593,6 +593,7 @@ private:
bool m_showProgress; bool m_showProgress;
bool m_blockContentsMovedSignal; bool m_blockContentsMovedSignal;
bool m_initializeColumnView;
Mode m_mode; Mode m_mode;
int m_iconSize; int m_iconSize;