Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QString QDir::homePath (  )  [static]

Returns the absolute path of the user's home directory.

Under Windows this function will return the directory of the current user's profile. Typically, this is:

doc/src/snippets/code/src_corelib_io_qdir.cpp 12

Use the toNativeSeparators() function to convert the separators to the ones that are appropriate for the underlying operating system.

If the directory of the current user's profile does not exist or cannot be retrieved, the following alternatives will be checked (in the given order) until an existing and available path is found:

1 The path specified by the USERPROFILE environment variable. The path formed by concatenating the HOMEDRIVE and HOMEPATH environment variables. The path specified by the HOME environment variable. The path returned by the rootPath() function (which uses the SystemDrive environment variable) The {C:/} directory.

Under non-Windows operating systems the HOME environment variable is used if it exists, otherwise the path returned by the rootPath() function is used.

See also:
home(), currentPath(), rootPath(), tempPath()

Definition at line 1916 of file qdir.cpp.

References cleanPath().

Referenced by QCleanlooksStyle::polish(), and QDesktopServices::storageLocation().

    return QString();
    return cleanPath(QFSFileEngine::homePath());

Generated by  Doxygen 1.6.0   Back to index