Skip to content

Commit c5efc2b

Browse files
committed
Code drop for 2012-02-03
1 parent 6fdc2ba commit c5efc2b

31 files changed

+386
-22
lines changed

src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,13 +1601,17 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
16011601
JSValue dividend = callFrame->r(vPC[2].u.operand).jsValue();
16021602
JSValue divisor = callFrame->r(vPC[3].u.operand).jsValue();
16031603

1604+
/* The JIT ALWAYS uses fmod. If we do not, the test case int / (-4 % 2) returns
1605+
infinity instead of -Infinity.
1606+
/////
16041607
if (dividend.isInt32() && divisor.isInt32() && divisor.asInt32() != 0) {
16051608
JSValue result = jsNumber(callFrame, dividend.asInt32() % divisor.asInt32());
16061609
ASSERT(result);
16071610
callFrame->r(dst) = result;
16081611
vPC += OPCODE_LENGTH(op_mod);
16091612
NEXT_INSTRUCTION();
16101613
}
1614+
*/
16111615

16121616
// Conversion to double must happen outside the call to fmod since the
16131617
// order of argument evaluation is not guaranteed.

src/3rdparty/javascriptcore/JavaScriptCore/runtime/NumberPrototype.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,9 @@ JSValue JSC_HOST_CALL numberProtoFuncToPrecision(ExecState* exec, JSObject*, JSV
417417
n = floor(x / tens);
418418
}
419419

420-
if (fabs((n + 1.0) * tens - x) <= fabs(n * tens - x))
421-
++n;
420+
// Should not do rounding up.
421+
// if (fabs((n + 1.0) * tens - x) <= fabs(n * tens - x))
422+
// ++n;
422423
// maintain n < 10^(precision)
423424
if (n >= intPow10(precision)) {
424425
n /= 10.0;

src/corelib/io/qfilesystemengine_unix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry,
174174
if (entry.isEmpty() || entry.isRoot())
175175
return entry;
176176

177-
#if !defined(Q_OS_MAC) && _POSIX_VERSION < 200809L
177+
#if !defined(Q_OS_MAC) && !defined(Q_OS_QNX) && _POSIX_VERSION < 200809L
178178
// realpath(X,0) is not supported
179179
Q_UNUSED(data);
180180
return QFileSystemEntry(slowCanonicalized(absoluteName(entry).filePath()));

src/corelib/io/qprocess_unix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ pid_t QProcessPrivate::spawnChild(const char *workingDir, char **argv, char **en
877877

878878
if (childPid != -1) {
879879
q->setProcessState(QProcess::Running);
880-
QMetaObject::invokeMethod(q, "_q_startupNotification", Qt::QueuedConnection);
880+
_q_startupNotification();
881881
}
882882

883883
return childPid;

src/corelib/tools/qlocale_unix.cpp

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
#include "qstringlist.h"
4747
#include "qvariant.h"
4848

49+
#if defined(Q_OS_QNX)
50+
#include <unistd.h>
51+
#endif
52+
4953
QT_BEGIN_NAMESPACE
5054

5155
#ifndef QT_NO_SYSTEMLOCALE
@@ -57,12 +61,28 @@ struct QSystemLocaleData
5761
,lc_monetary(QLocale::C)
5862
,lc_messages(QLocale::C)
5963
{
64+
updateLocale();
65+
}
66+
67+
void updateLocale()
68+
{
69+
#if defined(Q_OS_QNX)
70+
QByteArray all;
71+
72+
char buff[257];
73+
if(confstr( _CS_LOCALE, buff, 257 ) > 0)
74+
all = QByteArray(buff, 256);
75+
else
76+
all = qgetenv("LC_ALL");
77+
#else
6078
QByteArray all = qgetenv("LC_ALL");
79+
#endif
6180
QByteArray numeric = all.isEmpty() ? qgetenv("LC_NUMERIC") : all;
6281
QByteArray time = all.isEmpty() ? qgetenv("LC_TIME") : all;
6382
QByteArray monetary = all.isEmpty() ? qgetenv("LC_MONETARY") : all;
6483
lc_messages_var = all.isEmpty() ? qgetenv("LC_MESSAGES") : all;
6584
lc_measurement_var = all.isEmpty() ? qgetenv("LC_MEASUREMENT") : all;
85+
6686
QByteArray lang = qgetenv("LANG");
6787
if (lang.isEmpty())
6888
lang = QByteArray("C");
@@ -93,7 +113,17 @@ Q_GLOBAL_STATIC(QSystemLocaleData, qSystemLocaleData)
93113
#ifndef QT_NO_SYSTEMLOCALE
94114
QLocale QSystemLocale::fallbackLocale() const
95115
{
96-
QByteArray lang = qgetenv("LC_ALL");
116+
117+
#if defined(Q_OS_QNX)
118+
QByteArray lang;
119+
char buff[257];
120+
if(confstr( _CS_LOCALE, buff, 257 ) > 0)
121+
lang = QByteArray(buff, 256);
122+
else
123+
lang = qgetenv("LC_ALL");
124+
#else
125+
QByteArray lang = qgetenv("LC_ALL");
126+
#endif
97127
if (lang.isEmpty())
98128
lang = qgetenv("LC_NUMERIC");
99129
if (lang.isEmpty())
@@ -216,6 +246,9 @@ QVariant QSystemLocale::query(QueryType type, QVariant in) const
216246
return lc_messages.quoteString(in.value<QStringRef>(), QLocale::AlternateQuotation);
217247
case ListToSeparatedString:
218248
return lc_messages.createSeparatedList(in.value<QStringList>());
249+
case LocaleChanged:
250+
d->updateLocale();
251+
break;
219252
default:
220253
break;
221254
}

src/declarative/qml/qdeclarativeparser.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ using namespace QDeclarativeParser;
6868
QDeclarativeParser::Object::Object()
6969
: type(-1), majorVersion(-1), minorVersion(-1), idIndex(-1), metatype(0), synthCache(0), defaultProperty(0), parserStatusCast(-1)
7070
{
71+
// initialize the members in the meta object
72+
extObject.d.superdata = 0;
73+
extObject.d.stringdata = 0;
74+
extObject.d.data = 0;
75+
extObject.d.extradata = 0;
7176
}
7277

7378
QDeclarativeParser::Object::~Object()

src/gui/kernel/qapplication_p.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ class Q_GUI_EXPORT QApplicationPrivate : public QCoreApplicationPrivate
516516
static void reportGeometryChange(QWindowSystemInterfacePrivate::ScreenGeometryEvent *e);
517517
// static void reportAvailableGeometryChange(int screenIndex);
518518
static void reportAvailableGeometryChange(QWindowSystemInterfacePrivate::ScreenAvailableGeometryEvent *e);
519-
519+
static void reportLocaleChange();
520520
#endif
521521

522522
#ifdef Q_WS_QWS

src/gui/kernel/qapplication_qpa.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ void QApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate
130130
QApplicationPrivate::reportAvailableGeometryChange(
131131
static_cast<QWindowSystemInterfacePrivate::ScreenAvailableGeometryEvent *>(e));
132132
break;
133+
case QWindowSystemInterfacePrivate::LocaleChange:
134+
QApplicationPrivate::reportLocaleChange();
135+
break;
133136
default:
134137
qWarning() << "Unknown user input event type:" << e->type;
135138
break;
@@ -983,4 +986,9 @@ void QApplicationPrivate::reportAvailableGeometryChange(
983986
}
984987
}
985988

989+
void QApplicationPrivate::reportLocaleChange()
990+
{
991+
QApplication::sendSpontaneousEvent( qApp, new QEvent( QEvent::LocaleChange ) );
992+
}
993+
986994
QT_END_NAMESPACE

src/gui/kernel/qcursor_qpa.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
#include <qcursor.h>
4343
#include <private/qcursor_p.h>
4444
#include <qbitmap.h>
45+
#include "qplatformintegration_qpa.h"
46+
#include "private/qapplication_p.h"
4547

4648
QT_BEGIN_NAMESPACE
4749

@@ -122,6 +124,11 @@ void QCursor::setPos(int x, int y)
122124
//
123125
if (pos() == QPoint(x, y))
124126
return;
127+
128+
QPlatformIntegration *pi = QApplicationPrivate::platformIntegration();
129+
130+
if (pi)
131+
pi->setCursorPos(x, y);
125132
}
126133

127134
QT_END_NAMESPACE

src/gui/kernel/qplatformintegration_qpa.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ QPixmap QPlatformIntegration::grabWindow(WId window, int x, int y, int width, in
5656
return QPixmap();
5757
}
5858

59+
void QPlatformIntegration::setCursorPos(int x, int y)
60+
{
61+
Q_UNUSED(x);
62+
Q_UNUSED(y);
63+
}
64+
5965
/*!
6066
Factory function for the eventloop integration interface.
6167

src/gui/kernel/qplatformintegration_qpa.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ class Q_GUI_EXPORT QPlatformIntegration
8484
virtual void moveToScreen(QWidget *window, int screen) {Q_UNUSED(window); Q_UNUSED(screen);}
8585
virtual bool isVirtualDesktop() { return false; }
8686
virtual QPixmap grabWindow(WId window, int x, int y, int width, int height) const;
87+
virtual void setCursorPos(int x, int y);
8788

8889
//Deeper window system integrations
8990
virtual QPlatformFontDatabase *fontDatabase() const;

src/gui/kernel/qwindowsysteminterface_qpa.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include "qwindowsysteminterface_qpa_p.h"
4343
#include "qapplication_p.h"
4444
#include <QAbstractEventDispatcher>
45+
#include <private/qlocale_p.h>
4546

4647
QT_BEGIN_NAMESPACE
4748

@@ -288,4 +289,14 @@ void QWindowSystemInterface::handleScreenCountChange(int count)
288289
QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);
289290
}
290291

292+
void QWindowSystemInterface::handleLocaleChange()
293+
{
294+
QWindowSystemInterfacePrivate::LocaleChangeEvent *e =
295+
new QWindowSystemInterfacePrivate::LocaleChangeEvent();
296+
297+
QLocalePrivate::updateSystemPrivate();
298+
QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);
299+
}
300+
301+
291302
QT_END_NAMESPACE

src/gui/kernel/qwindowsysteminterface_qpa.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ class Q_GUI_EXPORT QWindowSystemInterface
100100
static void handleScreenGeometryChange(int screenIndex);
101101
static void handleScreenAvailableGeometryChange(int screenIndex);
102102
static void handleScreenCountChange(int count);
103+
104+
// Change to the locale.
105+
static void handleLocaleChange();
103106
};
104107

105108
QT_END_NAMESPACE

src/gui/kernel/qwindowsysteminterface_qpa_p.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ class QWindowSystemInterfacePrivate {
6161
Touch,
6262
ScreenGeometry,
6363
ScreenAvailableGeometry,
64-
ScreenCountChange
64+
ScreenCountChange,
65+
LocaleChange
6566
};
6667

6768
class WindowSystemEvent {
@@ -192,6 +193,13 @@ class QWindowSystemInterfacePrivate {
192193
int index;
193194
};
194195

196+
class LocaleChangeEvent : public WindowSystemEvent {
197+
public:
198+
LocaleChangeEvent()
199+
: WindowSystemEvent(LocaleChange) { }
200+
};
201+
202+
195203
static QList<WindowSystemEvent *> windowSystemEventQueue;
196204
static QMutex queueMutex;
197205

src/gui/painting/qdrawhelper.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,10 @@ class RadialFetchPlain
14411441
}
14421442
} else {
14431443
while (buffer < end) {
1444-
*buffer++ = qt_gradient_pixel(&data->gradient, qSqrt(det) - b);
1444+
if(det > 0)
1445+
*buffer++ = qt_gradient_pixel(&data->gradient, qSqrt(det) - b);
1446+
else
1447+
*buffer++ = qt_gradient_pixel(&data->gradient, 0 - b);
14451448

14461449
det += delta_det;
14471450
delta_det += delta_delta_det;

src/gui/text/qfontdatabase_qpa.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE
5454

5555
Q_GUI_EXPORT void qt_registerFont(const QString &familyName, const QString &foundryname, int weight,
5656
QFont::Style style, int stretch, bool antialiased, bool scalable, int pixelSize,
57-
const QSupportedWritingSystems &writingSystems, void *handle)
57+
bool fixed, const QSupportedWritingSystems &writingSystems, void *handle)
5858
{
5959
QFontDatabasePrivate *d = privateDb();
6060
// qDebug() << "Adding font" << familyname << weight << italic << pixelSize << file << fileIndex << antialiased;
@@ -76,6 +76,7 @@ Q_GUI_EXPORT void qt_registerFont(const QString &familyName, const QString &fou
7676
QtFontStyle *fontStyle = foundry->style(styleKey, QString(), true);
7777
fontStyle->smoothScalable = scalable;
7878
fontStyle->antialiased = antialiased;
79+
f->fixedPitch = fixed;
7980
QtFontSize *size = fontStyle->pixelSize(pixelSize?pixelSize:SMOOTH_SCALABLE, true);
8081
size->handle = handle;
8182
}
@@ -218,6 +219,8 @@ bool QFontDatabase::removeApplicationFont(int handle)
218219
if (handle < 0 || handle >= db->applicationFonts.count())
219220
return false;
220221

222+
QApplicationPrivate::platformIntegration()->fontDatabase()->removeApplicationFont(db->applicationFonts[handle].families);
223+
221224
db->applicationFonts[handle] = QFontDatabasePrivate::ApplicationFont();
222225

223226
db->reregisterAppFonts = true;

src/gui/text/qplatformfontdatabase_qpa.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE
4949

5050
extern void qt_registerFont(const QString &familyname, const QString &foundryname, int weight,
5151
QFont::Style style, int stretch, bool antialiased,bool scalable, int pixelSize,
52-
const QSupportedWritingSystems &writingSystems, void *hanlde);
52+
bool fixed, const QSupportedWritingSystems &writingSystems, void *hanlde);
5353

5454
/*!
5555
\fn void QPlatformFontDatabase::registerQPF2Font(const QByteArray &dataArray, void *)
@@ -88,7 +88,7 @@ void QPlatformFontDatabase::registerQPF2Font(const QByteArray &dataArray, void *
8888
}
8989
}
9090
QFont::Stretch stretch = QFont::Unstretched;
91-
registerFont(fontName,QString(),fontWeight,fontStyle,stretch,true,false,pixelSize,writingSystems,handle);
91+
registerFont(fontName,QString(),fontWeight,fontStyle,stretch,true,false,pixelSize,false,writingSystems,handle);
9292
}
9393
} else {
9494
qDebug() << "header verification of QPF2 font failed. maybe it is corrupt?";
@@ -123,11 +123,11 @@ void QPlatformFontDatabase::registerQPF2Font(const QByteArray &dataArray, void *
123123
*/
124124
void QPlatformFontDatabase::registerFont(const QString &familyname, const QString &foundryname, QFont::Weight weight,
125125
QFont::Style style, QFont::Stretch stretch, bool antialiased, bool scalable, int pixelSize,
126-
const QSupportedWritingSystems &writingSystems, void *usrPtr)
126+
bool fixed, const QSupportedWritingSystems &writingSystems, void *usrPtr)
127127
{
128128
if (scalable)
129129
pixelSize = 0;
130-
qt_registerFont(familyname,foundryname,weight,style,stretch,antialiased,scalable,pixelSize,writingSystems,usrPtr);
130+
qt_registerFont(familyname,foundryname,weight,style,stretch,antialiased,scalable,pixelSize,fixed,writingSystems,usrPtr);
131131
}
132132

133133
class QWritingSystemsPrivate
@@ -314,6 +314,14 @@ QStringList QPlatformFontDatabase::addApplicationFont(const QByteArray &fontData
314314
return QStringList();
315315
}
316316

317+
void QPlatformFontDatabase::removeApplicationFont(const QStringList &families)
318+
{
319+
Q_UNUSED(families);
320+
321+
qWarning("This plugin does not support application fonts");
322+
}
323+
324+
317325
/*!
318326
Releases the font handle and deletes any associated data loaded from a file.
319327
*/

src/gui/text/qplatformfontdatabase_qpa.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class Q_GUI_EXPORT QPlatformFontDatabase
9090
virtual QFontEngine *fontEngine(const QFontDef &fontDef, QUnicodeTables::Script script, void *handle);
9191
virtual QStringList fallbacksForFamily(const QString family, const QFont::Style &style, const QFont::StyleHint &styleHint, const QUnicodeTables::Script &script) const;
9292
virtual QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName);
93+
virtual void removeApplicationFont(const QStringList &families);
9394
virtual void releaseHandle(void *handle);
9495

9596
virtual QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference);
@@ -100,7 +101,7 @@ class Q_GUI_EXPORT QPlatformFontDatabase
100101
static void registerQPF2Font(const QByteArray &dataArray, void *handle);
101102
static void registerFont(const QString &familyname, const QString &foundryname, QFont::Weight weight,
102103
QFont::Style style, QFont::Stretch stretch, bool antialiased, bool scalable, int pixelSize,
103-
const QSupportedWritingSystems &writingSystems, void *handle);
104+
bool fixed, const QSupportedWritingSystems &writingSystems, void *handle);
104105
};
105106

106107
QT_END_NAMESPACE

src/plugins/platforms/blackberry/blackberry.pro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ SOURCES = main.cpp \
1616
qbbwindow.cpp \
1717
qbbrasterwindowsurface.cpp \
1818
qbbvirtualkeyboard.cpp \
19-
qbbclipboard.cpp
19+
qbbclipboard.cpp \
20+
qbblocalethread.cpp
2021

2122
HEADERS = qbbbuffer.h \
2223
qbbeventthread.h \
@@ -29,7 +30,8 @@ HEADERS = qbbbuffer.h \
2930
qbbwindow.h \
3031
qbbrasterwindowsurface.h \
3132
qbbvirtualkeyboard.h \
32-
qbbclipboard.h
33+
qbbclipboard.h \
34+
qbblocalethread.h
3335

3436
QMAKE_CXXFLAGS += -I./private
3537

0 commit comments

Comments
 (0)