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

List:       kde-devel
Subject:    Re: detecting names of kioslave directories
From:       Kevin Ottens <ervin () kde ! org>
Date:       2005-09-12 14:32:58
Message-ID: 200509121633.05029.ervin () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Le Lundi 12 Septembre 2005 16:21, Carl a écrit :
> Hi all,
>
> I'm a computer science student learning C++.  I'm in the process of
> learning QT/KDE.  I'm trying to hack a program called kmetabar.  I need the
> application to detect if the current directory is trash:/ .  Currently the
> code is
>
>   const KURL url = item.url();
>   QString name = item.name();
>
> This works great for everything but KIOslaves.  When entering trash:/ or
> any other KIOslave, name is empty.  So the application assumes that it is
> the root directory.  Any help pointing me in the right direction would be
> appreciated.  Thank you.

It _is_ a root directory. It just happens to be the root directory of the 
protocol trash. You'd better look at the url itself than the name of the item 
in my opinion. KURL::protocol() and KURL::path() being surely the methods
you are looking for.

I advise you also to check that everything works as expected when using the 
system:/ ioslave which tends to hide protocols like trash:/, you can access 
the trash using system:/trash URL.

And finally you might want to take a look at how konqueror popupmenu works. If 
I recall correctly the metabar is a way to display the relevant actions for a 
file selection or the current view, and this feature exists in the konqueror 
popupmenu too (it's in the kdebase/libkonq module).

Hope that helps.

Regards.
-- 
Kévin 'ervin' Ottens, http://ervin.ipsquad.net
"Ni le maître sans disciple, Ni le disciple sans maître,
Ne font reculer l'ignorance."

[Attachment #5 (application/pgp-signature)]

 =

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscrib=
e <<


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

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