Changeset 8 for trunk/src/tools
- Timestamp:
- Nov 16, 2005, 8:36:46 PM (20 years ago)
- Location:
- trunk/src/tools
- Files:
-
- 8 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tools/qconfig.cpp
r7 r8 2 2 3 3 /* Install paths from configure */ 4 static const char QT_INSTALL_PREFIX [267] = "qt_nstpath= E:\\develop\\Qt\\win-3.3.1";5 static const char QT_INSTALL_BINS [267] = "qt_binpath= E:\\develop\\Qt\\win-3.3.1\\bin";6 static const char QT_INSTALL_DOCS [267] = "qt_docpath= E:\\develop\\Qt\\win-3.3.1\\doc";7 static const char QT_INSTALL_HEADERS[267] = "qt_hdrpath= E:\\develop\\Qt\\win-3.3.1\\include";8 static const char QT_INSTALL_LIBS [267] = "qt_libpath= E:\\develop\\Qt\\win-3.3.1\\lib";9 static const char QT_INSTALL_PLUGINS[267] = "qt_plgpath= E:\\develop\\Qt\\win-3.3.1\\plugins";10 static const char QT_INSTALL_DATA [267] = "qt_datpath= E:\\develop\\Qt\\win-3.3.1";11 static const char QT_INSTALL_TRANSLATIONS [267] = "qt_trnpath= E:\\develop\\Qt\\win-3.3.1\\translations";4 static const char QT_INSTALL_PREFIX [267] = "qt_nstpath=C:\\Qt\\3.3.1"; 5 static const char QT_INSTALL_BINS [267] = "qt_binpath=C:\\Qt\\3.3.1\\bin"; 6 static const char QT_INSTALL_DOCS [267] = "qt_docpath=C:\\Qt\\3.3.1\\doc"; 7 static const char QT_INSTALL_HEADERS[267] = "qt_hdrpath=C:\\Qt\\3.3.1\\include"; 8 static const char QT_INSTALL_LIBS [267] = "qt_libpath=C:\\Qt\\3.3.1\\lib"; 9 static const char QT_INSTALL_PLUGINS[267] = "qt_plgpath=C:\\Qt\\3.3.1\\plugins"; 10 static const char QT_INSTALL_DATA [267] = "qt_datpath=C:\\Qt\\3.3.1"; 11 static const char QT_INSTALL_TRANSLATIONS [267] = "qt_trnpath=C:\\Qt\\3.3.1\\translations"; 12 12 13 13 /* strlen( "qt_xxxpath=" ) == 11 */ -
trunk/src/tools/qcriticalsection_p.cpp
r7 r8 36 36 #if defined(QT_THREAD_SUPPORT) 37 37 38 #include "qt_windows.h"39 40 38 #include <private/qcriticalsection_p.h> 41 39 40 #if defined(Q_WS_WIN) 41 # include "qt_windows.h" 42 #elif defined(Q_OS_OS2) 43 # include "qt_os2.h" 44 #endif 45 46 #if defined(Q_WS_WIN) 42 47 class QCriticalSectionPrivate 43 48 { … … 47 52 CRITICAL_SECTION section; 48 53 }; 49 54 #endif 50 55 51 56 QCriticalSection::QCriticalSection() 52 57 { 58 #if defined(Q_WS_WIN) 53 59 d = new QCriticalSectionPrivate; 54 60 InitializeCriticalSection( &d->section ); 61 #endif 55 62 } 56 63 57 64 QCriticalSection::~QCriticalSection() 58 65 { 66 #if defined(Q_WS_WIN) 59 67 DeleteCriticalSection( &d->section ); 60 68 delete d; 69 #endif 61 70 } 62 71 63 72 void QCriticalSection::enter() 64 73 { 74 #if defined(Q_WS_WIN) 65 75 EnterCriticalSection( &d->section ); 76 #elif defined(Q_OS_OS2) 77 DosEnterCritSec(); 78 #endif 66 79 } 67 80 68 81 void QCriticalSection::leave() 69 82 { 83 #if defined(Q_WS_WIN) 70 84 LeaveCriticalSection( &d->section ); 85 #elif defined(Q_OS_OS2) 86 DosExitCritSec(); 87 #endif 71 88 } 72 89 -
trunk/src/tools/qcriticalsection_p.h
r7 r8 38 38 39 39 #ifndef QT_H 40 #include "qglobal.h" 40 41 #endif // QT_H 41 42 … … 54 55 #if defined(QT_THREAD_SUPPORT) 55 56 56 #if defined(Q_WS_WIN) 57 #if defined(Q_WS_WIN) || defined(Q_OS_OS2) 57 58 58 59 /* … … 60 61 */ 61 62 63 #if defined(Q_WS_WIN) 62 64 class QCriticalSectionPrivate; 65 #endif 63 66 64 67 class QCriticalSection … … 70 73 void leave(); 71 74 75 #if defined(Q_WS_WIN) 72 76 private: 73 77 QCriticalSectionPrivate *d; 78 #endif 74 79 }; 75 80 -
trunk/src/tools/qdatetime.cpp
r7 r8 51 51 #endif 52 52 53 #if defined(Q_OS_OS2) 54 #include <unidef.h> 55 #include <sys/timeb.h> 56 #endif 57 53 58 static const uint FIRST_DAY = 2361222; // Julian day for 1752-09-14 54 59 static const int FIRST_YEAR = 1752; // ### wrong for many countries … … 515 520 } 516 521 #endif 517 #ifndef Q_WS_WIN 522 #if defined(Q_OS_OS2) 523 UniChar buffer[256]; 524 tm tt; 525 memset( &tt, 0, sizeof( tm ) ); 526 tt.tm_mon = month - 1; 527 LocaleObject lo = qt_os2DefLocaleObj(); 528 if (lo) 529 if ( UniStrftime( lo, buffer, sizeof( buffer ) / sizeof( UniChar ), 530 (UniChar *)L"%b", &tt ) 531 ) 532 return QString::fromUcs2( buffer ); 533 #elif !defined(Q_WS_WIN) 518 534 char buffer[255]; 519 535 tm tt; … … 561 577 } 562 578 #endif 563 #ifndef Q_WS_WIN 579 #if defined(Q_OS_OS2) 580 UniChar buffer[256]; 581 tm tt; 582 memset( &tt, 0, sizeof( tm ) ); 583 tt.tm_mon = month - 1; 584 LocaleObject lo = qt_os2DefLocaleObj(); 585 if (lo) 586 if ( UniStrftime( lo, buffer, sizeof( buffer ) / sizeof( UniChar ), 587 (UniChar *)L"%B", &tt ) 588 ) 589 return QString::fromUcs2( buffer ); 590 #elif !defined(Q_WS_WIN) 564 591 char buffer[255]; 565 592 tm tt; … … 615 642 } 616 643 #endif 617 #ifndef Q_WS_WIN 644 #if defined(Q_OS_OS2) 645 UniChar buffer[256]; 646 tm tt; 647 memset( &tt, 0, sizeof( tm ) ); 648 tt.tm_wday = ( weekday == 7 ) ? 0 : weekday; 649 LocaleObject lo = qt_os2DefLocaleObj(); 650 if (lo) 651 if ( UniStrftime( lo, buffer, sizeof( buffer ) / sizeof( UniChar ), 652 (UniChar *)L"%a", &tt ) 653 ) 654 return QString::fromUcs2( buffer ); 655 #elif !defined(Q_WS_WIN) 618 656 char buffer[255]; 619 657 tm tt; … … 663 701 } 664 702 #endif 665 #ifndef Q_WS_WIN 703 #if defined(Q_OS_OS2) 704 UniChar buffer[256]; 705 tm tt; 706 memset( &tt, 0, sizeof( tm ) ); 707 tt.tm_wday = ( weekday == 7 ) ? 0 : weekday; 708 LocaleObject lo = qt_os2DefLocaleObj(); 709 if (lo) 710 if ( UniStrftime( lo, buffer, sizeof( buffer ) / sizeof( UniChar ), 711 (UniChar *)L"%A", &tt ) 712 ) 713 return QString::fromUcs2( buffer ); 714 #elif !defined(Q_WS_WIN) 666 715 char buffer[255]; 667 716 tm tt; … … 729 778 case Qt::LocalDate: 730 779 { 731 #ifndef Q_WS_WIN 780 #if defined(Q_OS_OS2) 781 tm tt; 782 memset( &tt, 0, sizeof( tm ) ); 783 UniChar buf[256]; 784 tt.tm_mday = day(); 785 tt.tm_mon = month() - 1; 786 tt.tm_year = year() - 1900; 787 788 LocaleObject lo = qt_os2DefLocaleObj(); 789 if (lo) 790 if ( UniStrftime( lo, buf, sizeof( buf ) / sizeof( UniChar ), 791 (UniChar *)L"%x", &tt ) 792 ) 793 return QString::fromUcs2( buf ); 794 #elif !defined(Q_WS_WIN) 732 795 tm tt; 733 796 memset( &tt, 0, sizeof( tm ) ); … … 1395 1458 case Qt::LocalDate: 1396 1459 { 1397 #ifndef Q_WS_WIN 1460 #if defined(Q_OS_OS2) 1461 tm tt; 1462 memset( &tt, 0, sizeof( tm ) ); 1463 UniChar buf[256]; 1464 tt.tm_sec = second(); 1465 tt.tm_min = minute(); 1466 tt.tm_hour = hour(); 1467 1468 LocaleObject lo = qt_os2DefLocaleObj(); 1469 if (lo) 1470 if ( UniStrftime( lo, buf, sizeof( buf ) / sizeof( UniChar ), 1471 (UniChar *)L"%X", &tt ) 1472 ) 1473 return QString::fromUcs2( buf ); 1474 #elif !defined(Q_WS_WIN) 1398 1475 tm tt; 1399 1476 memset( &tt, 0, sizeof( tm ) ); … … 1743 1820 ct->ds = (uint)( MSECS_PER_HOUR * t->tm_hour + MSECS_PER_MIN * t->tm_min + 1744 1821 1000 * t->tm_sec + tv.tv_usec / 1000 ); 1822 #elif defined(Q_OS_OS2) 1823 timeb ltime; 1824 ::ftime( <ime ); 1825 tm *t; 1826 if ( ts == Qt::LocalTime ) 1827 t = localtime( <ime.time ); 1828 else 1829 t = gmtime( <ime.time ); 1830 ct->ds = (uint) ( MSECS_PER_HOUR * t->tm_hour + MSECS_PER_MIN * t->tm_min + 1831 1000 * t->tm_sec + ltime.millitm ); 1745 1832 #else 1746 1833 time_t ltime; // no millisecond resolution … … 1748 1835 tm *t; 1749 1836 if ( ts == Qt::LocalTime ) 1750 localtime( <ime );1837 t = localtime( <ime ); 1751 1838 else 1752 gmtime( <ime );1839 t = gmtime( <ime ); 1753 1840 ct->ds = (uint) ( MSECS_PER_HOUR * t->tm_hour + MSECS_PER_MIN * t->tm_min + 1754 1841 1000 * t->tm_sec ); -
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. -
trunk/src/tools/qfile.cpp
r7 r8 139 139 140 140 Qt uses Unicode file names. If you want to do your own I/O on Unix 141 systems you may want to use encodeName() (and decodeName()) to141 and OS/2 systems you may want to use encodeName() (and decodeName()) to 142 142 convert the file name into the local encoding. 143 143 … … 565 565 /*! 566 566 When you use QFile, QFileInfo, and QDir to access the file system 567 with Qt, you can use Unicode file names. On Unix , these file names568 are converted to an 8-bit encoding. If you want to do your own569 file I/O on Unix , you should convert the file name using this567 with Qt, you can use Unicode file names. On Unix and OS/2, these file 568 names are converted to an 8-bit encoding. If you want to do your own 569 file I/O on Unix or OS/2, you should convert the file name using this 570 570 function. On Windows NT/2000, Unicode file names are supported 571 571 directly in the file system and this function should be avoided. -
trunk/src/tools/qfiledefs_p.h
r7 r8 54 54 struct QFileInfoCache 55 55 { 56 #if defined(Q_WS_WIN) 56 #if defined(Q_WS_WIN) || defined(Q_OS_OS2) 57 57 QT_STATBUF st; 58 58 #else -
trunk/src/tools/qfileinfo.cpp
r7 r8 64 64 A QFileInfo can point to a file with either a relative or an 65 65 absolute file path. Absolute file paths begin with the directory 66 separator "/" (or with a drive specification on Windows ). Relative66 separator "/" (or with a drive specification on Windows and OS/2). Relative 67 67 file names begin with a directory name or a file name and specify 68 68 a path relative to the current working directory. An example of an … … 130 130 rights of the current user, you should use isReadable(), isWritable() and 131 131 isExecutable(). 132 133 @@TODO: describe OS/2 semantics regarding permissions. 132 134 */ 133 135 … … 266 268 The \a file can also include an absolute or relative file path. 267 269 Absolute paths begin with the directory separator (e.g. "/" under 268 Unix) or a drive specification (under Windows ). Relative file270 Unix) or a drive specification (under Windows and OS/2). Relative file 269 271 names begin with a directory name or a file name and specify a 270 272 path relative to the current directory. … … 529 531 } 530 532 531 #if ndef Q_WS_WIN533 #if !defined(Q_WS_WIN) && !defined(Q_OS_OS2) 532 534 bool QFileInfo::isHidden() const 533 535 { … … 654 656 The absolute path name consists of the full path and the file 655 657 name. On Unix this will always begin with the root, '/', 656 directory. On Windows this will always begin 'D:/' where D is a658 directory. On Windows and OS/2 this will always begin 'D:/' where D is a 657 659 drive letter, except for network shares that are not mapped to a 658 660 drive letter, in which case the path will begin '//sharename/'. … … 672 674 QString tmp; 673 675 if ( QDir::isRelativePath(fn) 674 #if defined(Q_OS_WIN32) 676 #if defined(Q_OS_WIN32) || defined(Q_OS_OS2) 675 677 && fn[1] != ':' 676 678 #endif -
trunk/src/tools/qglobal.cpp
r7 r8 47 47 #if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) && !defined(Q_OS_TEMP) 48 48 #include <crtdbg.h> 49 #endif 50 51 #if defined(Q_OS_OS2) 52 #include "qt_os2.h" 49 53 #endif 50 54 … … 359 363 \endcode 360 364 361 Under X11 , the text is printed to stderr. Under Windows, the text365 Under X11 or OS/2, the text is printed to stderr. Under Windows, the text 362 366 is sent to the debugger. 363 367 … … 392 396 \endcode 393 397 394 Under X11 , the text is printed to stderr. Under Windows, the text398 Under X11 or OS/2, the text is printed to stderr. Under Windows, the text 395 399 is sent to the debugger. 396 400 … … 426 430 \endcode 427 431 428 Under X11 , the text is printed to stderr. Under Windows, the text432 Under X11 or OS/2, the text is printed to stderr. Under Windows, the text 429 433 is sent to the debugger. 430 434 … … 652 656 error code will be used if possible. Use this method to handle 653 657 failures in platform specific API calls. 658 659 Under OS/2, the value -1 for \a code should only be used after Presentation 660 Manager calls. 654 661 655 662 This function does nothing when Qt is built with \c QT_NO_DEBUG … … 689 696 } ); 690 697 LocalFree( (HLOCAL)string ); 698 #elif defined(Q_OS_OS2) 699 if ( code != -1 ) { 700 CHAR buf [256] = {0}; 701 ULONG len = 0; 702 APIRET rc = DosGetMessage( NULL, 0, buf, sizeof(buf) - 1, code, "OSO001.MSG", &len ); 703 if ( !rc ) { 704 buf[len] = '\0'; 705 qWarning( "%s\n\tError %s", msg, buf ); 706 } else { 707 if ( rc == ERROR_MR_MSG_TOO_LONG ) 708 qWarning( 709 "%s\n\tError code SYS%04d, " 710 "type help %d in the command prompt to get more information", 711 msg, code, code ); 712 else 713 qWarning( "%s\n\tError code %d (system error)", msg, code ); 714 } 715 } else { 716 code = (int) WinGetLastError( 0 ); 717 if ( code ) 718 qWarning( "%s\n\tError code %08X (PM error)", msg, code ); 719 else 720 qWarning( msg ); 721 } 691 722 #else 692 723 if ( code != -1 ) … … 858 889 859 890 The default message handler prints the message to the standard 860 output under X11 or to the debugger under Windows. If it is a891 output under X11 and OS/2 or to the debugger under Windows. If it is a 861 892 fatal message, the application aborts immediately. 862 893 -
trunk/src/tools/qgpluginmanager.cpp
r7 r8 315 315 return; 316 316 317 #if defined(Q_OS_WIN32) 317 #if defined(Q_OS_WIN32) || defined(Q_OS_OS2) 318 318 QString filter = "*.dll"; 319 319 #elif defined(Q_OS_MACX) -
trunk/src/tools/qlibrary.cpp
r7 r8 1 //depot/qt/3/src/tools/qlibrary.cpp#9 - edit change 123005 (text)2 1 /**************************************************************************** 3 2 ** $Id$ … … 123 122 QLibrary lib( "mylib.dll" ); 124 123 \endcode 125 on Windows , and124 on Windows and OS/2, and 126 125 \code 127 126 QLibrary lib( "libmylib.so" ); … … 178 177 with a C++ compiler. On Windows you also have to explicitly export 179 178 the function from the DLL using the \c {__declspec(dllexport)} 180 compiler directive. 179 compiler directive. 181 180 182 181 \code … … 197 196 \endcode 198 197 198 On OS/2 you should create a .DEF file that describes what functions are 199 exported and use it when linking your DLL (@@TODO: add more info and an 200 example). 201 199 202 On Darwin and Mac OS X this function uses code from dlcompat, part of the 200 203 OpenDarwin project. … … 385 388 QString str = lib.library(); 386 389 \endcode 387 will set \e str to "mylib.dll" on Windows , and "libmylib.so" on Linux.390 will set \e str to "mylib.dll" on Windows and OS/2, and "libmylib.so" on Linux. 388 391 */ 389 392 QString QLibrary::library() const … … 394 397 QString filename = libfile; 395 398 396 #if defined(Q_WS_WIN) 399 #if defined(Q_WS_WIN) || defined(Q_OS_OS2) 397 400 if ( filename.findRev( '.' ) <= filename.findRev( '/' ) ) 398 401 filename += ".dll"; -
trunk/src/tools/qlibrary_p.h
r7 r8 64 64 QLibraryPrivate( QLibrary *lib ); 65 65 66 #if def Q_WS_WIN66 #if defined(Q_WS_WIN) 67 67 HINSTANCE pHnd; 68 #elif defined(Q_OS_OS2) 69 HMODULE pHnd; 68 70 #else 69 71 void *pHnd; -
trunk/src/tools/qlocale.cpp
r7 r8 53 53 # define isnan(d) _isnan(d) 54 54 # endif 55 #endif 55 #elif defined(Q_OS_OS2) && defined(Q_CC_GNU) 56 # undef NAN 57 # undef INFINITY 58 #endif 59 56 60 57 61 #if !defined( QWS ) && defined( Q_OS_MAC ) -
trunk/src/tools/qsettings.cpp
r7 r8 74 74 75 75 On Unix systems, QSettings uses text files to store settings. On Windows 76 systems, QSettings uses the system registry. On Mac OS X, QSettings uses77 the Carbon preferences API.76 and OS/2 systems, QSettings uses the system registry. On Mac OS X, 77 QSettings uses the Carbon preferences API. 78 78 79 79 Each setting comprises an identifying key and the data associated with … … 160 160 \endcode 161 161 162 Since settings for Windows a re stored in the registry there are162 Since settings for Windows and OS/2 are stored in the registry there are 163 163 some size limitations as follows: 164 164 \list … … 225 225 226 226 For cross-platform applications you should ensure that the 227 \link #sizelimit Windows size limitations \endlink are not exceeded.227 \link #sizelimit Windows and OS/2 size limitations \endlink are not exceeded. 228 228 */ 229 229 … … 233 233 \value Mac Macintosh execution environments 234 234 \value Unix Mac OS X, Unix, Linux and Unix-like execution environments 235 \value Windows Windows execution environments235 \value Windows Windows and OS/2 execution environments 236 236 */ 237 237 … … 333 333 return; 334 334 335 #if ndef Q_WS_WIN335 #if !defined(Q_WS_WIN) && !defined(Q_WS_PM) 336 336 HANDLE lockfd = openlock( filename, Q_LOCKREAD ); 337 337 #endif … … 356 356 file.close(); 357 357 358 #if ndef Q_WS_WIN358 #if !defined(Q_WS_WIN) && !defined(Q_WS_PM) 359 359 closelock( lockfd ); 360 360 #endif … … 456 456 : groupDirty( TRUE ), modified(FALSE), globalScope(TRUE) 457 457 { 458 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))458 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 459 459 if ( format != QSettings::Ini ) 460 460 return; … … 697 697 698 698 When \a s is \e Windows and the execution environment is \e not 699 Windows the function does nothing. Similarly when \a s is \e Unix and699 Windows or OS/2 the function does nothing. Similarly when \a s is \e Unix and 700 700 the execution environment is \e not Unix the function does nothing. 701 701 702 When \a s is \e Windows, and the execution environment is Windows , the702 When \a s is \e Windows, and the execution environment is Windows or OS/2, the 703 703 search path list will be used as the first subfolder of the "Software" 704 704 folder in the registry. … … 781 781 void QSettings::insertSearchPath( System s, const QString &path) 782 782 { 783 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))783 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 784 784 if ( d->sysd ) { 785 785 d->sysInsertSearchPath( s, path ); … … 788 788 #endif 789 789 790 #if !defined(Q_WS_WIN) 790 #if !defined(Q_WS_WIN) && !defined(Q_WS_PM) 791 791 if ( s == Windows ) 792 792 return; 793 793 #endif 794 #if !defined(Q_WS_WIN) 794 #if !defined(Q_WS_WIN) && !defined(Q_WS_PM) 795 795 if ( s == Mac ) 796 796 return; … … 804 804 } 805 805 806 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))806 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 807 807 if ( d->sysd && s != Unix ) { 808 808 #else … … 816 816 817 817 QString realPath = path; 818 #if defined(Q_WS_WIN) 818 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 819 819 QString defPath = d->globalScope ? d->searchPaths.first() : d->searchPaths.last(); 820 820 realPath = defPath + path; … … 844 844 } 845 845 846 #if def Q_WS_WIN846 #if defined(Q_WS_WIN) || defined (Q_WS_PM) 847 847 if ( d->sysd ) { 848 848 d->sysRemoveSearchPath( s, path ); … … 850 850 } 851 851 #endif 852 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))852 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 853 853 if ( d->sysd && s != Unix ) { 854 854 #else … … 876 876 Q_CHECK_PTR(d); 877 877 878 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))878 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 879 879 d->sysd = 0; 880 880 d->sysInit(); … … 893 893 Q_CHECK_PTR(d); 894 894 895 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))895 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 896 896 d->sysd = 0; 897 897 if ( format == Native ) … … 911 911 sync(); 912 912 913 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))913 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 914 914 if ( d->sysd ) 915 915 d->sysClear(); … … 926 926 bool QSettings::sync() 927 927 { 928 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))928 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 929 929 if ( d->sysd ) 930 930 return d->sysSync(); … … 981 981 } 982 982 983 #if ndef Q_WS_WIN983 #if !defined(Q_WS_WIN) && !defined(Q_WS_PM) 984 984 HANDLE lockfd = openlock( filename, Q_LOCKWRITE ); 985 985 #endif … … 1055 1055 file.remove(); 1056 1056 1057 #if ndef Q_WS_WIN1057 #if !defined(Q_WS_WIN) && !defined(Q_WS_PM) 1058 1058 closelock( lockfd ); 1059 1059 #endif … … 1093 1093 } 1094 1094 1095 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1095 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1096 1096 if ( d->sysd ) 1097 1097 return d->sysReadBoolEntry( grp_key, def, ok ); … … 1145 1145 } 1146 1146 1147 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1147 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1148 1148 if ( d->sysd ) 1149 1149 return d->sysReadDoubleEntry( grp_key, def, ok ); … … 1190 1190 } 1191 1191 1192 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1192 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1193 1193 if ( d->sysd ) 1194 1194 return d->sysReadNumEntry( grp_key, def, ok ); … … 1236 1236 } 1237 1237 1238 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1238 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1239 1239 if ( d->sysd ) 1240 1240 return d->sysReadEntry( grp_key, def, ok ); … … 1311 1311 } 1312 1312 1313 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1313 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1314 1314 if ( d->sysd ) 1315 1315 return d->sysWriteEntry( grp_key, value ); … … 1342 1342 } 1343 1343 1344 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1344 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1345 1345 if ( d->sysd ) 1346 1346 return d->sysWriteEntry( grp_key, value ); … … 1372 1372 } 1373 1373 1374 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1374 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1375 1375 if ( d->sysd ) 1376 1376 return d->sysWriteEntry( grp_key, value ); … … 1425 1425 } 1426 1426 1427 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1427 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1428 1428 if ( d->sysd ) 1429 1429 return d->sysWriteEntry( grp_key, value ); … … 1486 1486 } 1487 1487 1488 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1488 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1489 1489 if ( d->sysd ) 1490 1490 return d->sysRemoveEntry( grp_key ); … … 1564 1564 } 1565 1565 1566 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1566 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1567 1567 if ( d->sysd ) 1568 1568 return d->sysEntryList( grp_key ); … … 1660 1660 } 1661 1661 1662 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1662 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1663 1663 if ( d->sysd ) 1664 1664 return d->sysSubkeyList( grp_key ); … … 1753 1753 } 1754 1754 1755 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))1755 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 1756 1756 if ( d->sysd ) 1757 1757 return QDateTime(); … … 1961 1961 void QSettings::setPath( const QString &domain, const QString &product, Scope scope ) 1962 1962 { 1963 // On Windows , any trailing ".com(\..*)" is stripped from the domain. The1963 // On Windows and OS/2, any trailing ".com(\..*)" is stripped from the domain. The 1964 1964 // Global scope corresponds to HKEY_LOCAL_MACHINE, and User corresponds to 1965 1965 // HKEY_CURRENT_USER. Note that on some installations, not all users can … … 1982 1982 int lastDot = domain.findRev( '.' ); 1983 1983 1984 #if defined(Q_WS_WIN) 1984 #if defined(Q_WS_WIN) || defined(Q_WS_PM) 1985 1985 actualSearchPath = "/" + domain.mid( 0, lastDot ) + "/" + product; 1986 1986 insertSearchPath( Windows, actualSearchPath ); -
trunk/src/tools/qsettings_p.h
r7 r8 106 106 bool globalScope :1; 107 107 108 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_ OS_MAC))108 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_WS_PM) || defined(Q_OS_MAC)) 109 109 // system dependent implementations to use the 110 110 // system specific setting database (ie. registry on Windows) -
trunk/src/tools/qstring.cpp
r7 r8 62 62 #if defined(Q_WS_WIN) 63 63 #include "qt_windows.h" 64 #endif 65 #if defined(Q_OS_OS2) 66 #include <unidef.h> 67 #include <uconv.h> 64 68 #endif 65 69 #if !defined( QT_NO_COMPONENT ) && !defined( QT_LITE_COMPONENT ) … … 5701 5705 /*! 5702 5706 Returns the string encoded in a locale-specific format. On X11, 5703 this is the QTextCodec::codecForLocale(). On Windows , it is a5707 this is the QTextCodec::codecForLocale(). On Windows and OS/2, it is a 5704 5708 system-defined encoding. On Mac OS X, this always uses UTF-8 as 5705 5709 the encoding. … … 5731 5735 return isNull() ? QCString("") : qt_winQString2MB( *this ); 5732 5736 #endif 5737 #if defined(Q_OS_OS2) 5738 return isNull() ? QCString("") : qt_os2QString2MB( *this ); 5739 #endif 5733 5740 #ifdef Q_WS_QWS 5734 5741 return utf8(); // ### if there is any 8 bit format supported? … … 5780 5787 return qt_winMB2QString( local8Bit ); 5781 5788 #endif 5789 #if defined(Q_OS_OS2) 5790 return qt_os2MB2QString( local8Bit, len ); 5791 #endif 5782 5792 #ifdef Q_WS_QWS 5783 5793 return fromUtf8(local8Bit,len); … … 6193 6203 return 0; 6194 6204 } 6205 #elif defined(Q_OS_OS2) 6206 LocaleObject lo = qt_os2DefLocaleObj(); 6207 if (lo) 6208 return UniStrcoll( lo, (UniChar*) ucs2(), (UniChar *) s.ucs2() ); 6209 else 6210 return ucstrcmp( *this, s ); 6195 6211 #elif defined(Q_WS_MACX) 6196 6212 int delta = 0; … … 6928 6944 6929 6945 #endif // Q_OS_WIN32 6946 6947 #if defined (Q_OS_OS2) 6948 6949 static LocaleObject qt_os2DefLocaleObj_var = NULL; 6950 static UconvObject qt_os2DefUconvObj_var = NULL; 6951 6952 const LocaleObject qt_os2DefLocaleObj() 6953 { 6954 if ( !qt_os2DefLocaleObj_var ) 6955 UniCreateLocaleObject( UNI_UCS_STRING_POINTER, (UniChar *)L"", 6956 &qt_os2DefLocaleObj_var ); 6957 return qt_os2DefLocaleObj_var; 6958 } 6959 6960 const UconvObject qt_os2DefUconvObj() 6961 { 6962 if ( !qt_os2DefUconvObj_var ) 6963 UniCreateUconvObject( (UniChar *)L"", &qt_os2DefUconvObj_var ); 6964 return qt_os2DefUconvObj_var; 6965 } 6966 6967 QCString qt_os2QString2MB( const QString& s, int uclen ) 6968 { 6969 if ( uclen < 0 || (uint) uclen > s.length() ) 6970 uclen = s.length(); 6971 if ( s.isNull() ) 6972 return QCString(); 6973 if ( uclen == 0 ) 6974 return QCString(""); 6975 6976 UniChar *ucPtr = (UniChar *) s.unicode(); 6977 size_t ucLeft = uclen; 6978 6979 size_t mblen = uclen; 6980 QCString mbBuf( mblen + 1 ); 6981 char *mbPtr = mbBuf.data(); 6982 size_t mbLeft = mblen; 6983 6984 size_t nonIdent = 0; 6985 UconvObject uo = qt_os2DefUconvObj(); 6986 int rc; 6987 6988 while ( ucLeft ) { 6989 rc = UniUconvFromUcs ( uo, &ucPtr, &ucLeft, (void**)&mbPtr, &mbLeft, &nonIdent ); 6990 if ( rc == ULS_BUFFERFULL ) { 6991 size_t mbDone = mblen - mbLeft; 6992 size_t ucDone = uclen - ucLeft; 6993 // assume that ucLeft/mbLeft is an approximation of ucDone/mbDone 6994 mblen = mbDone + (ucLeft * mbDone) / ucDone; 6995 mbBuf.resize( mblen + 1 ); 6996 mbPtr = mbBuf.data() + mbDone; 6997 } else if ( rc != ULS_SUCCESS ) { 6998 #ifndef QT_NO_DEBUG 6999 // Fail. 7000 qWarning("UniUconvFromUcs cannot convert multibyte text (error %d): %s (UTF8)", 7001 rc, s.utf8().data()); 7002 #endif 7003 break; 7004 } 7005 } 7006 mbBuf[ mblen - mbLeft ] = '\0'; 7007 return mbBuf; 7008 } 7009 7010 // WATCH OUT: mblen must NOT include the NUL (in contrast with qt_winMB2QString) 7011 QString qt_os2MB2QString( const char* mb, int mblen ) 7012 { 7013 if ( !mb ) 7014 return QString::null; 7015 if ( mblen < 0 ) { 7016 mblen = strlen( mb ); 7017 } else { 7018 char *end = (char *) memchr (mb, '\0', mblen); 7019 if ( end ) 7020 mblen = end - mb; 7021 } 7022 if ( !mblen ) 7023 return QString::null; 7024 7025 const char *mbPtr = mb; 7026 size_t mbLeft = mblen; 7027 7028 size_t uclen = mblen; 7029 QMemArray<UniChar> ucBuf( uclen ); 7030 UniChar *ucPtr = ucBuf.data(); 7031 size_t ucLeft = uclen; 7032 7033 size_t nonIdent = 0; 7034 UconvObject uo = qt_os2DefUconvObj(); 7035 int rc; 7036 7037 while ( mbLeft ) { 7038 rc = UniUconvToUcs ( uo, (void**)&mbPtr, &mbLeft, &ucPtr, &ucLeft, &nonIdent ); 7039 if ( rc == ULS_BUFFERFULL ) { 7040 size_t ucDone = uclen - ucLeft; 7041 size_t mbDone = mblen - mbLeft; 7042 // assume that mbLeft/ucLeft is an approximation of mbDone/ucDone 7043 uclen = ucDone + (mbLeft * ucDone) / mbDone; 7044 ucBuf.resize( uclen ); 7045 ucPtr = ucBuf.data() + ucDone; 7046 } else if ( rc != ULS_SUCCESS ) { 7047 #ifndef QT_NO_DEBUG 7048 // Fail. 7049 qWarning("UniUconvFromUcs cannot convert multibyte text (error %d)", rc); 7050 #endif 7051 break; 7052 } 7053 } 7054 uclen -= ucLeft; 7055 if ( uclen == 0 ) 7056 return QString::null; 7057 QString s( (QChar*)ucBuf.data(), uclen ); 7058 return s; 7059 } 7060 7061 #endif // Q_OS_OS2 -
trunk/src/tools/qt_tools.pri
r7 r8 91 91 } 92 92 93 os2:SOURCES += $$TOOLS_CPP/qdir_pm.cpp \ 94 $$TOOLS_CPP/qfile_pm.cpp \ 95 $$TOOLS_CPP/qfileinfo_pm.cpp \ 96 $$TOOLS_CPP/qlibrary_pm.cpp \ 97 $$TOOLS_CPP/qsettings_pm.cpp \ 98 $$TOOLS_CPP/qmutex_pm.cpp \ 99 $$TOOLS_CPP/qwaitcondition_pm.cpp \ 100 $$TOOLS_CPP/qthreadstorage_pm.cpp \ 101 $$TOOLS_CPP/qcriticalsection_p.cpp 102 93 103 offmac:SOURCES += $$TOOLS_CPP/qdir_mac.cpp \ 94 104 $$TOOLS_CPP/qfile_mac.cpp \ … … 102 112 103 113 mac:!x11:!embedded:SOURCES += $$TOOLS_CPP/qsettings_mac.cpp 104 mac { 114 mac { 105 115 SOURCES+=3rdparty/dlcompat/dlfcn.c 106 116 INCLUDEPATH+=3rdparty/dlcompat … … 149 159 } 150 160 } 151 -
trunk/src/tools/qthreadinstance_p.h
r7 r8 88 88 static void finish( QThreadInstance * ); 89 89 #endif // Q_OS_WIN32 90 91 #ifdef Q_OS_OS2 92 TID thread_id; 93 int waiters; 94 95 static void _System start( void * ); 96 static void finish( QThreadInstance * ); 97 #endif // Q_OS_OS2 90 98 }; 91 99
Note:
See TracChangeset
for help on using the changeset viewer.