Example #1
0
QString QDir::homeDirPath()
{
    QString d;
    d = QFile::decodeName(getenv("HOME"));
    slashify( d );
    if ( d.isNull() )
	d = rootDirPath();
    return d;
}
Example #2
0
const QFileInfoList * QDir::drives()
{
    // at most one instance of QFileInfoList is leaked, and this variable
    // points to that list
    static QFileInfoList * knownMemoryLeak = 0;

    if ( !knownMemoryLeak ) {
	knownMemoryLeak = new QFileInfoList;
	// non-win32 versions both use just one root directory
	knownMemoryLeak->append( new QFileInfo( rootDirPath() ) );
    }

    return knownMemoryLeak;
}
Example #3
0
QString QDir::homeDirPath()
{
    QString d = p_getenv ( "HOME" );
    if ( d.isNull () ) {
        d = p_getenv ( "USERPROFILE" );
        if ( d.isNull () ) {
            QString homeDrive = p_getenv ( "HOMEDRIVE" );
            QString homePath = p_getenv ( "HOMEPATH" );
            if ( !homeDrive.isNull () && !homePath.isNull () ) {
                d = homeDrive + homePath;
            } else {
                d = rootDirPath ();
            }
        }
    }
    slashify( d );
    return d;
}
Example #4
0
const QFileInfoList * QDir::drives()
{
    // at most one instance of QFileInfoList is leaked, and this variable
    // points to that list
    static QFileInfoList * knownMemoryLeak = 0;

    if ( !knownMemoryLeak ) {

#ifdef QT_THREAD_SUPPORT
	QMutexLocker locker( qt_global_mutexpool ?
			     qt_global_mutexpool->get( &knownMemoryLeak ) : 0 );
#endif // QT_THREAD_SUPPORT

	if ( !knownMemoryLeak ) {
	    knownMemoryLeak = new QFileInfoList;
	    // non-win32 versions both use just one root directory
	    knownMemoryLeak->append( new QFileInfo( rootDirPath() ) );
	}
    }

    return knownMemoryLeak;
}