Changeset 8 for trunk/src/tools/qsettings.cpp
- Timestamp:
- Nov 16, 2005, 8:36:46 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 );
Note:
See TracChangeset
for help on using the changeset viewer.