Opened 15 years ago
Closed 5 years ago
#139 closed enhancement (fixed)
Enable drive icons
Reported by: | rudi | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | Qt Enhanced |
Component: | QtGui | Version: | 4.5.1 GA |
Severity: | low | Keywords: | |
Cc: |
Description
Assign the proper icons to drives (i.e. Floppy, CD, HDD nad Network).
Change History (7)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Thank you, the icons look good. Committed in r607, with the one exception that we never do INCL_blabla or include <os2.h> directly in Qt, we #include <qt_os2.h> instead. Please also follow the Qt source code formatting guidelines which saves me from dummy work :)
Also, I was thinking of taking native icons from the PM which should not be difficult thanks to WinLoadFileIcon(); your code will be used as a fallback in this case. Will leave the defect open till this is implemented.
Note that I had to update qt_os2.h (because INCL_DOS doesn't actually assume INCL_DOSDEVIOCTL for some reason), but the change does not affect anything but qfileiconprovider.cpp so you can save yourself from the full rebuild by setting the date of qt_os2.h back to the past.
comment:3 by , 15 years ago
After looking again at the code:
Can we be sure that the drive letter returned by info.absoluteFilePath() is always upper case ?
Also, the check for "partitionable removable" is not neccessary, because they are reported as DEVTYPE_FIXED. Unfortunately, I don't have a computer with a 5.25" floppy ;-).
comment:4 by , 15 years ago
QFileInfo::absoluteFilePath() should always uppercase drive letters, but I added a small fix for the case in r619 if it ever stops doing so.
Your concern about DEVTYPE_FIXED is not fully clear to me: here, both floppies and CDs don't have this flag so everything works fine. Do you mean that there are cases when the drive is non-fixed but it has DEVTYPE_FIXED set?
I also wonder how the USB sticks are reported (can't check it here). Do they look like CDs in Qt applications on your system?
comment:5 by , 15 years ago
USB sticks are reported as DEVTYPE_FIXED with bit 3 in the fsDeviceAttr set (i.e. partitionable removable). With the current code they are shown as harddrives. However the check for partitionable removable isn't neccessary. It also must be mentioned, that the bits 3 and 4 of fsDeviceAttr are not present in really ancient versions of OS/2 (Warp3, unfixed Warp4). But I'm not sure, if Qt will run at all on those systems...
comment:6 by , 15 years ago
In r642, I implemented support for displaying native file icons in QFileDialog.
Regarding DEVTYPE_FIXED. Thank you for the explanation, but I think that it's correct that USB sticks are shown as hard drives now (in fact, they are more like hard drives than like CDs) so I don't see a need to change the current code.
Another nice thing would be to take native icons for drives themselves (currently we use Qt icons for drives) as well as for "Computer" (Local System) and for other things like "Trash" (Shredder). This requires usage of RWS though (to call methods of WPS objects from another process) and I'm not sure I will be able to implement this for the 4.6.2 milestone. Will leave this defect open until this is done.
comment:7 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
If one feels like we should add that in Qt5 please open a ticket at https://github.com/bitwiseworks/qtbase-os2
Possible solution:
in QFileIconProvider::icon(const QFileInfo &info)
needs: