kde_file.h vs POSIX headers vs qplatformdefs.h

David Faure faure at kde.org
Fri Aug 9 19:54:10 UTC 2013


On Thursday 08 August 2013 16:56:23 Aurélien Gâteau wrote:
> Hi,
> 
> I started working on a kdelibs cleanup task:
> 
> "Make use of qplatformdefs.h definitions instead of using the POSIX versions
> directly. Partly revert that commit, that would port to QFile::Permissions:
> b03e81a61311ae1b64b0d37415477f9c08fe6142"
> 
> I have a few questions however:
> 
> 1. I am not exactly sure what "partly revert that commit" means.

Port back from QFile::Permissions to mode_t given that mode_t is available in 
win32-msvc*/qplatformdefs.h

(not everywhere, but in the places where the above commits did a half job at 
porting from mode_t to QFile::Permissions).

QFile::Permissions is more limited (no suid bits) and having to convert 
between mode_t and QFile::Permissions is just extra work.

The portability issue however is that S_ISDIR(mode) isn't provided on Windows, 
only (mode & QT_STAT_DIR).
Same for S_ISREG: mode & QT_STAT_REG.

> Actually, I am wondering if porting to qplatformdefs is the highest 
> priority: the fact we are using POSIX functions right now does not prevent 
> splitting, does it?

No splitting, no, but it prevents releasing if we use the wrong types in 
public headers (then we can't change that later on). Turns out mode_t is OK, 
but e.g. time_t isn't (hence the porting to QDateTime).

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE, in particular KDE Frameworks 5



More information about the Kde-frameworks-devel mailing list