KFilePlacesModel/View question

Chani chanika at gmail.com
Sun Oct 18 19:53:21 BST 2009


On October 18, 2009 11:37:05 nf2 wrote:
> On Sun, Oct 18, 2009 at 7:37 PM, Chani <chanika at gmail.com> wrote:
> > On October 18, 2009 04:24:57 nf2 wrote:
> >> I'm wondering whether the device related code in KFilePlacesModel
> >> could be internalized a bit. So that the classes using it don't have
> >> to deal with devices directly (like kfilplacesview.cpp,
> >> systemmodel.cpp, placesengine.cpp, placesrunner.cpp). That way we
> >> could more easily plug a different model, for instance when running
> >> KDE apps outside KDE.
> >>
> >> My question is about the code at line 152 in kfileplacesview.cpp:
> >>
> >> if (((device.is<Solid::StorageAccess>() &&
> >> device.as<Solid::StorageAccess>()->isAccessible()) ||
> >>              (device.parent().is<Solid::StorageAccess>() &&
> >> device.parent().as<Solid::StorageAccess>()->isAccessible())) &&
> >>             ((device.is<Solid::StorageDrive>() &&
> >> device.as<Solid::StorageDrive>()->isRemovable()) ||
> >>              (device.parent().is<Solid::StorageDrive>() &&
> >> device.parent().as<Solid::StorageDrive>()->isRemovable())) &&
> >>             ((device.is<Solid::StorageDrive>() &&
> >> device.as<Solid::StorageDrive>()->driveType() !=
> >> Solid::StorageDrive::CdromDrive) ||
> >>              (device.parent().is<Solid::StorageDrive>() &&
> >> device.parent().as<Solid::StorageDrive>()->driveType() !=
> >> Solid::StorageDrive::CdromDrive))) {
> >>             isRemovableDevice = true;
> >>         }
> >>
> >> It hardly ever sets isRemovableDevice = true (which would show the
> >> capacity bar), or perhaps i just don't have devices where it would.
> >>
> >> Regards,
> >> Norbert
> >
> > that is one hell of an ugly line... but... you don't have a usb drive? :)
> 
> Ah - really - for USB-Sticks the capacity bar is shown, but not for
> external USB hard-drives.

o.0
that's weird.
I also wonder why it's not shown for non-removable drives... I'm not going to 
try and parse that monster line.

-- 
This message brought to you by eevil bananas and the number 3.
www.chani3.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20091018/19681fcc/attachment.sig>


More information about the kde-core-devel mailing list