Changeset 615


Ignore:
Timestamp:
Feb 27, 2010, 1:33:23 AM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

corelib: Make sure hardware error popups are disabled at application startup and restore the enabled state at application termination (fixes #131).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/corelib/kernel/qcoreapplication_pm.cpp

    r564 r615  
    4242****************************************************************************/
    4343
     44
     45
     46
    4447#include "qcoreapplication.h"
    4548#include "qcoreapplication_p.h"
    4649#include "qstringlist.h"
    47 #include "qt_os2.h"
    4850#include "qvector.h"
    4951#include "qmutex.h"
     
    106108}
    107109
    108 // @todo check if we really need this when doing timers in QEventDispatcherPM
    109 #if 0
    110 void QCoreApplicationPrivate::removePostedTimerEvent(QObject *object, int timerId)
     110static ULONG savedDosErrorState = 0xff;
     111
     112)
    111113{
    112     QThreadData *data = object->d_func()->threadData;
     114    // 27 - Get process DosError setting
     115    DosSysCtl(27, &savedDosErrorState);
     116    // disable hardware error popups to make the user's life less annoying
     117    DosError(savedDosErrorState & ~FERR_ENABLEHARDERR);
     118    return 0;
     119}
    113120
    114     QMutexLocker locker(&data->postEventList.mutex);
    115     if (data->postEventList.size() == 0)
    116         return;
    117     for (int i = 0; i < data->postEventList.size(); ++i) {
    118         const QPostEvent & pe = data->postEventList.at(i);
    119         if (pe.receiver == object
    120             && pe.event
    121             && (pe.event->type() == QEvent::Timer || pe.event->type() == QEvent::ZeroTimerEvent)
    122             && static_cast<QTimerEvent *>(pe.event)->timerId() == timerId) {
    123                 --pe.receiver->d_func()->postedEvents;
    124                 pe.event->posted = false;
    125                 delete pe.event;
    126                 const_cast<QPostEvent &>(pe).event = 0;
    127                 return;
    128             }
    129     }
     121static int globalDone()
     122{
     123    // restore error popups
     124    DosError(savedDosErrorState);
     125    return 0;
    130126}
    131 #endif
     127
     128Q_CONSTRUCTOR_FUNCTION(globalInit)
     129Q_DESTRUCTOR_FUNCTION(globalDone)
    132130
    133131QT_END_NAMESPACE
Note: See TracChangeset for help on using the changeset viewer.