--Boundary-00=_r2qV+ZyCiAHRskt Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Friday 21 February 2003 20:25, Maksim Orlovich wrote: > Since I don't think it'd be backwards compatible to make > KDirLister::setShowDotFiles context dependent, KDirLister is not really designed to have different settings for different directories. It will be very hairy to add it. > the setting in the sidebar > treeview should probably be fixed to the one of the view's root directory. The attached patch does this. However, it now becomes very obvious that the "show hidden files" menu-option has no effect on the dirtree. I'm not sure if there is a simple way to make it follow the other view in this regard, but otherwise I would like to suggest to simply disable showing dotfiles in the directory tree and be done with it. (also attached) Cheers, Waldo -- bastian@kde.org -=|[ SuSE, The Linux Desktop Experts ]|=- bastian@suse.com --Boundary-00=_r2qV+ZyCiAHRskt Content-Type: text/x-diff; charset="iso-8859-1"; name="dirtree.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dirtree.diff" Index: dirtree_module.cpp =================================================================== RCS file: /home/kde/kdebase/konqueror/sidebar/trees/dirtree_module/dirtree_module.cpp,v retrieving revision 1.21 diff -u -r1.21 dirtree_module.cpp --- dirtree_module.cpp 21 Oct 2002 04:21:08 -0000 1.21 +++ dirtree_module.cpp 21 Feb 2003 22:41:42 -0000 @@ -29,7 +29,7 @@ KonqSidebarDirTreeModule::KonqSidebarDirTreeModule( KonqSidebarTree * parentTree ) - : KonqSidebarTreeModule( parentTree ), m_dirLister(0L), m_topLevelItem(0L), m_pProps(0L) + : KonqSidebarTreeModule( parentTree ), m_dirLister(0L), m_topLevelItem(0L) { // Used to be static... s_defaultViewProps = new KonqPropsView( @@ -40,7 +40,6 @@ KonqSidebarDirTreeModule::~KonqSidebarDirTreeModule() { - delete m_pProps; delete s_defaultViewProps; delete m_dirLister; } @@ -163,6 +162,9 @@ { m_dirLister = new KDirLister( true ); m_dirLister->setDirOnlyMode( true ); + KonqPropsView props(tree()->part()->parentInstance(), s_defaultViewProps); + props.enterDir(item->externalURL()); + m_dirLister->setShowingDotFiles( props.isShowingDotFiles() ); connect( m_dirLister, SIGNAL( newItems( const KFileItemList & ) ), this, SLOT( slotNewItems( const KFileItemList & ) ) ); @@ -178,13 +180,6 @@ this, SLOT( slotRedirection( const KURL &, const KURL & ) ) ); } - if ( !m_pProps ) // created on demand - { - // Create a properties instance for this view - //m_pProps = new KonqPropsView( KonqSidebarTreeFactory::instance(), s_defaultViewProps ); - m_pProps = new KonqPropsView(tree()->part()->parentInstance(), s_defaultViewProps ); - } - if ( !item->isTopLevelItem() && static_cast(item)->hasStandardIcon() ) { @@ -203,23 +198,9 @@ // This causes a reparsing, but gets rid of the trailing slash KURL url( item->externalURL().url(-1) ); - // Check for new properties in the new dir - // newProps returns true the first time, and any time something might - // have changed. - /*bool newProps = */m_pProps->enterDir( url ); - m_dirLister->setShowingDotFiles( m_pProps->isShowingDotFiles() ); - if (tree()->isOpeningFirstChild()) m_dirLister->setAutoErrorHandlingEnabled(false,0); else m_dirLister->setAutoErrorHandlingEnabled(true,tree()); m_dirLister->openURL( url, true /*keep*/ ); - -#if 0 - if ( newProps ) - { - // See the other parts - m_pProps->applyColors( viewport() ); - } -#endif } void KonqSidebarDirTreeModule::slotNewItems( const KFileItemList& entries ) Index: dirtree_module.h =================================================================== RCS file: /home/kde/kdebase/konqueror/sidebar/trees/dirtree_module/dirtree_module.h,v retrieving revision 1.6 diff -u -r1.6 dirtree_module.h --- dirtree_module.h 23 Jan 2002 23:46:40 -0000 1.6 +++ dirtree_module.h 21 Feb 2003 22:41:42 -0000 @@ -70,7 +70,6 @@ KonqSidebarTreeTopLevelItem * m_topLevelItem; KonqPropsView * s_defaultViewProps; - KonqPropsView * m_pProps; }; --Boundary-00=_r2qV+ZyCiAHRskt Content-Type: text/x-diff; charset="iso-8859-1"; name="dirtree2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dirtree2.diff" Index: dirtree_module.cpp =================================================================== RCS file: /home/kde/kdebase/konqueror/sidebar/trees/dirtree_module/dirtree_module.cpp,v retrieving revision 1.21 diff -u -r1.21 dirtree_module.cpp --- dirtree_module.cpp 21 Oct 2002 04:21:08 -0000 1.21 +++ dirtree_module.cpp 21 Feb 2003 22:50:58 -0000 @@ -29,19 +29,12 @@ KonqSidebarDirTreeModule::KonqSidebarDirTreeModule( KonqSidebarTree * parentTree ) - : KonqSidebarTreeModule( parentTree ), m_dirLister(0L), m_topLevelItem(0L), m_pProps(0L) + : KonqSidebarTreeModule( parentTree ), m_dirLister(0L), m_topLevelItem(0L) { - // Used to be static... - s_defaultViewProps = new KonqPropsView( - tree()->part()->parentInstance(),0); - - //KonqSidebarTreeFactory::instance(), 0L ); } KonqSidebarDirTreeModule::~KonqSidebarDirTreeModule() { - delete m_pProps; - delete s_defaultViewProps; delete m_dirLister; } @@ -178,13 +171,6 @@ this, SLOT( slotRedirection( const KURL &, const KURL & ) ) ); } - if ( !m_pProps ) // created on demand - { - // Create a properties instance for this view - //m_pProps = new KonqPropsView( KonqSidebarTreeFactory::instance(), s_defaultViewProps ); - m_pProps = new KonqPropsView(tree()->part()->parentInstance(), s_defaultViewProps ); - } - if ( !item->isTopLevelItem() && static_cast(item)->hasStandardIcon() ) { @@ -203,23 +189,9 @@ // This causes a reparsing, but gets rid of the trailing slash KURL url( item->externalURL().url(-1) ); - // Check for new properties in the new dir - // newProps returns true the first time, and any time something might - // have changed. - /*bool newProps = */m_pProps->enterDir( url ); - m_dirLister->setShowingDotFiles( m_pProps->isShowingDotFiles() ); - if (tree()->isOpeningFirstChild()) m_dirLister->setAutoErrorHandlingEnabled(false,0); else m_dirLister->setAutoErrorHandlingEnabled(true,tree()); m_dirLister->openURL( url, true /*keep*/ ); - -#if 0 - if ( newProps ) - { - // See the other parts - m_pProps->applyColors( viewport() ); - } -#endif } void KonqSidebarDirTreeModule::slotNewItems( const KFileItemList& entries ) Index: dirtree_module.h =================================================================== RCS file: /home/kde/kdebase/konqueror/sidebar/trees/dirtree_module/dirtree_module.h,v retrieving revision 1.6 diff -u -r1.6 dirtree_module.h --- dirtree_module.h 23 Jan 2002 23:46:40 -0000 1.6 +++ dirtree_module.h 21 Feb 2003 22:50:58 -0000 @@ -68,9 +68,6 @@ KURL m_selectAfterOpening; KonqSidebarTreeTopLevelItem * m_topLevelItem; - - KonqPropsView * s_defaultViewProps; - KonqPropsView * m_pProps; }; --Boundary-00=_r2qV+ZyCiAHRskt--