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

    r769 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)
     
    4444#include "qbitmap.h"
    4545#include "private/qsoftkeymanager_p.h"
    46 #include "private/qobject_p.h"
     46#include "private/qaction_p.h"
    4747#include "private/qsoftkeymanager_common_p.h"
    4848
     
    105105    switch (standardKey) {
    106106    case MenuSoftKey: // FALL-THROUGH
    107         action->setProperty(MENU_ACTION_PROPERTY, QVariant(true)); // TODO: can be refactored away to use _q_action_menubar
     107        QActionPrivate::get(action)->menuActionSoftkeys = true;
    108108    case OkSoftKey:
    109109    case SelectSoftKey:
     
    163163void QSoftKeyManager::updateSoftKeys()
    164164{
     165    QSoftKeyManager::instance()->d_func()->pendingUpdate = true;
    165166    QEvent *event = new QEvent(QEvent::UpdateSoftKeys);
    166167    QApplication::postEvent(QSoftKeyManager::instance(), event);
     
    251252
    252253    d->updateSoftKeys_sys();
     254    d->pendingUpdate = false;
    253255    return true;
    254256}
     
    256258void QSoftKeyManager::setForceEnabledInSoftkeys(QAction *action)
    257259{
    258     action->setProperty(FORCE_ENABLED_PROPERTY, QVariant(true));
     260    QActionPrivate::get(action)->forceEnabledInSoftkeys = true;
    259261}
    260262
    261263bool QSoftKeyManager::isForceEnabledInSofkeys(QAction *action)
    262264{
    263     bool ret = false;
    264     QVariant property = action->property(FORCE_ENABLED_PROPERTY);
    265     if (property.isValid() && property.toBool())
    266         ret = true;
    267     return ret;
     265    return QActionPrivate::get(action)->forceEnabledInSoftkeys;
    268266}
    269267
     
    280278bool QSoftKeyManager::handleCommand(int command)
    281279{
     280    if (QSoftKeyManager::instance()->d_func()->pendingUpdate)
     281        (void)QSoftKeyManager::instance()->handleUpdateSoftKeys();
     282
    282283    return static_cast<QSoftKeyManagerPrivateS60*>(QSoftKeyManager::instance()->d_func())->handleCommand(command);
    283284}
Note: See TracChangeset for help on using the changeset viewer.