summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJanne Koskinen <janne.p.koskinen@digia.com>2009-06-17 13:51:46 (GMT)
committerJanne Koskinen <janne.p.koskinen@digia.com>2009-06-17 13:51:46 (GMT)
commitd9911390f17426801f553cb82654e102fe0400b9 (patch)
tree5c0dd218d44d0989761c01007d128de2d0e60f4c /src
parent75140c4776934744c37a34b10b7d4b8665aa4dc1 (diff)
parent06346d241d3a66bb488addcacae8a6e0d0d6e59c (diff)
downloadQt-d9911390f17426801f553cb82654e102fe0400b9.zip
Qt-d9911390f17426801f553cb82654e102fe0400b9.tar.gz
Qt-d9911390f17426801f553cb82654e102fe0400b9.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt-s60-public
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp11
-rw-r--r--src/corelib/tools/qscopedpointer.cpp17
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp2
-rw-r--r--src/gui/kernel/qapplication_s60.cpp7
-rw-r--r--src/gui/kernel/qlayout.cpp14
-rw-r--r--src/gui/kernel/qwidget.cpp12
-rw-r--r--src/gui/widgets/qmainwindow.cpp11
-rw-r--r--src/network/kernel/qhostinfo_unix.cpp3
8 files changed, 59 insertions, 18 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index 423fbaa..17bb9a7 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -231,6 +231,9 @@ void QTimerActiveObject::RunL()
void QTimerActiveObject::Run()
{
+ if (!okToRun())
+ return;
+
if (m_timerInfo->interval > 0) {
// Start a new timer immediately so that we don't lose time.
iStatus = KRequestPending;
@@ -644,9 +647,9 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
QT_TRY {
Q_D(QAbstractEventDispatcher);
- // It is safe if this counter overflows. The main importance is that each
- // iteration count is different from the last.
- m_iterationCount++;
+ // It is safe if this counter overflows. The main importance is that each
+ // iteration count is different from the last.
+ m_iterationCount++;
RThread &thread = d->threadData->symbian_thread_handle;
@@ -719,7 +722,7 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
break;
}
block = false;
- if (timeState == TimeStarted && time.elapsed() > 100) {
+ if (timeState == TimeStarted && time.elapsed() > 100) {
priority = m_processHandle.Priority();
m_processHandle.SetPriority(EPriorityLow);
time.start();
diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp
index 6a1ffb6..912edb6 100644
--- a/src/corelib/tools/qscopedpointer.cpp
+++ b/src/corelib/tools/qscopedpointer.cpp
@@ -80,6 +80,21 @@
\note QScopedPointer does not work with arrays.
+ \section1 Forward Declared Pointers
+
+ Classes that are forward declared can be used within QScopedPointer, as
+ long as the destructor of the forward declared class is available whenever
+ a QScopedPointer needs to clean up.
+
+ Concretely, this means that all classes containing a QScopedPointer that
+ points to a forward declared class must have non-inline constructors,
+ destructors and assignment operators:
+
+ \snippet doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp 4
+
+ Otherwise, the compiler output a warning about not being able to destruct
+ \c MyPrivateClass.
+
\sa QSharedPointer
*/
@@ -142,7 +157,7 @@
/*!
- \fn bool QScopedPointer::operator!=(const QScopedPointer<T> *other) const
+ \fn bool QScopedPointer::operator!=(const QScopedPointer<T> &other) const
Inequality operator. Returns true if the scoped pointer \a other
is not pointing to the same object as this pointer, otherwise returns false.
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 7d79422..9e70cff 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -74,8 +74,6 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
m_fepState->SetFlags(EAknEditorFlagDefault);
m_fepState->SetDefaultInputMode( EAknEditorTextInputMode );
m_fepState->SetPermittedInputModes( EAknEditorAllInputModes );
- m_fepState->SetLocalLanguage(ELangEnglish);
- m_fepState->SetDefaultLanguage(ELangEnglish);
m_fepState->SetDefaultCase( EAknEditorLowerCase );
m_fepState->SetPermittedCases( EAknEditorLowerCase|EAknEditorUpperCase );
m_fepState->SetSpecialCharacterTableResourceId( 0 );
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 9a2bbe6..3bd6e6b 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1075,9 +1075,10 @@ void QApplication::symbianHandleCommand(int command)
default:
if (command >= SOFTKEYSTART && command <= SOFTKEYEND) {
int index= command-SOFTKEYSTART;
- QWidget* focused = QApplication::focusWidget();
- const QList<QAction*>& softKeys = focused->softKeys();
- Q_ASSERT(index<softKeys.count());
+ QWidget *focused = QApplication::focusWidget();
+ QWidget *softKeySource = focused ? focused : QApplication::activeWindow();
+ const QList<QAction*>& softKeys = softKeySource->softKeys();
+ Q_ASSERT(index < softKeys.count());
softKeys.at(index)->activate(QAction::Trigger);
}
else
diff --git a/src/gui/kernel/qlayout.cpp b/src/gui/kernel/qlayout.cpp
index 4463aab..d8d8234 100644
--- a/src/gui/kernel/qlayout.cpp
+++ b/src/gui/kernel/qlayout.cpp
@@ -145,7 +145,12 @@ QLayout::QLayout(QLayoutPrivate &dd, QLayout *lay, QWidget *w)
} else {
d->topLevel = true;
w->d_func()->layout = this;
- invalidate();
+ QT_TRY {
+ invalidate();
+ } QT_CATCH(...) {
+ w->d_func()->layout = 0;
+ QT_RETHROW;
+ }
}
}
}
@@ -230,7 +235,12 @@ QLayout::QLayout(QWidget *parent, int margin, int spacing, const char *name)
} else {
d->topLevel = true;
parent->d_func()->layout = this;
- invalidate();
+ QT_TRY {
+ invalidate();
+ } QT_CATCH(...) {
+ parent->d_func()->layout = 0;
+ QT_RETHROW;
+ }
}
}
}
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index a83a79f..8d2569e 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -5781,7 +5781,6 @@ bool QWidget::hasFocus() const
void QWidget::setFocus(Qt::FocusReason reason)
{
Q_D(QWidget);
- d->setSoftKeys_sys(softKeys());
if (!isEnabled())
return;
@@ -7733,6 +7732,7 @@ bool QWidget::event(QEvent *event)
#if defined(Q_WS_WIN)
QInputContextPrivate::updateImeStatus(this, true);
#endif
+ d->setSoftKeys_sys(softKeys());
focusInEvent((QFocusEvent*)event);
break;
@@ -7885,6 +7885,10 @@ bool QWidget::event(QEvent *event)
if (w && w->isVisible() && !w->isWindow())
QApplication::sendEvent(w, event);
}
+
+ if (isWindow() && isActiveWindow())
+ d->setSoftKeys_sys(softKeys());
+
break; }
case QEvent::LanguageChange:
@@ -11617,7 +11621,8 @@ void QWidget::setSoftKey(QAction *softKey)
d->softKeys.clear();
if (softKey)
d->softKeys.append(softKey);
- if (QApplication::focusWidget() == this)
+ if ((!QApplication::focusWidget() && this == QApplication::activeWindow())
+ || QApplication::focusWidget() == this)
d->setSoftKeys_sys(this->softKeys());
}
@@ -11634,7 +11639,8 @@ void QWidget::setSoftKeys(const QList<QAction*> &softKeys)
d->softKeys.clear();
d->softKeys = softKeys;
- if ((QApplication::focusWidget() == this) || (QApplication::focusWidget()==0))
+ if ((!QApplication::focusWidget() && this == QApplication::activeWindow())
+ || QApplication::focusWidget() == this)
d->setSoftKeys_sys(this->softKeys());
}
diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp
index 2f3b412..5f8371c 100644
--- a/src/gui/widgets/qmainwindow.cpp
+++ b/src/gui/widgets/qmainwindow.cpp
@@ -1396,7 +1396,16 @@ bool QMainWindow::event(QEvent *event)
}
break;
#endif
-
+#ifndef QT_NO_MENUBAR
+ case QEvent::WindowActivate:
+ if (d->layout->menuBar()) {
+ // ### TODO: This is evil, there is no need to create a new action every time
+ QAction* menu = new QAction(QString::fromLatin1("Menu"), this);
+ menu->setSoftKeyRole(QAction::MenuSoftKey);
+ setSoftKey(menu);
+ }
+ break;
+#endif
default:
break;
}
diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
index f5d7166..bdbf986 100644
--- a/src/network/kernel/qhostinfo_unix.cpp
+++ b/src/network/kernel/qhostinfo_unix.cpp
@@ -320,8 +320,7 @@ QString QHostInfo::localDomainName()
if (local_res_ninit) {
// using thread-safe version
res_state_ptr state = res_state_ptr(qMalloc(sizeof(*state)));
- if (!state)
- qBadAlloc();
+ Q_CHECK_PTR(state);
memset(state, 0, sizeof(*state));
local_res_ninit(state);
QString domainName = QUrl::fromAce(state->defdname);