[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: [Fwd: KFM Url completion patch...]
From:       David Faure <David.Faure () insa-lyon ! fr>
Date:       1999-01-27 10:51:30
[Download RAW message or body]

On Wed, Jan 27, 1999 at 11:42:42AM +0100, David Faure wrote:
> On Wed, Jan 27, 1999 at 11:19:40AM +0100, Stephan Kulow wrote:
> > Hi!
> > 
> > What do you think? I guess kfm is becoming more and
> > more a webbrowser than a file manager, but would it
> > work currently to type into it "homeworks" and it changes
> > to homeworks? I wouldn't want to see it going to http://homeworks
> > then.
> No, it wouldn't work.
> The URL in the statusbar has to be valid at any time, and "homeworks" is
> not a valid URL. (because no protocol part and not beginning with a '/').
> (at least one or the other is needed)
> 
> So the idea is good, I think.
> But it's a bit late.
> After a pre2 we're supposed to fix real showstoppers (I fixed two segfaults 
> yesterady), not introduce new features, even small ones, that could break
> something in 1.1
> Sorry.

On second thought...
Dawit Alemayehu sent me this patch, which does even smarter things : allow to enter
a subdir in the current directory, and if it doesn't exist, then prepend
"http://".

+        else
+        {
+            KURL path ( getURL() );
+            QDir::setCurrent ( path.directory () );
+            QFileInfo f ( QDir::currentDirPath().append( "/" ).append( url
+).data() );
+            debug ( f.filePath() );
+               if ( f.exists() )
+                url = f.filePath();
+            else
+                url = url.prepend ("http://");
+        }

Looks like this feature is really wanted for 1.1 ...
Which behaviour is preferred ?


BTW, he also suggested to remove trailing and leading white space (before,
of course) :
+       // strip off any leading and trailing white space
+       while (url.find(' ') == 0)
+         url.remove(0, 1);
+       while (url.findRev(' ') == (signed) url.length()-1)
+             url.remove(url.length()-1, 1); 

-- 
 ____________________________________________________________________
|                                                                    |
|  David FAURE                                                       |
|  E-mail : David.Faure@insa-lyon.fr, faure@kde.org                  |
|  http://www.insa-lyon.fr/People/AEDI/dfaure/index.html             |
|____________________________________________________________________|

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic