KFileDialog not remembering the last dir when using startdir keywords

Guillaume Laurent glaurent at telegraph-road.org
Thu Mar 6 21:08:34 GMT 2003


On Thursday 06 March 2003 15:26, Guillaume Laurent wrote:
> On Thursday 06 March 2003 12:30, Waldo Bastian wrote:
> > > if (result.contains(directory)) {
> > >  result.remove(directory)
> > >  result.prepend(directory)
> > > }
> > >
> > > so the last dir is properly remembered in all cases. Is that ok ?
> >
> > The if should be dropped completely then.
>
> Yes, that occurred to me a minute after posting (as usual). I'll commit the
> patch tonight unless someone disagrees.

Committed to HEAD and KDE_3_1_BRANCH :

cvs -z3 diff -r 1.2 -r 1.3 krecentdirs.cpp
Index: krecentdirs.cpp
===================================================================
RCS file: /home/kde/kdelibs/kio/kfile/krecentdirs.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -p -r1.2 -r1.3
--- krecentdirs.cpp     10 Oct 2001 17:40:40 -0000      1.2
+++ krecentdirs.cpp     6 Mar 2003 21:03:43 -0000       1.3
@@ -88,7 +88,8 @@ void KRecentDirs::add(const QString &fil
    QString key = fileClass;
    QStringList result;
    KConfig *config = recentdirs_readList(key, result, false);
-   if (!result.contains(directory))
+   // make sure the dir is first in history
+   result.remove(directory);
       result.prepend(directory);
    while(result.count() > MAX_DIR_HISTORY)
       result.remove(result.fromLast());

-- 
					Guillaume.
					http://www.telegraph-road.org




More information about the kde-core-devel mailing list