diff options
author | Janne Anttila <janne.anttila@digia.com> | 2009-04-28 07:29:45 (GMT) |
---|---|---|
committer | Janne Anttila <janne.anttila@digia.com> | 2009-04-28 07:29:45 (GMT) |
commit | 3e95fb56113b5b039408498032f9b6365e77c5e2 (patch) | |
tree | a8d2730ff900104a5d25556f5a1b5378859519ad | |
parent | 5cd48cdbf67a1bb1f717a4b207272a9ac0ccf2ac (diff) | |
parent | bce48e0a5317be7ebbfbaf714de00ab083ef7cf5 (diff) | |
download | Qt-3e95fb56113b5b039408498032f9b6365e77c5e2.zip Qt-3e95fb56113b5b039408498032f9b6365e77c5e2.tar.gz Qt-3e95fb56113b5b039408498032f9b6365e77c5e2.tar.bz2 |
Merge branch 'master' of git@scm.dev.troll.no:qt/qt-s60-public
-rw-r--r-- | mkspecs/common/symbian/symbian.conf | 2 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake_abld.cpp | 2 | ||||
-rw-r--r-- | src/corelib/corelib.pro | 8 | ||||
-rw-r--r-- | src/gui/dialogs/qdialog.cpp | 19 | ||||
-rw-r--r-- | src/gui/widgets/qmenu_symbian.cpp | 23 | ||||
-rw-r--r-- | src/gui/widgets/qmenubar.cpp | 6 | ||||
-rw-r--r-- | src/s60installs/qt_libs.pro | 6 | ||||
-rw-r--r-- | src/sql/sql.pro | 8 | ||||
-rw-r--r-- | tests/auto/network-settings.h | 140 |
9 files changed, 182 insertions, 32 deletions
diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index f39a5d6..81b439a 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -107,7 +107,7 @@ QMAKE_STRIPFLAGS_LIB += --strip-unneeded load(qt_config) load(platform_paths) -MMP_RULES += EXPORTUNFROZEN +MMP_RULES += EXPORTUNFROZEN PAGED SYMBIAN_PLATFORMS = WINSCW GCCE ARMV5 # Legacy support requires some hardcoded stdapis paths. diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp index d1942c6..aee9745 100644 --- a/qmake/generators/symbian/symmake_abld.cpp +++ b/qmake/generators/symbian/symmake_abld.cpp @@ -157,7 +157,7 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl; t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; - t << "XCOPY = xcopy /d /f /h /r /k /y /i" << endl; + t << "XCOPY = xcopy /d /f /h /r /y /i" << endl; t << "ABLD = ABLD.BAT" << endl; t << "DEBUG_PLATFORMS = " << debugPlatforms.join(" ") << endl; t << "RELEASE_PLATFORMS = " << releasePlatforms.join(" ") << endl; diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index 469225e..c55c2da 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -27,4 +27,10 @@ QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtCore.dynlist contains(DEFINES,QT_EVAL):include(eval.pri) -symbian:TARGET.UID3=0x2001B2DC
\ No newline at end of file +symbian: { + TARGET.UID3=0x2001B2DC + + # Workaroud for problems with paging this dll + MMP_RULES -= PAGED + MMP_RULES *= UNPAGED +}
\ No newline at end of file diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp index b0aa7b6..ef562f4 100644 --- a/src/gui/dialogs/qdialog.cpp +++ b/src/gui/dialogs/qdialog.cpp @@ -67,7 +67,9 @@ extern bool qt_wince_is_smartphone(); //is defined in qguifunctions_wce.cpp #elif defined(Q_WS_S60) # include "qfiledialog.h" #endif - +#if defined(Q_OS_SYMBIAN) +#include "qmenubar.h" +#endif #ifndef SPI_GETSNAPTODEFBUTTON # define SPI_GETSNAPTODEFBUTTON 95 #endif @@ -488,6 +490,14 @@ int QDialog::exec() #endif //QT_NO_MENUBAR #endif //Q_OS_WINCE_WM +#ifdef Q_OS_SYMBIAN +#ifndef QT_NO_MENUBAR + QMenuBar *menuBar = 0; + if (!findChild<QMenuBar *>()) + menuBar = new QMenuBar(this); +#endif +#endif + #if !defined(Q_WS_S60) show(); #else @@ -520,6 +530,13 @@ int QDialog::exec() delete menuBar; #endif //QT_NO_MENUBAR #endif //Q_OS_WINCE_WM +#ifdef Q_OS_SYMBIAN +#ifndef QT_NO_MENUBAR + else if (menuBar) + delete menuBar; +#endif //QT_NO_MENUBAR +#endif //Q_OS_SYMBIAN + return res; } diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index a50c5c0..9e53df5 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -33,7 +33,7 @@ QT_BEGIN_NAMESPACE // ### FIX/Document this, we need some safe range of menu id's for Qt that don't clash with AIW ones #define QT_FIRST_MENU_ITEM 32000 -static QMenuBarPrivate *s60_menubar=0; +static QList<QMenuBarPrivate *> s60_menubars; struct SymbianMenuItem { @@ -167,7 +167,7 @@ static void setSoftkeys() { CEikButtonGroupContainer* cba = CEikonEnv::Static()->AppUiFactory()->Cba(); if (cba){ - if (s60_menubar) + if (s60_menubars.count()>0) cba->SetCommandSetL(R_AVKON_SOFTKEYS_OPTIONS_EXIT); else cba->SetCommandSetL(R_AVKON_SOFTKEYS_EXIT); @@ -178,11 +178,11 @@ static void rebuildMenu() { qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; deleteAll( &symbianMenus ); - if (!s60_menubar) + if (s60_menubars.count()==0) return; - for (int i = 0; i < s60_menubar->actions.size(); ++i) { + for (int i = 0; i < s60_menubars.last()->actions.size(); ++i) { QSymbianMenuAction *symbianActionTopLevel = new QSymbianMenuAction; - symbianActionTopLevel->action = s60_menubar->actions.at(i); + symbianActionTopLevel->action = s60_menubars.last()->actions.at(i); symbianActionTopLevel->parent = 0; symbianActionTopLevel->command = qt_symbian_menu_static_cmd_id++; qt_symbian_insert_action(symbianActionTopLevel, &symbianMenus); @@ -193,7 +193,7 @@ static void rebuildMenu() Q_GUI_EXPORT void qt_symbian_show_toplevel( CEikMenuPane* menuPane) { - if (!s60_menubar) + if (s60_menubars.count()==0) return; rebuildMenu(); for (int i = 0; i < symbianMenus.count(); ++i) @@ -261,15 +261,17 @@ void QMenuBarPrivate::symbianDestroyMenuBar() Q_Q(QMenuBar); int index = nativeMenuBars.indexOf(q); nativeMenuBars.removeAt(index); + s60_menubars.removeLast(); + rebuildMenu(); if (symbian_menubar) - delete symbian_menubar; + delete symbian_menubar; symbian_menubar = 0; } QMenuBarPrivate::QSymbianMenuBarPrivate::QSymbianMenuBarPrivate(QMenuBarPrivate *menubar) { d = menubar; - s60_menubar = menubar; + s60_menubars.append(menubar); } QMenuBarPrivate::QSymbianMenuBarPrivate::~QSymbianMenuBarPrivate() @@ -277,7 +279,7 @@ QMenuBarPrivate::QSymbianMenuBarPrivate::~QSymbianMenuBarPrivate() deleteAll( &symbianMenus ); symbianMenus.clear(); d = 0; - s60_menubar = 0; + rebuild(); } QMenuPrivate::QSymbianMenuPrivate::QSymbianMenuPrivate() @@ -362,9 +364,10 @@ void QMenuBarPrivate::QSymbianMenuBarPrivate::removeAction(QSymbianMenuAction *a void QMenuBarPrivate::QSymbianMenuBarPrivate::rebuild() { setSoftkeys(); - if (!s60_menubar) + if (s60_menubars.count()==0) return; rebuildMenu(); } + #endif //QT_NO_MENUBAR diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp index b92f48b..b6ce76b 100644 --- a/src/gui/widgets/qmenubar.cpp +++ b/src/gui/widgets/qmenubar.cpp @@ -1045,6 +1045,12 @@ void QMenuBar::setVisible(bool visible) if(d->wce_menubar) return; #endif +#ifdef Q_OS_SYMBIAN + Q_D(QMenuBar); + if(d->symbian_menubar) + return; +#endif + QWidget::setVisible(visible); } diff --git a/src/s60installs/qt_libs.pro b/src/s60installs/qt_libs.pro index 546c5b6..2ba8b79 100644 --- a/src/s60installs/qt_libs.pro +++ b/src/s60installs/qt_libs.pro @@ -42,11 +42,9 @@ symbian: { #ENDIF qtlibraries.path = /sys/bin - qtlibraries.depends = "(0x20009a80), 1, 5, 0, {\"Symbian OS PIPS\"}" + qtlibraries.depends = "(0x20013851), 1, 5, 1, {\"PIPS Installer\"}" contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) { - qtlibraries.depends += "(0x200110CB), 1, 5, 0, {\"Open C LIBSSL Common\"}" - qtlibraries.depends += "(0x10281f34), 1, 5, 0, {\"Open C LIBSSL\"}" - qtlibraries.depends += "(0x2001B28B), 1, 5, 0, {\"OpenC LIBZ Support Files\"}" + qtlibraries.depends += "(0x200110CB), 1, 5, 1, {\"Open C LIBSSL Common\"}" } contains(QT_CONFIG, stl) { qtlibraries.depends += "(0x2000F866), 1, 0, 0, {\"Standard C++ Library Common\"}" diff --git a/src/sql/sql.pro b/src/sql/sql.pro index f089dd7..60be748 100644 --- a/src/sql/sql.pro +++ b/src/sql/sql.pro @@ -17,5 +17,11 @@ include(kernel/kernel.pri) include(drivers/drivers.pri) include(models/models.pri) -symbian:TARGET.UID3=0x2001E61D +symbian: { + TARGET.UID3=0x2001E61D + + # Workaroud for problems with paging this dll + MMP_RULES -= PAGED + MMP_RULES *= UNPAGED +} diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h index 8056350..8195c40 100644 --- a/tests/auto/network-settings.h +++ b/tests/auto/network-settings.h @@ -43,6 +43,8 @@ #ifdef Q_OS_SYMBIAN #include <sys/socket.h> #include <net/if.h> +#include <QSharedPointer> +#include <QHash> #endif #if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86) // In emulator we use WINSOCK connectivity by default. Unfortunately winsock @@ -55,22 +57,62 @@ //#define SYMBIAN_WINSOCK_CONNECTIVITY #endif + class QtNetworkSettingsRecord { + public: + QtNetworkSettingsRecord() { } + + QtNetworkSettingsRecord(const QString& recName, const QString& recVal) + : strRecordName(recName), strRecordValue(recVal) { } + + QtNetworkSettingsRecord(const QtNetworkSettingsRecord & other) + : strRecordName(other.strRecordName), strRecordValue(other.strRecordValue) { } + + ~QtNetworkSettingsRecord() { } + + const QString& recordName() const { return strRecordName; } + const QString& recordValue() const { return strRecordValue; } + + private: + QString strRecordName; + QString strRecordValue; + }; + class QtNetworkSettings { public: + static QString serverLocalName() { +#ifdef Q_OS_SYMBIAN + loadTestSettings(); + + if(QtNetworkSettings::entries.contains("server.localname")) { + QtNetworkSettingsRecord* entry = entries["server.localname"]; + return entry->recordValue(); + } +#endif return QString("qttest"); //return QString("aspiriniks"); //return QString("qt-test-server"); } static QString serverDomainName() { +#ifdef Q_OS_SYMBIAN + loadTestSettings(); + + if(QtNetworkSettings::entries.contains("server.domainname")) { + QtNetworkSettingsRecord* entry = entries["server.domainname"]; + return entry->recordValue(); + } +#endif return QString("it.local"); //return QString("troll.no"); } static QString serverName() { +#ifdef Q_OS_SYMBIAN + loadTestSettings(); +#endif return serverLocalName() + "." + serverDomainName(); } static QString winServerName() @@ -84,6 +126,18 @@ public: } static const char *serverIP() { +#ifdef Q_OS_SYMBIAN + loadTestSettings(); + + if(QtNetworkSettings::entries.contains("server.ip")) { + QtNetworkSettingsRecord* entry = entries["server.ip"]; + QByteArray valueAsAscii = entry->recordValue().toAscii(); + if(*serverIPAscii == 0) { + ::strcpy(serverIPAscii, valueAsAscii.data()); + } + return serverIPAscii; + } +#endif //return "10.10.0.147"; return "10.10.14.172"; //return "10.3.7.2"; @@ -114,12 +168,15 @@ 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( "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() @@ -137,50 +194,107 @@ public: private: #ifdef Q_OS_SYMBIAN - static bool bIsIapLoaded; + + static QHash<QString, QtNetworkSettingsRecord* > entries; + static bool bDefaultIapLoaded; + static bool bTestSettingsLoaded; static QString iapFileFullPath; - static QString defaultIap; + static QString strDefaultIap; + static char serverIPAscii[256]; static QString getDefaultIap() { - if(!bIsIapLoaded) - loadIapCfg(); + if(!bDefaultIapLoaded) { + if(!loadDefaultIap()) // not found in file - use default + strDefaultIap = QString("Lab"); + } - return defaultIap; + return strDefaultIap; } - static void loadIapCfg() { + static bool loadDefaultIap() { QFile iapCfgFile(iapFileFullPath); + bool bFoundDefaultIapTag = false; + if (iapCfgFile.open(QFile::ReadOnly)) { QTextStream input(&iapCfgFile); QString line; - bool bFoundDefaultTag = false; do { line = input.readLine().trimmed(); if(line.startsWith(QString("#"))) continue; // comment found if(line.contains(QString("[DEFAULT]"))) { - bFoundDefaultTag = true; - } else if(line.startsWith(QString("[")) && bFoundDefaultTag) { + bFoundDefaultIapTag = true; + } else if(line.startsWith(QString("[")) && bFoundDefaultIapTag) { + bFoundDefaultIapTag = false; break; // stick to default } - if(bFoundDefaultTag && line.contains("name")) { + if(bFoundDefaultIapTag && line.contains("name")) { int position = line.indexOf(QString("=")); position += QString("=").length(); - defaultIap = line.mid(position).trimmed(); + strDefaultIap = line.mid(position).trimmed(); break; } } while (!line.isNull()); } + + return bFoundDefaultIapTag; + } + + static bool loadTestSettings() { + if(bTestSettingsLoaded) + return true; + + QFile cfgFile(iapFileFullPath); + bool bFoundTestTag = false; + + if (cfgFile.open(QFile::ReadOnly)) { + QTextStream input(&cfgFile); + QString line; + do { + line = input.readLine().trimmed(); + + if(line.startsWith(QString("#")) || line.length() == 0) + continue; // comment or empty line found + + if(line.contains(QString("[TEST]"))) { + bFoundTestTag = true; + } else if(line.startsWith(QString("[")) && bFoundTestTag) { + bFoundTestTag = false; + break; // finished with test tag + } + + if(bFoundTestTag) { // non-empty line + int position = line.indexOf(QString("=")); + + if(position <= 0) // not found + continue; + + // found - extract + + QString recname = line.mid(0, position - QString("=").length()).trimmed(); + QString recval = line.mid(position + QString("=").length()).trimmed(); + + //create record + QtNetworkSettingsRecord *entry = new QtNetworkSettingsRecord(recname, recval); + entries.insert(entry->recordName(), entry); + } + } while (!line.isNull()); + } + + return bTestSettingsLoaded = true; } #endif }; #ifdef Q_OS_SYMBIAN -bool QtNetworkSettings::bIsIapLoaded = false; +QHash<QString, QtNetworkSettingsRecord* > QtNetworkSettings::entries = QHash<QString, QtNetworkSettingsRecord* > (); +bool QtNetworkSettings::bDefaultIapLoaded = false; +bool QtNetworkSettings::bTestSettingsLoaded = false; QString QtNetworkSettings::iapFileFullPath = QString("C:\\Data\\iap.txt"); -QString QtNetworkSettings::defaultIap = QString("Lab"); // this will be default value +QString QtNetworkSettings::strDefaultIap = QString(""); +char QtNetworkSettings::serverIPAscii[256]; #endif #ifdef Q_OS_SYMBIAN |