Changeset 8 for trunk/src/tools/qdir.cpp


Ignore:
Timestamp:
Nov 16, 2005, 8:36:46 PM (20 years ago)
Author:
dmik
Message:

Transferred Qt for OS/2 version 3.3.1-rc5 sources from the CVS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tools/qdir.cpp

    r7 r8  
    6868    A QDir can point to a file using either a relative or an absolute
    6969    path. Absolute paths begin with the directory separator "/"
    70     (optionally preceded by a drive specification under Windows). If
     70    (optionally preceded by a drive specification under Windows and OS/2). If
    7171    you always use "/" as a directory separator, Qt will translate
    7272    your paths to conform to the underlying operating system. Relative
     
    116116    The list of root directories is provided by drives(); on Unix
    117117    systems this returns a list containing one root directory, "/"; on
    118     Windows the list will usually contain "C:/", and possibly "D:/",
     118    Windows or OS/2 the list will usually contain "C:/", and possibly "D:/",
    119119    etc.
    120120
     
    281281    The path can be either absolute or relative. Absolute paths begin
    282282    with the directory separator "/" (optionally preceded by a drive
    283     specification under Windows). Relative file names begin with a
     283    specification under Windows and OS/2). Relative file names begin with a
    284284    directory name or a file name and specify a path relative to the
    285285    current directory. An example of an absolute path is the string
     
    403403
    404404    QString tmp = absPath();
    405 #ifdef Q_OS_WIN32
     405#if defined(Q_OS_WIN32) || defined(Q_OS_OS2)
    406406    if ( fileName[0].isLetter() && fileName[1] == ':' ) {
     407#if defined(Q_OS_OS2)
     408#if defined(Q_CC_GNU)
     409        char drv = fileName.upper()[0].latin1();
     410        if ( _getdrive() != drv ) {
     411            char buf[PATH_MAX];
     412            _getcwd1( buf, drv );
     413#else
     414        int drv = fileName.upper()[0].latin1() - 'A' + 1;
     415        if ( _getdrive() != drv ) {
     416            char buf[PATH_MAX];
     417            _getdcwd( drv, buf, PATH_MAX );
     418#endif
     419            tmp = buf;
     420#else
    407421        int drv = fileName.upper()[0].latin1() - 'A' + 1;
    408422        if ( _getdrive() != drv ) {
     
    416430                tmp = buf;
    417431            } );
     432#endif
    418433            if ( !tmp.endsWith("\\") )
    419434                tmp += "\\";
     
    445460    "c:\winnt\system32".
    446461
     462    On OS/2, convertSeparators("c:/os2/system") returns
     463    "c:\os2\system".
     464   
    447465    The returned string may be the same as the argument on some
    448466    operating systems, for example on Unix.
     
    10831101/*!
    10841102    Returns the native directory separator; "/" under UNIX (including
    1085     Mac OS X) and "\" under Windows.
     1103    Mac OS X) and "\" under Windows and OS/2.
    10861104
    10871105    You do not need to use this function to build file paths. If you
     
    11261144    environment variable). If none of these exist "C:\" is used.
    11271145
     1146    Under OS/2 the \c HOME environment variable is also used. If it
     1147    does not exist the path is formed by concatenating the \c
     1148    HOMEDRIVE and \c HOMEPATH environment variables. If they don't
     1149    exist the rootDirPath() is used (which always returns "x:/" where \c x
     1150    is the system boot drive letter).
     1151   
    11281152    Under non-Windows operating systems the \c HOME environment
    11291153    variable is used if it exists, otherwise rootDirPath() is used.
Note: See TracChangeset for help on using the changeset viewer.