summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2009-09-28 10:19:43 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2009-09-28 10:19:43 (GMT)
commit075f157eee733d89a492f34a07787944ce55b7aa (patch)
tree00a3ad103ee8913e3acb256c012d9beeed7a739e
parent0d781e36b1fecac919cb4ade55fd03e0f63b87c6 (diff)
parent857a77fe62b9ad3165cf67a5c2e869e5e7dd9e36 (diff)
downloadQt-075f157eee733d89a492f34a07787944ce55b7aa.zip
Qt-075f157eee733d89a492f34a07787944ce55b7aa.tar.gz
Qt-075f157eee733d89a492f34a07787944ce55b7aa.tar.bz2
Merge branch '4.6' of git@scm.dev.troll.no:qt/qt into 4.6
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h5
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp3
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h4
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp12
-rw-r--r--src/gui/painting/qpaintbuffer.cpp5
-rw-r--r--src/gui/painting/qpaintbuffer_p.h4
-rw-r--r--src/script/bridge/qscriptactivationobject.cpp2
-rw-r--r--src/script/bridge/qscriptfunction.cpp4
-rw-r--r--src/script/bridge/qscriptobject.cpp4
-rw-r--r--tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp36
11 files changed, 69 insertions, 14 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h
index 8072162..811818d 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h
@@ -43,11 +43,12 @@ namespace JSC {
#if PLATFORM(QT)
#ifdef QT_BUILD_SCRIPT_LIB
- virtual void scriptUnload(qint64 id)
+ virtual void scriptUnload(QT_PREPEND_NAMESPACE(qint64) id)
{
UNUSED_PARAM(id);
};
- virtual void scriptLoad(qint64 id, const UString &program,
+ virtual void scriptLoad(QT_PREPEND_NAMESPACE(qint64) id,
+ const UString &program,
const UString &fileName, int baseLineNumber)
{
UNUSED_PARAM(id);
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp
index 7d3a84d..ec242cc 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp
@@ -3469,7 +3469,8 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
structure = callDataScopeChain->globalObject()->emptyObjectStructure();
#ifdef QT_BUILD_SCRIPT_LIB
// ### world-class hack
- QScriptObject* newObject = new (globalData) QScriptObject(structure);
+ QT_PREPEND_NAMESPACE(QScriptObject)* newObject
+ = new (globalData) QT_PREPEND_NAMESPACE(QScriptObject)(structure);
#else
JSObject* newObject = new (globalData) JSObject(structure);
#endif
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp
index a110dcd..0b147df 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp
@@ -1777,7 +1777,7 @@ DEFINE_STUB_FUNCTION(JSObject*, op_construct_JSConstruct)
else
structure = constructor->scope().node()->globalObject()->emptyObjectStructure();
#ifdef QT_BUILD_SCRIPT_LIB
- return new (stackFrame.globalData) QScriptObject(structure);
+ return new (stackFrame.globalData) QT_PREPEND_NAMESPACE(QScriptObject)(structure);
#else
return new (stackFrame.globalData) JSObject(structure);
#endif
@@ -3108,4 +3108,4 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, vm_throw)
} // namespace JSC
-#endif // ENABLE(JIT)
+ #endif // ENABLE(JIT)
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h
index b7af4f8..4d327cc 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h
@@ -20,10 +20,12 @@
#ifndef QWEBINSPECTOR_P_H
#define QWEBINSPECTOR_P_H
+QT_BEGIN_NAMESPACE
class QSize;
+class QWidget;
+QT_END_NAMESPACE
class QWebInspector;
class QWebPage;
-class QWidget;
class QWebInspectorPrivate {
public:
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index 45ecb5a..7874622 100644
--- a/src/gui/kernel/qsoftkeymanager.cpp
+++ b/src/gui/kernel/qsoftkeymanager.cpp
@@ -247,9 +247,15 @@ bool QSoftKeyManager::handleCommand(int command)
if (command >= s60CommandStart && QSoftKeyManagerPrivate::softKeySource) {
int index = command - s60CommandStart;
const QList<QAction*>& softKeys = QSoftKeyManagerPrivate::softKeySource->actions();
- if (index < softKeys.count()) {
- softKeys.at(index)->activate(QAction::Trigger);
- return true;
+ for (int i = 0, j = 0; i < softKeys.count(); ++i) {
+ QAction *action = softKeys.at(i);
+ if (action->softKeyRole() != QAction::NoSoftKey) {
+ if (j == index) {
+ action->activate(QAction::Trigger);
+ return true;
+ }
+ j++;
+ }
}
}
diff --git a/src/gui/painting/qpaintbuffer.cpp b/src/gui/painting/qpaintbuffer.cpp
index 1038f74..57e7cd0 100644
--- a/src/gui/painting/qpaintbuffer.cpp
+++ b/src/gui/painting/qpaintbuffer.cpp
@@ -49,6 +49,8 @@
//#define QPAINTBUFFER_DEBUG_DRAW
+QT_BEGIN_NAMESPACE
+
extern int qt_defaultDpiX();
extern int qt_defaultDpiY();
extern void qt_format_text(const QFont &font,
@@ -1740,7 +1742,9 @@ struct QPaintBufferCacheEntry
QVariant::Type type;
quint64 cacheKey;
};
+QT_END_NAMESPACE
Q_DECLARE_METATYPE(QPaintBufferCacheEntry)
+QT_BEGIN_NAMESPACE
QDataStream &operator<<(QDataStream &stream, const QPaintBufferCacheEntry &entry)
{
@@ -1832,3 +1836,4 @@ QDataStream &operator>>(QDataStream &stream, QPaintBuffer &buffer)
return stream;
}
+QT_END_NAMESPACE
diff --git a/src/gui/painting/qpaintbuffer_p.h b/src/gui/painting/qpaintbuffer_p.h
index a80fa8d..6a7ac73 100644
--- a/src/gui/painting/qpaintbuffer_p.h
+++ b/src/gui/painting/qpaintbuffer_p.h
@@ -59,6 +59,8 @@
#include <private/qtextengine_p.h>
#include <QDebug>
+QT_BEGIN_NAMESPACE
+
class QPaintBufferPrivate;
class QPaintBufferPlayback;
@@ -440,4 +442,6 @@ private:
FreeFunc free;
};
+QT_END_NAMESPACE
+
#endif // QPAINTBUFFER_P_H
diff --git a/src/script/bridge/qscriptactivationobject.cpp b/src/script/bridge/qscriptactivationobject.cpp
index 7982982..edccb3e 100644
--- a/src/script/bridge/qscriptactivationobject.cpp
+++ b/src/script/bridge/qscriptactivationobject.cpp
@@ -46,7 +46,7 @@
namespace JSC
{
- ASSERT_CLASS_FITS_IN_CELL(QScript::QScriptActivationObject);
+ ASSERT_CLASS_FITS_IN_CELL(QT_PREPEND_NAMESPACE(QScript::QScriptActivationObject));
}
QT_BEGIN_NAMESPACE
diff --git a/src/script/bridge/qscriptfunction.cpp b/src/script/bridge/qscriptfunction.cpp
index 5f419ff..d3767bf 100644
--- a/src/script/bridge/qscriptfunction.cpp
+++ b/src/script/bridge/qscriptfunction.cpp
@@ -55,8 +55,8 @@
namespace JSC
{
-ASSERT_CLASS_FITS_IN_CELL(QScript::FunctionWrapper);
-ASSERT_CLASS_FITS_IN_CELL(QScript::FunctionWithArgWrapper);
+ASSERT_CLASS_FITS_IN_CELL(QT_PREPEND_NAMESPACE(QScript::FunctionWrapper));
+ASSERT_CLASS_FITS_IN_CELL(QT_PREPEND_NAMESPACE(QScript::FunctionWithArgWrapper));
}
QT_BEGIN_NAMESPACE
diff --git a/src/script/bridge/qscriptobject.cpp b/src/script/bridge/qscriptobject.cpp
index 0d899f8..55644fe 100644
--- a/src/script/bridge/qscriptobject.cpp
+++ b/src/script/bridge/qscriptobject.cpp
@@ -46,8 +46,8 @@
namespace JSC
{
//QT_USE_NAMESPACE
-ASSERT_CLASS_FITS_IN_CELL(QScriptObject);
-ASSERT_CLASS_FITS_IN_CELL(QScriptObjectPrototype);
+ASSERT_CLASS_FITS_IN_CELL(QT_PREPEND_NAMESPACE(QScriptObject));
+ASSERT_CLASS_FITS_IN_CELL(QT_PREPEND_NAMESPACE(QScriptObjectPrototype));
}
QT_BEGIN_NAMESPACE
diff --git a/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp b/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp
index 81ef498..8788117 100644
--- a/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp
+++ b/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp
@@ -42,6 +42,8 @@
#include <QtTest/QtTest>
#include "qevent.h"
+#include "qdialog.h"
+#include "qdialogbuttonbox.h"
#include "private/qsoftkeymanager_p.h"
class tst_QSoftKeyManager : public QObject
@@ -59,6 +61,7 @@ public slots:
void cleanup();
private slots:
void updateSoftKeysCompressed();
+ void handleCommand();
};
class EventListener : public QObject
@@ -133,6 +136,39 @@ void tst_QSoftKeyManager::updateSoftKeysCompressed()
QVERIFY(listener.numUpdateSoftKeys == 1);
}
+/*
+ This tests that when the S60 environment sends us a command
+ that it actually gets mapped to the correct action.
+*/
+void tst_QSoftKeyManager::handleCommand()
+{
+ QDialog w;
+ QDialogButtonBox *buttons = new QDialogButtonBox(
+ QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
+ Qt::Horizontal,
+ &w);
+
+ w.show();
+ QApplication::processEvents();
+
+ QCOMPARE(w.actions().count(), 2);
+
+ QSignalSpy spy0(w.actions()[0], SIGNAL(triggered()));
+ QSignalSpy spy1(w.actions()[1], SIGNAL(triggered()));
+
+ // These should work eventually, but do not yet
+// QTest::keyPress(&w, Qt::Key_Context1);
+// QTest::keyPress(&w, Qt::Key_Context2);
+
+ qApp->symbianHandleCommand(6000);
+ qApp->symbianHandleCommand(6001);
+
+ QApplication::processEvents();
+
+ QCOMPARE(spy0.count(), 1);
+ QCOMPARE(spy1.count(), 1);
+}
+
QTEST_MAIN(tst_QSoftKeyManager)
#include "tst_qsoftkeymanager.moc"