src/corelib/global/qglobal.cpp
branchRCL_3
changeset 4 3b1da2848fc7
parent 3 41300fa6a67c
child 7 3f74d0d4af4c
equal deleted inserted replaced
3:41300fa6a67c 4:3b1da2848fc7
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the QtCore module of the Qt Toolkit.
     7 ** This file is part of the QtCore module of the Qt Toolkit.
     8 **
     8 **
    78 #include <e32debug.h>
    78 #include <e32debug.h>
    79 #include <flogger.h>
    79 #include <flogger.h>
    80 #include <f32file.h>
    80 #include <f32file.h>
    81 #include <e32math.h>
    81 #include <e32math.h>
    82 # include "private/qcore_symbian_p.h"
    82 # include "private/qcore_symbian_p.h"
       
    83 
    83 _LIT(qt_S60Filter, "Series60v?.*.sis");
    84 _LIT(qt_S60Filter, "Series60v?.*.sis");
    84 _LIT(qt_S60SystemInstallDir, "z:\\system\\install\\");
    85 _LIT(qt_S60SystemInstallDir, "z:\\system\\install\\");
    85 
       
    86 #endif
    86 #endif
    87 
    87 
    88 QT_BEGIN_NAMESPACE
    88 QT_BEGIN_NAMESPACE
    89 
    89 
    90 
    90 
  1225     \macro Q_WS_MAC
  1225     \macro Q_WS_MAC
  1226     \relates <QtGlobal>
  1226     \relates <QtGlobal>
  1227 
  1227 
  1228     Defined on Mac OS X.
  1228     Defined on Mac OS X.
  1229 
  1229 
  1230     \sa Q_WS_WIN, Q_WS_X11, Q_WS_QWS
  1230     \sa Q_WS_WIN, Q_WS_X11, Q_WS_QWS, Q_WS_S60
  1231 */
  1231 */
  1232 
  1232 
  1233 /*!
  1233 /*!
  1234     \macro Q_WS_WIN
  1234     \macro Q_WS_WIN
  1235     \relates <QtGlobal>
  1235     \relates <QtGlobal>
  1236 
  1236 
  1237     Defined on Windows.
  1237     Defined on Windows.
  1238 
  1238 
  1239     \sa Q_WS_MAC, Q_WS_X11, Q_WS_QWS
  1239     \sa Q_WS_MAC, Q_WS_X11, Q_WS_QWS, Q_WS_S60
  1240 */
  1240 */
  1241 
  1241 
  1242 /*!
  1242 /*!
  1243     \macro Q_WS_X11
  1243     \macro Q_WS_X11
  1244     \relates <QtGlobal>
  1244     \relates <QtGlobal>
  1245 
  1245 
  1246     Defined on X11.
  1246     Defined on X11.
  1247 
  1247 
  1248     \sa Q_WS_MAC, Q_WS_WIN, Q_WS_QWS
  1248     \sa Q_WS_MAC, Q_WS_WIN, Q_WS_QWS, Q_WS_S60
  1249 */
  1249 */
  1250 
  1250 
  1251 /*!
  1251 /*!
  1252     \macro Q_WS_QWS
  1252     \macro Q_WS_QWS
  1253     \relates <QtGlobal>
  1253     \relates <QtGlobal>
  1254 
  1254 
  1255     Defined on Qt for Embedded Linux.
  1255     Defined on Qt for Embedded Linux.
  1256 
  1256 
  1257     \sa Q_WS_MAC, Q_WS_WIN, Q_WS_X11
  1257     \sa Q_WS_MAC, Q_WS_WIN, Q_WS_X11, Q_WS_S60
  1258 */
  1258 */
  1259 
  1259 
  1260 /*!
  1260 /*!
  1261     \macro Q_OS_DARWIN
  1261     \macro Q_OS_DARWIN
  1262     \relates <QtGlobal>
  1262     \relates <QtGlobal>
  1597     \relates <QtGlobal>
  1597     \relates <QtGlobal>
  1598 
  1598 
  1599     Defined if the application is compiled using Green Hills
  1599     Defined if the application is compiled using Green Hills
  1600     Optimizing C++ Compilers.
  1600     Optimizing C++ Compilers.
  1601 */
  1601 */
       
  1602 
       
  1603 /*!
       
  1604   \macro Q_OS_MAC
       
  1605   \relates <QtGlobal>
       
  1606 
       
  1607   Defined on MAC OS (synonym for Darwin).
       
  1608  */
       
  1609 
       
  1610 /*!
       
  1611   \macro Q_OS_SYMBIAN
       
  1612   \relates <QtGlobal>
       
  1613 
       
  1614   Defined on Symbian.
       
  1615  */
       
  1616 
       
  1617 /*!
       
  1618   \macro Q_WS_S60
       
  1619   \relates <QtGlobal>
       
  1620 
       
  1621   Defined on S60.
       
  1622 
       
  1623   \sa Q_WS_MAC, Q_WS_WIN, Q_WS_X11, Q_WS_QWS
       
  1624  */
  1602 
  1625 
  1603 #if defined(QT_BUILD_QMAKE)
  1626 #if defined(QT_BUILD_QMAKE)
  1604 // needed to bootstrap qmake
  1627 // needed to bootstrap qmake
  1605 static const unsigned int qt_one = 1;
  1628 static const unsigned int qt_one = 1;
  1606 const int QSysInfo::ByteOrder = ((*((unsigned char *) &qt_one) == 0) ? BigEndian : LittleEndian);
  1629 const int QSysInfo::ByteOrder = ((*((unsigned char *) &qt_one) == 0) ? BigEndian : LittleEndian);
  2188         for (int i = 0; i < ptr.Length(); i += hbuffer->Length()) {
  2211         for (int i = 0; i < ptr.Length(); i += hbuffer->Length()) {
  2189             hbuffer->Des().Copy(ptr.Mid(i, qMin(maxBlockSize, ptr.Length()-i)));
  2212             hbuffer->Des().Copy(ptr.Mid(i, qMin(maxBlockSize, ptr.Length()-i)));
  2190             RDebug::Print(format, hbuffer);
  2213             RDebug::Print(format, hbuffer);
  2191         }
  2214         }
  2192         delete hbuffer;
  2215         delete hbuffer;
  2193 //QTP:Prod add logging to the file
       
  2194 #if defined(QT_WARNING_FILE_OUTPUT)
       
  2195         _LIT( KLogDir, "QT" );
  2216         _LIT( KLogDir, "QT" );
  2196         _LIT( KLogFile, "QT.log" );
  2217         _LIT( KLogFile, "QT.log" );
  2197         _LIT( KLogStarting, "Starting: %S");
  2218         _LIT( KLogStarting, "Starting: %S");
  2198         static bool logStarted;
  2219         static bool logStarted;
  2199         if ( !logStarted ){
  2220         if ( !logStarted ){
  2204             RFileLogger::Write( KLogDir, KLogFile, EFileLoggingModeAppend, procName);
  2225             RFileLogger::Write( KLogDir, KLogFile, EFileLoggingModeAppend, procName);
  2205             logStarted = true; 
  2226             logStarted = true; 
  2206         }
  2227         }
  2207 
  2228 
  2208         RFileLogger::Write( KLogDir, KLogFile, EFileLoggingModeAppend, ptr );
  2229         RFileLogger::Write( KLogDir, KLogFile, EFileLoggingModeAppend, ptr );
  2209 #endif
       
  2210 #else
  2230 #else
  2211         fprintf(stderr, "%s\n", buf);
  2231         fprintf(stderr, "%s\n", buf);
  2212         fflush(stderr);
  2232         fflush(stderr);
  2213 #endif
  2233 #endif
  2214     }
  2234     }