Changeset 8 for trunk/src/tools/qdir.cpp
- Timestamp:
- Nov 16, 2005, 8:36:46 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tools/qdir.cpp
r7 r8 68 68 A QDir can point to a file using either a relative or an absolute 69 69 path. Absolute paths begin with the directory separator "/" 70 (optionally preceded by a drive specification under Windows ). If70 (optionally preceded by a drive specification under Windows and OS/2). If 71 71 you always use "/" as a directory separator, Qt will translate 72 72 your paths to conform to the underlying operating system. Relative … … 116 116 The list of root directories is provided by drives(); on Unix 117 117 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:/", 119 119 etc. 120 120 … … 281 281 The path can be either absolute or relative. Absolute paths begin 282 282 with the directory separator "/" (optionally preceded by a drive 283 specification under Windows ). Relative file names begin with a283 specification under Windows and OS/2). Relative file names begin with a 284 284 directory name or a file name and specify a path relative to the 285 285 current directory. An example of an absolute path is the string … … 403 403 404 404 QString tmp = absPath(); 405 #if def Q_OS_WIN32405 #if defined(Q_OS_WIN32) || defined(Q_OS_OS2) 406 406 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 407 421 int drv = fileName.upper()[0].latin1() - 'A' + 1; 408 422 if ( _getdrive() != drv ) { … … 416 430 tmp = buf; 417 431 } ); 432 #endif 418 433 if ( !tmp.endsWith("\\") ) 419 434 tmp += "\\"; … … 445 460 "c:\winnt\system32". 446 461 462 On OS/2, convertSeparators("c:/os2/system") returns 463 "c:\os2\system". 464 447 465 The returned string may be the same as the argument on some 448 466 operating systems, for example on Unix. … … 1083 1101 /*! 1084 1102 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. 1086 1104 1087 1105 You do not need to use this function to build file paths. If you … … 1126 1144 environment variable). If none of these exist "C:\" is used. 1127 1145 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 1128 1152 Under non-Windows operating systems the \c HOME environment 1129 1153 variable is used if it exists, otherwise rootDirPath() is used.
Note:
See TracChangeset
for help on using the changeset viewer.