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/qsettings.cpp

    r7 r8  
    7474
    7575    On Unix systems, QSettings uses text files to store settings. On Windows
    76     systems, QSettings uses the system registry.  On Mac OS X, QSettings uses
    77     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.
    7878
    7979    Each setting comprises an identifying key and the data associated with
     
    160160    \endcode
    161161
    162     Since settings for Windows are stored in the registry there are
     162    Since settings for Windows and OS/2 are stored in the registry there are
    163163    some size limitations as follows:
    164164    \list
     
    225225
    226226    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.
    228228*/
    229229
     
    233233    \value Mac Macintosh execution environments
    234234    \value Unix Mac OS X, Unix, Linux and Unix-like execution environments
    235     \value Windows Windows execution environments
     235    \value Windows Windows and OS/2 execution environments
    236236*/
    237237
     
    333333        return;
    334334
    335 #ifndef Q_WS_WIN
     335#if !defined(Q_WS_WIN) && !defined(Q_WS_PM)
    336336    HANDLE lockfd = openlock( filename, Q_LOCKREAD );
    337337#endif
     
    356356    file.close();
    357357
    358 #ifndef Q_WS_WIN
     358#if !defined(Q_WS_WIN) && !defined(Q_WS_PM)
    359359    closelock( lockfd );
    360360#endif
     
    456456    : groupDirty( TRUE ), modified(FALSE), globalScope(TRUE)
    457457{
    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))
    459459    if ( format != QSettings::Ini )
    460460        return;
     
    697697
    698698  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 and
     699  Windows or OS/2 the function does nothing. Similarly when \a s is \e Unix and
    700700  the execution environment is \e not Unix the function does nothing.
    701701
    702   When \a s is \e Windows, and the execution environment is Windows, the
     702  When \a s is \e Windows, and the execution environment is Windows or OS/2, the
    703703  search path list will be used as the first subfolder of the "Software"
    704704  folder in the registry.
     
    781781void QSettings::insertSearchPath( System s, const QString &path)
    782782{
    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))
    784784    if ( d->sysd ) {
    785785        d->sysInsertSearchPath( s, path );
     
    788788#endif
    789789
    790 #if !defined(Q_WS_WIN)
     790#if !defined(Q_WS_WIN) && !defined(Q_WS_PM)
    791791    if ( s == Windows )
    792792        return;
    793793#endif
    794 #if !defined(Q_WS_WIN)
     794#if !defined(Q_WS_WIN) && !defined(Q_WS_PM)
    795795    if ( s == Mac )
    796796        return;
     
    804804    }
    805805
    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))
    807807    if ( d->sysd && s != Unix ) {
    808808#else
     
    816816
    817817    QString realPath = path;
    818 #if defined(Q_WS_WIN)
     818#if defined(Q_WS_WIN) || defined(Q_WS_PM)
    819819    QString defPath = d->globalScope ? d->searchPaths.first() : d->searchPaths.last();
    820820    realPath = defPath + path;
     
    844844    }
    845845
    846 #ifdef Q_WS_WIN
     846#if defined(Q_WS_WIN) || defined (Q_WS_PM)
    847847    if ( d->sysd ) {
    848848        d->sysRemoveSearchPath( s, path );
     
    850850    }
    851851#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))
    853853    if ( d->sysd && s != Unix ) {
    854854#else
     
    876876    Q_CHECK_PTR(d);
    877877
    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))
    879879    d->sysd = 0;
    880880    d->sysInit();
     
    893893    Q_CHECK_PTR(d);
    894894
    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))
    896896    d->sysd = 0;
    897897    if ( format == Native )
     
    911911    sync();
    912912
    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))
    914914    if ( d->sysd )
    915915        d->sysClear();
     
    926926bool QSettings::sync()
    927927{
    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))
    929929    if ( d->sysd )
    930930        return d->sysSync();
     
    981981        }
    982982
    983 #ifndef Q_WS_WIN
     983#if !defined(Q_WS_WIN) && !defined(Q_WS_PM)
    984984        HANDLE lockfd = openlock( filename, Q_LOCKWRITE );
    985985#endif
     
    10551055        file.remove();
    10561056
    1057 #ifndef Q_WS_WIN
     1057#if !defined(Q_WS_WIN) && !defined(Q_WS_PM)
    10581058        closelock( lockfd );
    10591059#endif
     
    10931093    }
    10941094
    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))
    10961096    if ( d->sysd )
    10971097        return d->sysReadBoolEntry( grp_key, def, ok );
     
    11451145    }
    11461146
    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))
    11481148    if ( d->sysd )
    11491149        return d->sysReadDoubleEntry( grp_key, def, ok );
     
    11901190    }
    11911191
    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))
    11931193    if ( d->sysd )
    11941194        return d->sysReadNumEntry( grp_key, def, ok );
     
    12361236    }
    12371237
    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))
    12391239    if ( d->sysd )
    12401240        return d->sysReadEntry( grp_key, def, ok );
     
    13111311    }
    13121312
    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))
    13141314    if ( d->sysd )
    13151315        return d->sysWriteEntry( grp_key, value );
     
    13421342    }
    13431343
    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))
    13451345    if ( d->sysd )
    13461346        return d->sysWriteEntry( grp_key, value );
     
    13721372    }
    13731373
    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))
    13751375    if ( d->sysd )
    13761376        return d->sysWriteEntry( grp_key, value );
     
    14251425    }
    14261426
    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))
    14281428    if ( d->sysd )
    14291429        return d->sysWriteEntry( grp_key, value );
     
    14861486    }
    14871487
    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))
    14891489    if ( d->sysd )
    14901490        return d->sysRemoveEntry( grp_key );
     
    15641564    }
    15651565
    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))
    15671567    if ( d->sysd )
    15681568        return d->sysEntryList( grp_key );
     
    16601660    }
    16611661
    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))
    16631663    if ( d->sysd )
    16641664        return d->sysSubkeyList( grp_key );
     
    17531753    }
    17541754
    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))
    17561756    if ( d->sysd )
    17571757        return QDateTime();
     
    19611961void QSettings::setPath( const QString &domain, const QString &product, Scope scope )
    19621962{
    1963 //    On Windows, any trailing ".com(\..*)" is stripped from the domain. The
     1963//    On Windows and OS/2, any trailing ".com(\..*)" is stripped from the domain. The
    19641964//    Global scope corresponds to HKEY_LOCAL_MACHINE, and User corresponds to
    19651965//    HKEY_CURRENT_USER. Note that on some installations, not all users can
     
    19821982    int lastDot = domain.findRev( '.' );
    19831983
    1984 #if defined(Q_WS_WIN)
     1984#if defined(Q_WS_WIN) || defined(Q_WS_PM)
    19851985    actualSearchPath = "/" + domain.mid( 0, lastDot ) + "/" + product;
    19861986    insertSearchPath( Windows, actualSearchPath );
Note: See TracChangeset for help on using the changeset viewer.