Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/kernel/qeventdispatcher_s60.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4545
    4646QT_BEGIN_NAMESPACE
     47
     48QtEikonEnv::QtEikonEnv()
     49    : m_lastIterationCount(0)
     50    , m_savedStatusCode(KRequestPending)
     51    , m_hasAlreadyRun(false)
     52{
     53}
     54
     55QtEikonEnv::~QtEikonEnv()
     56{
     57}
     58
     59void QtEikonEnv::RunL()
     60{
     61    QEventDispatcherS60 *dispatcher = qobject_cast<QEventDispatcherS60 *>(QAbstractEventDispatcher::instance());
     62    if (!dispatcher) {
     63        CEikonEnv::RunL();
     64        return;
     65    }
     66
     67    if (m_lastIterationCount != dispatcher->iterationCount()) {
     68        m_hasAlreadyRun = false;
     69        m_lastIterationCount = dispatcher->iterationCount();
     70    }
     71
     72    if (m_hasAlreadyRun) {
     73        // Fool the active scheduler into believing we are still waiting for events.
     74        // The window server thinks we are not, however.
     75        m_savedStatusCode = iStatus.Int();
     76        iStatus = KRequestPending;
     77        SetActive();
     78        dispatcher->queueDeferredActiveObjectsCompletion();
     79    } else {
     80        m_hasAlreadyRun = true;
     81        CEikonEnv::RunL();
     82    }
     83}
     84
     85void QtEikonEnv::DoCancel()
     86{
     87    complete();
     88
     89    CEikonEnv::DoCancel();
     90}
     91
     92void QtEikonEnv::complete()
     93{
     94    if (m_hasAlreadyRun) {
     95        if (m_savedStatusCode != KRequestPending) {
     96            TRequestStatus *status = &iStatus;
     97            QEventDispatcherSymbian::RequestComplete(status, m_savedStatusCode);
     98            m_savedStatusCode = KRequestPending;
     99        }
     100        m_hasAlreadyRun = false;
     101    }
     102}
    47103
    48104QEventDispatcherS60::QEventDispatcherS60(QObject *parent)
     
    128184}
    129185
     186// reimpl
     187void QEventDispatcherS60::reactivateDeferredActiveObjects()
     188{
     189    if (S60->qtOwnsS60Environment) {
     190        static_cast<QtEikonEnv *>(CCoeEnv::Static())->complete();
     191    }
     192
     193    QEventDispatcherSymbian::reactivateDeferredActiveObjects();
     194}
     195
    130196QT_END_NAMESPACE
Note: See TracChangeset for help on using the changeset viewer.