summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkku Luukkainen <markku.luukkainen@digia.com>2009-04-30 12:51:56 (GMT)
committerMarkku Luukkainen <markku.luukkainen@digia.com>2009-04-30 12:51:56 (GMT)
commit0a6297151db47b8a53fdadd169d5eaaef4879517 (patch)
treef8a6555b30136bb96c246154f3ed997390c406fb
parente7864bbc420151aee1facc6383fd8c7fd9a63d13 (diff)
parent07c36999845183ad32b35ee9e5a57ac055b7f4dd (diff)
downloadQt-0a6297151db47b8a53fdadd169d5eaaef4879517.zip
Qt-0a6297151db47b8a53fdadd169d5eaaef4879517.tar.gz
Qt-0a6297151db47b8a53fdadd169d5eaaef4879517.tar.bz2
Merge branch 'softkeys' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into softkeys
-rw-r--r--qmake/generators/symbian/initprojectdeploy_symbian.cpp2
-rw-r--r--qmake/generators/symbian/symmake.cpp14
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.cpp10
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp4
-rw-r--r--src/gui/kernel/qapplication_s60.cpp35
-rw-r--r--src/gui/kernel/qwidget_s60.cpp7
-rw-r--r--src/gui/styles/qs60style.cpp3
-rw-r--r--src/qbase.pri6
-rw-r--r--tests/auto/network-settings.h61
-rw-r--r--tests/auto/qlocalsocket/tst_qlocalsocket.cpp6
-rw-r--r--tests/auto/qtcpsocket/tst_qtcpsocket.cpp15
11 files changed, 95 insertions, 68 deletions
diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
index e0e19b1..23b2c50 100644
--- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp
+++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp
@@ -58,7 +58,7 @@ static void createPluginStub(const QFileInfo& info,
// Add note to stub so that people will not wonder what it is.
// Creation date is added to make new stub to deploy always to
// force plugin cache miss when loading plugins.
- t << "This file is a Qt plugin stub file. The real Qt plugin is located in \\sys\\bin. Created:" << QDateTime::currentDateTime().toString() << "\n";
+ t << "This file is a Qt plugin stub file. The real Qt plugin is located in \\sys\\bin. Created:" << QDateTime::currentDateTime().toString(Qt::ISODate) << "\n";
} else {
fprintf(stderr, "cannot deploy \"%s\" because of plugin stub file creation failed\n", info.fileName().toLatin1().constData());
}
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
index 06e761a..69d09ac 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -123,7 +123,7 @@ void SymbianMakefileGenerator::writeHeader(QTextStream &t) {
t << "// ============================================================================" << endl;
t << "// * Makefile for building: " << escapeFilePath(var("TARGET")) << endl;
t << "// * Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
- t << QDateTime::currentDateTime().toString() << endl;
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
t << "// * This file is generated by qmake and should not be modified by the" << endl;
t << "// * user." << endl;
t << "// * Project: " << fileFixify(project->projectFile()) << endl;
@@ -255,7 +255,7 @@ bool SymbianMakefileGenerator::generatePkgFile(const QString &compiler, const QS
// header info
QTextStream t(&pkgFile);
- t << QString("; %1 generated by qmake at %2").arg(pkgFilename).arg(QDateTime::currentDateTime().toString()) << endl;
+ t << QString("; %1 generated by qmake at %2").arg(pkgFilename).arg(QDateTime::currentDateTime().toString(Qt::ISODate)) << endl;
t << "; This file is generated by qmake and should not be modified by the user" << endl;
t << ";" << endl << endl;
@@ -365,7 +365,7 @@ bool SymbianMakefileGenerator::writeCustomDefFile() {
t << "; ==============================================================================" << endl;
t << "; Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
- t << QDateTime::currentDateTime().toString() << endl;
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
t << "; This file is generated by qmake and should not be modified by the" << endl;
t << "; user." << endl;
t << "; Name : " PLUGIN_COMMON_DEF_FILE_ACTUAL << endl;
@@ -614,7 +614,7 @@ bool SymbianMakefileGenerator::removeDuplicatedStrings(QStringList& stringList)
bool SymbianMakefileGenerator::writeMmpFileHeader(QTextStream &t){
t << "// ==============================================================================" << endl;
t << "// Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
- t << QDateTime::currentDateTime().toString() << endl;
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
t << "// This file is generated by qmake and should not be modified by the" << endl;
t << "// user." << endl;
t << "// Name : " << escapeFilePath(fileFixify(project->projectFile().remove(project->projectFile().length()-4,4))) << ".mmp" << endl;
@@ -1129,7 +1129,7 @@ bool SymbianMakefileGenerator::writeRegRssFile(QString &appName, QStringList &us
QTextStream t(&ft);
t << "// ============================================================================" << endl;
t << "// * Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
- t << QDateTime::currentDateTime().toString() << endl;
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
t << "// * This file is generated by qmake and should not be modified by the" << endl;
t << "// * user." << endl;
t << "// ============================================================================" << endl;
@@ -1164,7 +1164,7 @@ bool SymbianMakefileGenerator::writeRssFile(QString &appName, QString &numberOfI
QTextStream t(&ft);
t << "// ============================================================================" << endl;
t << "// * Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
- t << QDateTime::currentDateTime().toString() << endl;
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
t << "// * This file is generated by qmake and should not be modified by the" << endl;
t << "// * user." << endl;
t << "// ============================================================================" << endl;
@@ -1208,7 +1208,7 @@ bool SymbianMakefileGenerator::writeLocFile(QString &appName, QStringList &symbi
QTextStream t(&ft);
t << "// ============================================================================" << endl;
t << "// * Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: ";
- t << QDateTime::currentDateTime().toString() << endl;
+ t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
t << "// * This file is generated by qmake and should not be modified by the" << endl;
t << "// * user." << endl;
t << "// ============================================================================" << endl;
diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp
index 541226f..fe25dd0 100644
--- a/qmake/generators/symbian/symmake_sbsv2.cpp
+++ b/qmake/generators/symbian/symmake_sbsv2.cpp
@@ -73,9 +73,6 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo
QStringList debugPlatforms = allPlatforms;
QStringList releasePlatforms = allPlatforms;
releasePlatforms.removeAll("winscw"); // No release for emulator
-#if !defined(Q_OS_WIN)
- debugPlatforms.removeAll("winscw"); // Winscw is only for windows
-#endif
bool isSubdirs = getTargetExtension() == "subdirs";
@@ -344,7 +341,6 @@ bool SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t
t << endl;
-#if defined(Q_OS_WIN)
// Write winscw deployment rules
QString remoteTestPath = epocRoot() + QLatin1String("epoc32/winscw/c/private/") + privateDirUid;
DeploymentList depList;
@@ -356,7 +352,10 @@ bool SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t
QString fromItem = depList.at(i).from;
QString toItem = depList.at(i).to;
fromItem.replace("\\", "/");
- toItem.replace("\\", "/").prepend(QDir::current().absolutePath().left(2)); // add drive
+ toItem.replace("\\", "/");
+#if defined(Q_OS_WIN)
+ toItem.prepend(QDir::current().absolutePath().left(2)); // add drive
+#endif
t << "OPTION DEPLOY_SOURCE " << fromItem << endl;
t << "OPTION DEPLOY_TARGET " << toItem << endl;
t << "END" << endl;
@@ -364,7 +363,6 @@ bool SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t
t << "#endif" << endl;
t << endl;
-#endif
// ### TODO: Linux emulator (platsim?) deployment
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index b38a6c6..f7605c8 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -365,9 +365,9 @@ void QSelectThread::requestSocketEvents ( QSocketNotifier *notifier, TRequestSta
start();
}
- Q_ASSERT(!m_AOStatuses.contains(notifier));
-
QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
+
+ Q_ASSERT(!m_AOStatuses.contains(notifier));
m_AOStatuses.insert(notifier, status);
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index b021b1c..c7bbcdb 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -531,6 +531,9 @@ TCoeInputCapabilities QSymbianControl::InputCapabilities() const
void QSymbianControl::Draw(const TRect& r) const
{
QWindowSurface *surface = qwidget->windowSurface();
+ if (!surface)
+ return;
+
QPaintEngine *engine = surface->paintDevice()->paintEngine();
if (!engine)
return;
@@ -948,6 +951,7 @@ int QApplication::s60ProcessEvent(TWsEvent *event)
// Qt event handling. Handle some events regardless of if the handle is in our
// widget map or not.
CCoeControl* control = reinterpret_cast<CCoeControl*>(event->Handle());
+ const bool controlInMap = QWidgetPrivate::mapper && QWidgetPrivate::mapper->contains(control);
switch (event->Type()) {
#ifndef QT_NO_IM
case EEventKey:
@@ -970,17 +974,12 @@ int QApplication::s60ProcessEvent(TWsEvent *event)
}
#endif
case EEventPointerEnter:
- if (QWidgetPrivate::mapper && QWidgetPrivate::mapper->contains(control))
- {
- // Qt::Enter will be generated in HandlePointerL
- return 1;
- }
+ if (controlInMap)
+ return 1; // Qt::Enter will be generated in HandlePointerL
break;
case EEventPointerExit:
- if (QWidgetPrivate::mapper && QWidgetPrivate::mapper->contains(control))
- {
- if (S60)
- {
+ if (controlInMap) {
+ if (S60) {
// mouseEvent outside our window, send leave event to last focused widget
QMouseEvent mEvent(QEvent::Leave, S60->lastPointerEventPos, S60->lastCursorPos,
Qt::NoButton, QApplicationPrivate::mouse_buttons, Qt::NoModifier);
@@ -995,11 +994,27 @@ int QApplication::s60ProcessEvent(TWsEvent *event)
if (S60)
S60->updateScreenSize();
return 0; // Propagate to CONE
+ case EEventWindowVisibilityChanged:
+ if (controlInMap) {
+ const TWsVisibilityChangedEvent *visChangedEvent = event->VisibilityChanged();
+ QWidget *w = QWidgetPrivate::mapper->value(control);
+ if (!w->d_func()->maybeTopData())
+ break;
+ if (visChangedEvent->iFlags & TWsVisibilityChangedEvent::ENotVisible) {
+ delete w->d_func()->topData()->backingStore;
+ w->d_func()->topData()->backingStore = 0;
+ } else if ((visChangedEvent->iFlags & TWsVisibilityChangedEvent::EPartiallyVisible)
+ && !w->d_func()->maybeBackingStore()) {
+ w->d_func()->topData()->backingStore = new QWidgetBackingStore(w);
+ }
+ return 1;
+ }
+ break;
default:
break;
}
- if (!QWidgetPrivate::mapper || !QWidgetPrivate::mapper->contains(control))
+ if (!controlInMap)
return -1;
return 0;
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 116dc35..ec80a18 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -195,12 +195,13 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
data.crect.moveTopLeft(QPoint(clientRect.iTl.iX, clientRect.iTl.iY));
QSymbianControl *control= new QSymbianControl(q);
control->ConstructL(true,desktop);
- if (!desktop)
- {
+ if (!desktop) {
QTLWExtra *topExtra = topData();
topExtra->rwindow = control->DrawableWindow();
// Request mouse move events.
- topExtra->rwindow->PointerFilter(EPointerFilterEnterExit | EPointerFilterMove | EPointerFilterDrag, 0);
+ topExtra->rwindow->PointerFilter(EPointerFilterEnterExit
+ | EPointerFilterMove | EPointerFilterDrag, 0);
+ topExtra->rwindow->EnableVisibilityChangeEvents();
}
id = (WId)control;
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 58dcb98..059198d 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -2157,12 +2157,13 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
ret = QCommonStyle::subControlRect(control, option, scontrol, widget);
switch (scontrol) {
case SC_GroupBoxCheckBox: //fallthrough
- case SC_GroupBoxLabel:
+ case SC_GroupBoxLabel: {
//slightly indent text and boxes, so that dialog border does not mess with them.
const int horizontalSpacing =
QS60StylePrivate::pixelMetric(QStyle::PM_LayoutHorizontalSpacing);
const int bottomMargin = QS60StylePrivate::pixelMetric(QStyle::PM_LayoutBottomMargin);
ret.adjust(2,horizontalSpacing-3,0,0);
+ }
break;
case SC_GroupBoxFrame: {
const QRect textBox = subControlRect(control, option, SC_GroupBoxLabel, widget);
diff --git a/src/qbase.pri b/src/qbase.pri
index 5ec63fb..d52120a 100644
--- a/src/qbase.pri
+++ b/src/qbase.pri
@@ -97,11 +97,7 @@ win32 {
symbian {
!static {
DEFINES+=QT_MAKEDLL
- contains(QT_EDITION, OpenSource) {
- TARGET.CAPABILITY = LocalServices NetworkServices ReadUserData UserEnvironment WriteUserData
- } else {
- TARGET.CAPABILITY = All -Tcb
- }
+ TARGET.CAPABILITY = All -Tcb
}
}
win32-borland:INCLUDEPATH += kernel
diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h
index 4cee7ed..952ab89 100644
--- a/tests/auto/network-settings.h
+++ b/tests/auto/network-settings.h
@@ -131,11 +131,10 @@ public:
if(QtNetworkSettings::entries.contains("server.ip")) {
QtNetworkSettingsRecord* entry = entries["server.ip"];
- QByteArray valueAsAscii = entry->recordValue().toAscii();
- if(*serverIPAscii == 0) {
- ::strcpy(serverIPAscii, valueAsAscii.data());
+ if(serverIp.isNull()) {
+ serverIp = entry->recordValue().toAscii();
}
- return serverIPAscii;
+ return serverIp.data();
}
#endif
//return "10.10.0.147";
@@ -168,28 +167,32 @@ public:
expected = expected.append(" Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
return expected;
}
-<<<<<<< HEAD:tests/auto/network-settings.h
static QByteArray expectedReplyFtp()
{
- QByteArray expected( "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID AUTH=PLAIN SASL-IR] " );
- expected = expected.append(QtNetworkSettings::serverLocalName().toAscii());
- expected = expected.append(" Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
+ QByteArray expected( "220 (vsFTPd 2.0.5)\r\n221 Goodbye.\r\n" );
return expected;
}
-=======
->>>>>>> 6d41f31... Nwteork server test related data (serever name, IP address ...) can now:tests/auto/network-settings.h
#ifdef Q_OS_SYMBIAN
static void setDefaultIap()
{
+ loadDefaultIap();
+
struct ifreq ifReq;
- strcpy( ifReq.ifr_name, getDefaultIap().toAscii().constData());
+ if(entries.contains("iap.default")) {
+ QtNetworkSettingsRecord* entry = entries["iap.default"];
+ QByteArray tmp(entry->recordValue().toAscii());
+ strcpy( ifReq.ifr_name, tmp.data());
+ }
+ else // some default value
+ strcpy( ifReq.ifr_name, "Lab");
+
int err = setdefaultif( &ifReq );
if(err)
- printf("Setting default IAP - '%s' failed: %d\n", getDefaultIap().toAscii().constData(), err);
+ printf("Setting default IAP - '%s' failed: %d\n", ifReq.ifr_name, err);
else
- printf("'%s' used as an default IAP\n", getDefaultIap().toAscii().constData());
+ printf("'%s' used as an default IAP\n", ifReq.ifr_name);
}
#endif
@@ -201,20 +204,14 @@ private:
static bool bDefaultIapLoaded;
static bool bTestSettingsLoaded;
static QString iapFileFullPath;
- static QString strDefaultIap;
- static char serverIPAscii[256];
-
- static QString getDefaultIap() {
- if(!bDefaultIapLoaded) {
- if(!loadDefaultIap()) // not found in file - use default
- strDefaultIap = QString("Lab");
- }
-
- return strDefaultIap;
- }
+ static QByteArray serverIp;
static bool loadDefaultIap() {
+ if(bDefaultIapLoaded)
+ return true;
+
QFile iapCfgFile(iapFileFullPath);
+
bool bFoundDefaultIapTag = false;
if (iapCfgFile.open(QFile::ReadOnly)) {
@@ -227,21 +224,24 @@ private:
if(line.contains(QString("[DEFAULT]"))) {
bFoundDefaultIapTag = true;
- } else if(line.startsWith(QString("[")) && bFoundDefaultIapTag) {
- bFoundDefaultIapTag = false;
- break; // stick to default
+ } else if(line.contains(QString("[")) && bFoundDefaultIapTag) {
+ break;
}
if(bFoundDefaultIapTag && line.contains("name")) {
int position = line.indexOf(QString("="));
position += QString("=").length();
- strDefaultIap = line.mid(position).trimmed();
+
+ //create record
+ QtNetworkSettingsRecord *entry =
+ new QtNetworkSettingsRecord( QString("iap.default"), line.mid(position).trimmed() );
+ entries.insert(entry->recordName(), entry);
break;
}
} while (!line.isNull());
}
- return bFoundDefaultIapTag;
+ return bDefaultIapLoaded = bFoundDefaultIapTag;
}
static bool loadTestSettings() {
@@ -295,8 +295,7 @@ QHash<QString, QtNetworkSettingsRecord* > QtNetworkSettings::entries = QHash<QSt
bool QtNetworkSettings::bDefaultIapLoaded = false;
bool QtNetworkSettings::bTestSettingsLoaded = false;
QString QtNetworkSettings::iapFileFullPath = QString("C:\\Data\\iap.txt");
-QString QtNetworkSettings::strDefaultIap = QString("");
-char QtNetworkSettings::serverIPAscii[256];
+QByteArray QtNetworkSettings::serverIp;
#endif
#ifdef Q_OS_SYMBIAN
diff --git a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp
index c289c24..50ac953 100644
--- a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp
@@ -716,12 +716,18 @@ void tst_QLocalSocket::threadedConnection()
QFETCH(int, threads);
Server server;
+#if defined(Q_OS_SYMBIAN)
+ server.setStackSize(0x14000);
+#endif
server.clients = threads;
server.start();
QList<Client*> clients;
for (int i = 0; i < threads; ++i) {
clients.append(new Client());
+#if defined(Q_OS_SYMBIAN)
+ clients.last()->setStackSize(0x14000);
+#endif
clients.last()->start();
}
diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
index 6087e0d..2e039bf 100644
--- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
+++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp
@@ -81,7 +81,8 @@
#ifndef TEST_QNETWORK_PROXY
//#define TEST_QNETWORK_PROXY
#endif
-#ifdef TEST_QNETWORK_PROXY
+#if defined(TEST_QNETWORK_PROXY) || defined (Q_CC_RVCT)
+// RVCT compiles also unused inline methods
# include <QNetworkProxy>
#endif
@@ -903,8 +904,12 @@ void tst_QTcpSocket::disconnectWhileConnecting()
socket->disconnectFromHost();
}
- connect(socket, SIGNAL(disconnected()), SLOT(exitLoopSlot()));
+ connect(socket, SIGNAL(disconnected()), SLOT(exitLoopSlot()));
+#ifndef Q_OS_SYMBIAN
enterLoop(10);
+#else
+ enterLoop(30);
+#endif
QVERIFY2(!timeout(), "Network timeout");
QVERIFY(socket->state() == QAbstractSocket::UnconnectedState);
if (!closeDirectly) {
@@ -987,6 +992,8 @@ void tst_QTcpSocket::disconnectWhileConnectingNoEventLoop_data()
void tst_QTcpSocket::disconnectWhileConnectingNoEventLoop()
{
+ QSKIP("Check this", SkipAll);
+
QFETCH(QByteArray, data);
ReceiverThread thread;
@@ -1058,7 +1065,11 @@ void tst_QTcpSocket::disconnectWhileLookingUp()
// let anything queued happen
QEventLoop loop;
+#ifndef Q_OS_SYMBIAN
QTimer::singleShot(50, &loop, SLOT(quit()));
+#else
+ QTimer::singleShot(500, &loop, SLOT(quit()));
+#endif
loop.exec();
// recheck