[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: [PATCH] Use KUrl::prettyUrl to display user entered remote URLs
From: Sebastian =?iso-8859-1?q?Tr=FCg?= <strueg () mandriva ! com>
Date: 2008-07-18 14:00:10
Message-ID: 200807181600.11462.strueg () mandriva ! com
[Download RAW message or body]
On Friday 18 July 2008 15:10:24 David Faure wrote:
> On Friday 18 July 2008, Sebastian Tr=FCg wrote:
> > On Friday 18 July 2008 11:47:53 Andreas Pakulat wrote:
> > > On 18.07.08 11:26:06, Sebastian Tr=FCg wrote:
> > > > May I apply this patch?
> > > > trunk and 4.1?
> > >
> > > How about adjusting the code a bit more and using KUrl::pathOrUrl()?
> > > Would save the else part.
> >
> > strangly pathOrUrl does not have an option parameter. Maybe that could =
be
> > added for 4.2?
>
> Oh. No reason this is missing, indeed. Added.
ok, updated patch for trunk. May I commit and use the old patch for 4.1?
Cheers,
Sebastian
["kurlcombobox-prettyurl.diff" (text/x-diff)]
Index: kio/kfile/kurlcombobox.cpp
===================================================================
--- kio/kfile/kurlcombobox.cpp (revision 834244)
+++ kio/kfile/kurlcombobox.cpp (working copy)
@@ -140,15 +140,7 @@
item->url = url;
item->icon = icon;
if ( text.isEmpty() ) {
- KUrl::AdjustPathOption mode = KUrl::LeaveTrailingSlash;
- if (d->myMode == Directories)
- mode = KUrl::AddTrailingSlash;
- else
- mode = KUrl::RemoveTrailingSlash;
- if ( url.isLocalFile() )
- item->text = url.path( mode );
- else
- item->text = url.prettyUrl( mode );
+ item->text = url.pathOrUrl(d->myMode == Directories ? KUrl::AddTrailingSlash \
: KUrl::RemoveTrailingSlash); }
else
item->text = text;
@@ -202,7 +194,7 @@
if (remove == RemoveBottom) {
if (!urls.isEmpty())
urls.removeLast();
- }
+ }
else {
if (!urls.isEmpty())
urls.removeFirst();
@@ -241,7 +233,7 @@
item->text = u.path( mode ); // don't show file:/
}
else
- item->text = *it;
+ item->text = u.prettyUrl();
d->insertUrlItem( item );
d->itemList.append( item );
@@ -311,7 +303,7 @@
KComboBox::insertItem( id, d->opendirIcon, text);
else
KComboBox::insertItem( id,item->icon, text);
-
+
d->itemMapper.insert( id, item );
d->itemList.append( item );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic