diff options
author | mread <qt-info@nokia.com> | 2009-08-05 09:32:17 (GMT) |
---|---|---|
committer | mread <qt-info@nokia.com> | 2009-08-05 09:32:17 (GMT) |
commit | 638edc80e3b224a6830dda0a2bd3097cb82dcb96 (patch) | |
tree | bdbb6a19e69f1388abcd032c1795ac87b13ceec1 | |
parent | 867bcdcce78acca9fde2ffc57e6a304cd2e25517 (diff) | |
parent | acd877fbff4a0c785143fcc891eae73f5b986ff9 (diff) | |
download | Qt-638edc80e3b224a6830dda0a2bd3097cb82dcb96.zip Qt-638edc80e3b224a6830dda0a2bd3097cb82dcb96.tar.gz Qt-638edc80e3b224a6830dda0a2bd3097cb82dcb96.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt-s60-public
198 files changed, 1831 insertions, 1971 deletions
diff --git a/demos/chip/chip.pro b/demos/chip/chip.pro index 2c44e56..a24a634 100644 --- a/demos/chip/chip.pro +++ b/demos/chip/chip.pro @@ -18,4 +18,3 @@ sources.path = $$[QT_INSTALL_DEMOS]/chip INSTALLS += target sources include($$QT_SOURCE_TREE/demos/demobase.pri) - diff --git a/demos/demobase.pri b/demos/demobase.pri index 724f64b..9ec8fe9 100644 --- a/demos/demobase.pri +++ b/demos/demobase.pri @@ -1,6 +1,6 @@ symbian {
- RSS_RULES ="group_name=\"QtDemos\";"
-
+ RSS_RULES ="group_name=\"QtDemos\";"
+
vendorinfo = \
"; Localised Vendor name" \
"%{\"Nokia, Qt Software\"}" \
diff --git a/demos/embedded/anomaly/src/Main.cpp b/demos/embedded/anomaly/src/Main.cpp index d861857..6ab7403 100644 --- a/demos/embedded/anomaly/src/Main.cpp +++ b/demos/embedded/anomaly/src/Main.cpp @@ -51,4 +51,3 @@ int main(int argc, char *argv[]) return app.exec(); } - diff --git a/demos/embedded/desktopservices/contenttab.cpp b/demos/embedded/desktopservices/contenttab.cpp index bdc5e03..e2618b0 100644 --- a/demos/embedded/desktopservices/contenttab.cpp +++ b/demos/embedded/desktopservices/contenttab.cpp @@ -53,32 +53,32 @@ #include "contenttab.h" -// CONSTRUCTORS & DESTRUCTORS -ContentTab::ContentTab(QWidget *parent) : - QListWidget(parent) -{ +// CONSTRUCTORS & DESTRUCTORS +ContentTab::ContentTab(QWidget *parent) : + QListWidget(parent) +{ setDragEnabled(false); setIconSize(QSize(45, 45)); } - -ContentTab::~ContentTab() + +ContentTab::~ContentTab() { } // NEW PUBLIC METHODS -void ContentTab::init(const QDesktopServices::StandardLocation &location, - const QString &filter, +void ContentTab::init(const QDesktopServices::StandardLocation &location, + const QString &filter, const QString &icon) { setContentDir(location); QStringList filterList; filterList = filter.split(";"); - m_ContentDir.setNameFilters(filterList); - setIcon(icon); - + m_ContentDir.setNameFilters(filterList); + setIcon(icon); + connect(this, SIGNAL(itemClicked(QListWidgetItem *)), - this, SLOT(openItem(QListWidgetItem *))); - + this, SLOT(openItem(QListWidgetItem *))); + populateListWidget(); } @@ -98,7 +98,7 @@ void ContentTab::populateListWidget() QFileInfoList fileList = m_ContentDir.entryInfoList(QDir::Files, QDir::Time); foreach(QFileInfo item, fileList) { new QListWidgetItem(m_Icon, itemName(item), this); - } + } } QString ContentTab::itemName(const QFileInfo &item) @@ -111,21 +111,21 @@ QUrl ContentTab::itemUrl(QListWidgetItem *item) return QUrl("file:///" + m_ContentDir.absolutePath() + "/" + item->text()); } -void ContentTab::keyPressEvent(QKeyEvent *event) +void ContentTab::keyPressEvent(QKeyEvent *event) { - switch(event->key()) { + switch (event->key()) { case Qt::Key_Up: - if(currentRow() == 0) { - setCurrentRow(count()-1); + if (currentRow() == 0) { + setCurrentRow(count() - 1); } else { - setCurrentRow(currentRow()-1); + setCurrentRow(currentRow() - 1); } break; case Qt::Key_Down: - if(currentRow() == (count()-1)) { - setCurrentRow(0); + if (currentRow() == (count() - 1)) { + setCurrentRow(0); } else { - setCurrentRow(currentRow()+1); + setCurrentRow(currentRow() + 1); } break; case Qt::Key_Select: @@ -138,15 +138,15 @@ void ContentTab::keyPressEvent(QKeyEvent *event) void ContentTab::handleErrorInOpen(QListWidgetItem *item) { - Q_UNUSED(item); - QMessageBox::warning( this, tr("Operation Failed"), tr("Unkown error!"), QMessageBox::Close); + Q_UNUSED(item); + QMessageBox::warning(this, tr("Operation Failed"), tr("Unkown error!"), QMessageBox::Close); } // NEW SLOTS void ContentTab::openItem(QListWidgetItem *item) { bool ret = QDesktopServices::openUrl(itemUrl(item)); - if(!ret) + if (!ret) handleErrorInOpen(item); } diff --git a/demos/embedded/desktopservices/contenttab.h b/demos/embedded/desktopservices/contenttab.h index 8d37209..21da07f 100644 --- a/demos/embedded/desktopservices/contenttab.h +++ b/demos/embedded/desktopservices/contenttab.h @@ -61,41 +61,41 @@ QT_END_NAMESPACE /** * ContentTab class. -* +* * This class implements general purpose tab for media files. */ class ContentTab : public QListWidget { Q_OBJECT -public: // Constructors & Destructors +public: // Constructors & Destructors ContentTab(QWidget *parent); virtual ~ContentTab(); - + public: // New Methods - virtual void init(const QDesktopServices::StandardLocation &location, - const QString &filter, - const QString &icon); - + virtual void init(const QDesktopServices::StandardLocation &location, + const QString &filter, + const QString &icon); + protected: // New Methods virtual void setContentDir(const QDesktopServices::StandardLocation &location); - virtual void setIcon(const QString &icon); + virtual void setIcon(const QString &icon); virtual void populateListWidget(); virtual QString itemName(const QFileInfo &item); virtual QUrl itemUrl(QListWidgetItem *item); virtual void handleErrorInOpen(QListWidgetItem *item); protected: - void keyPressEvent(QKeyEvent *event); - + void keyPressEvent(QKeyEvent *event); + public slots: // New Slots - virtual void openItem(QListWidgetItem *item); + virtual void openItem(QListWidgetItem *item); -protected: // Owned variables +protected: // Owned variables QDir m_ContentDir; QIcon m_Icon; }; -#endif // CONTENTTAB_H_ +#endif // CONTENTTAB_H_ // End of File diff --git a/demos/embedded/desktopservices/desktopservices.pro b/demos/embedded/desktopservices/desktopservices.pro index 32cb6d9..32dfa40 100644 --- a/demos/embedded/desktopservices/desktopservices.pro +++ b/demos/embedded/desktopservices/desktopservices.pro @@ -1,5 +1,5 @@ TEMPLATE = app -TARGET = +TARGET = INCLUDEPATH += . HEADERS += desktopwidget.h contenttab.h linktab.h @@ -18,6 +18,6 @@ DEPLOYMENT += music image include($$QT_SOURCE_TREE/demos/demobase.pri) symbian { - TARGET.UID3 = 0xA000C611 + TARGET.UID3 = 0xA000C611 ICON = ./resources/heart.svg } diff --git a/demos/embedded/desktopservices/desktopservices.qrc b/demos/embedded/desktopservices/desktopservices.qrc index d36205d..410175f 100644 --- a/demos/embedded/desktopservices/desktopservices.qrc +++ b/demos/embedded/desktopservices/desktopservices.qrc @@ -1,8 +1,8 @@ <!DOCTYPE RCC><RCC version="1.0"> -<qresource prefix="/"> - <file>resources/music.png</file> - <file>resources/photo.png</file> - <file>resources/browser.png</file> - <file>resources/message.png</file> +<qresource prefix="/"> + <file>resources/music.png</file> + <file>resources/photo.png</file> + <file>resources/browser.png</file> + <file>resources/message.png</file> </qresource> </RCC> diff --git a/demos/embedded/desktopservices/desktopwidget.cpp b/demos/embedded/desktopservices/desktopwidget.cpp index 3abe591..f3c02dc 100644 --- a/demos/embedded/desktopservices/desktopwidget.cpp +++ b/demos/embedded/desktopservices/desktopwidget.cpp @@ -51,40 +51,40 @@ // CLASS HEADER #include "desktopwidget.h" -// CONSTRUCTORS & DESTRUCTORS +// CONSTRUCTORS & DESTRUCTORS DesktopWidget::DesktopWidget(QWidget *parent) : QWidget(parent) - + { QTabWidget *tabWidget = new QTabWidget(this); // Images ContentTab* imageTab = new ContentTab(tabWidget); - imageTab->init(QDesktopServices::PicturesLocation, + imageTab->init(QDesktopServices::PicturesLocation, "*.png;*.jpg;*.jpeg;*.bmp;*.gif", ":/resources/photo.png"); - tabWidget->addTab(imageTab, tr("Images")); - + tabWidget->addTab(imageTab, tr("Images")); + // Music - ContentTab* musicTab = new ContentTab(tabWidget); - musicTab->init(QDesktopServices::MusicLocation, - "*.wav;*.mp3;*.mp4", - ":/resources/music.png"); - tabWidget->addTab(musicTab, tr("Music")); - + ContentTab* musicTab = new ContentTab(tabWidget); + musicTab->init(QDesktopServices::MusicLocation, + "*.wav;*.mp3;*.mp4", + ":/resources/music.png"); + tabWidget->addTab(musicTab, tr("Music")); + // Links - LinkTab* othersTab = new LinkTab(tabWidget);; + LinkTab* othersTab = new LinkTab(tabWidget);; // Given icon file will be overriden by LinkTab - othersTab->init(QDesktopServices::PicturesLocation, "", ""); - tabWidget->addTab(othersTab, tr("Links")); - + othersTab->init(QDesktopServices::PicturesLocation, "", ""); + tabWidget->addTab(othersTab, tr("Links")); + // Layout QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(tabWidget); - setLayout(layout); + setLayout(layout); } - + DesktopWidget::~DesktopWidget() { } - + // End of file diff --git a/demos/embedded/desktopservices/desktopwidget.h b/demos/embedded/desktopservices/desktopwidget.h index 246ab18..6b0af79 100644 --- a/demos/embedded/desktopservices/desktopwidget.h +++ b/demos/embedded/desktopservices/desktopwidget.h @@ -55,19 +55,19 @@ QT_END_NAMESPACE // CLASS DECLARATION /** * DesktopWidget class. -* +* * Implements the main top level widget for QDesktopServices demo app. */ class DesktopWidget : public QWidget { - Q_OBJECT - -public: // Constructors & Destructors + Q_OBJECT + +public: // Constructors & Destructors DesktopWidget(QWidget *parent); ~DesktopWidget(); - + }; - -#endif // DESKTOPWIDGET_H_ - + +#endif // DESKTOPWIDGET_H_ + // End of file diff --git a/demos/embedded/desktopservices/linktab.cpp b/demos/embedded/desktopservices/linktab.cpp index 32411fe..67dbccf 100644 --- a/demos/embedded/desktopservices/linktab.cpp +++ b/demos/embedded/desktopservices/linktab.cpp @@ -50,7 +50,7 @@ #include "linktab.h" LinkTab::LinkTab(QWidget *parent) : - ContentTab(parent) + ContentTab(parent) { } @@ -66,9 +66,9 @@ void LinkTab::populateListWidget() QUrl LinkTab::itemUrl(QListWidgetItem *item) { - if(m_WebItem == item) { + if (m_WebItem == item) { return QUrl(tr("http://www.qtsoftware.com")); - } else if(m_MailToItem == item) { + } else if (m_MailToItem == item) { return QUrl(tr("mailto:qts60-feedback@trolltech.com?subject=QtS60 feedback&body=Hello")); } else { // We should never endup here @@ -78,8 +78,8 @@ QUrl LinkTab::itemUrl(QListWidgetItem *item) } void LinkTab::handleErrorInOpen(QListWidgetItem *item) { - if(m_MailToItem == item) { - QMessageBox::warning( this, tr("Operation Failed"), tr("Please check that you have\ne-mail account defined."), QMessageBox::Close); + if (m_MailToItem == item) { + QMessageBox::warning(this, tr("Operation Failed"), tr("Please check that you have\ne-mail account defined."), QMessageBox::Close); } else { ContentTab::handleErrorInOpen(item); } diff --git a/demos/embedded/desktopservices/linktab.h b/demos/embedded/desktopservices/linktab.h index a9c9868..e44b785 100644 --- a/demos/embedded/desktopservices/linktab.h +++ b/demos/embedded/desktopservices/linktab.h @@ -57,30 +57,30 @@ QT_END_NAMESPACE /** * LinkTab class. -* +* * This class implements tab for opening http and mailto links. */ class LinkTab : public ContentTab { Q_OBJECT - -public: // Constructors & Destructors + +public: // Constructors & Destructors LinkTab(QWidget *parent); - ~LinkTab(); - -protected: // Derived Methods + ~LinkTab(); + +protected: // Derived Methods virtual void populateListWidget(); - virtual QUrl itemUrl(QListWidgetItem *item); + virtual QUrl itemUrl(QListWidgetItem *item); virtual void handleErrorInOpen(QListWidgetItem *item); - -private: // Used variables + +private: // Used variables QListWidgetItem *m_WebItem; - QListWidgetItem *m_MailToItem; - -private: // Owned variables - + QListWidgetItem *m_MailToItem; + +private: // Owned variables + }; -#endif // CONTENTTAB_H_ - +#endif // CONTENTTAB_H_ + // End of File diff --git a/demos/embedded/desktopservices/main.cpp b/demos/embedded/desktopservices/main.cpp index ebbcf63..0abfc78 100644 --- a/demos/embedded/desktopservices/main.cpp +++ b/demos/embedded/desktopservices/main.cpp @@ -48,8 +48,8 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); DesktopWidget* myWidget = new DesktopWidget(0); - myWidget->showMaximized(); - + myWidget->showMaximized(); + return app.exec(); } diff --git a/demos/embedded/embedded.pro b/demos/embedded/embedded.pro index 25904ef..a5e3465 100644 --- a/demos/embedded/embedded.pro +++ b/demos/embedded/embedded.pro @@ -17,4 +17,3 @@ sources.path = $$[QT_INSTALL_DEMOS]/embedded INSTALLS += sources include($$QT_SOURCE_TREE/demos/demobase.pri) - diff --git a/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.pro b/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.pro index 51a04e7..3ce2fbf 100644 --- a/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.pro +++ b/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.pro @@ -9,7 +9,7 @@ RESOURCES += embeddedsvgviewer.qrc target.path = $$[QT_INSTALL_DEMOS]/embedded/embeddedsvgviewer sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html *.svg files sources.path = $$[QT_INSTALL_DEMOS]/embedded/embeddedsvgviewer -INSTALLS += target sources +INSTALLS += target sources wince* { DEPLOYMENT_PLUGIN += qsvg @@ -18,4 +18,3 @@ wince* { include($$QT_SOURCE_TREE/demos/demobase.pri) symbian:TARGET.UID3 = 0xA000A640 - diff --git a/demos/embedded/fluidlauncher/config_s60/config.xml b/demos/embedded/fluidlauncher/config_s60/config.xml index f6bac67..95e96bd 100644 --- a/demos/embedded/fluidlauncher/config_s60/config.xml +++ b/demos/embedded/fluidlauncher/config_s60/config.xml @@ -13,7 +13,7 @@ <example filename="fridgemagnets" name="Fridge Magnets" image="screenshots/fridgemagnets_s60.png" args="-small-screen"/> <example filename="drilldown" name="Drilldown" image="screenshots/drilldown_s60.png"/> <example filename="softkeys" name="Softkeys" image="screenshots/softkeys_s60.png"/> - <example filename="anomaly" name="Anomaly Browser" image="screenshots/anomaly_s60.png"/> + <example filename="anomaly" name="Anomaly Browser" image="screenshots/anomaly_s60.png"/> </demos> <slideshow timeout="60000" interval="10000"> <imagedir dir="slides"/> diff --git a/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro index 0d83945..3eff37b 100644 --- a/demos/embedded/fluidlauncher/fluidlauncher.pro +++ b/demos/embedded/fluidlauncher/fluidlauncher.pro @@ -1,5 +1,5 @@ TEMPLATE = app -TARGET = +TARGET = DEPENDPATH += . INCLUDEPATH += . @@ -55,9 +55,9 @@ wince*{ DEPLOYMENT_PLUGIN += qgif qjpeg qmng qsvg } -symbian { +symbian { load(data_caging_paths) - + TARGET.UID3 = 0xA000A641 executables.sources = \ @@ -73,7 +73,7 @@ symbian { fridgemagnets.exe \ drilldown.exe \ softkeys.exe - contains(QT_CONFIG, webkit) { + contains(QT_CONFIG, webkit) { executables.sources += anomaly.exe } @@ -92,9 +92,9 @@ symbian { $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/fridgemagnets_reg.rsc \ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/drilldown_reg.rsc \ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/softkeys_reg.rsc - contains(QT_CONFIG, webkit) { + contains(QT_CONFIG, webkit) { reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/anomaly_reg.rsc - } + } reg_resource.path = $$REG_RESOURCE_IMPORT_DIR @@ -111,9 +111,9 @@ symbian { $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/fridgemagnets.rsc \ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/drilldown.rsc \ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/softkeys.rsc - contains(QT_CONFIG, webkit) { + contains(QT_CONFIG, webkit) { resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/anomaly.rsc - } + } resource.path = $$APP_RESOURCE_DIR @@ -134,9 +134,9 @@ symbian { $$PWD/../desktopservices/data/*.mp3 \ $$PWD/../desktopservices/data/*.wav desktopservices_music.path = /data/sounds - + desktopservices_images.sources = $$PWD/../desktopservices/data/*.png - desktopservices_images.path = /data/images + desktopservices_images.path = /data/images saxbookmarks.sources = $$PWD/../../../examples/xml/saxbookmarks/frank.xbel saxbookmarks.sources += $$PWD/../../../examples/xml/saxbookmarks/jennifer.xbel diff --git a/demos/interview/interview.pro b/demos/interview/interview.pro index 19b2ca8..0faa21f 100644 --- a/demos/interview/interview.pro +++ b/demos/interview/interview.pro @@ -17,4 +17,3 @@ sources.path = $$[QT_INSTALL_DEMOS]/interview INSTALLS += target sources include($$QT_SOURCE_TREE/demos/demobase.pri) - diff --git a/demos/mainwindow/mainwindow.pro b/demos/mainwindow/mainwindow.pro index 6e7d784..87b42be 100644 --- a/demos/mainwindow/mainwindow.pro +++ b/demos/mainwindow/mainwindow.pro @@ -15,4 +15,3 @@ sources.path = $$[QT_INSTALL_DEMOS]/mainwindow INSTALLS += target sources include($$QT_SOURCE_TREE/demos/demobase.pri) - diff --git a/demos/spreadsheet/spreadsheet.pro b/demos/spreadsheet/spreadsheet.pro index 5cf251a..102b75d 100644 --- a/demos/spreadsheet/spreadsheet.pro +++ b/demos/spreadsheet/spreadsheet.pro @@ -32,4 +32,3 @@ sources.path = $$[QT_INSTALL_DEMOS]/spreadsheet INSTALLS += target sources include($$QT_SOURCE_TREE/demos/demobase.pri) - diff --git a/demos/textedit/textedit.pro b/demos/textedit/textedit.pro index 6f15e70..8b29a45 100644 --- a/demos/textedit/textedit.pro +++ b/demos/textedit/textedit.pro @@ -20,4 +20,3 @@ sources.path = $$[QT_INSTALL_DEMOS]/textedit INSTALLS += target sources include($$QT_SOURCE_TREE/demos/demobase.pri) - diff --git a/demos/undo/undo.pro b/demos/undo/undo.pro index bf7017b..a4257cd 100644 --- a/demos/undo/undo.pro +++ b/demos/undo/undo.pro @@ -16,4 +16,3 @@ sources.path = $$[QT_INSTALL_DEMOS]/undo INSTALLS += target sources include($$QT_SOURCE_TREE/demos/demobase.pri) - diff --git a/examples/draganddrop/dropsite/dropsite.pro b/examples/draganddrop/dropsite/dropsite.pro index 268e247..a42f717 100644 --- a/examples/draganddrop/dropsite/dropsite.pro +++ b/examples/draganddrop/dropsite/dropsite.pro @@ -11,4 +11,3 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/dropsite INSTALLS += target sources include($$QT_SOURCE_TREE/examples/examplebase.pri) - diff --git a/examples/draganddrop/fridgemagnets/dragwidget.cpp b/examples/draganddrop/fridgemagnets/dragwidget.cpp index 81dbc00..92a6960 100644 --- a/examples/draganddrop/fridgemagnets/dragwidget.cpp +++ b/examples/draganddrop/fridgemagnets/dragwidget.cpp @@ -76,7 +76,7 @@ DragWidget::DragWidget(QWidget *parent) //! [2] #ifndef Q_WS_S60 - //Fridge magnets is used for demoing Qt on S60 and themed backgrounds look better than white + //Fridge magnets is used for demoing Qt on S60 and themed backgrounds look better than white QPalette newPalette = palette(); newPalette.setColor(QPalette::Window, Qt::white); setPalette(newPalette); diff --git a/examples/examplebase.pri b/examples/examplebase.pri index 70e1c37..caaf819 100644 --- a/examples/examplebase.pri +++ b/examples/examplebase.pri @@ -1,6 +1,6 @@ symbian { - RSS_RULES ="group_name=\"QtExamples\";" - + RSS_RULES ="group_name=\"QtExamples\";" + vendorinfo = \ "; Localised Vendor name" \ "%{\"Nokia, Qt Software\"}" \ @@ -10,4 +10,3 @@ symbian { " " default_deployment.pkg_prerules += vendorinfo } -
\ No newline at end of file diff --git a/examples/network/ftp/ftpwindow.cpp b/examples/network/ftp/ftpwindow.cpp index ffab8b4..b60da66 100644 --- a/examples/network/ftp/ftpwindow.cpp +++ b/examples/network/ftp/ftpwindow.cpp @@ -56,10 +56,10 @@ FtpWindow::FtpWindow(QWidget *parent) ftpServerLabel->setBuddy(ftpServerLineEdit); statusLabel = new QLabel(tr("Please enter the name of an FTP server.")); -#ifdef Q_OS_SYMBIAN - // Use word wrapping to fit the text on screen +#ifdef Q_OS_SYMBIAN + // Use word wrapping to fit the text on screen statusLabel->setWordWrap( true ); -#endif +#endif fileList = new QTreeWidget; fileList->setEnabled(false); @@ -69,7 +69,7 @@ FtpWindow::FtpWindow(QWidget *parent) connectButton = new QPushButton(tr("Connect")); connectButton->setDefault(true); - + cdToParentButton = new QPushButton; cdToParentButton->setIcon(QPixmap(":/images/cdtoparent.png")); cdToParentButton->setEnabled(false); @@ -105,15 +105,15 @@ FtpWindow::FtpWindow(QWidget *parent) // Make app better lookin on small screen QHBoxLayout *topLayout2 = new QHBoxLayout; topLayout2->addWidget(cdToParentButton); - topLayout2->addWidget(connectButton); + topLayout2->addWidget(connectButton); #endif - + QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addLayout(topLayout); -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN // Make app better lookin on small screen mainLayout->addLayout(topLayout2); -#endif +#endif mainLayout->addWidget(fileList); mainLayout->addWidget(statusLabel); mainLayout->addWidget(buttonBox); @@ -161,7 +161,7 @@ void FtpWindow::connectOrDisconnect() setCursor(Qt::WaitCursor); #endif -//![1] +//![1] ftp = new QFtp(this); connect(ftp, SIGNAL(commandFinished(int, bool)), this, SLOT(ftpCommandFinished(int, bool))); diff --git a/examples/network/ftp/main.cpp b/examples/network/ftp/main.cpp index f928bcb..978db0b 100644 --- a/examples/network/ftp/main.cpp +++ b/examples/network/ftp/main.cpp @@ -55,12 +55,12 @@ int main(int argc, char *argv[]) // in order that user can access the downloaded content QDir::setCurrent( "c:\\data" ); #endif - QApplication app(argc, argv); + QApplication app(argc, argv); FtpWindow ftpWin; -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN // Make application better looking and more usable on small screen ftpWin.showMaximized(); -#else +#else ftpWin.show(); #endif return ftpWin.exec(); diff --git a/examples/network/ftp/sym_iap_util.h b/examples/network/ftp/sym_iap_util.h index 74fe93a..c399b35 100644 --- a/examples/network/ftp/sym_iap_util.h +++ b/examples/network/ftp/sym_iap_util.h @@ -293,7 +293,7 @@ static QString qt_RouteInfoL() { return output; } -QString qt_TDesC2QStringL(const TDesC& aDescriptor) +QString qt_TDesC2QStringL(const TDesC& aDescriptor) { #ifdef QT_NO_UNICODE return QString::fromLocal8Bit(aDescriptor.Ptr(), aDescriptor.Length()); diff --git a/examples/painting/svgviewer/svgviewer.pro b/examples/painting/svgviewer/svgviewer.pro index 523dcf6..ea77946 100644 --- a/examples/painting/svgviewer/svgviewer.pro +++ b/examples/painting/svgviewer/svgviewer.pro @@ -28,5 +28,5 @@ symbian: { TARGET.UID3 = 0xA000A64E addFiles.sources = files\*.svg addFiles.path = . - DEPLOYMENT += addFiles + DEPLOYMENT += addFiles } diff --git a/examples/sql/drilldown/drilldown.pro b/examples/sql/drilldown/drilldown.pro index 7907bd2..1d0714b 100644 --- a/examples/sql/drilldown/drilldown.pro +++ b/examples/sql/drilldown/drilldown.pro @@ -1,7 +1,7 @@ HEADERS = ../connection.h \ imageitem.h \ informationwindow.h \ - view.h + view.h RESOURCES = drilldown.qrc SOURCES = imageitem.cpp \ informationwindow.cpp \ @@ -15,6 +15,6 @@ sources.files = $$SOURCES *.h $$RESOURCES $$FORMS drilldown.pro *.png *.jpg imag sources.path = $$[QT_INSTALL_EXAMPLES]/sql/drilldown INSTALLS += target sources -symbian:TARGET.UID3 = 0xA000C612 +symbian:TARGET.UID3 = 0xA000C612 include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/sql/drilldown/informationwindow.cpp b/examples/sql/drilldown/informationwindow.cpp index b01b753..8b5fd0c 100644 --- a/examples/sql/drilldown/informationwindow.cpp +++ b/examples/sql/drilldown/informationwindow.cpp @@ -101,9 +101,9 @@ InformationWindow::InformationWindow(int id, QSqlRelationalTableModel *offices, setWindowFlags(Qt::Window); enableButtons(false); setWindowTitle(tr("Office: %1").arg(locationText->text())); -#ifndef Q_OS_SYMBIAN +#ifndef Q_OS_SYMBIAN resize(320, sizeHint().height()); -#endif +#endif } //! [4] diff --git a/examples/sql/drilldown/main.cpp b/examples/sql/drilldown/main.cpp index 432849d..57a11ed 100644 --- a/examples/sql/drilldown/main.cpp +++ b/examples/sql/drilldown/main.cpp @@ -54,10 +54,10 @@ int main(int argc, char *argv[]) return 1; View view("offices", "images"); -#ifndef Q_OS_SYMBIAN +#ifndef Q_OS_SYMBIAN view.show(); -#else - view.showFullScreen(); -#endif +#else + view.showFullScreen(); +#endif return app.exec(); } diff --git a/examples/sql/drilldown/view.cpp b/examples/sql/drilldown/view.cpp index e288ac6..349547a 100644 --- a/examples/sql/drilldown/view.cpp +++ b/examples/sql/drilldown/view.cpp @@ -62,15 +62,15 @@ View::View(const QString &offices, const QString &images, QWidget *parent) QGraphicsPixmapItem *logo = scene->addPixmap(QPixmap(":/logo.png")); logo->setPos(30, 515); - + #ifndef Q_OS_SYMBIAN setMinimumSize(470, 620); - setMaximumSize(470, 620); + setMaximumSize(470, 620); #else - setDragMode(QGraphicsView::ScrollHandDrag); -#endif + setDragMode(QGraphicsView::ScrollHandDrag); +#endif - setWindowTitle(tr("Offices World Wide")); + setWindowTitle(tr("Offices World Wide")); } //! [1] @@ -135,7 +135,7 @@ void View::showInformation(ImageItem *image) window->show(); #else window->showFullScreen(); -#endif +#endif } else { InformationWindow *window; window = new InformationWindow(id, officeTable, this); @@ -148,7 +148,7 @@ void View::showInformation(ImageItem *image) window->show(); #else window->showFullScreen(); -#endif +#endif informationWindows.append(window); } } diff --git a/examples/widgets/softkeys/softkeys.cpp b/examples/widgets/softkeys/softkeys.cpp index 110f2e6..d8ab09a 100644 --- a/examples/widgets/softkeys/softkeys.cpp +++ b/examples/widgets/softkeys/softkeys.cpp @@ -65,7 +65,7 @@ MainWindow::MainWindow(QWidget *parent) toggleButton = new QPushButton(tr("Custom softkeys"), this); toggleButton->setContextMenuPolicy(Qt::NoContextMenu); - toggleButton->setCheckable(true); + toggleButton->setCheckable(true); pushButton = new QPushButton(tr("Open File Dialog"), this); pushButton->setContextMenuPolicy(Qt::NoContextMenu); diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index 54c2872..3f4f8d4 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -86,11 +86,11 @@ CFLAGS = $(CFLAGS) -DQMAKE_OPENSOURCE_EDITION QTOBJS= \ qbitarray.obj \ qbuffer.obj \ - qcryptographichash.obj \ + qcryptographichash.obj \ qfsfileengine.obj \ qfsfileengine_iterator.obj \ qbytearray.obj \ - qvsnprintf.obj \ + qvsnprintf.obj \ qbytearraymatcher.obj \ qdatetime.obj \ qdir.obj \ @@ -107,7 +107,7 @@ QTOBJS= \ qlistdata.obj \ qlinkedlist.obj \ qlocale.obj \ - qmalloc.obj \ + qmalloc.obj \ qmap.obj \ qregexp.obj \ qstring.obj \ @@ -119,9 +119,9 @@ QTOBJS= \ qsettings.obj \ qlibraryinfo.obj \ qvariant.obj \ - qurl.obj \ + qurl.obj \ qsettings_win.obj \ - qmetatype.obj \ + qmetatype.obj \ qnumeric.obj \ qscriptasm.obj \ qscriptast.obj \ @@ -179,7 +179,7 @@ clean:: -del qfsfileengine.obj -del qfsfileengine_iterator.obj -del qbytearray.obj - -del qvsnprintf.obj + -del qvsnprintf.obj -del qbytearraymatcher.obj -del qdatetime.obj -del qdir.obj @@ -207,9 +207,9 @@ clean:: -del qsettings.obj -del qlibraryinfo.obj -del qvariant.obj - -del qurl.obj + -del qurl.obj -del qsettings_win.obj - -del qmetatype.obj + -del qmetatype.obj -del project.obj -del main.obj -del makefile.obj @@ -424,6 +424,7 @@ qmap.obj: $(SOURCE_PATH)\src\corelib\tools\qmap.cpp qunicodetables.obj: $(SOURCE_PATH)\src\corelib\tools\qunicodetables.cpp $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qunicodetables.cpp + makefile.obj: $(SOURCE_PATH)/qmake/generators\makefile.cpp $(CXX) $(CXXFLAGS) generators\makefile.cpp @@ -464,7 +465,7 @@ symmake_sbsv2.obj: $(SOURCE_PATH)/qmake/generators/symbian/symmake_sbsv2.cpp $(CXX) $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp initprojectdeploy_symbian.obj: $(SOURCE_PATH)/qmake/generators/symbian/initprojectdeploy_symbian.cpp - $(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp + $(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp md5.obj: $(SOURCE_PATH)\src\3rdparty\md5\md5.cpp $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\3rdparty\md5\md5.cpp diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++ index dd65145..03ca6dd 100644 --- a/qmake/Makefile.win32-g++ +++ b/qmake/Makefile.win32-g++ @@ -19,13 +19,13 @@ CFLAGS = -c -o$@ -O \ -I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \ -I$(SOURCE_PATH)/include -I$(SOURCE_PATH)/include/QtCore \ -I$(BUILD_PATH)/src/corelib/global \ - -I$(BUILD_PATH)/include/QtScript \ + -I$(BUILD_PATH)/include/QtScript \ -I$(BUILD_PATH)/src/corelib/xml \ -I$(SOURCE_PATH)/mkspecs/win32-g++ \ -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PCRE \ - -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP \ - -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ - -DQT_BOOTSTRAPPED + -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP \ + -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ + -DQT_BOOTSTRAPPED CXXFLAGS = $(CFLAGS) LFLAGS = LIBS = -lole32 -luuid @@ -50,7 +50,7 @@ QTOBJS= \ qbitarray.o \ qbuffer.o \ qbytearray.o \ - qcryptographichash.o \ + qcryptographichash.o \ qvsnprintf.o \ qbytearraymatcher.o \ qconfig.o \ diff --git a/qmake/Makefile.win32-g++-sh b/qmake/Makefile.win32-g++-sh index 646815b..bd1b8b5 100644 --- a/qmake/Makefile.win32-g++-sh +++ b/qmake/Makefile.win32-g++-sh @@ -19,13 +19,13 @@ CFLAGS = -c -o$@ -O \ -I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \ -I$(SOURCE_PATH)/include -I$(SOURCE_PATH)/include/QtCore \ -I$(BUILD_PATH)/src/corelib/global \ - -I$(BUILD_PATH)/include/QtScript \ + -I$(BUILD_PATH)/include/QtScript \ -I$(BUILD_PATH)/src/corelib/xml \ -I$(SOURCE_PATH)/mkspecs/win32-g++ \ -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PCRE \ - -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP \ - -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ - -DQT_BOOTSTRAPPED + -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP \ + -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ + -DQT_BOOTSTRAPPED CXXFLAGS = $(CFLAGS) LFLAGS = LIBS = -lole32 -luuid diff --git a/qmake/Makefile.win32-mwc b/qmake/Makefile.win32-mwc index 08b6c49..b3b1b71 100644 --- a/qmake/Makefile.win32-mwc +++ b/qmake/Makefile.win32-mwc @@ -14,7 +14,7 @@ endif CXX = mwccsym2 CFLAGS = -gccinc \ -w on -w nonotused -w nonotinlined -w noimplicit -w nopadding -w noemptydecl \ - -w nounusedexpr -w nopossible -c -o $@ -O \ + -w nounusedexpr -w nopossible -c -o $@ -O \ -I. -Igenerators -Igenerators\unix \ -Igenerators\win32 -Igenerators\mac \ -Igenerators\symbian \ @@ -23,8 +23,8 @@ CFLAGS = -gccinc \ -I$(BUILD_PATH)\src\corelib\global \ -I$(SOURCE_PATH)\mkspecs\win32-mwc \ -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PCRE \ - -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DHAVE_QCONFIG_CPP \ - -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ + -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DHAVE_QCONFIG_CPP \ + -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ -DQT_NO_LIBRARY -I$(BUILD_PATH)\include\QtScript \ -I$(SOURCE_PATH)\corelib\xml -DQT_BOOTSTRAPPED @@ -52,7 +52,7 @@ QTOBJS= \ qbitarray.o \ qbuffer.o \ qbytearray.o \ - qcryptographichash.o \ + qcryptographichash.o \ qvsnprintf.o \ qbytearraymatcher.o \ qconfig.o \ diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 5eaa39f..345f999 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -275,7 +275,7 @@ MakefileGenerator::initOutPaths() int slash = path.lastIndexOf(Option::dir_sep); if(slash != -1) { path = path.left(slash); - // Make out path only if it does not contains makefile variables + // Make out path only if it does not contain makefile variables if(!path.contains("${")) if(path != "." && !mkdir(fileFixify(path, qmake_getpwd(), Option::output_dir))) diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp index 63b0f17..0b8fa17 100644 --- a/qmake/generators/metamakefile.cpp +++ b/qmake/generators/metamakefile.cpp @@ -420,8 +420,8 @@ SubdirsMetaMakefileGenerator::~SubdirsMetaMakefileGenerator() subs.clear(); } -class SymbianSubdirsMetaMakefileGenerator : public SubdirsMetaMakefileGenerator { - +class SymbianSubdirsMetaMakefileGenerator : public SubdirsMetaMakefileGenerator +{ public: SymbianSubdirsMetaMakefileGenerator(QMakeProject *p, const QString &n, bool op) : SubdirsMetaMakefileGenerator(p, n, op) { } virtual ~SymbianSubdirsMetaMakefileGenerator(); @@ -441,29 +441,23 @@ protected: private: QString cleanFromSpecialCharacters(QString& str); - }; QMap<QString, QString> SymbianSubdirsMetaMakefileGenerator::mmpPaths; QMultiMap<QString, QString> SymbianSubdirsMetaMakefileGenerator::mmpDependency; -QStringList SymbianSubdirsMetaMakefileGenerator::getDependencyList(QString mmpFilename, int recursionDepth) { - +QStringList SymbianSubdirsMetaMakefileGenerator::getDependencyList(QString mmpFilename, int recursionDepth) +{ QStringList list; - // printf("Entering recursion mmpFilename = %s and depth = %d \n", qPrintable(mmpFilename), recursionDepth); - QList<QString> values = mmpDependency.values(mmpFilename); if(recursionDepth < 0) { - // special case - // just first dependency level + // special case; just first dependency level list = values; return list; - } if(values.size() == 0) { - //reached recursion END condition if(recursionDepth == 0) { --recursionDepth; @@ -477,16 +471,13 @@ QStringList SymbianSubdirsMetaMakefileGenerator::getDependencyList(QString mmpFi } else { recursionDepth++; for (int i = 0; i < values.size(); ++i) { - QString current = values.at(i); - QStringList tailList = getDependencyList(current, recursionDepth); - for(int j = 0; j < tailList.size(); ++j) { - //QString path = mmpFilename + tailList.at(j); - QString path = tailList.at(j); - list.append(path); - //printf("MMPDEPENDENCY: %s\n", path.toAscii().data()); - }// for(int j = 0; j < values.size(); ++j) - //list.append(current); - } // for (int i = 0; i < values.size(); ++i) + QString current = values.at(i); + QStringList tailList = getDependencyList(current, recursionDepth); + for(int j = 0; j < tailList.size(); ++j) { + QString path = tailList.at(j); + list.append(path); + } + } if(recursionDepth > 0) { //for mmp somewhere in middle @@ -495,15 +486,17 @@ QStringList SymbianSubdirsMetaMakefileGenerator::getDependencyList(QString mmpFi recursionDepth--; return list; } - } + SymbianSubdirsMetaMakefileGenerator::~SymbianSubdirsMetaMakefileGenerator() { } -bool SymbianSubdirsMetaMakefileGenerator::write(const QString &oldpwd) { +bool SymbianSubdirsMetaMakefileGenerator::write(const QString &oldpwd) +{ return SubdirsMetaMakefileGenerator::write(oldpwd); } -QString SymbianSubdirsMetaMakefileGenerator::cleanFromSpecialCharacters(QString& str) { +QString SymbianSubdirsMetaMakefileGenerator::cleanFromSpecialCharacters(QString& str) +{ QString tmp = str; tmp.replace(QString("/"), QString("_")); @@ -515,26 +508,14 @@ QString SymbianSubdirsMetaMakefileGenerator::cleanFromSpecialCharacters(QString& return tmp; } -bool SymbianSubdirsMetaMakefileGenerator::init() { - +bool SymbianSubdirsMetaMakefileGenerator::init() +{ if(init_flag) return false; init_flag = true; - /* - Not neccessary as it was - causing second pass through - subdir elements - - SubdirsMetaMakefileGenerator::init(); - */ - - /* - if we are here then we have template = subdirs - - so... go for it ... - */ + // If we are here then we have template == subdirs Option::recursive = true; @@ -577,7 +558,6 @@ bool SymbianSubdirsMetaMakefileGenerator::init() { if(subdir.isDir()) { subdir = QFileInfo(subdir.filePath() + "/" + subdir.fileName() + Option::pro_ext); childMmpFilename = subdir.fileName(); - // TODO: create Option::mmp_ext childMmpFilename = subdir.absoluteFilePath(); childMmpFilename.replace(Option::pro_ext, QString("")); childMmpFilename.append(".mmp"); @@ -599,7 +579,7 @@ bool SymbianSubdirsMetaMakefileGenerator::init() { if(subdir.isRelative() && old_output_dir != oldpwd) { sub->output_dir = old_output_dir + "/" + subdir.path(); printf("Reading %s [%s]\n", subdir.absoluteFilePath().toLatin1().constData(), sub->output_dir.toLatin1().constData()); - } else { //what about shadow builds? + } else { sub->output_dir = sub->input_dir; printf("Reading %s\n", subdir.absoluteFilePath().toLatin1().constData()); } @@ -654,10 +634,8 @@ bool SymbianSubdirsMetaMakefileGenerator::init() { Subdir *self = new Subdir; self->input_dir = qmake_getpwd(); - // to fully expand find all dependencies - // do as recursion, then - // insert result - // as subdirs data in project + // To fully expand find all dependencies: + // Do as recursion, then insert result as subdirs data in project QString newpwd = qmake_getpwd(); if(!newpwd.endsWith('/')) newpwd += '/'; @@ -667,7 +645,7 @@ bool SymbianSubdirsMetaMakefileGenerator::init() { mmpFilename.prepend(newpwd); mmpFilename = mmpFilename.append(".mmp"); - // map mmpfile to its absolut filepath + // map mmpfile to its absolute filepath mmpPaths.insert(mmpFilename, newpwd); QStringList directDependencyList = getDependencyList(mmpFilename, -1); @@ -676,27 +654,14 @@ bool SymbianSubdirsMetaMakefileGenerator::init() { } QStringList dependencyList = getDependencyList(mmpFilename, 0); -/* - printf("\n \n PRINTING DEPENDENCY FOR: %s \n", mmpFilename.toAscii().data()); - // print it for debug - for(int i = 0; i < dependencyList.size(); ++i) { - printf("FINAL MMP DEPENDENCIES: %s\n", dependencyList.at(i).toAscii().data()); - } - printf("\n \n"); - printf("\n \n PRINTING DIRECT DEPENDENCY FOR: %s \n", mmpFilename.toAscii().data()); - // print it for debug - for(int i = 0; i < directDependencyList.size(); ++i) { - printf("DIRECT MMP DEPENDENCIES: %s\n", directDependencyList.at(i).toAscii().data()); - } - printf("\n \n"); -*/ self->output_dir = Option::output_dir; if(!Option::recursive || (!Option::output.fileName().endsWith(Option::dir_sep) && !QFileInfo(Option::output).isDir())) self->output_file = Option::output.fileName(); self->makefile = new BuildsMetaMakefileGenerator(project, name, false); self->makefile->init(); subs.append(self); + return true; } @@ -714,7 +679,6 @@ QStringList SymbianSubdirsMetaMakefileGenerator::calculateRelativePaths(QString mmpRelativePaths.append(childDir); else directory.relativeFilePath(relativePath); - //mmpRelativePaths.append(directory.relativeFilePath(childDir) + "/" + mmpChildren.at(i)); } } return mmpRelativePaths; diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp index 22e4aad..8e3e20b 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp +++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp @@ -118,9 +118,7 @@ void initProjectDeploySymbian(QMakeProject* project, } QString deploymentDrive = targetPathHasDriveLetter ? targetPath.left(2) : QLatin1String("c:"); - // foreach item in DEPLOYMENT foreach(QString item, project->values("DEPLOYMENT")) { - // get item.path QString devicePath = project->first(item + ".path"); if (!deployBinaries && !devicePath.isEmpty() @@ -172,7 +170,6 @@ void initProjectDeploySymbian(QMakeProject* project, continue; } - // foreach d in item.sources foreach(QString source, project->values(item + ".sources")) { source = Option::fixPathToLocalOS(source); QString nameFilter; @@ -216,7 +213,7 @@ void initProjectDeploySymbian(QMakeProject* project, QDirIterator iterator(searchPath, QStringList() << nameFilter , QDir::Files | QDir::NoDotAndDotDot | QDir::NoSymLinks , dirSearch ? QDirIterator::Subdirectories : QDirIterator::NoIteratorFlags ); - // foreach dirIterator-entry in d + while(iterator.hasNext()) { iterator.next(); QFileInfo iteratorInfo(iterator.filePath()); diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index c842b0e..1f22c70 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -146,7 +146,8 @@ QString SymbianMakefileGenerator::canonizePath(const QString& origPath) SymbianMakefileGenerator::SymbianMakefileGenerator() : MakefileGenerator() { } SymbianMakefileGenerator::~SymbianMakefileGenerator() { } -void SymbianMakefileGenerator::writeHeader(QTextStream &t) { +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: "; @@ -155,13 +156,10 @@ void SymbianMakefileGenerator::writeHeader(QTextStream &t) { t << "// * user." << endl; t << "// * Project: " << fileFixify(project->projectFile()) << endl; t << "// * Template: " << var("TEMPLATE") << endl; - //if(!project->isActiveConfig("build_pass")) - // t << "// = Command: " << build_args().replace("$(QMAKE)", - // (project->isEmpty("QMAKE_QMAKE") ? QString("qmake") : var("QMAKE_QMAKE"))) << endl; t << "// ============================================================================" << endl; t << endl; - // defining define for bld.inf + // Defining define for bld.inf QString shortProFilename = project->projectFile(); shortProFilename.replace(0, shortProFilename.lastIndexOf("/") + 1, QString("")); @@ -177,7 +175,8 @@ void SymbianMakefileGenerator::writeHeader(QTextStream &t) { t << "#define " << bldinfDefine.toUpper() << endl << endl; } -bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) { +bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) +{ writeHeader(t); QString numberOfIcons; @@ -268,7 +267,8 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) { return true; } -bool SymbianMakefileGenerator::generatePkgFile(const QString &compiler, const QString &config, const QString &iconFile) { +bool SymbianMakefileGenerator::generatePkgFile(const QString &compiler, const QString &config, const QString &iconFile) +{ QString build = ( config == "udeb" ) ? "debug" : "release"; QString pkgFilename = QString("%1_%2-%3.%4") .arg(fileInfo(project->projectFile()).completeBaseName()) @@ -281,15 +281,15 @@ bool SymbianMakefileGenerator::generatePkgFile(const QString &compiler, const QS generatedFiles << pkgFile.fileName(); - // header info + // Header info QTextStream t(&pkgFile); 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; - + // Construct QStringList from pkg_prerules since we need search it before printed to file QStringList rawPkgPreRules; - foreach(QString deploymentItem, project->values("DEPLOYMENT")) { + foreach(QString deploymentItem, project->values("DEPLOYMENT")) { foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_prerules")) { QStringList pkgrulesValue = project->values(pkgrulesItem); // If there is no stringlist defined for a rule, use rule name directly @@ -300,20 +300,20 @@ bool SymbianMakefileGenerator::generatePkgFile(const QString &compiler, const QS foreach(QString pkgrule, pkgrulesValue) { rawPkgPreRules << pkgrule; } - } + } } - } + } // Apply some defaults if specific data does not exist in PKG pre-rules - - if(!containsStartWithItem('&', rawPkgPreRules)) { + + if(!containsStartWithItem('&', rawPkgPreRules)) { // language, (*** hardcoded to english atm, should be parsed from TRANSLATIONS) t << "; Language" << endl; t << "&EN" << endl << endl; } else { // In case user defines langs, he must take care also about SIS header if(!containsStartWithItem('#', rawPkgPreRules)) - fprintf(stderr, "Warning: If language is defined with DEPLOYMENT pkg_prerules, also the SIS header must be defined\n"); + fprintf(stderr, "Warning: If language is defined with DEPLOYMENT pkg_prerules, also the SIS header must be defined\n"); } // name of application, UID and version @@ -321,39 +321,39 @@ bool SymbianMakefileGenerator::generatePkgFile(const QString &compiler, const QS int last = applicationName.lastIndexOf(QLatin1Char('/')); applicationName = applicationName.mid( last == -1 ? 0 : last+1 ); QString applicationVersion = project->first("VERSION").isEmpty() ? "1,0,0" : project->first("VERSION").replace('.', ','); - - if(!containsStartWithItem('#', rawPkgPreRules)) { + + if(!containsStartWithItem('#', rawPkgPreRules)) { t << "; SIS header: name, uid, version" << endl; t << QString("#{\"%1\"},(%2),%3").arg(applicationName).arg(uid3).arg(applicationVersion) << endl << endl; } // Localized vendor name if(!containsStartWithItem('%', rawPkgPreRules)) { - t << "; Localised Vendor name" << endl; - t << "%{\"Vendor\"}" << endl << endl; + t << "; Localised Vendor name" << endl; + t << "%{\"Vendor\"}" << endl << endl; } - + // Unique vendor name - if(!containsStartWithItem(':', rawPkgPreRules)) { + if(!containsStartWithItem(':', rawPkgPreRules)) { t << "; Unique Vendor name" << endl; t << ":\"Vendor\"" << endl << endl; } // PKG pre-rules - these are added before actual file installations i.e. SISX package body if(rawPkgPreRules.size()) { - t << "; Manual PKG pre-rules from PRO files" << endl; + t << "; Manual PKG pre-rules from PRO files" << endl; foreach(QString item, rawPkgPreRules) { t << item << endl; } - t << endl; - } + t << endl; + } - // install paths on the phone *** should be dynamic at some point + // Install paths on the phone *** should be dynamic at some point QString installPathBin = "!:\\sys\\bin"; QString installPathResource = "!:\\resource\\apps"; QString installPathRegResource = "!:\\private\\10003a3f\\import\\apps"; - // find location of builds + // Find location of builds QString epocReleasePath = QString("%1epoc32/release/%2/%3") .arg(epocRoot()) .arg(compiler) @@ -409,15 +409,15 @@ bool SymbianMakefileGenerator::generatePkgFile(const QString &compiler, const QS .arg(QString(depList.at(i).from).replace('\\','/')) .arg(depList.at(i).to) << endl; } - t << endl; - - // PKG post-rules - these are added after actual file installations i.e. SISX package body + t << endl; + + // PKG post-rules - these are added after actual file installations i.e. SIS package body t << "; Manual PKG post-rules from PRO files" << endl; - foreach(QString deploymentItem, project->values("DEPLOYMENT")) { + foreach(QString deploymentItem, project->values("DEPLOYMENT")) { foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_postrules")) { QStringList pkgrulesValue = project->values(pkgrulesItem); // If there is no stringlist defined for a rule, use rule name directly - // This is convenience for defining single line mmp statements + // This is convenience for defining single line statements if (pkgrulesValue.isEmpty()){ t << pkgrulesItem << endl; } else { @@ -425,9 +425,9 @@ bool SymbianMakefileGenerator::generatePkgFile(const QString &compiler, const QS t << pkgrule << endl; } } - t << endl; + t << endl; } - } + } return true; } @@ -444,7 +444,8 @@ bool SymbianMakefileGenerator::containsStartWithItem(const QChar &c, const QStri return result; } -bool SymbianMakefileGenerator::writeCustomDefFile() { +bool SymbianMakefileGenerator::writeCustomDefFile() +{ if(targetType.compare("plugin", Qt::CaseInsensitive) == 0 && !project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) { // Create custom def file for plugin QFile ft(QLatin1String(PLUGIN_COMMON_DEF_FILE_ACTUAL)); @@ -482,10 +483,7 @@ bool SymbianMakefileGenerator::writeCustomDefFile() { void SymbianMakefileGenerator::init() { MakefileGenerator::init(); -/* - DUMP_VAR("GENERATED_SOURCES"); -*/ - // fixing again !!! + if(0 != project->values("QMAKE_PLATFORM").size()) platform = varGlue("QMAKE_PLATFORM", "", " ", ""); @@ -502,29 +500,25 @@ void SymbianMakefileGenerator::init() // .mmp initMmpVariables(); - // UID1 - uid1 = generateUID1(); - - // check TARGET.UID2 and TARGET.UID3 presence + // Check TARGET.UID2 and TARGET.UID3 presence if(0 != project->values("TARGET.UID3").size()) { uid3 = project->first("TARGET.UID3"); } else { uid3 = generateUID3(); } - // some fix if((project->values("TEMPLATE")).contains("app")) targetType = "exe"; else if((project->values("TEMPLATE")).contains("lib")) { - // check CONFIG to see if we are to build staticlib or dll + // Check CONFIG to see if we are to build staticlib or dll if(project->values("CONFIG").contains("staticlib") || project->values("CONFIG").contains("static")) targetType = "staticlib"; else if (project->values("CONFIG").contains("plugin")) targetType = "plugin"; - else // for now it will be default + else targetType = "dll"; } - else // fix + else targetType = "subdirs"; if(0 != project->values("TARGET.UID2").size()) { @@ -534,11 +528,10 @@ void SymbianMakefileGenerator::init() } else { if(getTargetExtension() == "exe") { if(project->values("QT").contains("gui", Qt::CaseInsensitive)) { - // exe and also gui + // exe and gui -> uid2 needed uid2 = "0x100039CE"; } else { - // exe but not gui.. uid2 is ignored anyway - // set it to 0 + // exe but not gui: uid2 is ignored anyway -> set it to 0 uid2 = "0"; } } else if(getTargetExtension() == "dll" || getTargetExtension() == "lib") { @@ -563,7 +556,8 @@ void SymbianMakefileGenerator::init() } } -QString SymbianMakefileGenerator::getTargetExtension() { +QString SymbianMakefileGenerator::getTargetExtension() +{ QString ret; if(targetType.compare("exe", Qt::CaseInsensitive) == 0 || targetType.compare("app", Qt::CaseInsensitive) == 0) { ret.append("exe"); @@ -572,41 +566,30 @@ QString SymbianMakefileGenerator::getTargetExtension() { } else if (targetType.compare("dll", Qt::CaseInsensitive) == 0 || targetType.compare("plugin", Qt::CaseInsensitive) == 0) { ret.append("dll"); } else if (targetType.compare("subdirs", Qt::CaseInsensitive) == 0) { - // just fix ret.append("subdirs"); } else { - // if nothing said then assume "exe" + // If nothing else set, default to exe ret.append("exe"); } return ret; } -bool SymbianMakefileGenerator::isConfigSetToSymbian() { +bool SymbianMakefileGenerator::isConfigSetToSymbian() +{ return project->values("CONFIG").contains("symbian", Qt::CaseInsensitive); } -QString SymbianMakefileGenerator::generateUID1() { - // just for now - return QString(""); -} - -QString SymbianMakefileGenerator::generateUID2() { - // standard stuff; picked form symbian - // later meybe read from somewhere - return QString(""); -} - -QString SymbianMakefileGenerator::generateUID3() { - +QString SymbianMakefileGenerator::generateUID3() +{ QString target = project->first("TARGET"); QString currPath = qmake_getpwd(); target.prepend("/").prepend(currPath); return generate_test_uid(target); - } -bool SymbianMakefileGenerator::initMmpVariables() { +bool SymbianMakefileGenerator::initMmpVariables() +{ QStringList sysincspaths; QStringList srcincpaths; QStringList srcpaths; @@ -655,9 +638,7 @@ bool SymbianMakefileGenerator::initMmpVariables() { appendIfnotExist(sysincspaths, includepath + QString("/" QT_EXTRA_INCLUDE_DIR)); } - // remove duplicate include path entries - // convert to native directory separators - // to check if includepaths are same + // Remove duplicate include path entries QStringList temporary; for(int i = 0; i < sysincspaths.size(); ++i) { QString origPath = sysincspaths.at(i); @@ -671,7 +652,7 @@ bool SymbianMakefileGenerator::initMmpVariables() { if(origPathInfo.absoluteFilePath() == tmpPathInfo.absoluteFilePath()) { bFound = true; if(!tmpPathInfo.isRelative() && origPathInfo.isRelative()) { - // we keep the relative notation + // We keep the relative notation temporary.removeOne(tmpPath); temporary << origPath; } @@ -691,8 +672,8 @@ bool SymbianMakefileGenerator::initMmpVariables() { return true; } -bool SymbianMakefileGenerator::removeDuplicatedStrings(QStringList& stringList) { - +bool SymbianMakefileGenerator::removeDuplicatedStrings(QStringList& stringList) +{ QStringList tmpStringList; for(int i = 0; i < stringList.size(); ++i) { @@ -708,7 +689,8 @@ bool SymbianMakefileGenerator::removeDuplicatedStrings(QStringList& stringList) return true; } -bool SymbianMakefileGenerator::writeMmpFileHeader(QTextStream &t){ +bool SymbianMakefileGenerator::writeMmpFileHeader(QTextStream &t) +{ t << "// ==============================================================================" << endl; t << "// Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: "; t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; @@ -726,8 +708,6 @@ bool SymbianMakefileGenerator::writeMmpFile(QString &filename, QStringList &symb if(ft.open(QIODevice::WriteOnly)) { generatedFiles << ft.fileName(); - //printf("WRITING: %s \n", qPrintable(filename)); - QTextStream t(&ft); writeMmpFileHeader(t); @@ -775,8 +755,8 @@ bool SymbianMakefileGenerator::writeMmpFile(QString &filename, QStringList &symb return true; } -bool SymbianMakefileGenerator::writeMmpFileMacrosPart(QTextStream& t) { - +bool SymbianMakefileGenerator::writeMmpFileMacrosPart(QTextStream& t) +{ t << endl; if(isConfigSetToSymbian()) @@ -804,32 +784,34 @@ bool SymbianMakefileGenerator::writeMmpFileMacrosPart(QTextStream& t) { return true; } -bool SymbianMakefileGenerator::addMacro(QTextStream& t, const QString& value) { +bool SymbianMakefileGenerator::addMacro(QTextStream& t, const QString& value) +{ t << "MACRO" << "\t\t" << value << endl; return true; } -bool SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) { +bool SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) +{ if(getTargetExtension() == "exe") { t << "TARGET" << "\t\t" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".exe")) << "\n"; if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) t << "TARGETTYPE" << "\t\t" << "STDEXE" << endl; else t << "TARGETTYPE" << "\t\t" << "EXE" << endl; - } else if (getTargetExtension() == "dll"){ + } else if (getTargetExtension() == "dll"){ t << "TARGET" << "\t\t" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".dll")) << "\n"; if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) t << "TARGETTYPE" << "\t\t" << "STDDLL" << endl; else t << "TARGETTYPE" << "\t\t" << "DLL" << endl; - } else if (getTargetExtension() == "lib"){ + } else if (getTargetExtension() == "lib"){ t << "TARGET" << "\t\t" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".lib")) << "\n"; if (project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) t << "TARGETTYPE" << "\t\t" << "STDLIB" << endl; else t << "TARGETTYPE" << "\t\t" << "LIB" << endl; - } else { + } else { printf("unexpected target and targettype %s\n", getTargetExtension().toAscii().data()); } @@ -846,7 +828,7 @@ bool SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) { t << "SECUREID" << "\t\t" << uid3 << endl; } - // default value used from mkspecs..qconfig.h is 0 + // default value used from mkspecs is 0 if(0 != project->values("TARGET.VID").size()) { t << "VENDORID" << "\t\t" << project->values("TARGET.VID").join(" ") << endl; } @@ -861,7 +843,7 @@ bool SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) { t << "EPOCALLOWDLLDATA" << endl; if(targetType.compare("plugin", Qt::CaseInsensitive) == 0 && !project->values("CONFIG").contains("stdbinary", Qt::CaseInsensitive)) { - // use custom def file for Qt plugins + // Use custom def file for Qt plugins t << "DEFFILE " PLUGIN_COMMON_DEF_FILE_FOR_MMP << endl; } @@ -872,12 +854,11 @@ bool SymbianMakefileGenerator::writeMmpFileTargetPart(QTextStream& t) { /* - Application registration resource files - should be installed to the - + Application registration resource files should be installed to the \private\10003a3f\import\apps directory. */ -bool SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, QStringList &symbianLangCodes) { +bool SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, QStringList &symbianLangCodes) +{ if((getTargetExtension() == "exe") && !project->values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) { QString target = escapeFilePath(fileFixify(project->first("TARGET"))); @@ -897,15 +878,10 @@ bool SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, QStringL t << "TARGETPATH\t\t\t" RESOURCE_DIRECTORY_MMP<< endl; t << "END" << endl << endl; - // now append extension QString regTarget = target; regTarget.append("_reg.rss"); - // must state SOURCEPATH for resources - // relative placement (relative to dir where .mmp located) - // absolute placement (!RELATIVE! to EPOCROOT dir) - - t << "SOURCEPATH\t\t\t. " << endl; + t << "SOURCEPATH\t\t\t." << endl; t << "START RESOURCE\t\t" << regTarget << endl; if (isForSymbianSbsv2()) t << "DEPENDS " << target << ".rsg" << endl; @@ -915,7 +891,8 @@ bool SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, QStringL return true; } -bool SymbianMakefileGenerator::writeMmpFileSystemIncludePart(QTextStream& t) { +bool SymbianMakefileGenerator::writeMmpFileSystemIncludePart(QTextStream& t) +{ QDir current = QDir::current(); @@ -932,14 +909,16 @@ bool SymbianMakefileGenerator::writeMmpFileSystemIncludePart(QTextStream& t) { return true; } -bool SymbianMakefileGenerator::writeMmpFileIncludePart(QTextStream& t) { +bool SymbianMakefileGenerator::writeMmpFileIncludePart(QTextStream& t) +{ writeMmpFileSystemIncludePart(t); return true; } -bool SymbianMakefileGenerator::writeMmpFileLibraryPart(QTextStream& t) { +bool SymbianMakefileGenerator::writeMmpFileLibraryPart(QTextStream& t) +{ QStringList &libs = project->values("LIBS"); libs << project->values("QMAKE_LIBS"); @@ -947,8 +926,7 @@ bool SymbianMakefileGenerator::writeMmpFileLibraryPart(QTextStream& t) { for(int i = 0; i < libs.size(); ++i) { QString lib = libs.at(i); - // The -L flag is uninteresting, since all symbian libraries exist in the - // same directory. + // The -L flag is uninteresting, since all symbian libraries exist in the same directory. if(lib.startsWith("-l")) { lib.remove(0,2); QString mmpStatement; @@ -961,7 +939,7 @@ bool SymbianMakefileGenerator::writeMmpFileLibraryPart(QTextStream& t) { } else { // Hacky way to find out what kind of library it is. Check the // ARMV5 build directory for library type. We default to shared - // library, since that is probably more common. + // library, since that is more common. QString udebStaticLibLocation(epocRoot()); QString urelStaticLibLocation(udebStaticLibLocation); udebStaticLibLocation += QString("epoc32/release/armv5/udeb/%1.lib").arg(lib); @@ -981,7 +959,8 @@ bool SymbianMakefileGenerator::writeMmpFileLibraryPart(QTextStream& t) { return true; } -bool SymbianMakefileGenerator::writeMmpFileCapabilityPart(QTextStream& t) { +bool SymbianMakefileGenerator::writeMmpFileCapabilityPart(QTextStream& t) +{ if(0 != project->first("TARGET.CAPABILITY").size()) { QStringList &capabilities = project->values("TARGET.CAPABILITY"); t << "CAPABILITY" << "\t\t"; @@ -999,7 +978,8 @@ bool SymbianMakefileGenerator::writeMmpFileCapabilityPart(QTextStream& t) { return true; } -bool SymbianMakefileGenerator::writeMmpFileCompilerOptionPart(QTextStream& t) { +bool SymbianMakefileGenerator::writeMmpFileCompilerOptionPart(QTextStream& t) +{ QString cw, armcc; if(0 != project->values("QMAKE_CXXFLAGS.CW").size()) { @@ -1045,13 +1025,13 @@ bool SymbianMakefileGenerator::writeMmpFileCompilerOptionPart(QTextStream& t) { t << "OPTION" << '\t' << " CW " << cw << endl; if (!armcc.isEmpty()) t << "OPTION" << '\t' << " ARMCC "<< armcc << endl; - // others to come t << endl; return true; } -bool SymbianMakefileGenerator::writeMmpFileBinaryVersionPart(QTextStream& t) { +bool SymbianMakefileGenerator::writeMmpFileBinaryVersionPart(QTextStream& t) +{ QString applicationVersion = project->first("VERSION"); QStringList verNumList = applicationVersion.split('.'); uint major = 0; @@ -1088,7 +1068,8 @@ bool SymbianMakefileGenerator::writeMmpFileBinaryVersionPart(QTextStream& t) { return true; } -bool SymbianMakefileGenerator::writeMmpFileRulesPart(QTextStream& t) { +bool SymbianMakefileGenerator::writeMmpFileRulesPart(QTextStream& t) +{ foreach(QString item, project->values("MMP_RULES")) { t << endl; // If there is no stringlist defined for a rule, use rule name directly @@ -1104,7 +1085,8 @@ bool SymbianMakefileGenerator::writeMmpFileRulesPart(QTextStream& t) { return true; } -bool SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploymentExtension) { +bool SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploymentExtension) +{ // Read user defined bld inf rules QMap<QString, QStringList> userBldInfRules; for(QMap<QString, QStringList>::iterator it = project->variables().begin(); it != project->variables().end(); ++it) { @@ -1146,7 +1128,7 @@ bool SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy removeDuplicatedStrings(mmpProjects); removeDuplicatedStrings(shadowProjects); - // go in reverse order ... as that is the way how I build the list + // Go in reverse order as that is the way how we build the list QListIterator<QString> iT(mmpProjects); iT.toBack(); while(iT.hasPrevious()) { @@ -1167,10 +1149,9 @@ bool SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy relativePath = directory.relativeFilePath(fullProFilename); bldinfFilename = BLD_INF_FILENAME "." + cleanMmpName; if(relativePath.contains("/")) { - // shadow .pro not in same - // directory as parent .pro + // Shadow .pro not in same directory as parent .pro if(relativePath.startsWith("..")) { - // shadow .pro out of parent .pro + // Shadow .pro out of parent .pro relativePath.replace(relativePath.lastIndexOf("/"), relativePath.length(), QString("")); bldinfFilename.prepend("/").prepend(relativePath); } else { @@ -1178,11 +1159,10 @@ bool SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy bldinfFilename.prepend("/").prepend(relativePath); } } else { - // shadow .pro and parent .pro in same directory + // Shadow .pro and parent .pro in same directory bldinfFilename.prepend("./"); } } else { // regular project - // calc relative path QDir directory(currentPath); relativePath = directory.relativeFilePath(fullProFilename); relativePath.replace(relativePath.lastIndexOf("/"), relativePath.length(), QString("")); @@ -1261,7 +1241,8 @@ bool SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy return true; } -bool SymbianMakefileGenerator::writeRegRssFile(QString &appName, QStringList &userItems) { +bool SymbianMakefileGenerator::writeRegRssFile(QString &appName, QStringList &userItems) +{ QString filename(appName); filename.append("_reg.rss"); QFile ft(filename); @@ -1296,7 +1277,8 @@ bool SymbianMakefileGenerator::writeRegRssFile(QString &appName, QStringList &us return true; } -bool SymbianMakefileGenerator::writeRssFile(QString &appName, QString &numberOfIcons, QString &iconFile) { +bool SymbianMakefileGenerator::writeRssFile(QString &appName, QString &numberOfIcons, QString &iconFile) +{ QString filename(appName); filename.append(".rss"); QFile ft(filename); @@ -1340,7 +1322,8 @@ bool SymbianMakefileGenerator::writeRssFile(QString &appName, QString &numberOfI return true; } -bool SymbianMakefileGenerator::writeLocFile(QString &appName, QStringList &symbianLangCodes) { +bool SymbianMakefileGenerator::writeLocFile(QString &appName, QStringList &symbianLangCodes) +{ QString filename(appName); filename.append(".loc"); QFile ft(filename); @@ -1374,7 +1357,8 @@ bool SymbianMakefileGenerator::writeLocFile(QString &appName, QStringList &symbi return true; } -void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons, QString &iconFile, QStringList &userRssRules) { +void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons, QString &iconFile, QStringList &userRssRules) +{ for(QMap<QString, QStringList>::iterator it = project->variables().begin(); it != project->variables().end(); ++it) { if (it.key().startsWith(RSS_RULES_BASE)) { QString newKey = it.key().mid(sizeof(RSS_RULES_BASE)-1); @@ -1455,7 +1439,8 @@ void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons, QString &ico } } -QStringList SymbianMakefileGenerator::symbianLangCodesFromTsFiles() { +QStringList SymbianMakefileGenerator::symbianLangCodesFromTsFiles() +{ QStringList tsfiles; QStringList symbianLangCodes; tsfiles << project->values("TRANSLATIONS"); @@ -1476,7 +1461,8 @@ QStringList SymbianMakefileGenerator::symbianLangCodesFromTsFiles() { return symbianLangCodes; } -void SymbianMakefileGenerator::fillQt2S60LangMapTable() { +void SymbianMakefileGenerator::fillQt2S60LangMapTable() +{ qt2S60LangMapTable.reserve(170); // 165 items at time of writing. qt2S60LangMapTable.insert("ab", "SC"); //Abkhazian // qt2S60LangMapTable.insert("om", "SC"); //Afan // diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h index ba49118..3bf9f1d 100644 --- a/qmake/generators/symbian/symmake.h +++ b/qmake/generators/symbian/symmake.h @@ -46,25 +46,16 @@ QT_BEGIN_NAMESPACE -// In the Qt evaluation and educational version, we have a postfix in the -// library name (e.g. qtmteval301.dll). QTDLL_POSTFIX is used for this. -// A script modifies these lines when building eval/edu version, so be careful -// when changing them. -#ifndef QTDLL_POSTFIX -#define QTDLL_POSTFIX "" -#endif - #define BLD_INF_FILENAME "bld.inf" #define MAKEFILE_DEPENDENCY_SEPARATOR " \\\n\t" #define QT_EXTRA_INCLUDE_DIR "tmp" -class SymbianMakefileGenerator : public MakefileGenerator { - +class SymbianMakefileGenerator : public MakefileGenerator +{ protected: QString platform; - QString uid1; QString uid2; QString uid3; QString privateDirUid; @@ -92,8 +83,6 @@ protected: QString getTargetExtension(); bool isConfigSetToSymbian(); - QString generateUID1(); - QString generateUID2(); QString generateUID3(); bool initMmpVariables(); @@ -150,8 +139,6 @@ public: SymbianMakefileGenerator(); ~SymbianMakefileGenerator(); - }; #endif // SYMMAKEFILE_H - diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp index ccda9f2..17c365d 100644 --- a/qmake/generators/symbian/symmake_abld.cpp +++ b/qmake/generators/symbian/symmake_abld.cpp @@ -64,7 +64,6 @@ SymbianAbldMakefileGenerator::~SymbianAbldMakefileGenerator() { } bool SymbianAbldMakefileGenerator::writeMkFile(const QString& wrapperFileName, bool deploymentOnly) { - QString gnuMakefileName = QLatin1String("Makefile_") + uid3; removeSpecialCharacters(gnuMakefileName); gnuMakefileName.append(".mk"); @@ -204,9 +203,9 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool t << "endif" << endl; t << endl; t << "DEFINES" << '\t' << " = " - << varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ") - << varGlue("QMAKE_COMPILER_DEFINES", "-D", "-D", " ") - << varGlue("DEFINES","-D"," -D","") << endl; + << varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ") + << varGlue("QMAKE_COMPILER_DEFINES", "-D", "-D", " ") + << varGlue("DEFINES","-D"," -D","") << endl; t << "INCPATH" << '\t' << " = "; @@ -365,7 +364,7 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool t << "\t-bldmake clean" << endl; t << endl; - // create execution target + // Create execution target if (debugPlatforms.contains("winscw") && getTargetExtension() == "exe") { t << "run:" << endl; t << "\t-call " << epocRoot() << "epoc32\\release\\winscw\\udeb\\" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".exe")) << endl << endl; @@ -391,7 +390,7 @@ bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t) t << "\t-echo Deploying changed files..." << endl; for (int i=0; i<depList.size(); ++i) { - // xcopy prompts for selecting file or directory if target doesn't exist, + // Xcopy prompts for selecting file or directory if target doesn't exist, // and doesn't provide switch to force file selection. It does provide dir forcing, though, // so strip the last part of the destination. t << "\t-$(XCOPY) \"" << depList.at(i).from << "\" \"" << depList.at(i).to.left(depList.at(i).to.lastIndexOf("\\")+1) << "\"" << endl; @@ -425,4 +424,3 @@ void SymbianAbldMakefileGenerator::writeBldInfMkFilePart(QTextStream& t, bool ad t << "gnumakefile " << gnuMakefileName << endl; } } - diff --git a/qmake/generators/symbian/symmake_abld.h b/qmake/generators/symbian/symmake_abld.h index d323813..7de6510 100644 --- a/qmake/generators/symbian/symmake_abld.h +++ b/qmake/generators/symbian/symmake_abld.h @@ -46,8 +46,8 @@ QT_BEGIN_NAMESPACE -class SymbianAbldMakefileGenerator : public SymbianMakefileGenerator { - +class SymbianAbldMakefileGenerator : public SymbianMakefileGenerator +{ protected: // Inherited from parent @@ -62,8 +62,6 @@ public: SymbianAbldMakefileGenerator(); ~SymbianAbldMakefileGenerator(); - }; #endif // SYMMAKE_ABLD_H - diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp index 0266bac..34585e8 100644 --- a/qmake/generators/symbian/symmake_sbsv2.cpp +++ b/qmake/generators/symbian/symmake_sbsv2.cpp @@ -78,7 +78,9 @@ void SymbianSbsv2MakefileGenerator::exportFlm() if (QFile::copy(item.absoluteFilePath(), destInfo.absoluteFilePath())) generatedFiles << destInfo.absoluteFilePath(); else - fprintf(stderr, "Error: Could not copy '%s' -> '%s'\n", qPrintable(item.absoluteFilePath()), qPrintable(destInfo.absoluteFilePath())); + fprintf(stderr, "Error: Could not copy '%s' -> '%s'\n", + qPrintable(item.absoluteFilePath()), + qPrintable(destInfo.absoluteFilePath())); } } flmExportDone = true; @@ -354,8 +356,6 @@ bool SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t t << endl; - // ### TODO: Linux emulator (platsim?) deployment - // Write post link rules if(!project->isEmpty("QMAKE_POST_LINK")) { t << "START EXTENSION qt/qmake_post_link" << endl; @@ -418,4 +418,3 @@ void SymbianSbsv2MakefileGenerator::writeBldInfMkFilePart(QTextStream& t, bool a Q_UNUSED(t); Q_UNUSED(addDeploymentExtension); } - diff --git a/qmake/generators/symbian/symmake_sbsv2.h b/qmake/generators/symbian/symmake_sbsv2.h index e55d177..caa491d 100644 --- a/qmake/generators/symbian/symmake_sbsv2.h +++ b/qmake/generators/symbian/symmake_sbsv2.h @@ -46,8 +46,8 @@ QT_BEGIN_NAMESPACE -class SymbianSbsv2MakefileGenerator : public SymbianMakefileGenerator { - +class SymbianSbsv2MakefileGenerator : public SymbianMakefileGenerator +{ protected: // Inherited from parent @@ -69,4 +69,3 @@ private: }; #endif // SYMMAKE_SBSV2_H - diff --git a/qmake/project.cpp b/qmake/project.cpp index 0a5e9a3..7c7044c 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -3339,26 +3339,24 @@ QStringList &QMakeProject::values(const QString &_var, QMap<QString, QStringList // UIDs starting with 0xE are test UIDs in symbian -QString generate_test_uid(const QString& target) { +QString generate_test_uid(const QString& target) +{ QString tmp = generate_uid(target); tmp.replace(0,1,"E"); tmp.prepend("0x"); - // printf("generate_test_uid for %s is %s \n", qPrintable(target), qPrintable(tmp)); - return tmp; } // UIDs starting with 0xE are test UIDs in symbian -QString generate_uid(const QString& target) { - +QString generate_uid(const QString& target) +{ static QMap<QString, QString> targetToUid; QString tmp = targetToUid[target]; if(!tmp.isEmpty()) { - // printf("generate_uid for %s is %s \n", qPrintable(target), qPrintable(tmp)); return tmp; } diff --git a/qmake/qmake.pri b/qmake/qmake.pri index 2304fab..f43d933 100644 --- a/qmake/qmake.pri +++ b/qmake/qmake.pri @@ -17,14 +17,14 @@ SOURCES += project.cpp property.cpp main.cpp generators/makefile.cpp \ generators/symbian/symmake.cpp \ generators/symbian/symmake_abld.cpp \ generators/symbian/symmake_sbsv2.cpp \ - generators/symbian/initprojectdeploy_symbian.cpp + generators/symbian/initprojectdeploy_symbian.cpp # MWC does not provide an implementation of popen() so fake it. win32-mwc { SOURCES += qpopen.cpp \ } - + HEADERS += project.h property.h generators/makefile.h \ generators/unix/unixmake.h meta.h option.h cachekeys.h \ generators/win32/winmakefile.h generators/projectgenerator.h \ diff --git a/qmake/qpopen.cpp b/qmake/qpopen.cpp index ebde035..7acff92 100644 --- a/qmake/qpopen.cpp +++ b/qmake/qpopen.cpp @@ -69,7 +69,6 @@ bool QPopen::init(const char *command, const char* /* mode */) // Ensure that the write handle to the child process's pipe for STDIN is not inherited. SetHandleInformation( childStdInW, HANDLE_FLAG_INHERIT, 0); - //TCHAR szCmdline[strlen(command)]=TEXT(command); TCHAR *szCmdLine = new TCHAR[strlen(command)+1]; strcpy(szCmdLine, command); @@ -126,7 +125,6 @@ int QPopen::fwrite(char* buffer, int maxBytes) return 0; } - int QPopen::fread(char* buffer, int maxBytes) { DWORD bytesRead; @@ -140,4 +138,3 @@ int QPopen::fread(char* buffer, int maxBytes) return 0; } - diff --git a/src/corelib/arch/symbian/qatomic_symbian.cpp b/src/corelib/arch/symbian/qatomic_symbian.cpp index 9bec0f5..a228696 100644 --- a/src/corelib/arch/symbian/qatomic_symbian.cpp +++ b/src/corelib/arch/symbian/qatomic_symbian.cpp @@ -62,9 +62,9 @@ struct SPrintExitInfo TInt processHandleCount=0; TInt threadHandleCount=0; RThread().HandleCount(processHandleCount,threadHandleCount); - RDebug::Print(_L("%S exiting with %d allocated cells, %d handles"), - &fullName, - cells - initCells, + RDebug::Print(_L("%S exiting with %d allocated cells, %d handles"), + &fullName, + cells - initCells, (processHandleCount + threadHandleCount) - (initProcessHandleCount + initThreadHandleCount)); } TInt initCells; @@ -107,4 +107,3 @@ __declspec(dllexport) __asm int QBasicAtomicInt::fetchAndStoreOrdered(int newVal QT_END_NAMESPACE #endif // Q_CC_RVCT - diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 818e555..21cbd12 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1914,7 +1914,7 @@ QSysInfo::SymVersion QSysInfo::symbianVersion() \relates <QtGlobal> Users Q_CHECK_PTR on \a pointer, then returns \a pointer. - + This can be used as an inline version of Q_CHECK_PTR. */ @@ -2115,8 +2115,8 @@ QString qt_error_string(int errorCode) warnings, critical and fatal error messages. The Qt library (debug mode) contains hundreds of warning messages that are printed when internal errors (usually invalid function arguments) - occur. Qt built in release mode also contains such warnings unless - QT_NO_WARNING_OUTPUT and/or QT_NO_DEBUG_OUTPUT have been set during + occur. Qt built in release mode also contains such warnings unless + QT_NO_WARNING_OUTPUT and/or QT_NO_DEBUG_OUTPUT have been set during compilation. If you implement your own message handler, you get total control of these messages. @@ -2516,7 +2516,7 @@ Q_GLOBAL_STATIC(SeedStorage, randTLS) // Thread Local Storage for seed value */ void qsrand(uint seed) { -#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN) +#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN) SeedStorageType *pseed = randTLS()->localData(); if (!pseed) randTLS()->setLocalData(pseed = new SeedStorageType); @@ -3179,7 +3179,7 @@ bool QInternal::callFunction(InternalFunction func, void **args) Compares the floating point value \a p1 and \a p2 and returns \c true if they are considered equal, otherwise \c false. - Note that comparing values where either \a p1 or \a p2 is 0.0 will not work. + Note that comparing values where either \a p1 or \a p2 is 0.0 will not work. The solution to this is to compare against values greater than or equal to 1.0. \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 46 @@ -3416,7 +3416,7 @@ int qt_exception2SymbianError(const std::exception& aThrow) err = KErrUnderflow; qWarning("translation from std exception \"%s\" to %d", aThrow.what(), err); } - + return err; } #endif diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 257e3db..3493f13 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -915,9 +915,9 @@ QT_END_INCLUDE_NAMESPACE */ #ifndef QT_LINUXBASE /* the LSB defines TRUE and FALSE for us */ -/* Symbian OS defines TRUE = 1 and FALSE = 0, +/* Symbian OS defines TRUE = 1 and FALSE = 0, redefine to built-in booleans to make autotests work properly */ -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN #undef TRUE #undef FALSE #endif diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 9787566..836fa44 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -1824,7 +1824,7 @@ QChar QDir::separator() { #if defined (Q_FS_FAT) || defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN) return QLatin1Char('\\'); -#elif defined(Q_OS_UNIX) +#elif defined(Q_OS_UNIX) return QLatin1Char('/'); #elif defined (Q_OS_MAC) return QLatin1Char(':'); diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index f7120e1..cd8d36d 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -517,7 +517,7 @@ QTemporaryFile::QTemporaryFile() #ifdef Q_OS_SYMBIAN //Just for verify that folder really exist on hardware fileEngine()->mkdir( QDir::tempPath(), true ); -#endif +#endif } /*! diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index 3293d47..e876843 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -652,7 +652,7 @@ 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++; @@ -959,7 +959,7 @@ bool QEventDispatcherSymbian::unregisterTimers ( QObject * object ) { if (m_timerList.isEmpty()) return false; - + bool unregistered = false; for (QHash<int, SymbianTimerInfoPtr>::iterator i = m_timerList.begin(); i != m_timerList.end(); ) { if ((*i)->receiver == object) { @@ -1002,4 +1002,3 @@ void CQtActiveScheduler::Error(TInt aError) const } QT_END_NAMESPACE - diff --git a/src/corelib/kernel/qsystemsemaphore_symbian.cpp b/src/corelib/kernel/qsystemsemaphore_symbian.cpp index 8179046..1516841 100644 --- a/src/corelib/kernel/qsystemsemaphore_symbian.cpp +++ b/src/corelib/kernel/qsystemsemaphore_symbian.cpp @@ -47,7 +47,7 @@ #include <qcore_symbian_p.h> #include <e32cmn.h> QT_BEGIN_NAMESPACE - + #ifndef QT_NO_SYSTEMSEMAPHORE QSystemSemaphorePrivate::QSystemSemaphorePrivate() : @@ -65,7 +65,7 @@ void QSystemSemaphorePrivate::setErrorString(const QString &function, int err) errorString = QCoreApplication::tr("%1: already exists", "QSystemSemaphore").arg(function); error = QSystemSemaphore::AlreadyExists; break; - case KErrNotFound: + case KErrNotFound: errorString = QCoreApplication::tr("%1: doesn't exists", "QSystemSemaphore").arg(function); error = QSystemSemaphore::NotFound; break; diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 2b57d2f..dd3468d 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -156,7 +156,7 @@ static void construct(QVariant::Private *x, const void *copy) x->data.b = copy ? *static_cast<const bool *>(copy) : false; break; case QVariant::Double: -#if defined(Q_CC_RVCT) +#if defined(Q_CC_RVCT) // Using trinary operator with 64bit constants crashes when ran on Symbian device if (copy){ x->data.d = *static_cast<const double*>(copy); @@ -165,13 +165,13 @@ static void construct(QVariant::Private *x, const void *copy) } #else x->data.d = copy ? *static_cast<const double*>(copy) : 0.0; -#endif +#endif break; case QMetaType::Float: x->data.f = copy ? *static_cast<const float*>(copy) : 0.0f; break; case QVariant::LongLong: -#if defined(Q_CC_RVCT) +#if defined(Q_CC_RVCT) // Using trinary operator with 64bit constants crashes when ran on Symbian device if (copy){ x->data.ll = *static_cast<const qlonglong *>(copy); @@ -180,10 +180,10 @@ static void construct(QVariant::Private *x, const void *copy) } #else x->data.ll = copy ? *static_cast<const qlonglong *>(copy) : Q_INT64_C(0); -#endif +#endif break; case QVariant::ULongLong: -#if defined(Q_CC_RVCT) +#if defined(Q_CC_RVCT) // Using trinary operator with 64bit constants crashes when ran on Symbian device if (copy){ x->data.ull = *static_cast<const qulonglong *>(copy); @@ -192,7 +192,7 @@ static void construct(QVariant::Private *x, const void *copy) } #else x->data.ull = copy ? *static_cast<const qulonglong *>(copy) : Q_UINT64_C(0); -#endif +#endif break; case QVariant::Invalid: case QVariant::UserType: @@ -618,7 +618,7 @@ static bool convert(const QVariant::Private *d, QVariant::Type t, void *result, ok = &dummy; switch (uint(t)) { - case QVariant::Url: + case QVariant::Url: switch (d->type) { case QVariant::String: *static_cast<QUrl *>(result) = QUrl(*v_cast<QString>(d)); @@ -1214,8 +1214,8 @@ const QVariant::Handler *QVariant::handler = &qt_kernel_variant_handler; and versatile, but may prove less memory and speed efficient than storing specific types in standard data structures. - QVariant also supports the notion of null values, where you can - have a defined type with no value set. However, note that QVariant + QVariant also supports the notion of null values, where you can + have a defined type with no value set. However, note that QVariant types can only be cast when they have had a value set. \snippet doc/src/snippets/code/src_corelib_kernel_qvariant.cpp 1 diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp index 5364190..d7692b0 100644 --- a/src/corelib/plugin/qpluginloader.cpp +++ b/src/corelib/plugin/qpluginloader.cpp @@ -311,7 +311,7 @@ void QPluginLoader::setFileName(const QString &fileName) QFileInfoList driveList(QDir::drives()); foreach(const QFileInfo& drive, driveList) { QString testFilePath(drive.absolutePath() + stubPath); - testFilePath = QDir::cleanPath(testFilePath); + testFilePath = QDir::cleanPath(testFilePath); if (QFile::exists(testFilePath)) { fn = testFilePath; break; @@ -319,7 +319,7 @@ void QPluginLoader::setFileName(const QString &fileName) } } } - + #else QString fn = QFileInfo(fileName).canonicalFilePath(); #endif diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index fac50ee..a4a57ce 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -183,7 +183,7 @@ QThreadPrivate::QThreadPrivate(QThreadData *d) id = 0; waiters = 0; #endif -#if defined (Q_WS_WIN) || defined (Q_OS_SYMBIAN) +#if defined (Q_WS_WIN) || defined (Q_OS_SYMBIAN) terminationEnabled = true; terminatePending = false; #endif diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h index 51de0be..752796b 100644 --- a/src/corelib/thread/qthread_p.h +++ b/src/corelib/thread/qthread_p.h @@ -152,7 +152,7 @@ public: static void finish(void *, bool lockAnyway=true); #endif // Q_OS_WIN32 -#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined (Q_OS_SYMBIAN) +#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined (Q_OS_SYMBIAN) bool terminationEnabled, terminatePending; # endif QThreadData *data; diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index 881b889..cabf823 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -178,7 +178,7 @@ void QThreadPrivate::createEventDispatcher(QThreadData *data) else #endif #ifdef Q_OS_SYMBIAN - data->eventDispatcher = new QEventDispatcherSymbian; + data->eventDispatcher = new QEventDispatcherSymbian; #else data->eventDispatcher = new QEventDispatcherUNIX; #endif @@ -193,7 +193,7 @@ void *QThreadPrivate::start(void *arg) pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); pthread_cleanup_push(QThreadPrivate::finish, arg); #endif - + QThread *thr = reinterpret_cast<QThread *>(arg); QThreadData *data = QThreadData::get2(thr); @@ -226,7 +226,7 @@ void *QThreadPrivate::start(void *arg) #ifndef Q_OS_SYMBIAN pthread_cleanup_pop(1); #else - QThreadPrivate::finish(arg); + QThreadPrivate::finish(arg); #endif return 0; @@ -266,7 +266,7 @@ void QThreadPrivate::finish(void *arg) d->thread_id = 0; #ifdef Q_OS_SYMBIAN if (closeNativeHandle) - d->data->symbian_thread_handle.Close(); + d->data->symbian_thread_handle.Close(); #endif d->thread_done.wakeAll(); #ifdef Q_OS_SYMBIAN @@ -325,7 +325,7 @@ int QThread::idealThreadCount() #elif defined(Q_OS_INTEGRITY) // ### TODO - how to get the amound of CPUs on INTEGRITY? #elif defined(Q_OS_SYMBIAN) - // ### TODO - Get the number of cores from HAL? when multicore architectures (SMP) are supported + // ### TODO - Get the number of cores from HAL? when multicore architectures (SMP) are supported cores = 1; #else // the rest: Linux, Solaris, AIX, Tru64 @@ -545,10 +545,10 @@ void QThread::terminate() d->terminatePending = true; return; } - + d->terminated = true; QThreadPrivate::finish(this, false, false); - d->data->symbian_thread_handle.Terminate(KErrNone); + d->data->symbian_thread_handle.Terminate(KErrNone); d->data->symbian_thread_handle.Close(); #endif @@ -592,7 +592,7 @@ void QThread::setTerminationEnabled(bool enabled) d->terminated = true; QThreadPrivate::finish(thr, false); locker.unlock(); // don't leave the mutex locked! - pthread_exit(NULL); + pthread_exit(NULL); } #endif } diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index fc6a1e3a..a57fec7 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -150,10 +150,10 @@ struct Q_CORE_EXPORT QHashData }; inline void QHashData::mightGrow() // ### Qt 5: eliminate -{ +{ if (size >= numBuckets) rehash(numBits + 1); -} +} inline bool QHashData::willGrow() { @@ -992,12 +992,12 @@ Q_INLINE_TEMPLATE int QMultiHash<Key, T>::remove(const Key &key, const T &value) typename QHash<Key, T>::iterator end(QHash<Key, T>::end()); while (i != end && i.key() == key) { if (i.value() == value) { -#if defined(Q_CC_RVCT) - // RVCT has problems with scoping, apparently. +#if defined(Q_CC_RVCT) + // RVCT has problems with scoping, apparently. i = QHash<Key, T>::erase(i); #else i = erase(i); -#endif +#endif ++n; } else { ++i; diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index be80e75..70a2896 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -1019,12 +1019,12 @@ Q_INLINE_TEMPLATE int QMultiMap<Key, T>::remove(const Key &key, const T &value) typename QMap<Key, T>::iterator end(QMap<Key, T>::end()); while (i != end && !qMapLessThanKey<Key>(key, i.key())) { if (i.value() == value) { -#if defined(Q_CC_RVCT) - // RVCT has problems with scoping, apparently. +#if defined(Q_CC_RVCT) + // RVCT has problems with scoping, apparently. i = QMap<Key, T>::erase(i); #else i = erase(i); -#endif +#endif ++n; } else { ++i; diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index c9478cb..a6c2883 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1915,7 +1915,6 @@ int QPixmap::defaultDepth() #elif defined(Q_OS_SYMBIAN) return S60->screenDepth; #endif - } typedef void (*_qt_pixmap_cleanup_hook_64)(qint64); diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri index a8d09b0..8b46dc6 100644 --- a/src/gui/kernel/kernel.pri +++ b/src/gui/kernel/kernel.pri @@ -114,7 +114,7 @@ symbian { kernel/qclipboard_s60.cpp\ kernel/qdnd_s60.cpp \ kernel/qsound_s60.cpp - + HEADERS += \ kernel/qt_s60_p.h \ kernel/qeventdispatcher_s60_p.h @@ -198,7 +198,7 @@ embedded { qcocoaview_mac_p.h \ qcocoaapplication_mac_p.h \ qcocoaapplicationdelegate_mac_p.h \ - qmultitouch_mac_p.h + qmultitouch_mac_p.h OBJECTIVE_SOURCES += \ kernel/qcursor_mac.mm \ @@ -216,7 +216,7 @@ embedded { kernel/qt_cocoa_helpers_mac.mm \ kernel/qdesktopwidget_mac.mm \ kernel/qeventdispatcher_mac.mm \ - kernel/qcocoawindowcustomthemeframe_mac.mm \ + kernel/qcocoawindowcustomthemeframe_mac.mm \ kernel/qmultitouch_mac.mm \ HEADERS += \ @@ -225,10 +225,10 @@ embedded { kernel/qcocoaapplicationdelegate_mac_p.h \ kernel/qeventdispatcher_mac_p.h - MENU_NIB.files = mac/qt_menu.nib - MENU_NIB.path = Resources + MENU_NIB.files = mac/qt_menu.nib + MENU_NIB.path = Resources MENU_NIB.version = Versions - QMAKE_BUNDLE_DATA += MENU_NIB + QMAKE_BUNDLE_DATA += MENU_NIB RESOURCES += mac/macresources.qrc LIBS += -framework AppKit diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp index fe40ea8..07c40c7 100644 --- a/src/gui/kernel/qaction.cpp +++ b/src/gui/kernel/qaction.cpp @@ -1368,7 +1368,7 @@ QAction::MenuRole QAction::menuRole() const This indicates what softkey action this action is. Usually used on mobile platforms to map QActions to hardware keys. - + The softkey role can be changed any time. */ void QAction::setSoftKeyRole(SoftKeyRole softKeyRole) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 7836238..c831dad 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -124,7 +124,7 @@ private: QS60Beep::~QS60Beep() { - delete iToneUtil; + delete iToneUtil; } QS60Beep* QS60Beep::NewL(TInt aFrequency, TTimeIntervalMicroSeconds aDuration) @@ -153,7 +153,7 @@ void QS60Beep::Play() iState=EBeepPrepared; } } - + iToneUtil->Play(); iState=EBeepPlaying; } @@ -295,7 +295,7 @@ void QLongTapTimer::PointerEventL(const TPointerEvent& event) Cancel(); m_event = event; if (event.iType == TPointerEvent::EButton1Down) - { + { m_pressedCoordinates = QPoint(event.iPosition.iX,event.iPosition.iY); // must be same as KLongTapDelay in aknlongtapdetector.h After(800000); @@ -366,7 +366,7 @@ void QSymbianControl::HandlePointerEventL(const TPointerEvent& pEvent) } if (type == QMouseEvent::None) return; - + // store events for later sending/saving QWidget *alienWidget; typedef QPair<QWidget*,QMouseEvent> Event; @@ -375,7 +375,7 @@ void QSymbianControl::HandlePointerEventL(const TPointerEvent& pEvent) QPoint widgetPos = QPoint(pEvent.iPosition.iX, pEvent.iPosition.iY); TPoint controlScreenPos = PositionRelativeToScreen(); QPoint globalPos = QPoint(controlScreenPos.iX, controlScreenPos.iY) + widgetPos; - + if (type == QEvent::MouseButtonPress || type == QEvent::MouseButtonDblClick) { // get the button press target @@ -406,7 +406,7 @@ void QSymbianControl::HandlePointerEventL(const TPointerEvent& pEvent) events.append(Event(S60->lastPointerEventTarget,mEventLeave)); } QMouseEvent mEventEnter(QEvent::Enter, alienWidget->mapFromGlobal(globalPos), globalPos, - button, QApplicationPrivate::mouse_buttons, mapToQtModifiers(pEvent.iModifiers)); + button, QApplicationPrivate::mouse_buttons, mapToQtModifiers(pEvent.iModifiers)); events.append(Event(alienWidget,mEventEnter)); } @@ -672,14 +672,14 @@ void QSymbianControl::HandleResourceChange(int resourceType) { switch (resourceType) { case KInternalStatusPaneChange: - qwidget->d_func()->setWindowIcon_sys(true); - break; + qwidget->d_func()->setWindowIcon_sys(true); + break; case KUidValueCoeFontChangeEvent: // font change event break; #ifdef Q_WS_S60 case KEikDynamicLayoutVariantSwitch: - { + { if (qwidget->isFullScreen()) { SetExtentToWholeScreen(); } else if (qwidget->isMaximized()) { @@ -944,10 +944,10 @@ void QApplication::beep() QS60Beep* beep=NULL; TRAPD(err, beep=QS60Beep::NewL(frequency, duration)); if(!err) { - beep->Play(); + beep->Play(); } delete beep; - beep=NULL; + beep=NULL; } int QApplication::s60ProcessEvent(TWsEvent *event) @@ -1081,8 +1081,8 @@ void QApplication::symbianResourceChange(int type) case KEikDynamicLayoutVariantSwitch: { if (S60) - S60->updateScreenSize(); - + S60->updateScreenSize(); + #ifndef QT_NO_STYLE_S60 QS60Style *s60Style = 0; @@ -1096,7 +1096,7 @@ void QApplication::symbianResourceChange(int type) if (s60Style) s60Style->handleDynamicLayoutVariantSwitch(); -#endif +#endif } break; @@ -1104,7 +1104,7 @@ void QApplication::symbianResourceChange(int type) case KAknsMessageSkinChange: if (QS60Style *s60Style = qobject_cast<QS60Style*>(QApplication::style())) s60Style->handleSkinChange(); - break; + break; #endif #endif // Q_WS_S60 default: @@ -1175,5 +1175,3 @@ void QSessionManager::cancel() } #endif //QT_NO_SESSIONMANAGER QT_END_NAMESPACE - - diff --git a/src/gui/kernel/qclipboard_s60.cpp b/src/gui/kernel/qclipboard_s60.cpp index 27b4fdb..5536438 100644 --- a/src/gui/kernel/qclipboard_s60.cpp +++ b/src/gui/kernel/qclipboard_s60.cpp @@ -76,10 +76,10 @@ public: QMimeData* source() { return src; } bool connected() - { return connection; } + { return connection; } void clear(); RFs fsSession(); - + private: QMimeData* src; @@ -134,7 +134,7 @@ static QClipboardData *clipboardData() delete internalCbData; internalCbData = 0; } - else + else { qAddPostRoutine(cleanupClipboardData); } @@ -161,7 +161,7 @@ void writeToStreamLX(const QMimeData* aData, RWriteStream& aStream) aStream << TCardinality(ba.size()); aStream.WriteL(reinterpret_cast<const uchar*>(ba.constData()),ba.size()); CleanupStack::PopAndDestroy(stringData); - } + } } void readFromStreamLX(QMimeData* aData,RReadStream& aStream) @@ -169,7 +169,7 @@ void readFromStreamLX(QMimeData* aData,RReadStream& aStream) // This function both leaves and throws exceptions. There must be no destructor // dependencies between cleanup styles, and no cleanup stack dependencies on stacked objects. TCardinality mimeTypeCount; - aStream >> mimeTypeCount; + aStream >> mimeTypeCount; for (int i = 0; i< mimeTypeCount;i++) { // mime type @@ -220,7 +220,7 @@ const QMimeData* QClipboard::mimeData(Mode mode) const if (err != KErrNone){ qDebug()<< "clipboard is empty/err: " << err; } - + } return 0; } @@ -249,7 +249,7 @@ void QClipboard::setMimeData(QMimeData* src, Mode mode) qDebug()<< "clipboard write err :" << err; } } - emitChanged(QClipboard::Clipboard); + emitChanged(QClipboard::Clipboard); } bool QClipboard::supportsMode(Mode mode) const diff --git a/src/gui/kernel/qdnd_s60.cpp b/src/gui/kernel/qdnd_s60.cpp index 07b196e..c7656b0 100644 --- a/src/gui/kernel/qdnd_s60.cpp +++ b/src/gui/kernel/qdnd_s60.cpp @@ -94,8 +94,8 @@ class QShapedPixmapWidget public: QShapedPixmapWidget(RWsSession aWsSession,RWindowTreeNode* aNode) { - sprite = RWsSprite(aWsSession); - cursorSprite.iBitmap = 0; + sprite = RWsSprite(aWsSession); + cursorSprite.iBitmap = 0; cursorSprite.iMaskBitmap = 0; cursorSprite.iInvertMask = EFalse; cursorSprite.iOffset = TPoint(0,0); @@ -127,7 +127,7 @@ public: //### heaplock centralized. QImage temp = pm.toImage(); QSize size = pm.size(); - temp.bits(); + temp.bits(); CFbsBitmap *curbm = q_check_ptr(new CFbsBitmap()); // CBase derived object needs check on new curbm->Create(TSize(size.width(),size.height()),EColor16MA); curbm->LockHeap(ETrue); @@ -188,7 +188,7 @@ bool QDragManager::eventFilter(QObject *o, QEvent *e) switch(e->type()) { case QEvent::MouseButtonPress: { - } + } case QEvent::MouseMove: { if (!object) { //#### this should not happen @@ -211,7 +211,7 @@ bool QDragManager::eventFilter(QObject *o, QEvent *e) if (!cw) return true; TPoint windowPos = cw->effectiveWinId()->PositionRelativeToScreen(); - qt_symbian_dnd_deco->sprite.SetPosition(TPoint(me->globalX()- windowPos.iX,me->globalY()- windowPos.iY)); + qt_symbian_dnd_deco->sprite.SetPosition(TPoint(me->globalX()- windowPos.iX,me->globalY()- windowPos.iY)); while (cw && !cw->acceptDrops() && !cw->isWindow()) cw = cw->parentWidget(); @@ -318,7 +318,7 @@ Qt::DropAction QDragManager::drag(QDrag *o) object->d_func()->target = 0; TPoint windowPos = source()->effectiveWinId()->PositionRelativeToScreen(); qt_symbian_dnd_deco->sprite.SetPosition(TPoint(QCursor::pos().x()- windowPos.iX ,QCursor::pos().y() - windowPos.iY)); - + QPoint hotspot = drag_object->hotSpot(); qt_symbian_dnd_deco->cursorSprite.iOffset = TPoint(- hotspot.x(),- hotspot.y()); qt_symbian_dnd_deco->sprite.UpdateMember(0,qt_symbian_dnd_deco->cursorSprite); diff --git a/src/gui/kernel/qsound_s60.cpp b/src/gui/kernel/qsound_s60.cpp index c9eedf5..75458ec 100644 --- a/src/gui/kernel/qsound_s60.cpp +++ b/src/gui/kernel/qsound_s60.cpp @@ -65,22 +65,22 @@ public: void play(); void stop(); - + inline QSound* sound() const { return m_sound; } - + public: // from MMdaAudioPlayerCallback void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration); - void MapcPlayComplete(TInt aError); + void MapcPlayComplete(TInt aError); private: QSound *m_sound; - QAuServerS60 *m_server; + QAuServerS60 *m_server; bool m_prepared; - bool m_playCalled; - CMdaAudioPlayerUtility* m_playUtility; + bool m_playCalled; + CMdaAudioPlayerUtility* m_playUtility; }; - + class QAuServerS60 : public QAuServer { public: @@ -103,11 +103,11 @@ public: } bool okay() { return true; } - + protected: - void playCompleted(QAuBucketS60* bucket, int error) + void playCompleted(QAuBucketS60* bucket, int error) { - QSound *sound = bucket->sound(); + QSound *sound = bucket->sound(); if(!error) { // We need to handle repeats by ourselves, since with Symbian API we don't // know how many loops have been played when user asks it @@ -119,14 +119,14 @@ protected: // in order that QSound::isFinished will return true; while(decLoop(sound)) {} } - } + } protected: QAuBucketS60* bucket( QSound *s ) { return (QAuBucketS60*)QAuServer::bucket( s ); } - + friend class QAuBucketS60; }; @@ -160,32 +160,32 @@ void QAuBucketS60::play() { if(m_prepared) { // OpenFileL call is completed we can start playing immediately - m_playUtility->Play(); + m_playUtility->Play(); } else { m_playCalled = true; } - + } void QAuBucketS60::stop() { m_playCalled = false; - m_playUtility->Stop(); + m_playUtility->Stop(); } void QAuBucketS60::MapcPlayComplete(TInt aError) { m_server->playCompleted(this, aError); } - -void QAuBucketS60::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/) + +void QAuBucketS60::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/) { if(aError) { m_server->playCompleted(this, aError); } else { - m_prepared = true; + m_prepared = true; if(m_playCalled){ - play(); + play(); } } } @@ -196,7 +196,7 @@ QAuBucketS60::~QAuBucketS60() m_playUtility->Stop(); m_playUtility->Close(); } - + delete m_playUtility; } diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index 802a2f7..f6dd2e1 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -73,10 +73,10 @@ #include <akncontext.h> // CAknContextPane #include <eikspane.h> // CEikStatusPane #endif - + QT_BEGIN_NAMESPACE -// Application internal HandleResourceChangeL events, +// Application internal HandleResourceChangeL events, // system evens seems to start with 0x10 const TInt KInternalStatusPaneChange = 0x50000000; @@ -115,7 +115,7 @@ QS60Data* qGlobalS60Data(); class QAbstractLongTapObserver { public: - virtual void HandleLongTapEventL( const TPoint& aPenEventLocation, + virtual void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation ) = 0; }; class QLongTapTimer; diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index bfcb02b..bca0e9d 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -896,22 +896,22 @@ void QWidget::setAutoFillBackground(bool enabled) \endlist \sa QEvent, QPainter, QGridLayout, QBoxLayout - + \section1 SoftKeys \since 4.6 \preliminary - Softkeys API is a platform independent way of mapping actions to (hardware)keys + Softkeys API is a platform independent way of mapping actions to (hardware)keys and toolbars provided by the underlying platform. - - There are three major use cases supported. First one is a mobile device + + There are three major use cases supported. First one is a mobile device with keypad navigation and no touch ui. Second use case is a mobile - device with touch ui. Third use case is desktop. For now the softkey API is + device with touch ui. Third use case is desktop. For now the softkey API is only implemented for Series60. - - QActions are set to widget(s) via softkey API. Actions in focused widget are + + QActions are set to widget(s) via softkey API. Actions in focused widget are mapped to native toolbar or hardware keys. Even though the API allows to set - any amount of widgets there might be physical restrictions to amount of + any amount of widgets there might be physical restrictions to amount of softkeys that can be used by the device. \o Series60: For series60 menu button is automatically mapped to left @@ -919,7 +919,7 @@ void QWidget::setAutoFillBackground(bool enabled) \sa softKeys() \sa setSoftKey() - + */ QWidgetMapper *QWidgetPrivate::mapper = 0; // widget with wid @@ -5768,7 +5768,7 @@ void QWidget::setFocus(Qt::FocusReason reason) if (!isEnabled()) return; - + QWidget *f = this; while (f->d_func()->extra && f->d_func()->extra->focus_proxy) f = f->d_func()->extra->focus_proxy; @@ -11698,7 +11698,7 @@ void QWidget::clearMask() /*! \preliminary \since 4.6 - + Returns the (possibly empty) list of this widget's softkeys. Returned list cannot be changed. Softkeys should be added and removed via method called setSoftKeys @@ -11719,7 +11719,7 @@ const QList<QAction*>& QWidget::softKeys() const /*! \preliminary \since 4.6 - + Sets the softkey \a softkey to this widget's list of softkeys, Setting 0 as softkey will clear all the existing softkeys set to the widget diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index ad7cd2d..4336d45 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -317,14 +317,14 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de QT_TRAP_THROWING(control->ConstructL(true,desktop)); if (!desktop) { - TInt stackingFlags; - if ((q->windowType() & Qt::Popup) == Qt::Popup) { - stackingFlags = ECoeStackFlagRefusesAllKeys | ECoeStackFlagRefusesFocus; - } else { - stackingFlags = ECoeStackFlagStandard; - } - control->ControlEnv()->AppUi()->AddToStackL(control, ECoeStackPriorityDefault, stackingFlags); - + TInt stackingFlags; + if ((q->windowType() & Qt::Popup) == Qt::Popup) { + stackingFlags = ECoeStackFlagRefusesAllKeys | ECoeStackFlagRefusesFocus; + } else { + stackingFlags = ECoeStackFlagStandard; + } + control->ControlEnv()->AppUi()->AddToStackL(control, ECoeStackPriorityDefault, stackingFlags); + QTLWExtra *topExtra = topData(); topExtra->rwindow = control->DrawableWindow(); // Request mouse move events. @@ -349,7 +349,7 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de QSymbianControl *control = new QSymbianControl(q); setWinId(control); QT_TRAP_THROWING(control->ConstructL(!parentWidget)); - + TInt stackingFlags; if ((q->windowType() & Qt::Popup) == Qt::Popup) { stackingFlags = ECoeStackFlagRefusesAllKeys | ECoeStackFlagRefusesFocus; @@ -357,7 +357,7 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de stackingFlags = ECoeStackFlagStandard; } control->ControlEnv()->AppUi()->AddToStackL(control, ECoeStackPriorityDefault, stackingFlags); - + WId parentw = parentWidget->effectiveWinId(); QT_TRAP_THROWING(control->SetContainerWindowL(*parentw)); @@ -394,12 +394,12 @@ void QWidgetPrivate::show_sys() WId id = q->internalWinId(); if (!extra->topextra->activated) { - QT_TRAP_THROWING(id->ActivateL()); + QT_TRAP_THROWING(id->ActivateL()); extra->topextra->activated = 1; } id->MakeVisible(true); id->SetFocus(true); - + // Force setting of the icon after window is made visible, // this is needed even WA_SetWindowIcon is not set, as in that case we need // to reset to the application level window icon @@ -554,7 +554,7 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) if (wasCreated && old_winid) { old_winid->MakeVisible(false); if(old_winid->IsFocused()) // Avoid unnecessary calls to FocusChanged() - old_winid->SetFocus(false); + old_winid->SetFocus(false); old_winid->SetParent(0); } @@ -620,7 +620,7 @@ void QWidgetPrivate::s60UpdateIsOpaque() CFbsBitmap* qt_pixmapToNativeBitmap(QPixmap pixmap, bool invert) { - CFbsBitmap* fbsBitmap = q_check_ptr(new CFbsBitmap); // CBase derived object needs check on new + CFbsBitmap* fbsBitmap = q_check_ptr(new CFbsBitmap); // CBase derived object needs check on new TSize size(pixmap.size().width(), pixmap.size().height()); TDisplayMode mode(EColor16MU); @@ -631,7 +631,7 @@ CFbsBitmap* qt_pixmapToNativeBitmap(QPixmap pixmap, bool invert) // Will fix later on when native pixmap is implemented switch(pixmap.depth()) { case 1: - mode = EGray2; + mode = EGray2; break; case 4: mode = EColor16; @@ -661,7 +661,7 @@ CFbsBitmap* qt_pixmapToNativeBitmap(QPixmap pixmap, bool invert) QImage image = pixmap.toImage(); if(invert) - image.invertPixels(); + image.invertPixels(); int height = pixmap.size().height(); for(int i=0;i<height;i++ ) @@ -717,14 +717,14 @@ void QWidgetPrivate::setWindowIcon_sys(bool forceReset) // Context pane does not exist, try setting small icon to title pane TRect titlePaneRect; TBool found = AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::ETitlePane, titlePaneRect ); - CAknTitlePane* titlePane = S60->titlePane(); + CAknTitlePane* titlePane = S60->titlePane(); if (found && titlePane) { // We have title pane with valid metrics - // The API to get title_pane graphics size is not public -> assume square space based + // The API to get title_pane graphics size is not public -> assume square space based // on titlebar font height. CAknBitmap would be optimum, wihtout setting the size, since // then title pane would automatically scale the bitmap. Unfortunately it is not public API const CFont * font = AknLayoutUtils::FontFromId(EAknLogicalFontTitleFont); TSize iconSize(font->HeightInPixels(), font->HeightInPixels()); - + QIcon icon = q->windowIcon(); if (!icon.isNull()) { // Valid icon -> set it as an title pane small picture @@ -749,7 +749,7 @@ void QWidgetPrivate::setWindowIcon_sys(bool forceReset) } } } - + #else Q_UNUSED(forceReset) #endif @@ -763,10 +763,10 @@ void QWidgetPrivate::setWindowTitle_sys(const QString &caption) Q_ASSERT(q->testAttribute(Qt::WA_WState_Created)); CAknTitlePane* titlePane = S60->titlePane(); if(titlePane) { - if(caption.isEmpty()) - titlePane->SetTextToDefaultL(); - else - QT_TRAP_THROWING(titlePane->SetTextL(qt_QString2TPtrC(caption))); + if(caption.isEmpty()) + titlePane->SetTextToDefaultL(); + else + QT_TRAP_THROWING(titlePane->SetTextL(qt_QString2TPtrC(caption))); } } #else @@ -1048,7 +1048,7 @@ void QWidget::setWindowState(Qt::WindowStates newstate) if (isVisible()) { WId id = effectiveWinId(); if(id->IsFocused()) // Avoid unnecessary calls to FocusChanged() - id->SetFocus(false); + id->SetFocus(false); id->MakeVisible(false); } } else { @@ -1056,7 +1056,7 @@ void QWidget::setWindowState(Qt::WindowStates newstate) WId id = effectiveWinId(); id->MakeVisible(true); if(!id->IsFocused()) // Avoid unnecessary calls to FocusChanged() - id->SetFocus(true); + id->SetFocus(true); } const QRect normalGeometry = geometry(); const QRect r = top->normalGeometry; @@ -1118,7 +1118,7 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) // the next visible window will get keyboard focus WId wid = CEikonEnv::Static()->AppUi()->TopFocusedControl(); if (wid) { - QWidget *widget = QWidget::find(wid); + QWidget *widget = QWidget::find(wid); QApplication::setActiveWindow(widget); if (widget) { // Reset global window title for focusing window diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri index d153215..1f52422 100644 --- a/src/gui/painting/painting.pri +++ b/src/gui/painting/painting.pri @@ -233,7 +233,7 @@ contains(QMAKE_MAC_XARCH, no) { win32-g++|!win32:!*-icc* { mmx { - mmx_compiler.commands = $$QMAKE_CXX -c -Winline + mmx_compiler.commands = $$QMAKE_CXX -c -Winline mac { mmx_compiler.commands += -Xarch_i386 -mmmx @@ -375,7 +375,7 @@ symbian { "SOURCE qblendfunctions_armv6_rvct.s" \ "SOURCE qdrawhelper_armv6_rvct.s" \ "$${LITERAL_HASH}endif" - + MMP_RULES += armccIfdefBlock QMAKE_CXXFLAGS.ARMCC *= -O3 } diff --git a/src/gui/painting/qblendfunctions_armv6_rvct.s b/src/gui/painting/qblendfunctions_armv6_rvct.s index 312bd07..64d5aa5 100644 --- a/src/gui/painting/qblendfunctions_armv6_rvct.s +++ b/src/gui/painting/qblendfunctions_armv6_rvct.s @@ -54,13 +54,13 @@ ARM PRESERVE8 - INCLUDE qdrawhelper_armv6_rvct.inc + INCLUDE qdrawhelper_armv6_rvct.inc ;----------------------------------------------------------------------------- ; qt_blend_rgb32_on_rgb32_arm -; -; @brief +; +; @brief ; ; @param dest Destination pixels (r0) ; @param dbpl Destination bytes per line (r1) @@ -69,25 +69,25 @@ ; @param w Width (s0 -> r4) ; @param h Height (s1 -> r5) ; @param const_alpha Constant alpha (s2 -> r6) -; +; ;--------------------------------------------------------------------------- qt_blend_rgb32_on_rgb32_armv6 Function stmfd sp!, {r4-r12, r14} - + ; read arguments off the stack add r8, sp, #10 * 4 ldmia r8, {r9-r11} - + ; Reorganize registers - + mov r4, r10 mov r5, r1 mov r6, r3 - + mov r1, r2 mov r2, r9 mov r3, r11 - + ; Now we have registers ; @param dest Destination pixels (r0) ; @param src Source pixels (r1) @@ -96,53 +96,53 @@ qt_blend_rgb32_on_rgb32_armv6 Function ; @param h Height (r4) ; @param dbpl Destination bytes per line (r5) ; @param sbpl Source bytes per line (r6) - + cmp r3, #256 ; test if we have fully opaque constant alpha value bne rgb32_blend_const_alpha ; branch if not - + rgb32_blend_loop subs r4, r4, #1 bmi rgb32_blend_exit ; while(h--) - -rgb321 PixCpySafe r0, r1, r2 + +rgb321 PixCpySafe r0, r1, r2 add r0, r0, r5 ; dest = dest + dbpl - add r1, r1, r6 ; src = src + sbpl + add r1, r1, r6 ; src = src + sbpl + + b rgb32_blend_loop + - b rgb32_blend_loop - - rgb32_blend_const_alpha ;ldr r14, =ComponentHalf ; load 0x800080 to r14 mov r14, #0x800000 add r14, r14, #0x80 - + sub r3, r3, #1 ; const_alpha -= 1; rgb32_blend_loop_const_alpha subs r4, r4, #1 bmi rgb32_blend_exit ; while(h--) - + rgb322 BlendRowSafe PixelSourceOverConstAlpha add r0, r0, r5 ; dest = dest + dbpl - add r1, r1, r6 ; src = src + sbpl + add r1, r1, r6 ; src = src + sbpl b rgb32_blend_loop_const_alpha - -rgb32_blend_exit - + +rgb32_blend_exit + ldmfd sp!, {r4-r12, pc} ; pop and return - - - + + + ;----------------------------------------------------------------------------- ; qt_blend_argb32_on_argb32_arm -; -; @brief +; +; @brief ; ; @param dest Destination pixels (r0) ; @param dbpl Destination bytes per line (r1) @@ -151,25 +151,25 @@ rgb32_blend_exit ; @param w Width (s0 -> r4) ; @param h Height (s1 -> r5) ; @param const_alpha Constant alpha (s2 -> r6) -; +; ;--------------------------------------------------------------------------- qt_blend_argb32_on_argb32_armv6 Function stmfd sp!, {r4-r12, r14} - + ; read arguments off the stack add r8, sp, #10 * 4 ldmia r8, {r9-r11} - + ; Reorganize registers - + mov r4, r10 mov r5, r1 mov r6, r3 - + mov r1, r2 mov r2, r9 mov r3, r11 - + ; Now we have registers ; @param dest Destination pixels (r0) ; @param src Source pixels (r1) @@ -178,14 +178,14 @@ qt_blend_argb32_on_argb32_armv6 Function ; @param h Height (r4) ; @param dbpl Destination bytes per line (r5) ; @param sbpl Source bytes per line (r6) - + ;ldr r14, =ComponentHalf ; load 0x800080 to r14 mov r14, #0x800000 add r14, r14, #0x80 - + cmp r3, #256 ; test if we have fully opaque constant alpha value bne argb32_blend_const_alpha ; branch if not - + argb32_blend_loop subs r4, r4, #1 @@ -194,10 +194,10 @@ argb32_blend_loop argb321 BlendRowSafe PixelSourceOver add r0, r0, r5 ; dest = dest + dbpl - add r1, r1, r6 ; src = src + sbpl + add r1, r1, r6 ; src = src + sbpl b argb32_blend_loop - + argb32_blend_const_alpha sub r3, r3, #1 ; const_alpha -= 1; @@ -206,18 +206,17 @@ argb32_blend_loop_const_alpha subs r4, r4, #1 bmi argb32_blend_exit ; while(h--) - + argb322 BlendRowSafe PixelSourceOverConstAlpha add r0, r0, r5 ; dest = dest + dbpl - add r1, r1, r6 ; src = src + sbpl + add r1, r1, r6 ; src = src + sbpl b argb32_blend_loop_const_alpha - -argb32_blend_exit - + +argb32_blend_exit + ldmfd sp!, {r4-r12, pc} ; pop and return - - + + END ; File end - diff --git a/src/gui/painting/qcolormap_s60.cpp b/src/gui/painting/qcolormap_s60.cpp index 1b58598..29d340f 100644 --- a/src/gui/painting/qcolormap_s60.cpp +++ b/src/gui/painting/qcolormap_s60.cpp @@ -105,4 +105,3 @@ QColormap &QColormap::operator=(const QColormap &colormap) { qAtomicAssign(d, colormap.d); return *this; } QT_END_NAMESPACE - diff --git a/src/gui/painting/qdrawhelper_armv6_rvct.inc b/src/gui/painting/qdrawhelper_armv6_rvct.inc index b3e0605..1cb316a 100644 --- a/src/gui/painting/qdrawhelper_armv6_rvct.inc +++ b/src/gui/painting/qdrawhelper_armv6_rvct.inc @@ -52,10 +52,10 @@ ;----------------------------------------------------------------------------- ; Globals. -; Earch marcro expects that caller has loaded 0x800080 to r14. +; Earch marcro expects that caller has loaded 0x800080 to r14. ;----------------------------------------------------------------------------- -ComponentHalf EQU 0x800080 +ComponentHalf EQU 0x800080 ;----------------------------------------------------------------------------- ; ARM assembly implementations of accelerated graphics operations. @@ -65,7 +65,7 @@ ComponentHalf EQU 0x800080 ; - r0 = Target buffer pointer ; - r1 = Source buffer pointer ; - r2 = Length of the buffer to blend -; - r3 = Constant alpha for source buffer +; - r3 = Constant alpha for source buffer ; ;----------------------------------------------------------------------------- @@ -78,8 +78,8 @@ $func Function CODE32 $func MEND - - + + ;----------------------------------------------------------------------------- ; Armv6 boosted implementation of BYTE_MUL(...) function found in qdrawhelper_p.h. ; @@ -98,29 +98,29 @@ $func ; uint r8 = (x & 0xff00ff) * a + 0x800080 uxtb16 r8, $x ; r8 = r8 & 0x00FF00FF mla r8, r8, $a, r14 - + ; x = ((r >> 8) & 0xff00ff) * a + 0x800080 uxtb16 $x, $x, ror #8 mla $x, $x, $a, r14 - + ; r8 = (r8 + ((r8 >> 8) & 0xff00ff) ) >> 8 ; r8 &= 0xff00ff uxtab16 r8, r8, r8, ror #8 uxtb16 r8, r8, ror #8 - + ; x = x + ((x >>8) & 0xff00ff) uxtab16 $x, $x, $x, ror #8 - + ; x &= 0xff00ff00 ; x |= r8 uxtb16 $x, $x, ror #8 orr $dst, r8, $x, lsl #8 - + MEND - + ;----------------------------------------------------------------------------- -; Armv6 boosted implementation of INTERPOLATE_PIXEL_255(...) function found in +; Armv6 boosted implementation of INTERPOLATE_PIXEL_255(...) function found in ; qdrawhelper_p.h. ; ; @param dst Destination register where to store the result @@ -129,7 +129,7 @@ $func ; @param y Second value to multiply ; @param b Multiplicator byte for second value ; @param r14 Component half 0x800080 -; +; ; ; @note Trashes x, r8, r14 ;----------------------------------------------------------------------------- @@ -143,40 +143,40 @@ $func ; uint r8 = (((x & 0xff00ff) * a) + 0x800080) uxtb16 r8, $x ; r8 = r8 & 0x00FF00FF mla r8, r8, $a, r14 - + ; x = ((((x >> 8) & 0xff00ff) * a) + 0x800080) uxtb16 $x, $x, ror #8 mla $x, $x, $a, r14 - + ; Now we are trashing r14 to free it for other purposes - + ; uint r14 = (y & 0xff00ff) * b uxtb16 r14, $y ; r14 = y & 0x00FF00FF mul r14, r14, $b - + ; r8 = r8 + r14 add r8, r8, r14 - + ; r8 = (r8 + ((r8 >> 8) & 0xff00ff) ) >> 8 ; r8 &= 0xff00ff uxtab16 r8, r8, r8, ror #8 uxtb16 r8, r8, ror #8 - + ; r14 = ((y >> 8) & 0xff00ff) * b uxtb16 r14, $y, ror #8 ; r14 = ((y >> 8) & 0xFF00FF) mul r14, r14, $b - + ; x = x + r14 add $x, $x, r14 - + ; x = x + ((x >>8) & 0xff00ff) uxtab16 $x, $x, $x, ror #8 - + ; x &= 0xff00ff00 ; x |= r8 uxtb16 $x, $x, ror #8 orr $dst, r8, $x, lsl #8 - + MEND ;----------------------------------------------------------------------------- @@ -184,19 +184,19 @@ $func ;----------------------------------------------------------------------------- MACRO $label Blend4Pixels $BlendPixel - - ; Blend first 4 pixels - + + ; Blend first 4 pixels + ldmia r1!, {r4-r7} ldm r0, {r9-r12} - + b4p1_$label $BlendPixel r9, r4, r3 b4p2_$label $BlendPixel r10, r5, r3 b4p3_$label $BlendPixel r11, r6, r3 b4p4_$label $BlendPixel r12, r7, r3 - + stmia r0!, {r9-r12} - + MEND ;----------------------------------------------------------------------------- @@ -204,43 +204,43 @@ b4p4_$label $BlendPixel r12, r7, r3 ;----------------------------------------------------------------------------- MACRO $label Blend8Pixels $BlendPixel - + b8p1_$label Blend4Pixels $BlendPixel -b8p2_$label Blend4Pixels $BlendPixel - +b8p2_$label Blend4Pixels $BlendPixel + MEND - + ;----------------------------------------------------------------------------- ; ;----------------------------------------------------------------------------- MACRO $label Blend16Pixels $BlendPixel - + b16p1_$label Blend8Pixels $BlendPixel -b16p2_$label Blend8Pixels $BlendPixel - +b16p2_$label Blend8Pixels $BlendPixel + MEND - + ;----------------------------------------------------------------------------- ; ;----------------------------------------------------------------------------- MACRO $label Blend32Pixels $BlendPixel - + b32p1_$label Blend16Pixels $BlendPixel -b32p2_$label Blend16Pixels $BlendPixel - +b32p2_$label Blend16Pixels $BlendPixel + MEND ;----------------------------------------------------------------------------- -; A macro for source over compositing one row of pixels and saving the results +; A macro for source over compositing one row of pixels and saving the results ; to destination buffer. ; ; @param dest Destination buffer (r0) ; @param src Source buffer (r1) ; @param length Length (r2) ; @param const_alpha Constant alpha (r3) -; @param r14 Component Half (0x800080) (r14) +; @param r14 Component Half (0x800080) (r14) ; ; @note Advances r0, r1 ; @note Trashes r2, r4-r12 @@ -260,73 +260,73 @@ brp1_$label Blend32Pixels $BlendPixel b bloop_$label b_remaining_$label - + ; Remaining 31 pixels - + addmi r2, r2, #32 ; Blend 16 pixels tst r2, #16 beq b_remaining8_$label - + brp2_$label Blend16Pixels $BlendPixel - -b_remaining8_$label - + +b_remaining8_$label + ; Blend 8 pixels tst r2, #8 beq b_remaining4_$label - -brp3_$label Blend8Pixels $BlendPixel - -b_remaining4_$label - + +brp3_$label Blend8Pixels $BlendPixel + +b_remaining4_$label + ; Blend 4 pixels tst r2, #4 beq b_remaining3_$label - -brp4_$label Blend4Pixels $BlendPixel + +brp4_$label Blend4Pixels $BlendPixel b_remaining3_$label ; Remaining 3 pixels - + tst r2, #2 beq b_last_$label - + ldmia r1!, {r4-r5} ldm r0, {r9-r10} - + brp5_$label $BlendPixel r9, r4, r3 brp6_$label $BlendPixel r10, r5, r3 - + stmia r0!, {r9-r10} b_last_$label - + tst r2, #1 beq bexit_$label - + ldr r4, [r1] ldr r9, [r0] bpl_$label $BlendPixel r9, r4, r3 - + str r9, [r0] bexit_$label MEND - + ;----------------------------------------------------------------------------- -; A macro for source over compositing one row of pixels and saving the results +; A macro for source over compositing one row of pixels and saving the results ; to destination buffer. Restores all registers. ; ; @param dest Destination buffer (r0) ; @param src Source buffer (r1) ; @param length Length (r2) ; @param const_alpha Constant alpha (r3) -; @param r14 Component Half (0x800080) (r14) +; @param r14 Component Half (0x800080) (r14) ; ; @note Advances r0, r1 ; @note Trashes r2, r4-r12 @@ -336,16 +336,16 @@ $label BlendRowSafe $BlendPixel stmfd sp!, {r0-r6} ; Preserves registers only up to r6 -brs_$label BlendRow $BlendPixel +brs_$label BlendRow $BlendPixel ldmfd sp!, {r0-r6} - MEND - + MEND + ;----------------------------------------------------------------------------- -; Pix Copy. -; NOTE! Cache line size of ARM1136JF-S and ARM1136J-S is 32 bytes (8 pixels). +; Pix Copy. +; NOTE! Cache line size of ARM1136JF-S and ARM1136J-S is 32 bytes (8 pixels). ; ; @param dst Destination pixels (r0) ; @param src Source pixels (r1) @@ -369,7 +369,7 @@ pcpy_loop_$label pcpy_remaining_$label ; Copy up to 7 remaining pixels - + ; Copy 4 pixels tst $len, #4 ldmneia $src!, {r3-r6} @@ -384,9 +384,9 @@ pcpy_remaining_$label strne r3, [$dst] MEND - + ;----------------------------------------------------------------------------- -; General Pix Copy. Maximum 8 pixels at time. Restores all registers. +; General Pix Copy. Maximum 8 pixels at time. Restores all registers. ; ; @param dst Destination pixels (r0) ; @param src Source pixels (r1) @@ -402,10 +402,10 @@ $label PixCpySafe $dst, $src, $len pcs_$label PixCpy $dst, $src, $len ldmfd sp!, {r0-r6} ; pop - + MEND - - + + ;----------------------------------------------------------------------------- ; A macro for source over compositing one pixel and saving the result to ; dst register. @@ -422,7 +422,7 @@ $label PixelSourceOver $dst, $src, $const_alpha ; Negate src and extract alpha mvn $const_alpha, $src ; bitwise not - uxtb $const_alpha, $const_alpha, ror #24 ; r3 = ((r3 & 0xFF000000) >> 24); + uxtb $const_alpha, $const_alpha, ror #24 ; r3 = ((r3 & 0xFF000000) >> 24); ;cmp $const_alpha, #255 ; test for full transparency ( negated ) ;beq exit_$label @@ -430,12 +430,12 @@ $label PixelSourceOver $dst, $src, $const_alpha moveq $dst, $src beq exit_$label - ByteMul $dst, $dst, $const_alpha + ByteMul $dst, $dst, $const_alpha add $dst, $src, $dst - + exit_$label MEND - + ;----------------------------------------------------------------------------- ; A macro for source over compositing one pixel and saving the result to ; dst register. @@ -457,7 +457,7 @@ $label PixelSourceOverConstAlpha $dst, $src, $const_alpha ; Negate src and extract alpha mvn $const_alpha, $src ; bitwise not - uxtb $const_alpha, $const_alpha, ror #24 ; r3 = ((r3 & 0xFF000000) >> 24); + uxtb $const_alpha, $const_alpha, ror #24 ; r3 = ((r3 & 0xFF000000) >> 24); ByteMul $dst, $dst, $const_alpha @@ -466,8 +466,8 @@ $label PixelSourceOverConstAlpha $dst, $src, $const_alpha ; recover alpha ldmfd sp!, {$const_alpha} - MEND - + MEND + ;----------------------------------------------------------------------------- ; A macro for source over compositing one pixel and saving the result to ; a register. @@ -491,6 +491,6 @@ $label PixelSourceConstAlpha $dst, $src, $const_alpha ; recover r2 and r14 ldmfd sp!, {r2, r14} - MEND - + MEND + END ; File end diff --git a/src/gui/painting/qdrawhelper_armv6_rvct.s b/src/gui/painting/qdrawhelper_armv6_rvct.s index 3ffe48b..dd29f80 100644 --- a/src/gui/painting/qdrawhelper_armv6_rvct.s +++ b/src/gui/painting/qdrawhelper_armv6_rvct.s @@ -52,22 +52,22 @@ ARM PRESERVE8 - + INCLUDE qdrawhelper_armv6_rvct.inc - + ;----------------------------------------------------------------------------- ; qt_memfill32_armv6 -; +; ; @brief Not yet in use! ; ; @param dest Destination buffer (r0) ; @param value Value (r1) ; @param count Count (r2) -; +; ;--------------------------------------------------------------------------- qt_memfill32_armv6 Function stmfd sp!, {r4-r12, r14} - + mov r3, r1 mov r4, r1 mov r5, r1 @@ -75,7 +75,7 @@ qt_memfill32_armv6 Function mov r7, r1 mov r8, r1 mov r9, r1 - + mfill_loop ; Fill 32 pixels per loop iteration subs r2, r2, #32 @@ -88,16 +88,16 @@ mfill_loop mfill_remaining ; Fill up to 31 remaining pixels - + ; Fill 16 pixels tst r2, #16 stmneia r0!, {r1, r3, r4, r5, r6, r7, r8, r9} stmneia r0!, {r1, r3, r4, r5, r6, r7, r8, r9} - + ; Fill 8 pixels tst r2, #8 stmneia r0!, {r1, r3, r4, r5, r6, r7, r8, r9} - + ; Fill 4 pixels tst r2, #4 stmneia r0!, {r1, r3, r4, r5} @@ -109,31 +109,31 @@ mfill_remaining ; Fill last one tst r2, #1 strne r1, [r0] - + ldmfd sp!, {r4-r12, pc} ; pop and return - + ;----------------------------------------------------------------------------- ; comp_func_Source_arm -; -; @brief +; +; @brief ; ; @param dest Destination buffer (r0) ; @param src Source buffer (r1) ; @param length Length (r2) ; @param const_alpha Constant alpha (r3) -; +; ;--------------------------------------------------------------------------- comp_func_Source_armv6 Function stmfd sp!, {r4-r12, r14} - + cmp r3, #255 ; if(r3 == 255) bne src2 ; branch if not - + src1 PixCpy r0, r1, r2 ldmfd sp!, {r4-r12, pc} ; pop and return -src2 +src2 ;ldr r14, =ComponentHalf ; load 0x800080 to r14 mov r14, #0x800000 add r14, r14, #0x80 @@ -144,35 +144,34 @@ src22 BlendRow PixelSourceConstAlpha ;----------------------------------------------------------------------------- ; comp_func_SourceOver_arm -; -; @brief +; +; @brief ; ; @param dest Destination buffer (r0) ; @param src Source buffer (r1) ; @param length Length (r2) ; @param const_alpha Constant alpha (r3) -; +; ;--------------------------------------------------------------------------- comp_func_SourceOver_armv6 Function stmfd sp!, {r4-r12, r14} - + ;ldr r14, =ComponentHalf ; load 0x800080 to r14 mov r14, #0x800000 add r14, r14, #0x80 - + cmp r3, #255 ; if(r3 == 255) bne srcovr2 ; branch if not - + srcovr1 BlendRow PixelSourceOver - + ldmfd sp!, {r4-r12, pc} ; pop and return srcovr2 - + srcovr22 BlendRow PixelSourceOverConstAlpha ldmfd sp!, {r4-r12, pc} ; pop and return - - END ; File end - + + END ; File end diff --git a/src/gui/painting/qwindowsurface_s60_p.h b/src/gui/painting/qwindowsurface_s60_p.h index 40a866d..6a31ced 100644 --- a/src/gui/painting/qwindowsurface_s60_p.h +++ b/src/gui/painting/qwindowsurface_s60_p.h @@ -81,7 +81,7 @@ public: static void unlockBitmapHeap(); CFbsBitmap *symbianBitmap() const; - + private: void updatePaintDeviceOnBitmap(); diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 888a6ed..0277d2f 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -280,7 +280,7 @@ void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter, break; case SE_Editor: drawFrame(SF_Editor, painter, rect, flags | SF_PointNorth); - break; + break; default: break; } @@ -796,12 +796,12 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0)); QApplication::setPalette(widgetPalette, "QTextEdit"); widgetPalette = *palette; - + widgetPalette.setColor(QPalette::All, QPalette::HighlightedText, s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0)); QApplication::setPalette(widgetPalette, "QComboBox"); widgetPalette = *palette; - + widgetPalette.setColor(QPalette::WindowText, mainAreaTextColor); widgetPalette.setColor(QPalette::Button, QApplication::palette().color(QPalette::Button)); widgetPalette.setColor(QPalette::Dark, mainAreaTextColor.darker()); diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 2eb40de..4bf8143 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -270,7 +270,7 @@ public: SP_QsnFrButtonSideBInactive, SP_QsnFrButtonSideLInactive, SP_QsnFrButtonSideRInactive, - SP_QsnFrButtonCenterInactive, + SP_QsnFrButtonCenterInactive, SP_QsnFrNotepadCornerTl, SP_QsnFrNotepadCornerTr, SP_QsnFrNotepadCornerBl, diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 81ee8b1..f304d14 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -80,7 +80,7 @@ enum TSupportRelease { ES60_5_1 = 0x0008, ES60_5_2 = 0x0010, // Add all new releases here - ES60_AllReleases = ES60_3_1 | ES60_3_2 | ES60_5_0 | ES60_5_1 | ES60_5_2 + ES60_AllReleases = ES60_3_1 | ES60_3_2 | ES60_5_0 | ES60_5_1 | ES60_5_2 }; typedef struct { @@ -317,7 +317,7 @@ const partMapEntry QS60StyleModeSpecifics::m_partMap[] = { /* SP_QsnFrButtonSideBInactive */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b6}, /* SP_QsnFrButtonSideLInactive */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b7}, /* SP_QsnFrButtonSideRInactive */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b8}, - /* SP_QsnFrButtonCenterInactive */ {KAknsIIDQsnFrButtonTbCenter, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b9}, + /* SP_QsnFrButtonCenterInactive */ {KAknsIIDQsnFrButtonTbCenter, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b9}, /* SP_QsnFrNotepadCornerTl */ {KAknsIIDQsnFrNotepadContCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, /* SP_QsnFrNotepadCornerTr */ {KAknsIIDQsnFrNotepadContCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp index 6838d17..8176009 100644 --- a/src/gui/text/qfontdatabase_s60.cpp +++ b/src/gui/text/qfontdatabase_s60.cpp @@ -69,7 +69,7 @@ QFileInfoList alternativeFilePaths(const QString &path, const QStringList &nameF const QString zDriveString("Z:/"); driveStrings.removeAll(zDriveString); driveStrings.prepend(zDriveString); - + QStringList uniqueFileNameList; for (int i = driveStrings.count() - 1; i >= 0; --i) { const QDir dirOnDrive(driveStrings.at(i) + path); @@ -393,7 +393,7 @@ void QFontDatabase::load(const QFontPrivate *d, int script) { QFontEngine *fe = 0; QFontDef req = d->request; - + if (!d->engineData) { const QFontCache::Key key(cleanedFontDef(req), script); getEngineData(d, key); diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp index eb2d92e..18a0a73 100644 --- a/src/gui/util/qdesktopservices.cpp +++ b/src/gui/util/qdesktopservices.cpp @@ -287,10 +287,10 @@ void QDesktopServices::unsetUrlHandler(const QString &scheme) \note The storage location returned can be a directory that does not exist; i.e., it may need to be created by the system or the user. - + \note On Symbian OS, DataLocation and ApplicationsLocation always point to appropriate folder on same drive with executable. FontsLocation always points to folder on ROM drive. - Rest of the standard locations point to folder on same drive with executable, except + Rest of the standard locations point to folder on same drive with executable, except that if executable is in ROM the folder from C drive is returned. \note On Mac OS X, DataLocation does not include QCoreApplication::organizationName. diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp index 567b4ee..565dd6e 100644 --- a/src/gui/util/qdesktopservices_s60.cpp +++ b/src/gui/util/qdesktopservices_s60.cpp @@ -113,9 +113,9 @@ static void handleMailtoSchemeLX(const QUrl &url) QStringList bccs = bcc.split(",", QString::SkipEmptyParts); - RSendAs sendAs; - User::LeaveIfError(sendAs.Connect()); - QAutoClose<RSendAs> sendAsCleanup(sendAs); + RSendAs sendAs; + User::LeaveIfError(sendAs.Connect()); + QAutoClose<RSendAs> sendAsCleanup(sendAs); CSendAsAccounts* accounts = CSendAsAccounts::NewL(); @@ -124,43 +124,43 @@ static void handleMailtoSchemeLX(const QUrl &url) TInt count = accounts->Count(); CleanupStack::PopAndDestroy(accounts); - if(!count) { + if(!count) { // TODO: we should try to create account if count == 0 // CSendUi would provide account creation service for us, but it requires ridicilous // capabilities: LocalServices NetworkServices ReadDeviceData ReadUserData WriteDeviceData WriteUserData - User::Leave(KErrNotSupported); - } else { - RSendAsMessage sendAsMessage; + User::Leave(KErrNotSupported); + } else { + RSendAsMessage sendAsMessage; sendAsMessage.CreateL(sendAs, KUidMsgTypeSMTP); QAutoClose<RSendAsMessage> sendAsMessageCleanup(sendAsMessage); - - + + // Subject sendAsMessage.SetSubjectL(qt_QString2TPtrC(subject)); - + // Body sendAsMessage.SetBodyTextL(qt_QString2TPtrC(body)); - + // To foreach(QString item, recipients) sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo ); - + foreach(QString item, tos) sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo ); - + // Cc foreach(QString item, ccs) sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientCc ); - + // Bcc foreach(QString item, bccs) sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientBcc ); - + // send the message sendAsMessage.LaunchEditorAndCloseL(); // sendAsMessage is already closed sendAsMessageCleanup.Forget(); - } + } } static bool handleMailtoScheme(const QUrl &url) @@ -172,9 +172,9 @@ static bool handleMailtoScheme(const QUrl &url) static void handleOtherSchemesL(const TDesC& aUrl) { // Other schemes are at the moment passed to WEB browser - HBufC* buf16 = HBufC::NewLC( aUrl.Length() + KBrowserPrefix.iTypeLength ); - buf16->Des().Copy( KBrowserPrefix ); // Prefix used to launch correct browser view - buf16->Des().Append( aUrl ); + HBufC* buf16 = HBufC::NewLC( aUrl.Length() + KBrowserPrefix.iTypeLength ); + buf16->Des().Copy( KBrowserPrefix ); // Prefix used to launch correct browser view + buf16->Des().Append( aUrl ); TApaTaskList taskList( CEikonEnv::Static()->WsSession() ); TApaTask task = taskList.FindApp( KUidBrowser ); @@ -189,12 +189,12 @@ static void handleOtherSchemesL(const TDesC& aUrl) else { // Start a new browser instance - RApaLsSession appArcSession; - User::LeaveIfError( appArcSession.Connect() ); - CleanupClosePushL<RApaLsSession>( appArcSession ); - TThreadId id; + RApaLsSession appArcSession; + User::LeaveIfError( appArcSession.Connect() ); + CleanupClosePushL<RApaLsSession>( appArcSession ); + TThreadId id; appArcSession.StartDocument( *buf16, KUidBrowser , id ); - CleanupStack::PopAndDestroy(); // appArcSession + CleanupStack::PopAndDestroy(); // appArcSession } CleanupStack::PopAndDestroy( buf16 ); @@ -255,8 +255,8 @@ static void openDocumentL(const TDesC& aUrl) { #ifndef USE_DOCUMENTHANDLER // Start app associated to file MIME type by using RApaLsSession - // Apparc base method cannot be used to open app in embedded mode, - // but seems to be most stable way at the moment + // Apparc base method cannot be used to open app in embedded mode, + // but seems to be most stable way at the moment RApaLsSession appArcSession; User::LeaveIfError( appArcSession.Connect() ); CleanupClosePushL<RApaLsSession>( appArcSession ); @@ -264,25 +264,25 @@ static void openDocumentL(const TDesC& aUrl) // ESwitchFiles means do not start another instance // Leaves if file does not exist, leave is trapped in openDocument and false returned to user. User::LeaveIfError( appArcSession.StartDocument( aUrl, id, - RApaLsSession::ESwitchFiles ) ); // ELaunchNewApp + RApaLsSession::ESwitchFiles ) ); // ELaunchNewApp CleanupStack::PopAndDestroy(); // appArcSession #else // This is an alternative way to launch app associated to MIME type - // CDocumentHandler would support opening apps in embedded mode, - // but our Qt application window group seems to always get switched on top of embedded one - // -> Cannot use menus etc of embedded app -> used - - CDocumentHandler* docHandler = CDocumentHandler::NewLC(); - TDataType temp; - //Standalone file opening fails for some file-types at least in S60 3.1 emulator - //For example .txt file fails with KErrAlreadyInUse and music files with KERN-EXEC 0 - //Workaround is to use OpenFileEmbeddedL - //docHandler->OpenFileL(aUrl, temp); - - // Opening file with CDocumentHandler will leave if file does not exist - // Leave is trapped in openDocument and false returned to user. - docHandler->OpenFileEmbeddedL(aUrl, temp); - CleanupStack::PopAndDestroy(docHandler); + // CDocumentHandler would support opening apps in embedded mode, + // but our Qt application window group seems to always get switched on top of embedded one + // -> Cannot use menus etc of embedded app -> used + + CDocumentHandler* docHandler = CDocumentHandler::NewLC(); + TDataType temp; + //Standalone file opening fails for some file-types at least in S60 3.1 emulator + //For example .txt file fails with KErrAlreadyInUse and music files with KERN-EXEC 0 + //Workaround is to use OpenFileEmbeddedL + //docHandler->OpenFileL(aUrl, temp); + + // Opening file with CDocumentHandler will leave if file does not exist + // Leave is trapped in openDocument and false returned to user. + docHandler->OpenFileEmbeddedL(aUrl, temp); + CleanupStack::PopAndDestroy(docHandler); #endif } @@ -295,8 +295,8 @@ static void openDocumentL(const TDesC& aUrl) // wide range of schemes and is extensible by plugins static bool handleUrl(const QUrl &url) { - if (!url.isValid()) - return false; + if (!url.isValid()) + return false; QString urlString(url.toString()); TPtrC urlPtr(qt_QString2TPtrC(urlString)); @@ -313,12 +313,12 @@ static void handleUrlL(const TDesC& aUrl) } static bool launchWebBrowser(const QUrl &url) { - return handleUrl(url); + return handleUrl(url); } static bool openDocument(const QUrl &file) { - return handleUrl(url); + return handleUrl(url); } #endif @@ -391,7 +391,7 @@ QString QDesktopServices::storageLocation(StandardLocation type) //return QDir::homePath(); break; break; case DataLocation: - CEikonEnv::Static()->FsSession().PrivatePath( path ); + CEikonEnv::Static()->FsSession().PrivatePath( path ); // TODO: Should we actually return phone mem if data is on ROM? path.Insert( 0, exeDrive().Name() ); break; diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index 5207cc6..1b21b71 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -87,7 +87,7 @@ bool menuExists() { QWidget *w = qApp->activeWindow(); QMenuBarPrivate *mb = menubars()->value(w); - if ((!mb) && !menubars()->count()) + if ((!mb) && !menubars()->count()) return false; return true; } @@ -196,7 +196,7 @@ static void qt_symbian_insert_action(QSymbianMenuAction* action, QList<SymbianMe if (!action->action->isEnabled()){ menuItem->menuItemData.iFlags += EEikMenuItemDimmed; } - + if (action->action->isCheckable()) { if (action->action->isChecked()) menuItem->menuItemData.iFlags += EEikMenuItemCheckBox | EEikMenuItemSymbolOn; @@ -244,7 +244,7 @@ Q_GUI_EXPORT void qt_symbian_show_toplevel( CEikMenuPane* menuPane) return; rebuildMenu(); for (int i = 0; i < symbianMenus.count(); ++i) - QT_TRAP_THROWING(menuPane->AddMenuItemL(symbianMenus.at(i)->menuItemData)); + QT_TRAP_THROWING(menuPane->AddMenuItemL(symbianMenus.at(i)->menuItemData)); } Q_GUI_EXPORT void qt_symbian_show_submenu( CEikMenuPane* menuPane, int id) @@ -252,7 +252,7 @@ Q_GUI_EXPORT void qt_symbian_show_submenu( CEikMenuPane* menuPane, int id) SymbianMenuItem* menu = qt_symbian_find_menu(id, symbianMenus); if (menu) { for (int i = 0; i < menu->children.count(); ++i) - QT_TRAP_THROWING(menuPane->AddMenuItemL(menu->children.at(i)->menuItemData)); + QT_TRAP_THROWING(menuPane->AddMenuItemL(menu->children.at(i)->menuItemData)); } } @@ -262,7 +262,7 @@ void QMenuBarPrivate::symbianCommands(int command) QContextMenuEvent* event = new QContextMenuEvent(QContextMenuEvent::Keyboard, QPoint(0,0)); QCoreApplication::postEvent(widgetWithContextMenu, event); } - + int size = nativeMenuBars.size(); for (int i = 0; i < nativeMenuBars.size(); ++i) { SymbianMenuItem* menu = qt_symbian_find_menu_item(command, symbianMenus); diff --git a/src/network/kernel/qnetworkinterface_symbian.cpp b/src/network/kernel/qnetworkinterface_symbian.cpp index bec2dc3..f2ded36 100644 --- a/src/network/kernel/qnetworkinterface_symbian.cpp +++ b/src/network/kernel/qnetworkinterface_symbian.cpp @@ -41,12 +41,8 @@ //#define QNETWORKINTERFACE_DEBUG -//#include "qset.h" #include "qnetworkinterface.h" #include "qnetworkinterface_p.h" -//#include <private/qnativesocketengine_p.h> -//#include "qalgorithms.h" - #ifndef QT_NO_NETWORKINTERFACE @@ -54,57 +50,49 @@ #include <in_iface.h> #include <es_sock.h> -//#include <sys/types.h> -//#include <sys/socket.h> -//#include <errno.h> -//#include <net/if.h> -//#include <qplatformdefs.h> - QT_BEGIN_NAMESPACE -static QNetworkInterface::InterfaceFlags convertFlags( const TSoInetInterfaceInfo& aInfo ) +static QNetworkInterface::InterfaceFlags convertFlags(const TSoInetInterfaceInfo& aInfo) { QNetworkInterface::InterfaceFlags flags = 0; flags |= (aInfo.iState == EIfUp) ? QNetworkInterface::IsUp : QNetworkInterface::InterfaceFlag(0); // We do not have separate flag for running in Symbian OS flags |= (aInfo.iState == EIfUp) ? QNetworkInterface::IsRunning : QNetworkInterface::InterfaceFlag(0); - flags |= (aInfo.iFeatures&KIfCanBroadcast) ? QNetworkInterface::CanBroadcast : QNetworkInterface::InterfaceFlag(0); - flags |= (aInfo.iFeatures&KIfIsLoopback) ? QNetworkInterface::IsLoopBack : QNetworkInterface::InterfaceFlag(0); - flags |= (aInfo.iFeatures&KIfIsPointToPoint) ? QNetworkInterface::IsPointToPoint : QNetworkInterface::InterfaceFlag(0); - flags |= (aInfo.iFeatures&KIfCanMulticast) ? QNetworkInterface::CanMulticast : QNetworkInterface::InterfaceFlag(0); + flags |= (aInfo.iFeatures & KIfCanBroadcast) ? QNetworkInterface::CanBroadcast : QNetworkInterface::InterfaceFlag(0); + flags |= (aInfo.iFeatures & KIfIsLoopback) ? QNetworkInterface::IsLoopBack : QNetworkInterface::InterfaceFlag(0); + flags |= (aInfo.iFeatures & KIfIsPointToPoint) ? QNetworkInterface::IsPointToPoint : QNetworkInterface::InterfaceFlag(0); + flags |= (aInfo.iFeatures & KIfCanMulticast) ? QNetworkInterface::CanMulticast : QNetworkInterface::InterfaceFlag(0); return flags; } -QString qstringFromDesc( const TDesC& aData ) +QString qstringFromDesc(const TDesC& aData) { return QString::fromUtf16(aData.Ptr(), aData.Length()); } static QList<QNetworkInterfacePrivate *> interfaceListing() { - TInt err( KErrNone ); + TInt err(KErrNone); QList<QNetworkInterfacePrivate *> interfaces; // Connect to Native socket server RSocketServ socketServ; err = socketServ.Connect(); - if( err ) + if (err) return interfaces; // Open dummy socket for interface queries RSocket socket; - err = socket.Open( socketServ, _L("udp")); - if( err ) - { + err = socket.Open(socketServ, _L("udp")); + if (err) { socketServ.Close(); return interfaces; } // Ask socket to start enumerating interfaces - err = socket.SetOpt( KSoInetEnumInterfaces, KSolInetIfCtrl ); - if( err ) - { + err = socket.SetOpt(KSoInetEnumInterfaces, KSolInetIfCtrl); + if (err) { socket.Close(); socketServ.Close(); return interfaces; @@ -113,11 +101,9 @@ static QList<QNetworkInterfacePrivate *> interfaceListing() int ifindex = 0; TPckgBuf<TSoInetInterfaceInfo> infoPckg; TSoInetInterfaceInfo &info = infoPckg(); - while( socket.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, infoPckg) == KErrNone ) - { + while (socket.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, infoPckg) == KErrNone) { // Do not include IPv6 addresses because netmask and broadcast address cannot be determined correctly - if( info.iName != KNullDesC && info.iAddress.IsV4Mapped() ) - { + if (info.iName != KNullDesC && info.iAddress.IsV4Mapped()) { TName address; QNetworkAddressEntry entry; QNetworkInterfacePrivate *iface = 0; @@ -125,51 +111,48 @@ static QList<QNetworkInterfacePrivate *> interfaceListing() iface = new QNetworkInterfacePrivate; iface->index = ifindex++; interfaces << iface; - iface->name = qstringFromDesc( info.iName ); - iface->flags = convertFlags( info ); + iface->name = qstringFromDesc(info.iName); + iface->flags = convertFlags(info); - if( /*info.iFeatures&KIfHasHardwareAddr &&*/ info.iHwAddr.Family() != KAFUnspec ) - { - for ( TInt i = sizeof(SSockAddr); i < sizeof(SSockAddr) + info.iHwAddr.GetUserLen(); i++ ) - { + if (/*info.iFeatures&KIfHasHardwareAddr &&*/ info.iHwAddr.Family() != KAFUnspec) { + for (TInt i = sizeof(SSockAddr); i < sizeof(SSockAddr) + info.iHwAddr.GetUserLen(); i++) { address.AppendNumFixedWidth(info.iHwAddr[i], EHex, 2); - if( ( i + 1) < sizeof(SSockAddr) + info.iHwAddr.GetUserLen() ) - address.Append( _L(":") ); + if ((i + 1) < sizeof(SSockAddr) + info.iHwAddr.GetUserLen()) + address.Append(_L(":")); } address.UpperCase(); - iface->hardwareAddress = qstringFromDesc( address ); + iface->hardwareAddress = qstringFromDesc(address); } // Get the address of the interface info.iAddress.Output(address); - entry.setIp( QHostAddress( qstringFromDesc( address ) ) ); + entry.setIp(QHostAddress(qstringFromDesc(address))); // Get the interface netmask - // TODO: For some reason netmask is always 0.0.0.0 - //info.iNetMask.Output(address); - //entry.setNetmask( QHostAddress( qstringFromDesc( address ) ) ); + // For some reason netmask is always 0.0.0.0 + // info.iNetMask.Output(address); + // entry.setNetmask( QHostAddress( qstringFromDesc( address ) ) ); // Workaround: Let Symbian determine netmask based on IP address class - // TODO: works only for IPv4 + // TODO: Works only for IPv4 - Task: 259128 Implement IPv6 support TInetAddr netmask; - netmask.NetMask( info.iAddress ); + netmask.NetMask(info.iAddress); netmask.Output(address); - entry.setNetmask( QHostAddress( qstringFromDesc( address ) ) ); + entry.setNetmask(QHostAddress(qstringFromDesc(address))); // Get the interface broadcast address - if (iface->flags & QNetworkInterface::CanBroadcast) - { + if (iface->flags & QNetworkInterface::CanBroadcast) { // For some reason broadcast address is always 0.0.0.0 // info.iBrdAddr.Output(address); // entry.setBroadcast( QHostAddress( qstringFromDesc( address ) ) ); // Workaround: Let Symbian determine broadcast address based on IP address - // TODO: works only for IPv4 + // TODO: Works only for IPv4 - Task: 259128 Implement IPv6 support TInetAddr broadcast; - broadcast.NetBroadcast( info.iAddress ); + broadcast.NetBroadcast(info.iAddress); broadcast.Output(address); - entry.setBroadcast( QHostAddress( qstringFromDesc( address ) ) ); - } + entry.setBroadcast(QHostAddress(qstringFromDesc(address))); + } // Add new entry to interface address entries iface->addressEntries << entry; @@ -180,11 +163,11 @@ static QList<QNetworkInterfacePrivate *> interfaceListing() IsLoopBack = %d, IsPointToPoint = %d, CanMulticast = %d, \n\ ip = %s, netmask = %s, broadcast = %s,\n\ hwaddress = %s", - iface->name.toLatin1().constData(), - iface->flags & QNetworkInterface::IsUp, iface->flags & QNetworkInterface::IsRunning, iface->flags & QNetworkInterface::CanBroadcast, - iface->flags & QNetworkInterface::IsLoopBack, iface->flags & QNetworkInterface::IsPointToPoint, iface->flags & QNetworkInterface::CanMulticast, - entry.ip().toString().toLatin1().constData(), entry.netmask().toString().toLatin1().constData(), entry.broadcast().toString().toLatin1().constData(), - iface->hardwareAddress.toLatin1().constData()); + iface->name.toLatin1().constData(), + iface->flags & QNetworkInterface::IsUp, iface->flags & QNetworkInterface::IsRunning, iface->flags & QNetworkInterface::CanBroadcast, + iface->flags & QNetworkInterface::IsLoopBack, iface->flags & QNetworkInterface::IsPointToPoint, iface->flags & QNetworkInterface::CanMulticast, + entry.ip().toString().toLatin1().constData(), entry.netmask().toString().toLatin1().constData(), entry.broadcast().toString().toLatin1().constData(), + iface->hardwareAddress.toLatin1().constData()); #endif } } @@ -195,8 +178,7 @@ static QList<QNetworkInterfacePrivate *> interfaceListing() // use dummy socket to start enumerating routes err = socket.SetOpt(KSoInetEnumRoutes, KSolInetRtCtrl); - if( err ) - { + if (err) { socket.Close(); socketServ.Close(); // return what we have @@ -206,29 +188,28 @@ static QList<QNetworkInterfacePrivate *> interfaceListing() TSoInetRouteInfo routeInfo; TPckg<TSoInetRouteInfo> routeInfoPkg(routeInfo); - while(socket.GetOpt(KSoInetNextRoute, KSolInetRtCtrl, routeInfoPkg) == KErrNone) - { + while (socket.GetOpt(KSoInetNextRoute, KSolInetRtCtrl, routeInfoPkg) == KErrNone) { TName address; // get interface address routeInfo.iIfAddr.Output(address); QHostAddress ifAddr(qstringFromDesc(address)); - if(ifAddr.isNull()) + if (ifAddr.isNull()) continue; routeInfo.iDstAddr.Output(address); QHostAddress destination(qstringFromDesc(address)); - if(destination.isNull() || destination != ifAddr) + if (destination.isNull() || destination != ifAddr) continue; // search interfaces - for(int ifindex = 0; ifindex < interfaces.size(); ++ifindex) { + for (int ifindex = 0; ifindex < interfaces.size(); ++ifindex) { QNetworkInterfacePrivate *iface = interfaces.at(ifindex); - for(int eindex = 0; eindex < iface->addressEntries.size(); ++eindex) { + for (int eindex = 0; eindex < iface->addressEntries.size(); ++eindex) { QNetworkAddressEntry entry = iface->addressEntries.at(eindex); - if(entry.ip() != ifAddr) { + if (entry.ip() != ifAddr) { continue; - } else if(entry.ip().protocol() != QAbstractSocket::IPv4Protocol) { + } else if (entry.ip().protocol() != QAbstractSocket::IPv4Protocol) { // skip if not IPv4 address (e.g. IPv6) // as results not reliable on Symbian continue; @@ -240,9 +221,6 @@ static QList<QNetworkInterfacePrivate *> interfaceListing() // ::postProcess to have effect entry.setBroadcast(QHostAddress()); iface->addressEntries.replace(eindex, entry); -// printf("for %s netmask = %s and destination = %s ; type = %d; state = %d; metric = %d \n", -// ifAddr.toString().toLatin1().constData(), netmask.toString().toLatin1().constData(), destination.toString().toLatin1().constData(), -// routeInfo.iType, routeInfo.iState, routeInfo.iMetric); } } } diff --git a/src/plugins/qpluginbase.pri b/src/plugins/qpluginbase.pri index b14f839..10563c1 100644 --- a/src/plugins/qpluginbase.pri +++ b/src/plugins/qpluginbase.pri @@ -16,6 +16,6 @@ wince*:LIBS += $$QMAKE_LIBS_GUI symbian: { TARGET.EPOCALLOWDLLDATA=1 - TARGET.CAPABILITY = All -Tcb + TARGET.CAPABILITY = All -Tcb load(armcc_warnings) } diff --git a/src/plugins/s60/5_0/5_0.pro b/src/plugins/s60/5_0/5_0.pro index 878a466..d7c3cb2 100644 --- a/src/plugins/s60/5_0/5_0.pro +++ b/src/plugins/s60/5_0/5_0.pro @@ -8,7 +8,7 @@ contains(S60_VERSION, 3.1) { } else { SOURCES += ../src/qlocale_3_2.cpp \ ../src/qdesktopservices_3_2.cpp - LIBS += -ldirectorylocalizer + LIBS += -ldirectorylocalizer INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE } diff --git a/src/plugins/s60/bwins/qts60pluginu.def b/src/plugins/s60/bwins/qts60pluginu.def index 549f71f..a082262 100644 --- a/src/plugins/s60/bwins/qts60pluginu.def +++ b/src/plugins/s60/bwins/qts60pluginu.def @@ -4,4 +4,3 @@ EXPORTS ?defaultGetLongDateFormatSpec@@YA?AVTPtrC16@@AAVTExtendedLocale@@@Z @ 3 NONAME ; class TPtrC16 defaultGetLongDateFormatSpec(class TExtendedLocale &) ?defaultGetShortDateFormatSpec@@YA?AVTPtrC16@@AAVTExtendedLocale@@@Z @ 4 NONAME ; class TPtrC16 defaultGetShortDateFormatSpec(class TExtendedLocale &) ?localizedDirectoryName@@YA?AVQString@@AAV1@@Z @ 5 NONAME ; class QString localizedDirectoryName(class QString &) - diff --git a/src/plugins/s60/eabi/qts60pluginu.def b/src/plugins/s60/eabi/qts60pluginu.def index a433a5d..d768436 100644 --- a/src/plugins/s60/eabi/qts60pluginu.def +++ b/src/plugins/s60/eabi/qts60pluginu.def @@ -4,4 +4,3 @@ EXPORTS _Z28defaultGetLongDateFormatSpecR15TExtendedLocale @ 3 NONAME _Z29defaultGetShortDateFormatSpecR15TExtendedLocale @ 4 NONAME _Z22localizedDirectoryNameR7QString @ 5 NONAME - diff --git a/src/plugins/s60/s60pluginbase.pri b/src/plugins/s60/s60pluginbase.pri index 62100f9..0e11c7e 100644 --- a/src/plugins/s60/s60pluginbase.pri +++ b/src/plugins/s60/s60pluginbase.pri @@ -1,4 +1,4 @@ -# Note: These version based 'plugins' are not an actual Qt plugins, +# Note: These version based 'plugins' are not an actual Qt plugins, # they are just regular runtime loaded libraries include(../../qpluginbase.pri) diff --git a/src/plugins/s60/src/qdesktopservices_3_1.cpp b/src/plugins/s60/src/qdesktopservices_3_1.cpp index 0551a74..0f8e6a6 100644 --- a/src/plugins/s60/src/qdesktopservices_3_1.cpp +++ b/src/plugins/s60/src/qdesktopservices_3_1.cpp @@ -47,4 +47,3 @@ EXPORT_C QString localizedDirectoryName(QString&) qWarning("QDesktopServices::displayName() not implemented for this platform version"); return QString(); } - diff --git a/src/plugins/s60/src/qdesktopservices_3_2.cpp b/src/plugins/s60/src/qdesktopservices_3_2.cpp index f08799b..3708436 100644 --- a/src/plugins/s60/src/qdesktopservices_3_2.cpp +++ b/src/plugins/s60/src/qdesktopservices_3_2.cpp @@ -77,4 +77,3 @@ EXPORT_C QString localizedDirectoryName(QString& /* rawPath */) return QString(); } #endif - diff --git a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro index 0574341..4734144 100644 --- a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro +++ b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro @@ -3,4 +3,3 @@ TEMPLATE = subdirs # We just want to extract the zip file containing sqlite binaries for Symbian BLD_INF_RULES.prj_exports += ":zip SQLite3_v9.2.zip" - diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby index 8a0e03c..dc9ec43 100644 --- a/src/s60installs/qt.iby +++ b/src/s60installs/qt.iby @@ -5,7 +5,7 @@ // Dependancies for more than one module #include <base.iby> -#include <openenv.iby> // QtCore, QtGui, QtNetwork, QtOpenGL, QSvgIconEngine, +#include <openenv.iby> // QtCore, QtGui, QtNetwork, QtOpenGL, QSvgIconEngine, #include <cone.iby> // QtGui, QtOpenGL #include <stdcpp.iby> // for std C++ support diff --git a/src/s60installs/qt_libs.pro b/src/s60installs/qt_libs.pro index 369a74e..cb03a05 100644 --- a/src/s60installs/qt_libs.pro +++ b/src/s60installs/qt_libs.pro @@ -9,10 +9,10 @@ symbian: { TARGET.UID3 = 0x2001E61C VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} - qtresources.sources = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/s60main.rsc + qtresources.sources = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/s60main.rsc qtresources.path = $$APP_RESOURCE_DIR - qtlibraries.sources = \ + qtlibraries.sources = \ QtCore.dll \ QtXml.dll \ QtGui.dll \ @@ -23,21 +23,21 @@ symbian: { qts60plugin_3_1.dll \ qts60plugin_3_2.dll \ qts60plugin_5_0.dll - + # TODO: This should be conditional in PKG file, see commented code below # However we don't yet have such mechanism in place contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { - contains(CONFIG, system-sqlite): qtlibraries.sources += sqlite3.dll - } - + contains(CONFIG, system-sqlite): qtlibraries.sources += sqlite3.dll + } + #; EXISTS statement does not resolve !. Lets check the most common drives #IF NOT EXISTS("c:\sys\bin\sqlite3.dll") AND NOT EXISTS("e:\sys\bin\sqlite3.dll") AND NOT EXISTS("z:\sys\bin\sqlite3.dll") #"\Epoc32\release\armv5\UREL\sqlite3.dll"-"!:\sys\bin\sqlite3.dll" - #ENDIF + #ENDIF qtlibraries.path = /sys/bin - + vendorinfo = \ "; Localised Vendor name" \ "%{\"Nokia, Qt Software\"}" \ @@ -45,8 +45,8 @@ symbian: { "; Unique Vendor name" \ ":\"Nokia, Qt Software\"" \ " " - - + + qtlibraries.pkg_prerules = vendorinfo qtlibraries.pkg_prerules += "; Dependencies of Qt libraries" qtlibraries.pkg_prerules += "(0x20013851), 1, 5, 1, {\"PIPS Installer\"}" @@ -56,7 +56,7 @@ symbian: { contains(CONFIG, stl) { qtlibraries.pkg_prerules += "(0x2000F866), 1, 0, 0, {\"Standard C++ Library Common\"}" } - + !contains(QT_CONFIG, no-jpeg): imageformats_plugins.sources += qjpeg.dll !contains(QT_CONFIG, no-gif): imageformats_plugins.sources += qgif.dll !contains(QT_CONFIG, no-mng): imageformats_plugins.sources += qmng.dll @@ -66,10 +66,10 @@ symbian: { codecs_plugins.sources = qcncodecs.dll qjpcodecs.dll qtwcodecs.dll qkrcodecs.dll codecs_plugins.path = $$QT_PLUGINS_BASE_DIR/codecs - + DEPLOYMENT += qtresources qtlibraries imageformats_plugins codecs_plugins graphicssystems_plugins - contains(QT_CONFIG, svg): { + contains(QT_CONFIG, svg): { qtlibraries.sources += QtSvg.dll imageformats_plugins.sources += qsvg.dll iconengines_plugins.sources = qsvgicon.dll @@ -79,7 +79,7 @@ symbian: { contains(QT_CONFIG, phonon): { qtlibraries.sources += Phonon.dll - } + } graphicssystems_plugins.path = $$QT_PLUGINS_BASE_DIR/graphicssystems contains(QT_CONFIG, openvg) { diff --git a/src/s60main/qts60main.cpp b/src/s60main/qts60main.cpp index d7daf4a..67c20b7 100644 --- a/src/s60main/qts60main.cpp +++ b/src/s60main/qts60main.cpp @@ -48,16 +48,15 @@ * factory function to create the QtS60Main application class */ LOCAL_C CApaApplication* NewApplication() - { - return new CQtS60MainApplication; - } +{ + return new CQtS60MainApplication; +} /** * A normal Symbian OS executable provides an E32Main() function which is * called by the operating system to start the program. */ GLDEF_C TInt E32Main() - { - return EikStart::RunApplication( NewApplication ); - } - +{ + return EikStart::RunApplication(NewApplication); +} diff --git a/src/s60main/qts60main_mcrt0.cpp b/src/s60main/qts60main_mcrt0.cpp index 8631989..f591c89 100644 --- a/src/s60main/qts60main_mcrt0.cpp +++ b/src/s60main/qts60main_mcrt0.cpp @@ -51,13 +51,13 @@ #ifdef __ARMCC__ __asm int CallMain(int argc, char *argv[], char *envp[]) { - import main - code32 - b main + import main + code32 + b main } #define CALLMAIN(argc, argv, envp) CallMain(argc, argv, envp) #else -extern "C" int main (int argc, char *argv[], char *envp[]); +extern "C" int main(int argc, char *argv[], char *envp[]); #define CALLMAIN(argc, argv, envp) main(argc, argv, envp) #endif @@ -67,21 +67,21 @@ extern "C" GLDEF_C int __GccGlueInit() return 0; } -extern "C" IMPORT_C void exit (int ret); +extern "C" IMPORT_C void exit(int ret); GLDEF_C TInt QtMainWrapper() { - int argc=0; - char **argv=0; - char **envp=0; + int argc = 0; + char **argv = 0; + char **envp = 0; // get args & environment - __crt0(argc,argv,envp); + __crt0(argc, argv, envp); CleanupArrayDelete<char*>::PushL(argv); CleanupArrayDelete<char*>::PushL(envp); //Call user(application)'s main - int ret = 0; - QT_TRYCATCH_LEAVING( ret = CALLMAIN(argc, argv, envp); ); - CleanupStack::PopAndDestroy(2,argv); + int ret = 0; + QT_TRYCATCH_LEAVING(ret = CALLMAIN(argc, argv, envp);); + CleanupStack::PopAndDestroy(2, argv); return ret; } @@ -89,10 +89,10 @@ GLDEF_C TInt QtMainWrapper() #ifdef __GCC32__ /* stub function inserted into main() by GCC */ -extern "C" void __gccmain (void) {} +extern "C" void __gccmain(void) {} /* Default GCC entrypoint */ -extern "C" TInt _mainCRTStartup (void) +extern "C" TInt _mainCRTStartup(void) { extern TInt _E32Startup(); return _E32Startup(); diff --git a/src/s60main/qts60mainapplication.cpp b/src/s60main/qts60mainapplication.cpp index 2fada3d..9ad7f68 100644 --- a/src/s60main/qts60mainapplication.cpp +++ b/src/s60main/qts60mainapplication.cpp @@ -49,7 +49,7 @@ // ============================ MEMBER FUNCTIONS =============================== -_LIT( KQtWrapperResourceFile,"\\resource\\apps\\s60main.rsc" ); +_LIT(KQtWrapperResourceFile, "\\resource\\apps\\s60main.rsc"); // ----------------------------------------------------------------------------- // CQtS60MainApplication::CreateDocumentL() @@ -57,10 +57,10 @@ _LIT( KQtWrapperResourceFile,"\\resource\\apps\\s60main.rsc" ); // ----------------------------------------------------------------------------- // CApaDocument* CQtS60MainApplication::CreateDocumentL() - { +{ // Create an QtS60Main document, and return a pointer to it - return (static_cast<CApaDocument*>( CQtS60MainDocument::NewL( *this ) ) ); - } + return (static_cast<CApaDocument*>(CQtS60MainDocument::NewL(*this))); +} // ----------------------------------------------------------------------------- // CQtS60MainApplication::AppDllUid() @@ -68,10 +68,10 @@ CApaDocument* CQtS60MainApplication::CreateDocumentL() // ----------------------------------------------------------------------------- // TUid CQtS60MainApplication::AppDllUid() const - { +{ // Return the UID for the QtS60Main application return ProcessUid(); - } +} // ----------------------------------------------------------------------------- // CQtS60MainApplication::ResourceFileName() @@ -79,14 +79,13 @@ TUid CQtS60MainApplication::AppDllUid() const // ----------------------------------------------------------------------------- // TFileName CQtS60MainApplication::ResourceFileName() const - { +{ TFindFile finder(iCoeEnv->FsSession()); TInt err = finder.FindByDir(KQtWrapperResourceFile, KNullDesC); if (err == KErrNone) return finder.File(); return KNullDesC(); - } +} // End of File - diff --git a/src/s60main/qts60mainapplication.h b/src/s60main/qts60mainapplication.h index 70b6909..e178936 100644 --- a/src/s60main/qts60mainapplication.h +++ b/src/s60main/qts60mainapplication.h @@ -91,4 +91,3 @@ class CQtS60MainApplication : public CAknApplication #endif // __QtS60MainAPPLICATION_H__ // End of File - diff --git a/src/s60main/qts60mainappui.cpp b/src/s60main/qts60mainappui.cpp index ef54417..ede96cb 100644 --- a/src/s60main/qts60mainappui.cpp +++ b/src/s60main/qts60mainappui.cpp @@ -67,7 +67,7 @@ void CQtS60MainAppUi::ConstructL() // objects can still exist in static data at that point. Instead we will print relevant information // so that comparative checks may be made for memory leaks, using ~SPrintExitInfo in corelib. iEikonEnv->DisableExitChecks(ETrue); - + // Initialise app UI with standard value. // ENoAppResourceFile and ENonStandardResourceFile makes UI to work without // resource files in most SDKs. S60 3rd FP1 public seems to require resource file @@ -76,11 +76,11 @@ void CQtS60MainAppUi::ConstructL() CEikButtonGroupContainer* nativeContainer = Cba(); nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS); - + // Create async callback to call Qt main, // this is required to give S60 app FW to finish starting correctly - TCallBack callBack( OpenCMainStaticCallBack, this ); - iAsyncCallBack = new(ELeave) CAsyncCallBack( callBack, CActive::EPriorityIdle ); + TCallBack callBack(OpenCMainStaticCallBack, this); + iAsyncCallBack = new(ELeave) CAsyncCallBack(callBack, CActive::EPriorityIdle); iAsyncCallBack->Call(); } @@ -109,7 +109,7 @@ CQtS60MainAppUi::~CQtS60MainAppUi() // Takes care of command handling. // ----------------------------------------------------------------------------- // -void CQtS60MainAppUi::HandleCommandL( TInt aCommand ) +void CQtS60MainAppUi::HandleCommandL(TInt aCommand) { if (qApp) qApp->symbianHandleCommand(aCommand); @@ -123,7 +123,7 @@ void CQtS60MainAppUi::HandleCommandL( TInt aCommand ) void CQtS60MainAppUi::HandleResourceChangeL(TInt aType) { CAknAppUi::HandleResourceChangeL(aType); - + if (qApp) qApp->symbianResourceChange(aType); } @@ -157,9 +157,9 @@ void CQtS60MainAppUi::HandleStatusPaneSizeChange() // Called asynchronously from ConstructL() - passes call to nan static method // ----------------------------------------------------------------------------- // -TInt CQtS60MainAppUi::OpenCMainStaticCallBack( TAny* aObject ) +TInt CQtS60MainAppUi::OpenCMainStaticCallBack(TAny* aObject) { - CQtS60MainAppUi* myObj = static_cast<CQtS60MainAppUi*>( aObject ); + CQtS60MainAppUi* myObj = static_cast<CQtS60MainAppUi*>(aObject); myObj->OpenCMainCallBack(); return 0; } @@ -186,30 +186,28 @@ void CQtS60MainAppUi::DynInitMenuBarL(TInt, CEikMenuBar *) void CQtS60MainAppUi::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane *aMenuPane) { - if (aResourceId == R_QT_WRAPPERAPP_MENU){ + if (aResourceId == R_QT_WRAPPERAPP_MENU) { if (aMenuPane->NumberOfItemsInPane() <= 1) qt_symbian_show_toplevel(aMenuPane); - - } - else if( aResourceId != R_AVKON_MENUPANE_FEP_DEFAULT && aResourceId != R_AVKON_MENUPANE_EDITTEXT_DEFAULT && aResourceId != R_AVKON_MENUPANE_LANGUAGE_DEFAULT ){ + + } else if (aResourceId != R_AVKON_MENUPANE_FEP_DEFAULT && aResourceId != R_AVKON_MENUPANE_EDITTEXT_DEFAULT && aResourceId != R_AVKON_MENUPANE_LANGUAGE_DEFAULT) { qt_symbian_show_submenu(aMenuPane, aResourceId); } } -void CQtS60MainAppUi::RestoreMenuL(CCoeControl* aMenuWindow,TInt aMenuId,TMenuType aMenuType) +void CQtS60MainAppUi::RestoreMenuL(CCoeControl* aMenuWindow, TInt aMenuId, TMenuType aMenuType) { - if ((aMenuId==R_QT_WRAPPERAPP_MENUBAR) || (aMenuId == R_AVKON_MENUPANE_FEP_DEFAULT)) { + if ((aMenuId == R_QT_WRAPPERAPP_MENUBAR) || (aMenuId == R_AVKON_MENUPANE_FEP_DEFAULT)) { TResourceReader reader; - iCoeEnv->CreateResourceReaderLC(reader,aMenuId); + iCoeEnv->CreateResourceReaderLC(reader, aMenuId); aMenuWindow->ConstructFromResourceL(reader); CleanupStack::PopAndDestroy(); } - if (aMenuType==EMenuPane) - DynInitMenuPaneL(aMenuId,(CEikMenuPane*)aMenuWindow); + if (aMenuType == EMenuPane) + DynInitMenuPaneL(aMenuId, (CEikMenuPane*)aMenuWindow); else - DynInitMenuBarL(aMenuId,(CEikMenuBar*)aMenuWindow); - } + DynInitMenuBarL(aMenuId, (CEikMenuBar*)aMenuWindow); +} // End of File - diff --git a/src/s60main/qts60mainappui.h b/src/s60main/qts60mainappui.h index 6bdeb2e..cec0d98 100644 --- a/src/s60main/qts60mainappui.h +++ b/src/s60main/qts60mainappui.h @@ -96,7 +96,7 @@ class CQtS60MainAppUi : public CAknAppUi * @param aType event type. */ void HandleResourceChangeL(TInt aType); - + /** * HandleStatusPaneSizeChange. * Called by the framework when the application status pane @@ -133,4 +133,3 @@ class CQtS60MainAppUi : public CAknAppUi #endif // __QtS60MainAPPUI_H__ // End of File - diff --git a/src/s60main/qts60maindocument.cpp b/src/s60main/qts60maindocument.cpp index eb7ea42..77d5cc8 100644 --- a/src/s60main/qts60maindocument.cpp +++ b/src/s60main/qts60maindocument.cpp @@ -51,25 +51,25 @@ // Two-phased constructor. // ----------------------------------------------------------------------------- // -CQtS60MainDocument* CQtS60MainDocument::NewL( CEikApplication& aApp ) - { - CQtS60MainDocument* self = NewLC( aApp ); - CleanupStack::Pop( self ); +CQtS60MainDocument* CQtS60MainDocument::NewL(CEikApplication& aApp) +{ + CQtS60MainDocument* self = NewLC(aApp); + CleanupStack::Pop(self); return self; - } +} // ----------------------------------------------------------------------------- // CQtS60MainDocument::NewLC() // Two-phased constructor. // ----------------------------------------------------------------------------- // -CQtS60MainDocument* CQtS60MainDocument::NewLC( CEikApplication& aApp ) - { - CQtS60MainDocument* self = new ( ELeave ) CQtS60MainDocument( aApp ); - CleanupStack::PushL( self ); +CQtS60MainDocument* CQtS60MainDocument::NewLC(CEikApplication& aApp) +{ + CQtS60MainDocument* self = new(ELeave) CQtS60MainDocument(aApp); + CleanupStack::PushL(self); self->ConstructL(); return self; - } +} // ----------------------------------------------------------------------------- // CQtS60MainDocument::ConstructL() @@ -77,20 +77,20 @@ CQtS60MainDocument* CQtS60MainDocument::NewLC( CEikApplication& aApp ) // ----------------------------------------------------------------------------- // void CQtS60MainDocument::ConstructL() - { +{ // No implementation required - } +} // ----------------------------------------------------------------------------- // CQtS60MainDocument::CQtS60MainDocument() // C++ default constructor can NOT contain any code, that might leave. // ----------------------------------------------------------------------------- // -CQtS60MainDocument::CQtS60MainDocument( CEikApplication& aApp ) - : CAknDocument( aApp ) - { +CQtS60MainDocument::CQtS60MainDocument(CEikApplication& aApp) + : CAknDocument(aApp) +{ // No implementation required - } +} // --------------------------------------------------------------------------- // CQtS60MainDocument::~CQtS60MainDocument() @@ -98,9 +98,9 @@ CQtS60MainDocument::CQtS60MainDocument( CEikApplication& aApp ) // --------------------------------------------------------------------------- // CQtS60MainDocument::~CQtS60MainDocument() - { +{ // No implementation required - } +} // --------------------------------------------------------------------------- // CQtS60MainDocument::CreateAppUiL() @@ -108,11 +108,10 @@ CQtS60MainDocument::~CQtS60MainDocument() // --------------------------------------------------------------------------- // CEikAppUi* CQtS60MainDocument::CreateAppUiL() - { +{ // Create the application user interface, and return a pointer to it; // the framework takes ownership of this object - return ( static_cast <CEikAppUi*> ( new ( ELeave )CQtS60MainAppUi ) ); - } + return (static_cast <CEikAppUi*>(new(ELeave)CQtS60MainAppUi)); +} // End of File - diff --git a/src/s60main/qts60maindocument.h b/src/s60main/qts60maindocument.h index a95e620..77c5aa7 100644 --- a/src/s60main/qts60maindocument.h +++ b/src/s60main/qts60maindocument.h @@ -120,4 +120,3 @@ class CQtS60MainDocument : public CAknDocument #endif // __QTS60MAINDOCUMENT_H__ // End of File - diff --git a/src/s60main/s60main.pro b/src/s60main/s60main.pro index f74943f..57c9949 100644 --- a/src/s60main/s60main.pro +++ b/src/s60main/s60main.pro @@ -9,7 +9,7 @@ CONFIG -= qt shared symbian { # Note: UID only needed for ensuring that no filename generation conflicts occur - TARGET.UID3 = 0x2001E61F + TARGET.UID3 = 0x2001E61F CONFIG += png zlib CONFIG -= jpeg INCLUDEPATH += tmp $$QMAKE_INCDIR_QT/QtCore $$MW_LAYER_SYSTEMINCLUDE @@ -21,8 +21,8 @@ symbian { HEADERS = qts60mainapplication.h \ qts60mainappui.h \ qts60maindocument.h - - # This block serves the minimalistic resource file for S60 3.1 platforms. + + # This block serves the minimalistic resource file for S60 3.1 platforms. # Note there is no way to ifdef S60 version in mmp file, that is why the resource # file is always compiled for WINSCW minimalAppResource31 = \ @@ -30,23 +30,23 @@ symbian { "HEADER" \ "TARGETPATH resource\apps" \ "END" - MMP_RULES += minimalAppResource31 + MMP_RULES += minimalAppResource31 # s60main needs to be built in ARM mode for GCCE to work. MMP_RULES+="ALWAYS_BUILD_AS_ARM" # staticlib should not have any lib depencies in s60 # This seems not to work, some hard coded libs are still added as dependency - LIBS = + LIBS = } else { error("$$_FILE_ is intended only for Symbian!") } symbian-abld: { # abld build commands generated resources after the static library is built, and - # we have dependency to resource from static lib -> resources need to be generated + # we have dependency to resource from static lib -> resources need to be generated # explicitly before library - rsgFix2.commands = "-$(DEL_FILE) $(EPOCROOT)Epoc32\Data\z\resource\apps\s60main.rsc >NUL 2>&1" + rsgFix2.commands = "-$(DEL_FILE) $(EPOCROOT)Epoc32\Data\z\resource\apps\s60main.rsc >NUL 2>&1" rsgFix.commands = "-$(ABLD) resource $(PLATFORM) $(CFG) 2>NUL" QMAKE_EXTRA_TARGETS += rsgFix rsgFix2 PRE_TARGETDEPS += rsgFix rsgFix2 diff --git a/src/s60main/s60main.rss b/src/s60main/s60main.rss index 6e8004c..11c68a3 100644 --- a/src/s60main/s60main.rss +++ b/src/s60main/s60main.rss @@ -83,4 +83,3 @@ RESOURCE MENU_PANE r_qt_wrapperapp_menu { } // End of File - diff --git a/src/sql/sql.pro b/src/sql/sql.pro index 60be748..b8f819d 100644 --- a/src/sql/sql.pro +++ b/src/sql/sql.pro @@ -19,9 +19,8 @@ include(models/models.pri) symbian: { TARGET.UID3=0x2001E61D - + # Workaroud for problems with paging this dll MMP_RULES -= PAGED MMP_RULES *= UNPAGED } - diff --git a/tests/auto/_Categories/QtCore.txt b/tests/auto/_Categories/QtCore.txt index c3fb879..452b6ba 100644 --- a/tests/auto/_Categories/QtCore.txt +++ b/tests/auto/_Categories/QtCore.txt @@ -5,7 +5,7 @@ exceptionsafety qabstractitemmodel #Requires STL qalgorithms -qanimationgroup +qanimationgroup qatomicint qatomicpointer qbitarray @@ -80,7 +80,7 @@ qsocketnotifier qstate qstatemachine #Requires STL -qstl +qstl qstring qstringlist qstringmatcher diff --git a/tests/auto/_Categories/QtGui.txt b/tests/auto/_Categories/QtGui.txt index 6ef7cfe..dcb3be5 100644 --- a/tests/auto/_Categories/QtGui.txt +++ b/tests/auto/_Categories/QtGui.txt @@ -43,7 +43,7 @@ qdirmodel qdockwidget qdoublespinbox qdoublevalidator -qdrag +qdrag qerrormessage qfiledialog qfileiconprovider @@ -166,7 +166,7 @@ qtextlist qtextobject qtextodfwriter #This test can only be compiled on HW currently, because it does not use reduced exports -#Because we are planning to use class level exports also in HW later on, there is no +#Because we are planning to use class level exports also in HW later on, there is no #sense to enable this at all #qtextpiecetable qtextscriptengine diff --git a/tests/auto/_networkselftest/tst_networkselftest.cpp b/tests/auto/_networkselftest/tst_networkselftest.cpp index cfb5c3c..2c57e83 100644 --- a/tests/auto/_networkselftest/tst_networkselftest.cpp +++ b/tests/auto/_networkselftest/tst_networkselftest.cpp @@ -52,8 +52,8 @@ class tst_NetworkSelfTest: public QObject Q_OBJECT public: tst_NetworkSelfTest(); - virtual ~tst_NetworkSelfTest(); - + virtual ~tst_NetworkSelfTest(); + private slots: void hostTest(); void dnsResolution_data(); @@ -68,7 +68,7 @@ private slots: void httpServer(); void httpsServer(); void httpProxy(); - void httpProxyBasicAuth(); + void httpProxyBasicAuth(); void httpProxyNtlmAuth(); void socks5Proxy(); void socks5ProxyAuth(); @@ -371,7 +371,7 @@ void tst_NetworkSelfTest::remotePortsOpen_data() QTest::newRow("https") << 443; QTest::newRow("http-proxy") << 3128; QTest::newRow("http-proxy-auth-basic") << 3129; - QTest::newRow("http-proxy-auth-ntlm") << 3130; + QTest::newRow("http-proxy-auth-ntlm") << 3130; QTest::newRow("socks5-proxy") << 1080; QTest::newRow("socks5-proxy-auth") << 1081; } @@ -381,8 +381,8 @@ void tst_NetworkSelfTest::remotePortsOpen() #ifdef Q_OS_SYMBIAN if (qstrcmp(QTest::currentDataTag(), "http-proxy-auth-ntlm") == 0) QSKIP("NTML authentication not yet supported in Symbian", SkipSingle); -#endif - +#endif + QFETCH(int, portNumber); QTcpSocket socket; socket.connectToHost(QtNetworkSettings::serverName(), portNumber); @@ -538,7 +538,7 @@ void tst_NetworkSelfTest::httpProxyNtlmAuth() { #ifdef Q_OS_SYMBIAN QSKIP("NTML authentication not yet supported in Symbian", SkipAll); -#else +#else netChat(3130, QList<Chat>() // test auth required response << Chat::send("GET http://" + QtNetworkSettings::serverName().toLatin1() + "/ HTTP/1.0\r\n" @@ -551,7 +551,7 @@ void tst_NetworkSelfTest::httpProxyNtlmAuth() << Chat::discardUntil("\r\nProxy-Authenticate: NTLM\r\n") << Chat::DiscardUntilDisconnect ); -#endif +#endif } // SOCKSv5 is a binary protocol diff --git a/tests/auto/languagechange/tst_languagechange.cpp b/tests/auto/languagechange/tst_languagechange.cpp index f856f67..9ffadb1 100644 --- a/tests/auto/languagechange/tst_languagechange.cpp +++ b/tests/auto/languagechange/tst_languagechange.cpp @@ -213,11 +213,11 @@ void tst_languageChange::retranslatability() "get proper widget layout."); TransformTranslator translator; #if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86) - // Allow a little extra time or emulator startup delays cause failure + // Allow a little extra time or emulator startup delays cause failure QTimer::singleShot(5000, &translator, SLOT(install())); -#else +#else QTimer::singleShot(500, &translator, SLOT(install())); -#endif +#endif switch (dialogType) { case InputDialog: (void)QInputDialog::getInteger(0, QLatin1String("title"), QLatin1String("label")); diff --git a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp index a35270a..67aac6f 100644 --- a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp +++ b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp @@ -211,7 +211,7 @@ private slots: void noFallbackToRoot(); void setCurrentIndex_data(); void setCurrentIndex(); - + void task221955_selectedEditor(); void task250754_fontChange(); }; @@ -453,7 +453,7 @@ void tst_QAbstractItemView::basic_tests(TestView *view) view->setDragEnabled(true); QCOMPARE(view->dragEnabled(), true); #endif - + // setAlternatingRowColors view->setAlternatingRowColors(false); QCOMPARE(view->alternatingRowColors(), false); @@ -566,7 +566,7 @@ void tst_QAbstractItemView::basic_tests(TestView *view) view->tst_setState(TestView::CollapsingState); QVERIFY(view->tst_state()==TestView::CollapsingState); #endif - + view->tst_startAutoScroll(); view->tst_stopAutoScroll(); view->tst_doAutoScroll(); @@ -951,12 +951,12 @@ void tst_QAbstractItemView::dragAndDropOnChild() class TestModel : public QStandardItemModel { public: - TestModel(int rows, int columns) : QStandardItemModel(rows, columns) + TestModel(int rows, int columns) : QStandardItemModel(rows, columns) { setData_count = 0; } - virtual bool setData(const QModelIndex &/*index*/, const QVariant &/*value*/, int /*role = Qt::EditRole*/) + virtual bool setData(const QModelIndex &/*index*/, const QVariant &/*value*/, int /*role = Qt::EditRole*/) { ++setData_count; return true; @@ -973,20 +973,20 @@ void tst_QAbstractItemView::setItemDelegate_data() // default is rows, a -1 will switch to columns QTest::addColumn<IntList>("rowsOrColumnsWithDelegate"); QTest::addColumn<QPoint>("cellToEdit"); - QTest::newRow("4 columndelegates") - << (IntList() << -1 << 0 << 1 << 2 << 3) + QTest::newRow("4 columndelegates") + << (IntList() << -1 << 0 << 1 << 2 << 3) << QPoint(0, 0); - QTest::newRow("2 identical rowdelegates on the same row") - << (IntList() << 0 << 0) + QTest::newRow("2 identical rowdelegates on the same row") + << (IntList() << 0 << 0) << QPoint(0, 0); - QTest::newRow("2 identical columndelegates on the same column") - << (IntList() << -1 << 2 << 2) + QTest::newRow("2 identical columndelegates on the same column") + << (IntList() << -1 << 2 << 2) << QPoint(2, 0); - QTest::newRow("2 duplicate delegates, 1 row and 1 column") - << (IntList() << 0 << -1 << 2) + QTest::newRow("2 duplicate delegates, 1 row and 1 column") + << (IntList() << 0 << -1 << 2) << QPoint(2, 0); - QTest::newRow("4 duplicate delegates, 2 row and 2 column") - << (IntList() << 0 << 0 << -1 << 2 << 2) + QTest::newRow("4 duplicate delegates, 2 row and 2 column") + << (IntList() << 0 << 0 << -1 << 2 << 2) << QPoint(2, 0); } @@ -1008,7 +1008,7 @@ void tst_QAbstractItemView::setItemDelegate() if (row) { v.setItemDelegateForRow(rc, delegate); } else { - v.setItemDelegateForColumn(rc, delegate); + v.setItemDelegateForColumn(rc, delegate); } } } @@ -1126,42 +1126,42 @@ void tst_QAbstractItemView::setCurrentIndex() void tst_QAbstractItemView::task221955_selectedEditor() { QPushButton *button; - + QTreeWidget tree; tree.setColumnCount(2); tree.addTopLevelItem(new QTreeWidgetItem(QStringList() << "Foo" <<"1")); tree.addTopLevelItem(new QTreeWidgetItem(QStringList() << "Bar" <<"2")); tree.addTopLevelItem(new QTreeWidgetItem(QStringList() << "Baz" <<"3")); - + QTreeWidgetItem *dummy = new QTreeWidgetItem(); tree.addTopLevelItem(dummy); tree.setItemWidget(dummy, 0, button = new QPushButton("More...")); button->setAutoFillBackground(true); // as recommended in doc - + tree.show(); tree.setFocus(); tree.setCurrentIndex(tree.model()->index(1,0)); QTest::qWait(100); QApplication::setActiveWindow(&tree); - + QVERIFY(! tree.selectionModel()->selectedIndexes().contains(tree.model()->index(3,0))); //We set the focus to the button, the index need to be selected - button->setFocus(); + button->setFocus(); QTest::qWait(100); QVERIFY(tree.selectionModel()->selectedIndexes().contains(tree.model()->index(3,0))); - + tree.setCurrentIndex(tree.model()->index(1,0)); QVERIFY(! tree.selectionModel()->selectedIndexes().contains(tree.model()->index(3,0))); - + //Same thing but with the flag NoSelection, nothing can be selected. tree.setFocus(); tree.setSelectionMode(QAbstractItemView::NoSelection); tree.clearSelection(); QVERIFY(tree.selectionModel()->selectedIndexes().isEmpty()); QTest::qWait(10); - button->setFocus(); + button->setFocus(); QTest::qWait(50); QVERIFY(tree.selectionModel()->selectedIndexes().isEmpty()); } @@ -1202,7 +1202,7 @@ void tst_QAbstractItemView::task250754_fontChange() QTest::qWait(30); //now with the huge items, the scrollbar must be visible QVERIFY(tree.verticalScrollBar()->isVisible()); - + qApp->setStyleSheet(app_css); } diff --git a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp index 2a4a1a7..b3f918b 100644 --- a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp +++ b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp @@ -84,7 +84,7 @@ public: #ifdef Q_OS_SYMBIAN QString location = QLatin1String("./cache/"); #else - QString location = QDesktopServices::storageLocation(QDesktopServices::DataLocation) + QString location = QDesktopServices::storageLocation(QDesktopServices::DataLocation) + QLatin1String("/cache/"); #endif setCacheDirectory(location); @@ -111,7 +111,7 @@ tst_QAbstractNetworkCache::tst_QAbstractNetworkCache() } tst_QAbstractNetworkCache::~tst_QAbstractNetworkCache() -{ +{ } static bool AlwaysTrue = true; diff --git a/tests/auto/qautoptr/qautoptr.pro b/tests/auto/qautoptr/qautoptr.pro index 9eab084..b0c574f 100644 --- a/tests/auto/qautoptr/qautoptr.pro +++ b/tests/auto/qautoptr/qautoptr.pro @@ -1,4 +1,4 @@ load(qttest_p4) SOURCES += tst_qautoptr.cpp -QT = core +QT = core include(../xmlpatterns.pri) diff --git a/tests/auto/qbitarray/tst_qbitarray.cpp b/tests/auto/qbitarray/tst_qbitarray.cpp index 3c9ef53..f8f288f 100644 --- a/tests/auto/qbitarray/tst_qbitarray.cpp +++ b/tests/auto/qbitarray/tst_qbitarray.cpp @@ -646,7 +646,7 @@ void tst_QBitArray::resize() // grow the array back and check the new bit a.resize(10); QCOMPARE( a, QStringToQBitArray(QString("1100000000")) ); - + // other test with and a.resize(9); QBitArray b = QStringToQBitArray(QString("1111111111")); diff --git a/tests/auto/qclipboard/tst_qclipboard.cpp b/tests/auto/qclipboard/tst_qclipboard.cpp index 2929aab..88c7a2c 100644 --- a/tests/auto/qclipboard/tst_qclipboard.cpp +++ b/tests/auto/qclipboard/tst_qclipboard.cpp @@ -197,7 +197,7 @@ void tst_QClipboard::copy_exit_paste() // ### It's still possible to test copy/paste - just keep the apps running #elif defined (Q_OS_SYMBIAN) && defined (Q_CC_NOKIAX86) QSKIP("emulator cannot launch multiple processes",SkipAll); -#endif +#endif if (!nativeClipboardWorking()) QSKIP("Native clipboard not working in this setup", SkipAll); const QStringList stringArgument = QStringList() << "Test string."; @@ -240,7 +240,7 @@ void tst_QClipboard::setMimeData() QApplication::clipboard()->setMimeData(data, QClipboard::Clipboard); QApplication::clipboard()->setMimeData(data, QClipboard::Selection); QApplication::clipboard()->setMimeData(data, QClipboard::FindBuffer); - + QSignalSpy spySelection(QApplication::clipboard(), SIGNAL(selectionChanged())); QSignalSpy spyData(QApplication::clipboard(), SIGNAL(dataChanged())); QSignalSpy spyFindBuffer(QApplication::clipboard(), SIGNAL(findBufferChanged())); @@ -277,7 +277,7 @@ void tst_QClipboard::setMimeData() spySelection.clear(); spyData.clear(); spyFindBuffer.clear(); - + QApplication::clipboard()->setMimeData(newData, QClipboard::Clipboard); QApplication::clipboard()->setMimeData(newData, QClipboard::Selection); // used to crash on X11 QApplication::clipboard()->setMimeData(newData, QClipboard::FindBuffer); diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp index 4976b30..8b5acc7 100644 --- a/tests/auto/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/qcombobox/tst_qcombobox.cpp @@ -1246,7 +1246,7 @@ void tst_QComboBox::insertItem() QCOMPARE(testWidget->count(), initialItems.count() + 1); QCOMPARE(testWidget->itemText(expectedIndex), itemLabel); - + if (editable) QCOMPARE(testWidget->currentText(), QString("FOO")); } @@ -2196,7 +2196,7 @@ void tst_QComboBox::noScrollbar() QVERIFY(!comboBox.view()->horizontalScrollBar()->isVisible()); QVERIFY(!comboBox.view()->verticalScrollBar()->isVisible()); } - + { QTableWidget *table = new QTableWidget(2,2); QComboBox comboBox; diff --git a/tests/auto/qcssparser/qcssparser.pro b/tests/auto/qcssparser/qcssparser.pro index b655db1..abf7187 100644 --- a/tests/auto/qcssparser/qcssparser.pro +++ b/tests/auto/qcssparser/qcssparser.pro @@ -11,4 +11,3 @@ wince*|symbian: { addFiles.path = . DEPLOYMENT += addFiles } - diff --git a/tests/auto/qcssparser/tst_cssparser.cpp b/tests/auto/qcssparser/tst_cssparser.cpp index ce923e1..9870ec2 100644 --- a/tests/auto/qcssparser/tst_cssparser.cpp +++ b/tests/auto/qcssparser/tst_cssparser.cpp @@ -1139,8 +1139,8 @@ void tst_CssParser::specificity() QVERIFY(parser.parse(&sheet)); QCOMPARE(sheet.styleRules.count() + sheet.nameIndex.count() + sheet.idIndex.count() , 1); - QCss::StyleRule rule = (!sheet.styleRules.isEmpty()) ? sheet.styleRules.at(0) - : (!sheet.nameIndex.isEmpty()) ? *sheet.nameIndex.begin() + QCss::StyleRule rule = (!sheet.styleRules.isEmpty()) ? sheet.styleRules.at(0) + : (!sheet.nameIndex.isEmpty()) ? *sheet.nameIndex.begin() : *sheet.idIndex.begin(); QCOMPARE(rule.selectors.count(), 1); QTEST(rule.selectors.at(0).specificity(), "specificity"); diff --git a/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp index 55dd85c..e5cb4486 100644 --- a/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp +++ b/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp @@ -2216,12 +2216,12 @@ void tst_QDateTimeEdit::mousePress() // Ask the SC_SpinBoxUp button location from style QStyleOptionSpinBox so; - so.rect = testWidget->rect(); + so.rect = testWidget->rect(); QRect rectUp = testWidget->style()->subControlRect(QStyle::CC_SpinBox, &so, QStyle::SC_SpinBoxUp, testWidget); - + // Send mouseClick to center of SC_SpinBoxUp QTest::mouseClick(testWidget, Qt::LeftButton, 0, rectUp.center()); - QCOMPARE(testWidget->date().year(), 2005); + QCOMPARE(testWidget->date().year(), 2005); } diff --git a/tests/auto/qdesktopservices/qdesktopservices.pro b/tests/auto/qdesktopservices/qdesktopservices.pro index 3c96e85..7c1bdb9 100644 --- a/tests/auto/qdesktopservices/qdesktopservices.pro +++ b/tests/auto/qdesktopservices/qdesktopservices.pro @@ -10,22 +10,22 @@ symbian: { dummy.path = . text.sources = text\* - text.path = \data\others\ + text.path = \data\others\ image.sources = image\* image.path = \data\images\ - + audio.sources = audio\* audio.path = \data\sounds\ - + video.sources = video\* - video.path = \data\videos\ - + video.path = \data\videos\ + install.sources = install\* - install.path = \data\installs\ - + install.path = \data\installs\ + DEPLOYMENT += image audio video install - + # These are only needed for manual tests #DEPLOYMENT += dummy text } diff --git a/tests/auto/qdesktopservices/tst_qdesktopservices.cpp b/tests/auto/qdesktopservices/tst_qdesktopservices.cpp index c69b112..5e3ae4a 100644 --- a/tests/auto/qdesktopservices/tst_qdesktopservices.cpp +++ b/tests/auto/qdesktopservices/tst_qdesktopservices.cpp @@ -61,16 +61,16 @@ private slots: void cleanup(); void openUrl(); #ifdef Q_OS_SYMBIAN - // These test are manual ones, you need to check from device that + // These test are manual ones, you need to check from device that // correct system application is started with correct content - // When you want to run these test, uncomment //#define RUN_MANUAL_TESTS + // When you want to run these test, uncomment //#define RUN_MANUAL_TESTS void openHttpUrl_data(); void openHttpUrl(); void openMailtoUrl_data(); - void openMailtoUrl(); + void openMailtoUrl(); void openFileUrl_data(); void openFileUrl(); -#endif +#endif void handlers(); void storageLocation_data(); void storageLocation(); @@ -104,7 +104,7 @@ void tst_qdesktopservices::openUrl() // At the bare minimum check that they return false for invalid url's QCOMPARE(QDesktopServices::openUrl(QUrl()), false); #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) - // this test is only valid on windows on other systems it might mean open a new document in the application handling .file + // this test is only valid on windows on other systems it might mean open a new document in the application handling .file QCOMPARE(QDesktopServices::openUrl(QUrl("file://invalid.file")), false); #endif } @@ -112,32 +112,32 @@ void tst_qdesktopservices::openUrl() #ifdef Q_OS_SYMBIAN void tst_qdesktopservices::openHttpUrl_data() { - QTest::addColumn<QUrl>("url"); - QTest::addColumn<bool>("result"); - QTest::newRow("BasicWithHttp") << QUrl("http://www.google.fi") << true; - QTest::newRow("BasicWithoutHttp") << QUrl("www.nokia.fi") << true; + QTest::addColumn<QUrl>("url"); + QTest::addColumn<bool>("result"); + QTest::newRow("BasicWithHttp") << QUrl("http://www.google.fi") << true; + QTest::newRow("BasicWithoutHttp") << QUrl("www.nokia.fi") << true; QTest::newRow("BasicWithUserAndPw") << QUrl("http://s60prereleases:oslofjord@pepper.troll.no/s60prereleases/patches/") << true; QTest::newRow("URL with space") << QUrl("http://www.manataka.org/Contents Page.html") << true; - + } void tst_qdesktopservices::openHttpUrl() { -#ifndef RUN_MANUAL_TESTS - QSKIP("Test disabled -- only for manual purposes", SkipAll); -#endif - - QFETCH(QUrl, url); - QFETCH(bool, result); - QCOMPARE(QDesktopServices::openUrl(url), result); +#ifndef RUN_MANUAL_TESTS + QSKIP("Test disabled -- only for manual purposes", SkipAll); +#endif + + QFETCH(QUrl, url); + QFETCH(bool, result); + QCOMPARE(QDesktopServices::openUrl(url), result); QTest::qWait(30000); } void tst_qdesktopservices::openMailtoUrl_data() { QTest::addColumn<QUrl>("url"); - QTest::addColumn<bool>("result"); - + QTest::addColumn<bool>("result"); + // http://en.wikipedia.org/wiki/E-mail_address // RFC Valid e-mail addresses QTest::newRow("Wiki valid email 1") << QUrl("mailto:abc@example.com") << true; @@ -149,97 +149,97 @@ void tst_qdesktopservices::openMailtoUrl_data() QTest::newRow("Wiki valid email 7") << QUrl("mailto:abc+mailbox/department=shipping@example.com") << true; // S60 email client considers the next URL invalid, even ity should be valid QTest::newRow("Wiki valid email 8") << QUrl("mailto:!#$%&'*+-/=?^_`.{|}~@example.com") << true; // all of these characters are allowed - QTest::newRow("Wiki valid email 9") << QUrl("mailto:\"abc@def\"@example.com") << true; // anything goes inside quotation marks + QTest::newRow("Wiki valid email 9") << QUrl("mailto:\"abc@def\"@example.com") << true; // anything goes inside quotation marks QTest::newRow("Wiki valid email 10") << QUrl("mailto:\"Fred \\\"quota\\\" Bloggs\"@example.com") << true; // however, quotes need escaping - - // RFC invalid e-mail addresses - // These return true even though they are invalid, but check that user is notified about invalid URL in mail application - QTest::newRow("Wiki invalid email 1") << QUrl("mailto:Abc.example.com") << true; // character @ is missing - QTest::newRow("Wiki invalid email 2") << QUrl("mailto:Abc.@example.com") << true; // character dot(.) is last in local part - QTest::newRow("Wiki invalid email 3") << QUrl("mailto:Abc..123@example.com") << true; // character dot(.) is double - QTest::newRow("Wiki invalid email 4") << QUrl("mailto:A@b@c@example.com") << true; // only one @ is allowed outside quotations marks - QTest::newRow("Wiki invalid email 5") << QUrl("mailto:()[]\\;:,<>@example.com") << true; // none of the characters before the @ is allowed outside quotation marks - - QTest::newRow("Basic") << QUrl("mailto:test@nokia.com") << true; + + // RFC invalid e-mail addresses + // These return true even though they are invalid, but check that user is notified about invalid URL in mail application + QTest::newRow("Wiki invalid email 1") << QUrl("mailto:Abc.example.com") << true; // character @ is missing + QTest::newRow("Wiki invalid email 2") << QUrl("mailto:Abc.@example.com") << true; // character dot(.) is last in local part + QTest::newRow("Wiki invalid email 3") << QUrl("mailto:Abc..123@example.com") << true; // character dot(.) is double + QTest::newRow("Wiki invalid email 4") << QUrl("mailto:A@b@c@example.com") << true; // only one @ is allowed outside quotations marks + QTest::newRow("Wiki invalid email 5") << QUrl("mailto:()[]\\;:,<>@example.com") << true; // none of the characters before the @ is allowed outside quotation marks + + QTest::newRow("Basic") << QUrl("mailto:test@nokia.com") << true; QTest::newRow("BasicSeveralAddr") << QUrl("mailto:test@nokia.com,test2@nokia.com,test3@nokia.com") << true; - QTest::newRow("BasicAndSubject") << QUrl("mailto:test@nokia.com?subject=hello nokia") << true; - QTest::newRow("BasicAndTo") << QUrl("mailto:test@nokia.com?to=test2@nokia.com") << true; - + QTest::newRow("BasicAndSubject") << QUrl("mailto:test@nokia.com?subject=hello nokia") << true; + QTest::newRow("BasicAndTo") << QUrl("mailto:test@nokia.com?to=test2@nokia.com") << true; + QTest::newRow("BasicAndCc") << QUrl("mailto:test@nokia.com?cc=mycc@address.com") << true; - QTest::newRow("BasicAndBcc") << QUrl("mailto:test@nokia.com?bcc=mybcc@address.com") << true; - QTest::newRow("BasicAndBody") << QUrl("mailto:test@nokia.com?body=Test email message body") << true; - + QTest::newRow("BasicAndBcc") << QUrl("mailto:test@nokia.com?bcc=mybcc@address.com") << true; + QTest::newRow("BasicAndBody") << QUrl("mailto:test@nokia.com?body=Test email message body") << true; + // RFC examples, these are actually invalid because there is not host defined // Check that user is notified about invalid URL in mail application QTest::newRow("RFC2368 Example 1") << QUrl::fromEncoded("mailto:addr1%2C%20addr2") << true; QTest::newRow("RFC2368 Example 2") << QUrl::fromEncoded("mailto:?to=addr1%2C%20addr2") << true; QTest::newRow("RFC2368 Example 3") << QUrl("mailto:addr1?to=addr2") << true; - - QTest::newRow("RFC2368 Example 4") << QUrl("mailto:joe@example.com?cc=bob@example.com&body=hello") << true; + + QTest::newRow("RFC2368 Example 4") << QUrl("mailto:joe@example.com?cc=bob@example.com&body=hello") << true; QTest::newRow("RFC2368 Example 5") << QUrl("mailto:?to=joe@example.com&cc=bob@example.com&body=hello") << true; QTest::newRow("RFC2368 Example 6") << QUrl("mailto:foobar@example.com?In-Reply-To=%3c3469A91.D10AF4C@example.com") << true; // OpaqueData QTest::newRow("RFC2368 Example 7") << QUrl::fromEncoded("mailto:infobot@example.com?body=send%20current-issue%0D%0Asend%20index") << true; QTest::newRow("RFC2368 Example 8") << QUrl::fromEncoded("mailto:infobot@example.com?body=send%20current-issue") << true; QTest::newRow("RFC2368 Example 9") << QUrl("mailto:infobot@example.com?subject=current-issue") << true; QTest::newRow("RFC2368 Example 10") << QUrl("mailto:chris@example.com") << true; - + //QTest::newRow("RFC2368 Example 11 - illegal chars") << QUrl("mailto:joe@example.com?cc=bob@example.com?body=hello") << false; QTest::newRow("RFC2368 Example 12") << QUrl::fromEncoded("mailto:gorby%25kremvax@example.com") << true; // encoded reserved chars '%' - QTest::newRow("RFC2368 Example 13") << QUrl::fromEncoded("mailto:unlikely%3Faddress@example.com?blat=foop") << true; // encoded reserved chars `?' + QTest::newRow("RFC2368 Example 13") << QUrl::fromEncoded("mailto:unlikely%3Faddress@example.com?blat=foop") << true; // encoded reserved chars `?' } void tst_qdesktopservices::openMailtoUrl() { -#ifndef RUN_MANUAL_TESTS - QSKIP("Test disabled -- only for manual purposes", SkipAll); -#endif - - QFETCH(QUrl, url); - QFETCH(bool, result); - QCOMPARE(QDesktopServices::openUrl(url), result); +#ifndef RUN_MANUAL_TESTS + QSKIP("Test disabled -- only for manual purposes", SkipAll); +#endif + + QFETCH(QUrl, url); + QFETCH(bool, result); + QCOMPARE(QDesktopServices::openUrl(url), result); } void tst_qdesktopservices::openFileUrl_data() { QTest::addColumn<QUrl>("url"); - QTest::addColumn<bool>("result"); - + QTest::addColumn<bool>("result"); + // Text files - QTest::newRow("DOS text file") << QUrl("file:///c:/data/others/dosfile.txt") << true; - QTest::newRow("No EOF text file") << QUrl("file:///c:/data/others/noendofline.txt") << true; + QTest::newRow("DOS text file") << QUrl("file:///c:/data/others/dosfile.txt") << true; + QTest::newRow("No EOF text file") << QUrl("file:///c:/data/others/noendofline.txt") << true; QTest::newRow("text file") << QUrl("file:///c:/data/others/testfile.txt") << true; - QTest::newRow("text file with space") << QUrl("file:///c:/data/others/test file.txt") << true; - + QTest::newRow("text file with space") << QUrl("file:///c:/data/others/test file.txt") << true; + // Images - QTest::newRow("BMP image") << QUrl("file:///c:/data/images/image.bmp") << true; - QTest::newRow("GIF image") << QUrl("file:///c:/data/images/image.gif") << true; - QTest::newRow("JPG image") << QUrl("file:///c:/data/images/image.jpg") << true; - QTest::newRow("PNG image") << QUrl("file:///c:/data/images/image.png") << true; - - // Audio - QTest::newRow("MP4 audio") << QUrl("file:///c:/data/sounds/aac-only.mp4") << true; - QTest::newRow("3GP audio") << QUrl("file:///c:/data/sounds/audio_3gpp.3gp") << true; - - // Video - QTest::newRow("MP4 video") << QUrl("file:///c:/data/videos/vid-mpeg4-22k.mp4") << true; - - // Installs - QTest::newRow("SISX") << QUrl("file:///c:/data/installs/ErrRd.sisx") << true; - - // Errors - QTest::newRow("File does not exist") << QUrl("file:///c:/thisfileneverexists.txt") << false; + QTest::newRow("BMP image") << QUrl("file:///c:/data/images/image.bmp") << true; + QTest::newRow("GIF image") << QUrl("file:///c:/data/images/image.gif") << true; + QTest::newRow("JPG image") << QUrl("file:///c:/data/images/image.jpg") << true; + QTest::newRow("PNG image") << QUrl("file:///c:/data/images/image.png") << true; + + // Audio + QTest::newRow("MP4 audio") << QUrl("file:///c:/data/sounds/aac-only.mp4") << true; + QTest::newRow("3GP audio") << QUrl("file:///c:/data/sounds/audio_3gpp.3gp") << true; + + // Video + QTest::newRow("MP4 video") << QUrl("file:///c:/data/videos/vid-mpeg4-22k.mp4") << true; + + // Installs + QTest::newRow("SISX") << QUrl("file:///c:/data/installs/ErrRd.sisx") << true; + + // Errors + QTest::newRow("File does not exist") << QUrl("file:///c:/thisfileneverexists.txt") << false; } void tst_qdesktopservices::openFileUrl() { -#ifndef RUN_MANUAL_TESTS - QSKIP("Test disabled -- only for manual purposes", SkipAll); -#endif - - QFETCH(QUrl, url); - QFETCH(bool, result); +#ifndef RUN_MANUAL_TESTS + QSKIP("Test disabled -- only for manual purposes", SkipAll); +#endif + + QFETCH(QUrl, url); + QFETCH(bool, result); QCOMPARE(QDesktopServices::openUrl(url), result); - QTest::qWait(15000); + QTest::qWait(15000); } #endif @@ -297,11 +297,11 @@ void tst_qdesktopservices::storageLocation() QString storageLocation = QDesktopServices::storageLocation(location); QString displayName = QDesktopServices::displayName(location); //qDebug( "displayName: %s", displayName ); - + storageLocation = storageLocation.toLower(); displayName = displayName.toLower(); - - QString drive = QDir::currentPath().left(2).toLower(); + + QString drive = QDir::currentPath().left(2).toLower(); if( drive == "z:" ) drive = "c:"; @@ -319,9 +319,9 @@ void tst_qdesktopservices::storageLocation() case QDesktopServices::ApplicationsLocation: #ifdef Q_CC_NOKIAX86 QCOMPARE( storageLocation, QString("z:/sys/bin") ); -#else - QCOMPARE( storageLocation, drive + QString("/sys/bin") ); -#endif +#else + QCOMPARE( storageLocation, drive + QString("/sys/bin") ); +#endif break; case QDesktopServices::MusicLocation: QCOMPARE( storageLocation, drive + QString("/data/sounds") ); @@ -331,7 +331,7 @@ void tst_qdesktopservices::storageLocation() break; case QDesktopServices::PicturesLocation: QCOMPARE( storageLocation, drive + QString("/data/images") ); - break; + break; case QDesktopServices::TempLocation: QCOMPARE( storageLocation, QDir::tempPath().toLower()); break; @@ -339,18 +339,18 @@ void tst_qdesktopservices::storageLocation() QCOMPARE( storageLocation, QDir::homePath().toLower()); break; case QDesktopServices::DataLocation: - // Just check the folder not the drive + // Just check the folder not the drive QCOMPARE( storageLocation.mid(2), QDir::currentPath().mid(2).toLower()); - break; + break; default: QCOMPARE( storageLocation, QString() ); - break; + break; } #else QDesktopServices::storageLocation(location); QDesktopServices::displayName(location); -#endif +#endif } diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp index 8f8200c..503c3e9 100644 --- a/tests/auto/qdir/tst_qdir.cpp +++ b/tests/auto/qdir/tst_qdir.cpp @@ -382,20 +382,20 @@ void tst_QDir::entryList_data() QTest::addColumn<int>("sortspec"); QTest::addColumn<QStringList>("expected"); QTest::newRow("spaces1") << SRCDIR "testdir/spaces" << QStringList("*. bar") - << (int)(QDir::NoFilter) << (int)(QDir::NoSort) - << QStringList("foo. bar"); // notice how spaces5 works + << (int)(QDir::NoFilter) << (int)(QDir::NoSort) + << QStringList("foo. bar"); // notice how spaces5 works QTest::newRow("spaces2") << SRCDIR "testdir/spaces" << QStringList("*.bar") - << (int)(QDir::NoFilter) << (int)(QDir::NoSort) - << QStringList("foo.bar"); + << (int)(QDir::NoFilter) << (int)(QDir::NoSort) + << QStringList("foo.bar"); QTest::newRow("spaces3") << SRCDIR "testdir/spaces" << QStringList("foo.*") - << (int)(QDir::NoFilter) << (int)(QDir::NoSort) - << QString("foo. bar,foo.bar").split(','); + << (int)(QDir::NoFilter) << (int)(QDir::NoSort) + << QString("foo. bar,foo.bar").split(','); QTest::newRow("files1") << SRCDIR "testdir/dir" << QString("*r.cpp *.pro").split(" ") - << (int)(QDir::NoFilter) << (int)(QDir::NoSort) - << QString("qdir.pro,qrc_qdir.cpp,tst_qdir.cpp").split(','); + << (int)(QDir::NoFilter) << (int)(QDir::NoSort) + << QString("qdir.pro,qrc_qdir.cpp,tst_qdir.cpp").split(','); QTest::newRow("testdir1") << SRCDIR "testdir" << QStringList() - << (int)(QDir::AllDirs) << (int)(QDir::NoSort) - << QString(".,..,dir,spaces").split(','); + << (int)(QDir::AllDirs) << (int)(QDir::NoSort) + << QString(".,..,dir,spaces").split(','); // #### this test uses filenames that cannot be represented on all filesystems we test, in // particular HFS+ on the Mac. When checking out the files with perforce it silently ignores the // error that it cannot represent the file names stored in the repository and the test fails. That @@ -404,8 +404,8 @@ void tst_QDir::entryList_data() // ignored but git reports an error. The test only tried to prevent QDir from _hanging_ when listing // the directory. // QTest::newRow("unprintablenames") << SRCDIR "unprintablenames" << QStringList("*") -// << (int)(QDir::NoFilter) << (int)(QDir::NoSort) -// << QString(".,..").split(","); +// << (int)(QDir::NoFilter) << (int)(QDir::NoSort) +// << QString(".,..").split(","); QTest::newRow("resources1") << QString(":/tst_qdir/resources/entryList") << QStringList("*.data") << (int)(QDir::NoFilter) << (int)(QDir::NoSort) << QString("file1.data,file2.data,file3.data").split(','); @@ -540,10 +540,10 @@ void tst_QDir::entryList() QFile::remove(SRCDIR "entrylist/brokenlink.lnk"); QFile::remove(SRCDIR "entrylist/brokenlink"); - // WinCE/Symbian does not have . and .. in the directory listing + // WinCE/Symbian does not have . and .. in the directory listing #if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) - expected.removeAll("."); - expected.removeAll(".."); + expected.removeAll("."); + expected.removeAll(".."); #endif #if defined(Q_OS_WIN) @@ -553,7 +553,7 @@ void tst_QDir::entryList() QFile::link(SRCDIR "entryList/nothing", SRCDIR "entrylist/brokenlink.lnk"); #elif defined(Q_OS_SYMBIAN) // Symbian doesn't support links to directories - expected.removeAll("linktodirectory.lnk"); + expected.removeAll("linktodirectory.lnk"); // Expecting failures from a couple of OpenC bugs. Do checks only once. static int xFailChecked = false; @@ -737,7 +737,7 @@ void tst_QDir::canonicalPath_data() } #endif - QTest::newRow("relative") << "." << appPath; + QTest::newRow("relative") << "." << appPath; QTest::newRow("relativeSubDir") << "./testData/../testData" << appPath + "/testData"; #ifndef Q_WS_WIN @@ -784,10 +784,10 @@ void tst_QDir::current_data() else appPath.chop(1); // remove the ending slash #if defined Q_WS_WIN - if (appPath.endsWith("release", Qt::CaseInsensitive)) - appPath = appPath.left(appPath.length()-8); + if (appPath.endsWith("release", Qt::CaseInsensitive)) + appPath = appPath.left(appPath.length()-8); else if (appPath.endsWith("debug", Qt::CaseInsensitive)) - appPath = appPath.left(appPath.length()-6); + appPath = appPath.left(appPath.length()-6); #endif QTest::newRow("startup") << QString() << appPath; @@ -821,9 +821,9 @@ void tst_QDir::current() QDir newCurrent = QDir::current(); QDir::setCurrent(oldDir); #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) - QCOMPARE(newCurrent.absolutePath().toLower(), currentDir.toLower()); + QCOMPARE(newCurrent.absolutePath().toLower(), currentDir.toLower()); #else - QCOMPARE(newCurrent.absolutePath(), currentDir); + QCOMPARE(newCurrent.absolutePath(), currentDir); #endif } @@ -838,8 +838,8 @@ void tst_QDir::cd_data() QTest::addColumn<QString>("newDir"); QString appPath = QDir::currentPath(); - int index = appPath.lastIndexOf("/"); - QTest::newRow("cdUp") << QDir::currentPath() << ".." << true << appPath.left(index==0?1:index); + int index = appPath.lastIndexOf("/"); + QTest::newRow("cdUp") << QDir::currentPath() << ".." << true << appPath.left(index==0?1:index); QTest::newRow("noChange") << QDir::currentPath() << "." << true << appPath; #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) // on windows QDir::root() is usually c:/ but cd "/" will not force it to be root QTest::newRow("absolute") << QDir::currentPath() << "/" << true << "/"; @@ -881,11 +881,11 @@ void tst_QDir::setNameFilters_data() QTest::newRow("spaces1") << appPath + "testdir/spaces" << QStringList("*. bar") << QStringList("foo. bar"); QTest::newRow("spaces2") << appPath + "testdir/spaces" << QStringList("*.bar") - << QStringList("foo.bar"); + << QStringList("foo.bar"); QTest::newRow("spaces3") << appPath + "testdir/spaces" << QStringList("foo.*") - << QString("foo. bar,foo.bar").split(","); + << QString("foo. bar,foo.bar").split(","); QTest::newRow("files1") << appPath + "testdir/dir" << QString("*r.cpp *.pro").split(" ") - << QString("qdir.pro,qrc_qdir.cpp,tst_qdir.cpp").split(","); + << QString("qdir.pro,qrc_qdir.cpp,tst_qdir.cpp").split(","); QTest::newRow("resources1") << QString(":/tst_qdir/resources/entryList") << QStringList("*.data") << QString("file1.data,file2.data,file3.data").split(','); } @@ -1172,7 +1172,7 @@ void tst_QDir::operator_eq() void tst_QDir::dotAndDotDot() { #if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) - QSKIP("WinCE and Symbian do not have . nor ..", SkipAll); + QSKIP("WinCE and Symbian do not have . nor ..", SkipAll); #endif QDir dir(QString(SRCDIR "testdir/")); QStringList entryList = dir.entryList(QDir::Dirs); diff --git a/tests/auto/qfiledialog/qfiledialog.pro b/tests/auto/qfiledialog/qfiledialog.pro index 3c238ec..bea7716 100644 --- a/tests/auto/qfiledialog/qfiledialog.pro +++ b/tests/auto/qfiledialog/qfiledialog.pro @@ -15,6 +15,4 @@ wince*|symbian: { } symbian:TARGET.EPOCHEAPSIZE="0x100 0x1000000" - symbian:HEADERS += ../../../include/qtgui/private/qfileinfogatherer_p.h - diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp index d94c7e4..fde4e0a 100644 --- a/tests/auto/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp @@ -1101,7 +1101,7 @@ void tst_QFileInfo::isExecutable() #ifdef Q_OS_SYMBIAN # if defined(Q_CC_NOKIAX86) QSKIP("Impossible to implement reading/touching of application binaries in Symbian emulator", SkipAll); -# endif +# endif QString appPath = "c:/sys/bin/tst_qfileinfo.exe"; #else QString appPath = QCoreApplication::applicationDirPath(); diff --git a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro index e9d7272..9750c43 100644 --- a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro +++ b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro @@ -3,12 +3,12 @@ CONFIG += qttest_p4 include(../../src/qfiledialog.pri) include(../../../../modeltest/modeltest.pri) -SOURCES += tst_qfilesystemmodel.cpp +SOURCES += tst_qfilesystemmodel.cpp TARGET = tst_qfilesystemmodel symbian: { HEADERS += ../../../include/qtgui/private/qfileinfogatherer_p.h - + # need to deploy something to create the private directory dummyDeploy.sources = tst_qfilesystemmodel.cpp dummyDeploy.path = . diff --git a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp index 7dd2fd0..eec9872 100644 --- a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp +++ b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp @@ -193,7 +193,7 @@ void tst_QFontDatabase::addAppFont() { #ifdef Q_OS_SYMBIAN QSKIP( "Symbian: Application fonts are not yet supported", SkipAll ); -#else +#else QFETCH(bool, useMemoryFont); QSignalSpy fontDbChangedSpy(QApplication::instance(), SIGNAL(fontDatabaseChanged())); @@ -243,7 +243,7 @@ void tst_QFontDatabase::addAppFont() QCOMPARE(fontDbChangedSpy.count(), 2); QVERIFY(db.families() == oldFamilies); -#endif +#endif } QTEST_MAIN(tst_QFontDatabase) diff --git a/tests/auto/qfontdialog/tst_qfontdialog.cpp b/tests/auto/qfontdialog/tst_qfontdialog.cpp index 1444ee0..57098a8 100644 --- a/tests/auto/qfontdialog/tst_qfontdialog.cpp +++ b/tests/auto/qfontdialog/tst_qfontdialog.cpp @@ -170,7 +170,7 @@ void tst_QFontDialog::task256466_wrongStyle() for (int i = 0; i < familyList->model()->rowCount(); ++i) { QModelIndex currentFamily = familyList->model()->index(i, 0); familyList->setCurrentIndex(currentFamily); - QCOMPARE(dialog.currentFont(), fdb.font(currentFamily.data().toString(), + QCOMPARE(dialog.currentFont(), fdb.font(currentFamily.data().toString(), styleList->currentIndex().data().toString(), sizeList->currentIndex().data().toInt())); } } diff --git a/tests/auto/qftp/tst_qftp.cpp b/tests/auto/qftp/tst_qftp.cpp index 7942d4b..f32803e 100644 --- a/tests/auto/qftp/tst_qftp.cpp +++ b/tests/auto/qftp/tst_qftp.cpp @@ -193,7 +193,7 @@ tst_QFtp::tst_QFtp() } tst_QFtp::~tst_QFtp() -{ +{ } void tst_QFtp::initTestCase_data() @@ -201,12 +201,12 @@ void tst_QFtp::initTestCase_data() QTest::addColumn<bool>("setProxy"); QTest::addColumn<int>("proxyType"); - QTest::newRow("WithoutProxy") << false << 0; -#ifdef TEST_QNETWORK_PROXY + QTest::newRow("WithoutProxy") << false << 0; +#ifdef TEST_QNETWORK_PROXY QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy); //### doesn't work well yet. //QTest::newRow("WithHttpProxy") << true << int(QNetworkProxy::HttpProxy); -#endif +#endif } void tst_QFtp::initTestCase() @@ -1293,7 +1293,7 @@ void tst_QFtp::abort_data() QTest::newRow( "get_fluke02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("qtest/rfc3252") << QByteArray(); // Qt/CE and Symbian test environment has to less memory for this test -#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) +#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) QByteArray bigData( 10*1024*1024, 0 ); bigData.fill( 'B' ); diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 7552f18..5df4e9e 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -6468,7 +6468,7 @@ public: QGraphicsRectItem::paint(painter, option, widget); painter->drawText(boundingRect(), Qt::AlignCenter, QString("%1x%2\n%3x%4").arg(p.x()).arg(p.y()).arg(sp.x()).arg(sp.y())); } - + protected: void hoverMoveEvent(QGraphicsSceneHoverEvent *event) { @@ -6650,7 +6650,7 @@ void tst_QGraphicsItem::setTransformProperties_data() QTest::newRow("rotationXYZ") << QPointF() << qreal(-25) << qreal(12) << qreal(556) << qreal(1.0) << qreal(1.0) << qreal(0.0) << qreal(0.0); - QTest::newRow("rotationXYZ dicentred") << QPointF(-53, 25.2) + QTest::newRow("rotationXYZ dicentred") << QPointF(-53, 25.2) << qreal(-2578.2) << qreal(4565.2) << qreal(56) << qreal(1.0) << qreal(1.0) << qreal(0.0) << qreal(0.0); @@ -6789,7 +6789,7 @@ void tst_QGraphicsItem::setTransformProperties() QCOMPARE_TRANSFORM(item1->sceneTransform(), item2->sceneTransform()); - QCOMPARE_TRANSFORM(item1->itemTransform(item2), QTransform()); + QCOMPARE_TRANSFORM(item1->itemTransform(item2), QTransform()); QCOMPARE_TRANSFORM(item2->itemTransform(item1), QTransform()); } @@ -6819,7 +6819,7 @@ void tst_QGraphicsItem::setTransformProperties() QCOMPARE_TRANSFORM(item1->sceneTransform(), item2->sceneTransform()); - QCOMPARE_TRANSFORM(item1->itemTransform(item2), QTransform()); + QCOMPARE_TRANSFORM(item1->itemTransform(item2), QTransform()); QCOMPARE_TRANSFORM(item2->itemTransform(item1), QTransform()); } } diff --git a/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp b/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp index 536c750..ea2646e 100644 --- a/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp +++ b/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp @@ -178,7 +178,7 @@ void tst_QGraphicsLayout::automaticReparenting() QCOMPARE(w1->parentItem(), static_cast<QGraphicsItem*>(window)); QCOMPARE(w2->parentItem(), static_cast<QGraphicsItem*>(window)); - // Sublayouts + // Sublayouts QGraphicsLinearLayout *l2 = new QGraphicsLinearLayout(); QGraphicsWidget *w3 = new QGraphicsWidget(); l2->addItem(w3); @@ -212,7 +212,7 @@ void tst_QGraphicsLayout::automaticReparenting() class TestLayout : public QGraphicsLinearLayout { public: - TestLayout(QGraphicsLayoutItem *parent = 0) + TestLayout(QGraphicsLayoutItem *parent = 0) : QGraphicsLinearLayout(parent) { m_count = 0; @@ -224,7 +224,7 @@ class TestLayout : public QGraphicsLinearLayout QGraphicsLinearLayout::setGeometry(rect); } - + int m_count; }; @@ -320,9 +320,9 @@ public: } void setGeometry(const QRectF &geom); - + QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF() ) const; - + inline QGraphicsRectItem *rectItem() { return static_cast<QGraphicsRectItem *>(graphicsItem()); } @@ -354,20 +354,20 @@ QSizeF AnimatedLayoutItem::sizeHint(Qt::SizeHint which, const QSizeF &constraint class AnimatedLayout : public QObject, public QGraphicsLinearLayout { Q_OBJECT public: - AnimatedLayout(QGraphicsWidget *widget) : QGraphicsLinearLayout(widget), m_timeline(500, this) + AnimatedLayout(QGraphicsWidget *widget) : QGraphicsLinearLayout(widget), m_timeline(500, this) { connect(&m_timeline, SIGNAL(valueChanged(qreal)), this, SLOT(valueChanged(qreal))); } - + void setGeometry(const QRectF &geom) { fromGeoms.clear(); toGeoms.clear(); for (int i = 0; i < count(); ++i) { fromGeoms << itemAt(i)->geometry(); } - + QGraphicsLinearLayout::setGeometry(geom); - + for (int i = 0; i < count(); ++i) { toGeoms << itemAt(i)->geometry(); } @@ -380,13 +380,13 @@ private slots: QGraphicsLayoutItem *li = itemAt(i); QRectF from = fromGeoms.at(i); QRectF to = toGeoms.at(i); - - QRectF geom(from.topLeft() + (to.topLeft() - from.topLeft()) * value, + + QRectF geom(from.topLeft() + (to.topLeft() - from.topLeft()) * value, from.size() + (to.size() - from.size()) * value); static_cast<QGraphicsRectItem*>(li->graphicsItem())->setRect(geom); } } -private: +private: QTimeLine m_timeline; QVector<QRectF> fromGeoms; QVector<QRectF> toGeoms; @@ -407,7 +407,7 @@ void tst_QGraphicsLayout::alternativeLayoutItems() QGraphicsRectItem *item1 = new QGraphicsRectItem; AnimatedLayoutItem *li1 = new AnimatedLayoutItem(item1); lout->addItem(li1); - + QGraphicsRectItem *item2 = new QGraphicsRectItem; AnimatedLayoutItem *li2 = new AnimatedLayoutItem(item2); lout->addItem(li2); @@ -417,7 +417,7 @@ void tst_QGraphicsLayout::alternativeLayoutItems() lout->addItem(li3); window->setLayout(lout); - + window->setGeometry(0, 0, 99, 99); view.setSceneRect(QRectF(-10, -10, 110, 110)); view.resize(150, 150); @@ -426,11 +426,11 @@ void tst_QGraphicsLayout::alternativeLayoutItems() QApplication::processEvents(); QTest::qWait(750); QApplication::processEvents(); - + QCOMPARE(static_cast<QGraphicsRectItem*>(li1->graphicsItem())->rect(), QRectF( 0, 0, 33, 99)); QCOMPARE(static_cast<QGraphicsRectItem*>(li2->graphicsItem())->rect(), QRectF(33, 0, 33, 99)); QCOMPARE(static_cast<QGraphicsRectItem*>(li3->graphicsItem())->rect(), QRectF(66, 0, 33, 99)); - + lout->setOrientation(Qt::Vertical); QApplication::processEvents(); @@ -439,7 +439,7 @@ void tst_QGraphicsLayout::alternativeLayoutItems() QCOMPARE(static_cast<QGraphicsRectItem*>(li1->graphicsItem())->rect(), QRectF(0, 0, 99, 33)); QCOMPARE(static_cast<QGraphicsRectItem*>(li2->graphicsItem())->rect(), QRectF(0, 33, 99, 33)); QCOMPARE(static_cast<QGraphicsRectItem*>(li3->graphicsItem())->rect(), QRectF(0, 66, 99, 33)); - + } class CustomLayoutItem : public QGraphicsLayoutItem { @@ -451,8 +451,8 @@ public: setOwnedByLayout(true); } - QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF() ) const; - + QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF() ) const; + ~CustomLayoutItem() { m_destructedSet->insert(this); } @@ -482,8 +482,8 @@ public: m_destructedSet = destructedSet; } - QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF() ) const; - + QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF() ) const; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget * = 0) { const QRect r = option->rect.adjusted(0, 0, -1, -1); @@ -565,7 +565,7 @@ void insertItem(int index, QGraphicsLayoutItem *item) QGraphicsWidget *widget = static_cast<QGraphicsWidget *>(item); updateParentWidget(widget); - + if (index == items.count()) { items.append(item); @@ -613,7 +613,7 @@ void tst_QGraphicsLayout::ownership() CustomLayoutItem *li3 = new CustomLayoutItem(&destructedSet); lay->addItem(li3); destructedSet.clear(); - + delete lay; QSet<QGraphicsLayoutItem*> expected; expected << li1 << li2 << li3; @@ -642,10 +642,10 @@ void tst_QGraphicsLayout::ownership() { QGraphicsWidget *window = new QGraphicsWidget(0, Qt::Window); QGraphicsLinearLayout *lay = new QGraphicsLinearLayout; - + CustomGraphicsWidget *li1 = new CustomGraphicsWidget; lay->addItem(li1); - + QGraphicsLinearLayout *li2 = new QGraphicsLinearLayout; CustomGraphicsWidget *li2_1 = new CustomGraphicsWidget; li2->addItem(li2_1); @@ -654,25 +654,25 @@ void tst_QGraphicsLayout::ownership() CustomGraphicsWidget *li2_3 = new CustomGraphicsWidget; li2->addItem(li2_3); lay->addItem(li2); - + CustomGraphicsWidget *li3 = new CustomGraphicsWidget; lay->addItem(li3); - + window->setLayout(lay); scene.addItem(window); view.resize(500, 200); view.show(); - + for (int i = li2->count(); i > 0; --i) { QCOMPARE(li2->count(), i); delete li2->itemAt(0); } - + for (int i = lay->count(); i > 0; --i) { QCOMPARE(lay->count(), i); delete lay->itemAt(0); } - + delete window; } @@ -687,7 +687,7 @@ void tst_QGraphicsLayout::ownership() delete top; //don't crash after that. } - + } QTEST_MAIN(tst_QGraphicsLayout) diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 0b1d5cf..b07d87e 100644 --- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -3187,7 +3187,7 @@ void tst_QGraphicsProxyWidget::windowFlags() QVERIFY((widget->windowFlags() & widgetWFlags) == widgetWFlags); proxy.setWidget(widget); - + if (resultingProxyFlags == 0) QVERIFY(!proxy.windowFlags()); else @@ -3223,4 +3223,3 @@ QTEST_MAIN(tst_QGraphicsProxyWidget) #else // QT_NO_STYLE_CLEANLOOKS QTEST_NOOP_MAIN #endif - diff --git a/tests/auto/qhostinfo/tst_qhostinfo.cpp b/tests/auto/qhostinfo/tst_qhostinfo.cpp index 50d2325..f4ad307 100644 --- a/tests/auto/qhostinfo/tst_qhostinfo.cpp +++ b/tests/auto/qhostinfo/tst_qhostinfo.cpp @@ -165,7 +165,7 @@ tst_QHostInfo::tst_QHostInfo() } tst_QHostInfo::~tst_QHostInfo() -{ +{ } void tst_QHostInfo::initTestCase() @@ -223,7 +223,7 @@ void tst_QHostInfo::lookupIPv4_data() QTest::newRow("empty") << "" << "" << int(QHostInfo::HostNotFound); QTest::newRow("lupinella_00") << "l" << lupinellaIp << int(QHostInfo::NoError); - QTest::newRow("lupinella_01") << "lupinella" << lupinellaIp << int(QHostInfo::NoError); + QTest::newRow("lupinella_01") << "lupinella" << lupinellaIp << int(QHostInfo::NoError); QTest::newRow("lupinella_02") << "lupinella.troll.no" << lupinellaIp << int(QHostInfo::NoError); QTest::newRow("lupinella_03") << "lupinella.trolltech.com" << lupinellaIp << int(QHostInfo::NoError); QTest::newRow("multiple_ip4") << "multi.dev.troll.no" << "1.2.3.4 1.2.3.5 10.3.3.31" << int(QHostInfo::NoError); @@ -392,7 +392,7 @@ protected: void tst_QHostInfo::threadSafety() { const int nattempts = 5; -#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) +#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) const int runs = 10; #else const int runs = 100; diff --git a/tests/auto/qhttp/tst_qhttp.cpp b/tests/auto/qhttp/tst_qhttp.cpp index a6bec39..37ce256 100644 --- a/tests/auto/qhttp/tst_qhttp.cpp +++ b/tests/auto/qhttp/tst_qhttp.cpp @@ -198,9 +198,9 @@ void tst_QHttp::initTestCase_data() QTest::addColumn<int>("proxyType"); QTest::newRow("WithoutProxy") << false << 0; -#ifdef TEST_QNETWORK_PROXY +#ifdef TEST_QNETWORK_PROXY QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy); -#endif +#endif } void tst_QHttp::initTestCase() @@ -426,7 +426,7 @@ void tst_QHttp::head_data() QTest::newRow( "failprot_01" ) << QtNetworkSettings::serverName() << 80u << QString("/t") << 1 << 404 << 0u; - + QTest::newRow( "failprot_02" ) << QtNetworkSettings::serverName() << 80u << QString("qtest/rfc3252.txt") << 1 << 400 << 0u; @@ -1242,11 +1242,11 @@ void tst_QHttp::unexpectedRemoteClose() QCoreApplication::instance()->processEvents(); QEventLoop loop; -#ifndef Q_OS_SYMBIAN +#ifndef Q_OS_SYMBIAN QTimer::singleShot(3000, &loop, SLOT(quit())); -#else +#else QTimer::singleShot(30000, &loop, SLOT(quit())); -#endif +#endif QHttp http; QObject::connect(&http, SIGNAL(done(bool)), &loop, SLOT(quit())); diff --git a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp index 236d1a1..9fe59c9 100644 --- a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp +++ b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp @@ -419,17 +419,17 @@ void tst_QHttpNetworkConnection::post() QCOMPARE(reply->statusCode(), statusCode); QCOMPARE(reply->reasonPhrase(), statusString); - + qint64 cLen = reply->contentLength(); if (cLen==-1) { - // HTTP 1.1 server may respond with chunked encoding and in that + // HTTP 1.1 server may respond with chunked encoding and in that // case contentLength is not present in reply -> verify that it is the case QByteArray transferEnc = reply->headerField("Transfer-Encoding"); QCOMPARE(transferEnc, QByteArray("chunked")); - } else { + } else { QCOMPARE(cLen, qint64(contentLength)); - } - + } + stopWatch.start(); QByteArray ba; do { @@ -442,7 +442,7 @@ void tst_QHttpNetworkConnection::post() QVERIFY(reply->isFinished()); QCOMPARE(ba.size(), downloadSize); - + delete reply; } diff --git a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp index ce96a2c..4287a16 100644 --- a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp +++ b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp @@ -324,9 +324,9 @@ void tst_QHttpSocketEngine::simpleConnectToIMAP() array.resize(available); QVERIFY(socketDevice.read(array.data(), array.size()) == available); - // Check that the greeting is what we expect it to be - QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); - + // Check that the greeting is what we expect it to be + QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); + // Write a logout message QByteArray array2 = "XXXX LOGOUT\r\n"; @@ -455,7 +455,7 @@ void tst_QHttpSocketEngine::tcpSocketBlockingTest() // Read greeting QVERIFY(socket.waitForReadyRead(5000)); QString s = socket.readLine(); - QCOMPARE(s.toLatin1().constData(), QtNetworkSettings::expectedReplyIMAP().constData()); + QCOMPARE(s.toLatin1().constData(), QtNetworkSettings::expectedReplyIMAP().constData()); // Write NOOP QCOMPARE((int) socket.write("1 NOOP\r\n", 8), 8); @@ -528,11 +528,11 @@ void tst_QHttpSocketEngine::tcpSocketNonBlockingTest() } // Read greeting - QVERIFY(!tcpSocketNonBlocking_data.isEmpty()); - QCOMPARE(tcpSocketNonBlocking_data.at(0).toLatin1().constData(), - QtNetworkSettings::expectedReplyIMAP().constData()); - - + QVERIFY(!tcpSocketNonBlocking_data.isEmpty()); + QCOMPARE(tcpSocketNonBlocking_data.at(0).toLatin1().constData(), + QtNetworkSettings::expectedReplyIMAP().constData()); + + tcpSocketNonBlocking_data.clear(); tcpSocketNonBlocking_totalWritten = 0; @@ -710,10 +710,10 @@ void tst_QHttpSocketEngine::passwordAuth() QByteArray array; array.resize(available); QVERIFY(socketDevice.read(array.data(), array.size()) == available); - + // Check that the greeting is what we expect it to be - QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); - + QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); + // Write a logout message QByteArray array2 = "XXXX LOGOUT\r\n"; diff --git a/tests/auto/qimage/tst_qimage.cpp b/tests/auto/qimage/tst_qimage.cpp index af02bbf..703be80 100644 --- a/tests/auto/qimage/tst_qimage.cpp +++ b/tests/auto/qimage/tst_qimage.cpp @@ -270,7 +270,7 @@ void tst_QImage::formatHandlersInput_data() const QString prefix = QLatin1String(SRCDIR) + "images/"; #else const QString prefix = QLatin1String(SRCDIR) + "/images/"; - #endif + #endif // add a new line here when a file is added QTest::newRow("ICO") << "ICO" << prefix + "image.ico"; @@ -1476,9 +1476,9 @@ void tst_QImage::smoothScale3() void tst_QImage::smoothScaleBig() { #if defined(Q_OS_WINCE) - int bigValue = 2000; + int bigValue = 2000; #elif defined(Q_OS_SYMBIAN) - int bigValue = 2000; + int bigValue = 2000; #else int bigValue = 200000; #endif diff --git a/tests/auto/qimagereader/qimagereader.pro b/tests/auto/qimagereader/qimagereader.pro index 44a0ddc..b4e1de1 100644 --- a/tests/auto/qimagereader/qimagereader.pro +++ b/tests/auto/qimagereader/qimagereader.pro @@ -35,4 +35,3 @@ symbian*: { DEPLOYMENT += images imagePlugins } - diff --git a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp index f1adc51..df0853b 100644 --- a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp +++ b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp @@ -1120,7 +1120,7 @@ void tst_QItemDelegate::enterKey() QTest::keyClick(editor, Qt::Key(key)); QApplication::processEvents(); - + if (widget == 2 || widget == 3) { QVERIFY(!editor.isNull()); QCOMPARE(editor && editor->hasFocus(), expectedFocus); diff --git a/tests/auto/qitemmodel/qitemmodel.pro b/tests/auto/qitemmodel/qitemmodel.pro index 381a008..eb62b24 100644 --- a/tests/auto/qitemmodel/qitemmodel.pro +++ b/tests/auto/qitemmodel/qitemmodel.pro @@ -3,8 +3,6 @@ SOURCES += tst_qitemmodel.cpp QT += sql -symbian:TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb" - # NOTE: The deployment of the sqldrivers is disabled on purpose. # If we deploy the plugins, they are loaded twice when running # the tests on the autotest system. In that case we run out of @@ -15,3 +13,12 @@ symbian:TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb" # plugFiles.path = sqldrivers # DEPLOYMENT += plugFiles #} + +symbian { + TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb" + contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { + sqlite.path = /sys/bin + sqlite.sources = sqlite3.dll + DEPLOYMENT += sqlite + } +} diff --git a/tests/auto/qitemview/tst_qitemview.cpp b/tests/auto/qitemview/tst_qitemview.cpp index 6b664e7..afe679c 100644 --- a/tests/auto/qitemview/tst_qitemview.cpp +++ b/tests/auto/qitemview/tst_qitemview.cpp @@ -256,7 +256,7 @@ void tst_QItemView::populate() { treeModel = new CheckerModel; QModelIndex parent; -#if defined(QT_ARCH_ARM) || defined(Q_OS_SYMBIAN) +#if defined(QT_ARCH_ARM) || defined(Q_OS_SYMBIAN) const int baseInsert = 4; #else const int baseInsert = 26; @@ -360,7 +360,7 @@ void tst_QItemView::nonDestructiveBasicTest() QCOMPARE(view->showDropIndicator(), false); view->setDropIndicatorShown(true); QCOMPARE(view->showDropIndicator(), true); - + // setDragEnabled view->setDragEnabled(false); QCOMPARE(view->dragEnabled(), false); diff --git a/tests/auto/qkeyevent/tst_qkeyevent.cpp b/tests/auto/qkeyevent/tst_qkeyevent.cpp index 1e19a49..9adf97c 100644 --- a/tests/auto/qkeyevent/tst_qkeyevent.cpp +++ b/tests/auto/qkeyevent/tst_qkeyevent.cpp @@ -179,7 +179,7 @@ void tst_QKeyEvent::sendRecieveKeyEvents() QFETCH( QString, text ); testWidget->recievedKeyPress = false; -#ifdef Q_WS_WIN +#ifdef Q_WS_WIN // Will be eaten by Windows system if ( key == Qt::Key_Print ) return; @@ -208,7 +208,7 @@ void tst_QKeyEvent::sendRecieveKeyEvents() if ( key >= Qt::Key_BracketRight && key <= Qt::Key_ydiaeresis ) return; #endif // Q_WS_WIN - + #ifdef Q_OS_SYMBIAN // Not supported on symbian if ( key == Qt::Key_Print ) @@ -238,7 +238,7 @@ void tst_QKeyEvent::sendRecieveKeyEvents() if ( key >= Qt::Key_BracketRight && key <= Qt::Key_ydiaeresis ) return; #endif // Q_WS_WIN - + if ( key == Qt::Key_F1 ) return; // Ignore for the moment diff --git a/tests/auto/qlibrary/tst/tst.pro b/tests/auto/qlibrary/tst/tst.pro index 06c2cd8..e15d7ed 100644 --- a/tests/auto/qlibrary/tst/tst.pro +++ b/tests/auto/qlibrary/tst/tst.pro @@ -22,7 +22,7 @@ wince*: { system.trolltech.test.mylib.dll binDep.path = /sys/bin #mylib.dl2 nonstandard binary deployment will cause warning in emulator, -#but it can be safely ignored. +#but it can be safely ignored. custBinDep.sources = mylib.dl2 custBinDep.path = /sys/bin diff --git a/tests/auto/qlocalsocket/lackey/lackey.pro b/tests/auto/qlocalsocket/lackey/lackey.pro index f073e7a..7bb6bc3 100644 --- a/tests/auto/qlocalsocket/lackey/lackey.pro +++ b/tests/auto/qlocalsocket/lackey/lackey.pro @@ -12,7 +12,7 @@ mac:CONFIG -= app_bundle DEFINES += QLOCALSERVER_DEBUG DEFINES += QLOCALSOCKET_DEBUG -SOURCES += main.cpp +SOURCES += main.cpp TARGET = lackey -symbian:TARGET.CAPABILITY = ALL -TCB
\ No newline at end of file +symbian:TARGET.CAPABILITY = ALL -TCB
\ No newline at end of file diff --git a/tests/auto/qlocalsocket/test/test.pro b/tests/auto/qlocalsocket/test/test.pro index e399a29..da741b9 100644 --- a/tests/auto/qlocalsocket/test/test.pro +++ b/tests/auto/qlocalsocket/test/test.pro @@ -43,5 +43,5 @@ wince*|symbian { scriptFiles.path = lackey/scripts DEPLOYMENT = additionalFiles scriptFiles QT += script # for easy deployment of QtScript -} +} diff --git a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp index be8ec3f..e20105b 100644 --- a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp @@ -55,7 +55,7 @@ #ifdef Q_OS_SYMBIAN #define STRINGIFY(x) #x #define TOSTRING(x) STRINGIFY(x) - #define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/" + #define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/" #endif Q_DECLARE_METATYPE(QLocalSocket::LocalSocketError) Q_DECLARE_METATYPE(QLocalSocket::LocalSocketState) @@ -377,7 +377,7 @@ void tst_QLocalSocket::listenAndConnect() QSignalSpy spyReadyRead(socket, SIGNAL(readyRead())); socket->connectToServer(name); -#if defined(QT_LOCALSOCKET_TCP) || defined (Q_OS_SYMBIAN) +#if defined(QT_LOCALSOCKET_TCP) || defined (Q_OS_SYMBIAN) QTest::qWait(250); #endif @@ -579,10 +579,10 @@ void tst_QLocalSocket::fullPath() LocalSocket socket; socket.connectToServer(serverName); -#if defined (Q_OS_SYMBIAN) +#if defined (Q_OS_SYMBIAN) QTest::qWait(250); -#endif - +#endif + QCOMPARE(socket.serverName(), serverName); QCOMPARE(socket.fullServerName(), serverName); socket.disconnectFromServer(); @@ -730,16 +730,16 @@ void tst_QLocalSocket::threadedConnection() Server server; #if defined(Q_OS_SYMBIAN) server.setStackSize(0x14000); -#endif +#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) +#if defined(Q_OS_SYMBIAN) clients.last()->setStackSize(0x14000); -#endif +#endif clients.last()->start(); } @@ -951,7 +951,7 @@ void tst_QLocalSocket::unlink(QString name) int result = ::unlink(fullName.toUtf8().data()); if(result != 0) { - qWarning() << "Unlinking " << fullName << " failed with " << strerror(errno); + qWarning() << "Unlinking " << fullName << " failed with " << strerror(errno); } } #endif diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp index ce6afa1..9568e69 100644 --- a/tests/auto/qmenu/tst_qmenu.cpp +++ b/tests/auto/qmenu/tst_qmenu.cpp @@ -443,7 +443,7 @@ void tst_QMenu::overrideMenuAction() delete aFileMenu; - //after the deletion of the override menu action, + //after the deletion of the override menu action, //the menu should have its default menu action back QCOMPARE(m->menuAction(), menuaction); @@ -472,7 +472,7 @@ void tst_QMenu::statusTip() QVERIFY(btn != NULL); - //because showMenu calls QMenu::exec, we need to use a singleshot + //because showMenu calls QMenu::exec, we need to use a singleshot //to continue the test QTimer::singleShot(200,this, SLOT(onStatusTipTimer())); btn->showMenu(); @@ -486,10 +486,10 @@ void tst_QMenu::onStatusTipTimer() QVERIFY(menu != 0); QVERIFY(menu->isVisible()); QTest::keyClick(menu, Qt::Key_Down); - + //we store the statustip to press escape in any case //otherwise, if the test fails it blocks (never gets out of QMenu::exec - const QString st=statustip; + const QString st=statustip; menu->close(); //goes out of the menu @@ -554,10 +554,10 @@ void tst_QMenu::tearOff() menu->popup(QPoint(0,0)); QTest::qWait(50); QVERIFY(!menu->isTearOffMenuVisible()); - + QTest::mouseClick(menu, Qt::LeftButton, 0, QPoint(3, 3), 10); QTest::qWait(100); - + QVERIFY(menu->isTearOffMenuVisible()); QPointer<QMenu> torn = 0; foreach (QWidget *w, QApplication::allWidgets()) { @@ -640,7 +640,7 @@ void tst_QMenu::activeSubMenuPosition() main->setActiveAction(menuAction); sub->setActiveAction(subAction); -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN main->popup(QPoint(50,200)); #else main->popup(QPoint(200,200)); diff --git a/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp b/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp index dd584a0..be0bfe3 100644 --- a/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp +++ b/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp @@ -204,9 +204,9 @@ void tst_QNativeSocketEngine::simpleConnectToIMAP() //--------------------------------------------------------------------------- void tst_QNativeSocketEngine::udpLoopbackTest() { -#ifdef SYMBIAN_WINSOCK_CONNECTIVITY +#ifdef SYMBIAN_WINSOCK_CONNECTIVITY QSKIP("Not working on Emulator without WinPCAP", SkipAll); -#endif +#endif QNativeSocketEngine udpSocket; // Initialize device #1 @@ -257,7 +257,7 @@ void tst_QNativeSocketEngine::udpIPv6LoopbackTest() { #if defined(Q_OS_SYMBIAN) QSKIP("Symbian: IPv6 is not yet supported", SkipAll); -#endif +#endif QNativeSocketEngine udpSocket; // Initialize device #1 @@ -309,7 +309,7 @@ void tst_QNativeSocketEngine::broadcastTest() { #ifdef Q_OS_AIX QSKIP("Broadcast does not work on darko", SkipAll); -#endif +#endif QNativeSocketEngine broadcastSocket; // Initialize a regular Udp socket @@ -401,10 +401,10 @@ void tst_QNativeSocketEngine::serverTest() //--------------------------------------------------------------------------- void tst_QNativeSocketEngine::udpLoopbackPerformance() -{ -#ifdef SYMBIAN_WINSOCK_CONNECTIVITY +{ +#ifdef SYMBIAN_WINSOCK_CONNECTIVITY QSKIP("Not working on Emulator without WinPCAP", SkipAll); -#endif +#endif QNativeSocketEngine udpSocket; // Initialize device #1 @@ -576,13 +576,13 @@ void tst_QNativeSocketEngine::bind() QNativeSocketEngine binder3; QVERIFY(binder3.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol)); QVERIFY(!binder3.bind(QHostAddress::Any, 31180)); - -#ifdef SYMBIAN_WINSOCK_CONNECTIVITY + +#ifdef SYMBIAN_WINSOCK_CONNECTIVITY qDebug("On Symbian Emulator (WinSock) we get EADDRNOTAVAIL instead of EADDRINUSE"); - QVERIFY(binder3.error() == QAbstractSocket::SocketAddressNotAvailableError); + QVERIFY(binder3.error() == QAbstractSocket::SocketAddressNotAvailableError); #else QVERIFY(binder3.error() == QAbstractSocket::AddressInUseError); -#endif +#endif } //--------------------------------------------------------------------------- diff --git a/tests/auto/qnetworkinterface/tst_qnetworkinterface.cpp b/tests/auto/qnetworkinterface/tst_qnetworkinterface.cpp index cf3d856..f3f343b 100644 --- a/tests/auto/qnetworkinterface/tst_qnetworkinterface.cpp +++ b/tests/auto/qnetworkinterface/tst_qnetworkinterface.cpp @@ -129,8 +129,8 @@ void tst_QNetworkInterface::loopbackIPv6() { #ifdef Q_OS_SYMBIAN QSKIP( "Symbian: IPv6 is not yet supported", SkipAll ); -#else - +#else + QList<QHostAddress> all = QNetworkInterface::allAddresses(); bool loopbackfound = false; @@ -142,9 +142,9 @@ void tst_QNetworkInterface::loopbackIPv6() break; } else if (addr.protocol() == QAbstractSocket::IPv6Protocol) anyIPv6 = true; - + QVERIFY(!anyIPv6 || loopbackfound); -#endif +#endif } void tst_QNetworkInterface::localAddress() diff --git a/tests/auto/qnetworkreply/test/test.pro b/tests/auto/qnetworkreply/test/test.pro index 593de8b..e0df503 100644 --- a/tests/auto/qnetworkreply/test/test.pro +++ b/tests/auto/qnetworkreply/test/test.pro @@ -25,12 +25,10 @@ symbian:{ addFiles.sources = ../empty ../rfc3252.txt ../resource ../bigfile addFiles.path = . DEPLOYMENT += addFiles - + # Symbian toolchain does not support correct include semantics INCPATH+=..\..\..\..\include\QtNetwork\private # bigfile test case requires more heap TARGET.EPOCHEAPSIZE="0x100 0x1000000" TARGET.CAPABILITY="ALL -TCB" } - - diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 305eca6..3817d9e 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -876,7 +876,7 @@ tst_QNetworkReply::tst_QNetworkReply() } tst_QNetworkReply::~tst_QNetworkReply() -{ +{ } @@ -1721,11 +1721,11 @@ void tst_QNetworkReply::ioGetFromFtp() DataReader reader(reply); connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN QTestEventLoop::instance().enterLoop(20); #else - QTestEventLoop::instance().enterLoop(10); -#endif + QTestEventLoop::instance().enterLoop(10); +#endif QVERIFY(!QTestEventLoop::instance().timeout()); QCOMPARE(reply->url(), request.url()); @@ -1755,19 +1755,19 @@ void tst_QNetworkReply::ioGetFromFtpWithReuse() QSignalSpy spy(reply1, SIGNAL(finished())); connect(reply2, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN QTestEventLoop::instance().enterLoop(20); #else - QTestEventLoop::instance().enterLoop(10); -#endif + QTestEventLoop::instance().enterLoop(10); +#endif QVERIFY(!QTestEventLoop::instance().timeout()); if (spy.count() == 0) { connect(reply1, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN QTestEventLoop::instance().enterLoop(20); #else - QTestEventLoop::instance().enterLoop(10); -#endif + QTestEventLoop::instance().enterLoop(10); +#endif QVERIFY(!QTestEventLoop::instance().timeout()); } @@ -2456,11 +2456,11 @@ void tst_QNetworkReply::ioGetWithManyProxies() SLOT(sslErrors(QNetworkReply*,QList<QSslError>))); #endif -#ifndef Q_OS_SYMBIAN +#ifndef Q_OS_SYMBIAN QTestEventLoop::instance().enterLoop(10); -#else +#else QTestEventLoop::instance().enterLoop(60); -#endif +#endif QVERIFY(!QTestEventLoop::instance().timeout()); manager.disconnect(SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), @@ -3308,11 +3308,11 @@ void tst_QNetworkReply::downloadProgress() QVERIFY2(sender->waitForBytesWritten(2000), "Network timeout"); spy.clear(); -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN QTestEventLoop::instance().enterLoop(5); #else QTestEventLoop::instance().enterLoop(2); -#endif +#endif QVERIFY(!QTestEventLoop::instance().timeout()); QVERIFY(spy.count() > 0); @@ -3325,11 +3325,11 @@ void tst_QNetworkReply::downloadProgress() delete sender; spy.clear(); -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN QTestEventLoop::instance().enterLoop(5); #else QTestEventLoop::instance().enterLoop(2); -#endif +#endif QVERIFY(!QTestEventLoop::instance().timeout()); QVERIFY(spy.count() > 0); @@ -3344,7 +3344,7 @@ void tst_QNetworkReply::uploadProgress_data() } void tst_QNetworkReply::uploadProgress() -{ +{ QFETCH(QByteArray, data); QTcpServer server; QVERIFY(server.listen()); @@ -3616,11 +3616,11 @@ void tst_QNetworkReply::httpProxyCommands() // wait for the finished signal connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN QTestEventLoop::instance().enterLoop(5); #else - QTestEventLoop::instance().enterLoop(1); -#endif + QTestEventLoop::instance().enterLoop(1); +#endif QVERIFY(!QTestEventLoop::instance().timeout()); diff --git a/tests/auto/qobject/qobject.pro b/tests/auto/qobject/qobject.pro index 0cafdc3..b6b3f20 100644 --- a/tests/auto/qobject/qobject.pro +++ b/tests/auto/qobject/qobject.pro @@ -1,4 +1,2 @@ TEMPLATE = subdirs SUBDIRS = tst_qobject.pro signalbug.pro - - diff --git a/tests/auto/qobject/tst_qobject.cpp b/tests/auto/qobject/tst_qobject.cpp index 3276dee..f2d3651 100644 --- a/tests/auto/qobject/tst_qobject.cpp +++ b/tests/auto/qobject/tst_qobject.cpp @@ -1422,7 +1422,7 @@ void tst_QObject::moveToThread() #if defined(Q_OS_SYMBIAN) // Child timer will be registered after parent timer in the new // thread, and 10ms is less than symbian timer resolution, so - // child->timerEventThread compare after thread.wait() will + // child->timerEventThread compare after thread.wait() will // usually fail unless timers are farther apart. child->startTimer(100); object->startTimer(150); diff --git a/tests/auto/qobject/tst_qobject.pro b/tests/auto/qobject/tst_qobject.pro index b3bda37..aed181f 100644 --- a/tests/auto/qobject/tst_qobject.pro +++ b/tests/auto/qobject/tst_qobject.pro @@ -15,4 +15,3 @@ symbian: { addFiles.path = \sys\bin DEPLOYMENT += addFiles } - diff --git a/tests/auto/qobjectrace/tst_qobjectrace.cpp b/tests/auto/qobjectrace/tst_qobjectrace.cpp index b3052e0..b7a0bd6 100644 --- a/tests/auto/qobjectrace/tst_qobjectrace.cpp +++ b/tests/auto/qobjectrace/tst_qobjectrace.cpp @@ -44,8 +44,8 @@ #include <QtTest/QtTest> -enum { OneMinute = 60 * 1000, - TwoMinutes = OneMinute * 2, +enum { OneMinute = 60 * 1000, + TwoMinutes = OneMinute * 2, TenMinutes = OneMinute * 10, TwentyFiveMinutes = OneMinute * 25 }; @@ -143,7 +143,7 @@ void tst_QObjectRace::moveToThreadRace() // ### FIXME: task 257411 - remove xfail once this is fixed QEXPECT_FAIL("", "Symbian event dispatcher can't handle this kind of race, see task: 257411", Abort); QVERIFY(false); -#endif +#endif RaceObject *object = new RaceObject; enum { ThreadCount = 10 }; @@ -222,7 +222,7 @@ public: // Symbian needs "a bit" more time # define EXTRA_THREAD_WAIT TenMinutes # define MAIN_THREAD_WAIT TwentyFiveMinutes -#else +#else # define EXTRA_THREAD_WAIT 3000 # define MAIN_THREAD_WAIT TwoMinutes #endif @@ -230,13 +230,13 @@ public: void tst_QObjectRace::destroyRace() { #if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86) - // ### FIXME: task 257411 - remove xfail once this is fixed. + // ### FIXME: task 257411 - remove xfail once this is fixed. // Oddly enough, this seems to work properly in HW, if given enough time and memory. QEXPECT_FAIL("", "Symbian event dispatcher can't handle this kind of race on emulator, see task: 257411", Abort); QVERIFY(false); -#endif +#endif - enum { ThreadCount = 10, ObjectCountPerThread = 733, + enum { ThreadCount = 10, ObjectCountPerThread = 733, ObjectCount = ThreadCount * ObjectCountPerThread }; const char *_slots[] = { SLOT(slot1()) , SLOT(slot2()) , SLOT(slot3()), diff --git a/tests/auto/qpluginloader/tst/tst.pro b/tests/auto/qpluginloader/tst/tst.pro index f848bb1..ecc4ecb 100644 --- a/tests/auto/qpluginloader/tst/tst.pro +++ b/tests/auto/qpluginloader/tst/tst.pro @@ -24,7 +24,6 @@ symbian: { libDep.path = /sys/bin pluginDep.sources = theplugin.dll pluginDep.path = bin - + DEPLOYMENT += libDep pluginDep } - diff --git a/tests/auto/qpluginloader/tst_qpluginloader.cpp b/tests/auto/qpluginloader/tst_qpluginloader.cpp index 5f07c78..d45acaf 100644 --- a/tests/auto/qpluginloader/tst_qpluginloader.cpp +++ b/tests/auto/qpluginloader/tst_qpluginloader.cpp @@ -303,13 +303,13 @@ void tst_QPluginLoader::checkingStubsFromDifferentDrives() // This test needs C-drive + some additional drive (driveForStubs) - const QString driveForStubs("E:/");// != "C:/" + const QString driveForStubs("E:/");// != "C:/" const QString stubDir("system/temp/stubtest/"); const QString stubName("dummyStub.qtplugin"); const QString fullStubFileName(stubDir + stubName); QDir dir(driveForStubs); bool test1(false); bool test2(false); - + // initial clean up QFile::remove(driveForStubs + fullStubFileName); dir.rmdir(driveForStubs + stubDir); @@ -317,22 +317,22 @@ void tst_QPluginLoader::checkingStubsFromDifferentDrives() // create a stub dir and do stub drive check if (!dir.mkpath(stubDir)) QSKIP("Required drive not available for this test", SkipSingle); - + {// test without stub, should not be found QPluginLoader loader("C:/" + fullStubFileName); test1 = !loader.fileName().length(); - } - + } + // create a stub to defined drive QFile tempFile(driveForStubs + fullStubFileName); tempFile.open(QIODevice::ReadWrite); QFileInfo fileInfo(tempFile); - - {// now should be found even tried to find from C: + + {// now should be found even tried to find from C: QPluginLoader loader("C:/" + fullStubFileName); test2 = (loader.fileName() == fileInfo.absoluteFilePath()); } - + // clean up tempFile.close(); if (!QFile::remove(driveForStubs + fullStubFileName)) @@ -343,10 +343,9 @@ void tst_QPluginLoader::checkingStubsFromDifferentDrives() // test after cleanup QVERIFY(test1); QVERIFY(test2); - + #endif//Q_OS_SYMBIAN } QTEST_APPLESS_MAIN(tst_QPluginLoader) #include "tst_qpluginloader.moc" - diff --git a/tests/auto/qprogressbar/tst_qprogressbar.cpp b/tests/auto/qprogressbar/tst_qprogressbar.cpp index 403b56b..7f0c17d 100644 --- a/tests/auto/qprogressbar/tst_qprogressbar.cpp +++ b/tests/auto/qprogressbar/tst_qprogressbar.cpp @@ -174,7 +174,7 @@ void tst_QProgressBar::format() bar.repainted = false; bar.setFormat("%v of %m (%p%)"); qApp->processEvents(); -#ifndef Q_WS_MAC +#ifndef Q_WS_MAC // The Mac scroll bar is animated, which means we get paint events all the time. QVERIFY(!bar.repainted); #endif diff --git a/tests/auto/qresourceengine/qresourceengine.pro b/tests/auto/qresourceengine/qresourceengine.pro index d98c2db..3fad4c0 100644 --- a/tests/auto/qresourceengine/qresourceengine.pro +++ b/tests/auto/qresourceengine/qresourceengine.pro @@ -7,12 +7,12 @@ load(resources) # Input SOURCES += tst_resourceengine.cpp -RESOURCES += testqrc/test.qrc +RESOURCES += testqrc/test.qrc symbian-sbsv2 { - runtime_resource.target = $$PWD/runtime_resource.rcc + runtime_resource.target = $$PWD/runtime_resource.rcc } else { - runtime_resource.target = runtime_resource.rcc + runtime_resource.target = runtime_resource.rcc } runtime_resource.depends = $$PWD/testqrc/test.qrc runtime_resource.commands = $$QMAKE_RCC -root /runtime_resource/ -binary $${runtime_resource.depends} -o $${runtime_resource.target} @@ -21,15 +21,15 @@ PRE_TARGETDEPS += $${runtime_resource.target} wince*|symbian*:{ deploy.sources += runtime_resource.rcc parentdir.txt - test.sources = testqrc/* + test.sources = testqrc/* test.path = testqrc alias.sources = testqrc/aliasdir/* alias.path = testqrc/aliasdir - other.sources = testqrc/otherdir/* + other.sources = testqrc/otherdir/* other.path = testqrc/otherdir - search1.sources = testqrc/searchpath1/* + search1.sources = testqrc/searchpath1/* search1.path = testqrc/searchpath1 - search2.sources = testqrc/searchpath2/* + search2.sources = testqrc/searchpath2/* search2.path = testqrc/searchpath2 sub.sources = testqrc/subdir/* sub.path = testqrc/subdir diff --git a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp index 7215852..130133c 100644 --- a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp +++ b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp @@ -256,8 +256,8 @@ tst_Suite::tst_Suite() #ifdef Q_OS_SYMBIAN addTestExclusion("nested-repetition-count-overflow", "Demands too much memory on Symbian"); - addTestExclusion("unicode-test", "Demands too much memory on Symbian"); -#endif + addTestExclusion("unicode-test", "Demands too much memory on Symbian"); +#endif QVector<uint> *data = qt_meta_data_tst_Suite(); // content: diff --git a/tests/auto/qsettings/tst_qsettings.cpp b/tests/auto/qsettings/tst_qsettings.cpp index 2731c01..fdb2eb3 100644 --- a/tests/auto/qsettings/tst_qsettings.cpp +++ b/tests/auto/qsettings/tst_qsettings.cpp @@ -124,7 +124,7 @@ private slots: void setPath(); void setDefaultFormat(); void dontCreateNeedlessPaths(); -#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN) +#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN) void dontReorderIniKeysNeedlessly(); #endif @@ -3673,7 +3673,7 @@ void tst_QSettings::dontCreateNeedlessPaths() QVERIFY(!fileInfo.dir().exists()); } -#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN) +#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN) void tst_QSettings::dontReorderIniKeysNeedlessly() { #ifdef QT_QSETTINGS_ALWAYS_CASE_SENSITIVE_AND_FORGET_ORIGINAL_KEY_ORDER diff --git a/tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp b/tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp index d4ae159..a6064bc 100644 --- a/tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp +++ b/tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp @@ -134,24 +134,24 @@ void tst_QSocketNotifier::unexpectedDisconnection() QNativeSocketEngine readEnd1; readEnd1.initialize(QAbstractSocket::TcpSocket); - bool b = readEnd1.connectToHost(server.serverAddress(), server.serverPort()); + bool b = readEnd1.connectToHost(server.serverAddress(), server.serverPort()); QVERIFY(readEnd1.waitForWrite()); // while (!b && readEnd1.state() != QAbstractSocket::ConnectedState) // b = readEnd1.connectToHost(server.serverAddress(), server.serverPort()); QVERIFY(readEnd1.state() == QAbstractSocket::ConnectedState); - QVERIFY(server.waitForNewConnection()); + QVERIFY(server.waitForNewConnection()); QTcpSocket *writeEnd1 = server.nextPendingConnection(); QVERIFY(writeEnd1 != 0); - + QNativeSocketEngine readEnd2; readEnd2.initialize(QAbstractSocket::TcpSocket); - b = readEnd2.connectToHost(server.serverAddress(), server.serverPort()); + b = readEnd2.connectToHost(server.serverAddress(), server.serverPort()); QVERIFY(readEnd2.waitForWrite()); // while (!b) // b = readEnd2.connectToHost(server.serverAddress(), server.serverPort()); QVERIFY(readEnd2.state() == QAbstractSocket::ConnectedState); - QVERIFY(server.waitForNewConnection()); - QTcpSocket *writeEnd2 = server.nextPendingConnection(); + QVERIFY(server.waitForNewConnection()); + QTcpSocket *writeEnd2 = server.nextPendingConnection(); QVERIFY(writeEnd2 != 0); writeEnd1->write("1", 1); @@ -167,7 +167,7 @@ void tst_QSocketNotifier::unexpectedDisconnection() do { // we have to wait until sequence value changes - // as any event can make us jump out processing + // as any event can make us jump out processing QCoreApplication::processEvents(QEventLoop::WaitForMoreEvents); } while(tester.getSequence() <= 0); diff --git a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp index 2fc80da..d6628bd 100644 --- a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp +++ b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp @@ -336,7 +336,7 @@ void tst_QSocks5SocketEngine::simpleConnectToIMAP() QVERIFY(socketDevice.read(array.data(), array.size()) == available); // Check that the greeting is what we expect it to be - QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); + QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); // Write a logout message QByteArray array2 = "XXXX LOGOUT\r\n"; @@ -528,10 +528,10 @@ void tst_QSocks5SocketEngine::serverTest() //--------------------------------------------------------------------------- void tst_QSocks5SocketEngine::udpTest() { -#ifdef SYMBIAN_WINSOCK_CONNECTIVITY +#ifdef SYMBIAN_WINSOCK_CONNECTIVITY QSKIP("UDP works bads on non WinPCAP emulator setting", SkipAll); -#endif - +#endif + QSocks5SocketEngine udpSocket; // Initialize device #1 @@ -669,10 +669,10 @@ void tst_QSocks5SocketEngine::tcpSocketNonBlockingTest() } // Read greeting - QVERIFY(!tcpSocketNonBlocking_data.isEmpty()); - QCOMPARE(tcpSocketNonBlocking_data.at(0).toLatin1().constData(), - QtNetworkSettings::expectedReplyIMAP().constData()); - + QVERIFY(!tcpSocketNonBlocking_data.isEmpty()); + QCOMPARE(tcpSocketNonBlocking_data.at(0).toLatin1().constData(), + QtNetworkSettings::expectedReplyIMAP().constData()); + tcpSocketNonBlocking_data.clear(); tcpSocketNonBlocking_totalWritten = 0; @@ -857,9 +857,9 @@ void tst_QSocks5SocketEngine::passwordAuth() array.resize(available); QVERIFY(socketDevice.read(array.data(), array.size()) == available); - // Check that the greeting is what we expect it to be - QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); - + // Check that the greeting is what we expect it to be + QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); + // Write a logout message QByteArray array2 = "XXXX LOGOUT\r\n"; QVERIFY(socketDevice.write(array2.data(), @@ -925,9 +925,9 @@ void tst_QSocks5SocketEngine::passwordAuth2() array.resize(available); QVERIFY(socketDevice.read(array.data(), array.size()) == available); - // Check that the greeting is what we expect it to be - QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); - + // Check that the greeting is what we expect it to be + QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); + // Write a logout message QByteArray array2 = "XXXX LOGOUT\r\n"; QVERIFY(socketDevice.write(array2.data(), diff --git a/tests/auto/qsql/qsql.pro b/tests/auto/qsql/qsql.pro index 6660f42..167a38d 100644 --- a/tests/auto/qsql/qsql.pro +++ b/tests/auto/qsql/qsql.pro @@ -1,7 +1,7 @@ load(qttest_p4) SOURCES += tst_qsql.cpp -QT += sql +QT += sql contains(QT_CONFIG, qt3support): QT += qt3support @@ -12,7 +12,7 @@ wince*: { symbian { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.sources = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqldatabase/qsqldatabase.pro b/tests/auto/qsqldatabase/qsqldatabase.pro index d4d049a..1749d1e 100644 --- a/tests/auto/qsqldatabase/qsqldatabase.pro +++ b/tests/auto/qsqldatabase/qsqldatabase.pro @@ -19,10 +19,10 @@ wince*: { symbian { TARGET.EPOCHEAPSIZE=5000 5000000 TARGET.EPOCSTACKSIZE=50000 - + contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.sources = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqldriver/qsqldriver.pro b/tests/auto/qsqldriver/qsqldriver.pro index 0024841..59fc73a 100644 --- a/tests/auto/qsqldriver/qsqldriver.pro +++ b/tests/auto/qsqldriver/qsqldriver.pro @@ -6,7 +6,7 @@ QT += sql wince*: { plugFiles.sources = ../../../plugins/sqldrivers plugFiles.path = . - DEPLOYMENT += plugFiles + DEPLOYMENT += plugFiles } else { win32-g++ { LIBS += -lws2_32 diff --git a/tests/auto/qsqlerror/qsqlerror.pro b/tests/auto/qsqlerror/qsqlerror.pro index 855e720..2eb7934 100644 --- a/tests/auto/qsqlerror/qsqlerror.pro +++ b/tests/auto/qsqlerror/qsqlerror.pro @@ -10,7 +10,7 @@ SOURCES += tst_qsqlerror.cpp symbian { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.sources = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqlfield/qsqlfield.pro b/tests/auto/qsqlfield/qsqlfield.pro index 022d73f..6e5b461 100644 --- a/tests/auto/qsqlfield/qsqlfield.pro +++ b/tests/auto/qsqlfield/qsqlfield.pro @@ -6,7 +6,7 @@ QT += sql symbian { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.sources = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqlquery/qsqlquery.pro b/tests/auto/qsqlquery/qsqlquery.pro index 0313775..6222fa0 100644 --- a/tests/auto/qsqlquery/qsqlquery.pro +++ b/tests/auto/qsqlquery/qsqlquery.pro @@ -10,13 +10,13 @@ QT = core sql wince*: { plugFiles.sources = ../../../plugins/sqldrivers plugFiles.path = . - DEPLOYMENT += plugFiles + DEPLOYMENT += plugFiles } symbian { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.sources = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp index ab7f0c9..3187854 100644 --- a/tests/auto/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp @@ -302,7 +302,7 @@ void tst_QSqlQuery::dropTestTables( QSqlDatabase db ) tablenames << qTableName( "qtest_lockedtable" ); tablenames << qTableName( "Planet" ); - + tablenames << qTableName( "task_250026" ); tablenames << qTableName( "task_234422" ); diff --git a/tests/auto/qsqlquerymodel/qsqlquerymodel.pro b/tests/auto/qsqlquerymodel/qsqlquerymodel.pro index 7aa78a1..0adb6cd 100644 --- a/tests/auto/qsqlquerymodel/qsqlquerymodel.pro +++ b/tests/auto/qsqlquerymodel/qsqlquerymodel.pro @@ -8,7 +8,7 @@ wince*: { }else:symbian { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.sources = sqlite3.dll DEPLOYMENT += sqlite } }else { diff --git a/tests/auto/qsqlrecord/qsqlrecord.pro b/tests/auto/qsqlrecord/qsqlrecord.pro index db92c09..67e8ab9 100644 --- a/tests/auto/qsqlrecord/qsqlrecord.pro +++ b/tests/auto/qsqlrecord/qsqlrecord.pro @@ -4,7 +4,7 @@ SOURCES += tst_qsqlrecord.cpp symbian { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.sources = sqlite3.dll DEPLOYMENT += sqlite } diff --git a/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro b/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro index 6d7795b..5236447 100644 --- a/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro +++ b/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro @@ -6,11 +6,11 @@ QT += sql wince*: { plugFiles.sources = ../../../plugins/sqldrivers plugFiles.path = . - DEPLOYMENT += plugFiles + DEPLOYMENT += plugFiles }else:symbian { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.sources = sqlite3.dll DEPLOYMENT += sqlite } }else { diff --git a/tests/auto/qsqltablemodel/qsqltablemodel.pro b/tests/auto/qsqltablemodel/qsqltablemodel.pro index f7043cc..a9a536b 100644 --- a/tests/auto/qsqltablemodel/qsqltablemodel.pro +++ b/tests/auto/qsqltablemodel/qsqltablemodel.pro @@ -6,11 +6,11 @@ QT += sql wince*: { plugFiles.sources = ../../../plugins/sqldrivers plugFiles.path = . - DEPLOYMENT += plugFiles + DEPLOYMENT += plugFiles }else:symbian { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.sources = sqlite3.dll DEPLOYMENT += sqlite } }else { diff --git a/tests/auto/qsqlthread/qsqlthread.pro b/tests/auto/qsqlthread/qsqlthread.pro index 05c84e2..414f857 100644 --- a/tests/auto/qsqlthread/qsqlthread.pro +++ b/tests/auto/qsqlthread/qsqlthread.pro @@ -7,11 +7,11 @@ QT = core sql wince*: { plugFiles.sources = ../../../plugins/sqldrivers plugFiles.path = . - DEPLOYMENT += plugFiles + DEPLOYMENT += plugFiles }else:symbian { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.sources = sqlite3.dll DEPLOYMENT += sqlite } }else { diff --git a/tests/auto/qsslsocket/qsslsocket.pro b/tests/auto/qsslsocket/qsslsocket.pro index 8f61318..147175e 100644 --- a/tests/auto/qsslsocket/qsslsocket.pro +++ b/tests/auto/qsslsocket/qsslsocket.pro @@ -17,7 +17,7 @@ win32 { wince* { DEFINES += SRCDIR=\\\"./\\\" - + certFiles.sources = certs ssl.tar.gz certFiles.path = . DEPLOYMENT += certFiles @@ -25,7 +25,7 @@ wince* { DEFINES += QSSLSOCKET_CERTUNTRUSTED_WORKAROUND TARGET.EPOCHEAPSIZE="0x100 0x1000000" TARGET.CAPABILITY="ALL -TCB" - + certFiles.sources = certs ssl.tar.gz certFiles.path = . DEPLOYMENT += certFiles diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp index 295302f..95382bd 100644 --- a/tests/auto/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp @@ -195,9 +195,9 @@ protected slots: } void untrustedWorkaroundSlot(const QList<QSslError> &errors) { - if (errors.size() == 1 && - (errors.first().error() == QSslError::CertificateUntrusted || - errors.first().error() == QSslError::SelfSignedCertificate)) + if (errors.size() == 1 && + (errors.first().error() == QSslError::CertificateUntrusted || + errors.first().error() == QSslError::SelfSignedCertificate)) socket->ignoreSslErrors(); } @@ -223,7 +223,7 @@ tst_QSslSocket::tst_QSslSocket() } tst_QSslSocket::~tst_QSslSocket() -{ +{ } enum ProxyTests { @@ -498,7 +498,7 @@ void tst_QSslSocket::simpleConnectWithIgnore() if (!socket.canReadLine()) enterLoop(10); - QCOMPARE(socket.readAll(), QtNetworkSettings::expectedReplySSL()); + QCOMPARE(socket.readAll(), QtNetworkSettings::expectedReplySSL()); socket.disconnectFromHost(); } @@ -946,7 +946,7 @@ void tst_QSslSocket::waitForConnectedEncryptedReadyRead() QVERIFY(socket->waitForConnected(10000)); QVERIFY(socket->waitForEncrypted(10000)); - // dont forget to login + // dont forget to login QCOMPARE((int) socket->write("USER ftptest\r\n"), 14); QCOMPARE((int) socket->write("PASS ftP2Ptf\r\n"), 14); @@ -1050,7 +1050,7 @@ void tst_QSslSocket::systemCaCertificates() void tst_QSslSocket::wildcard() { - QSKIP("TODO: solve wildcard problem", SkipAll); + QSKIP("TODO: solve wildcard problem", SkipAll); if (!QSslSocket::supportsSsl()) return; @@ -1305,11 +1305,11 @@ protected: // delayed acceptance: QTest::qSleep(100); -#ifndef Q_OS_SYMBIAN +#ifndef Q_OS_SYMBIAN bool ret = server.waitForNewConnection(2000); #else - bool ret = server.waitForNewConnection(20000); -#endif + bool ret = server.waitForNewConnection(20000); +#endif // delayed start of encryption QTest::qSleep(100); @@ -1499,13 +1499,13 @@ void tst_QSslSocket::disconnectFromHostWhenConnecting() // without proxy, the state will be HostLookupState; // with proxy, the state will be ConnectingState. QVERIFY(socket->state() == QAbstractSocket::HostLookupState || - socket->state() == QAbstractSocket::ConnectingState); + socket->state() == QAbstractSocket::ConnectingState); socket->disconnectFromHost(); // the state of the socket must be the same before and after calling // disconnectFromHost() QCOMPARE(state, socket->state()); QVERIFY(socket->state() == QAbstractSocket::HostLookupState || - socket->state() == QAbstractSocket::ConnectingState); + socket->state() == QAbstractSocket::ConnectingState); QVERIFY(socket->waitForDisconnected(5000)); QCOMPARE(socket->state(), QAbstractSocket::UnconnectedState); // we did not call close, so the socket must be still open @@ -1522,16 +1522,16 @@ void tst_QSslSocket::disconnectFromHostWhenConnected() QSslSocketPtr socket = newSocket(); socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 993); socket->ignoreSslErrors(); -#ifndef Q_OS_SYMBIAN +#ifndef Q_OS_SYMBIAN QVERIFY(socket->waitForEncrypted(5000)); -#else - QVERIFY(socket->waitForEncrypted(10000)); -#endif +#else + QVERIFY(socket->waitForEncrypted(10000)); +#endif socket->write("XXXX LOGOUT\r\n"); QCOMPARE(socket->state(), QAbstractSocket::ConnectedState); socket->disconnectFromHost(); QCOMPARE(socket->state(), QAbstractSocket::ClosingState); -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN // I don't understand how socket->waitForDisconnected can work on other platforms // since socket->write will end to: // QMetaObject::invokeMethod(this, "_q_flushWriteBuffer", Qt::QueuedConnection); @@ -1540,9 +1540,9 @@ void tst_QSslSocket::disconnectFromHostWhenConnected() connect(socket, SIGNAL(disconnected()), this, SLOT(exitLoop())); enterLoop(5); QVERIFY(!timeout()); -#else - QVERIFY(socket->waitForDisconnected(5000)); -#endif +#else + QVERIFY(socket->waitForDisconnected(5000)); +#endif QCOMPARE(socket->bytesToWrite(), qint64(0)); } diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp index a859866..b6e16f0 100644 --- a/tests/auto/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp @@ -128,7 +128,7 @@ private slots: void targetStateDeleted(); void transitionToRootState(); void transitionEntersParent(); - + void defaultErrorState(); void customGlobalErrorState(); void customLocalErrorStateInBrokenState(); @@ -147,16 +147,16 @@ private slots: void customErrorStateNotInGraph(); void transitionToStateNotInGraph(); void restoreProperties(); - + void defaultGlobalRestorePolicy(); void globalRestorePolicySetToRestore(); void globalRestorePolicySetToDoNotRestore(); void noInitialStateForInitialState(); - + //void restorePolicyNotInherited(); //void mixedRestoreProperties(); - //void setRestorePolicyToDoNotRestore(); + //void setRestorePolicyToDoNotRestore(); //void setGlobalRestorePolicyToGlobalRestore(); //void restorePolicyOnChildState(); @@ -185,7 +185,7 @@ private slots: // void removeDefaultAnimationForSource(); // void removeDefaultAnimationForTarget(); // void overrideDefaultAnimationWithSource(); -// void overrideDefaultAnimationWithTarget(); +// void overrideDefaultAnimationWithTarget(); // void overrideDefaultSourceAnimationWithSpecific(); // void overrideDefaultTargetAnimationWithSpecific(); // void overrideDefaultTargetAnimationWithSource(); @@ -372,14 +372,14 @@ void tst_QStateMachine::defaultErrorState() class CustomErrorState: public QState { public: - CustomErrorState(QStateMachine *machine, QState *parent = 0) + CustomErrorState(QStateMachine *machine, QState *parent = 0) : QState(parent), error(QStateMachine::NoError), m_machine(machine) { } void onEntry(QEvent *) { - error = m_machine->error(); + error = m_machine->error(); errorString = m_machine->errorString(); } @@ -423,7 +423,7 @@ void tst_QStateMachine::customGlobalErrorState() QVERIFY(machine.configuration().contains(initialState)); QCoreApplication::processEvents(); - + QCOMPARE(machine.isRunning(), true); QCOMPARE(machine.configuration().count(), 1); QVERIFY(machine.configuration().contains(customErrorState)); @@ -434,7 +434,7 @@ void tst_QStateMachine::customGlobalErrorState() } void tst_QStateMachine::customLocalErrorStateInBrokenState() -{ +{ QStateMachine machine; CustomErrorState *customErrorState = new CustomErrorState(&machine); machine.addState(customErrorState); @@ -446,15 +446,15 @@ void tst_QStateMachine::customLocalErrorStateInBrokenState() QState *brokenState = new QState(); brokenState->setObjectName("brokenState"); - machine.addState(brokenState); - brokenState->setErrorState(customErrorState); + machine.addState(brokenState); + brokenState->setErrorState(customErrorState); QState *childState = new QState(brokenState); childState->setObjectName("childState"); initialState->addTransition(new EventTransition(QEvent::Type(QEvent::User + 1), brokenState)); - machine.start(); + machine.start(); QCoreApplication::processEvents(); machine.postEvent(new QEvent(QEvent::Type(QEvent::User + 1))); @@ -474,15 +474,15 @@ void tst_QStateMachine::customLocalErrorStateInOtherState() QState *initialState = new QState(); initialState->setObjectName("initialState"); - QTest::ignoreMessage(QtWarningMsg, "QState::setErrorState: error state cannot belong to a different state machine"); + QTest::ignoreMessage(QtWarningMsg, "QState::setErrorState: error state cannot belong to a different state machine"); initialState->setErrorState(customErrorState); machine.addState(initialState); machine.setInitialState(initialState); QState *brokenState = new QState(); brokenState->setObjectName("brokenState"); - - machine.addState(brokenState); + + machine.addState(brokenState); QState *childState = new QState(brokenState); childState->setObjectName("childState"); @@ -513,7 +513,7 @@ void tst_QStateMachine::customLocalErrorStateInParentOfBrokenState() QState *parentOfBrokenState = new QState(); machine.addState(parentOfBrokenState); parentOfBrokenState->setObjectName("parentOfBrokenState"); - parentOfBrokenState->setErrorState(customErrorState); + parentOfBrokenState->setErrorState(customErrorState); QState *brokenState = new QState(parentOfBrokenState); brokenState->setObjectName("brokenState"); @@ -553,7 +553,7 @@ void tst_QStateMachine::customLocalErrorStateOverridesParent() machine.addState(parentOfBrokenState); parentOfBrokenState->setObjectName("parentOfBrokenState"); parentOfBrokenState->setErrorState(customErrorStateForParent); - + QState *brokenState = new QState(parentOfBrokenState); brokenState->setObjectName("brokenState"); brokenState->setErrorState(customErrorStateForBrokenState); @@ -592,10 +592,10 @@ void tst_QStateMachine::errorStateHasChildren() QState *initialState = new QState(); initialState->setObjectName("initialState"); machine.addState(initialState); - machine.setInitialState(initialState); + machine.setInitialState(initialState); QState *brokenState = new QState(); - brokenState->setObjectName("brokenState"); + brokenState->setObjectName("brokenState"); machine.addState(brokenState); QState *childState = new QState(brokenState); @@ -612,7 +612,7 @@ void tst_QStateMachine::errorStateHasChildren() QCOMPARE(machine.isRunning(), true); QCOMPARE(machine.configuration().count(), 2); QVERIFY(machine.configuration().contains(customErrorState)); - QVERIFY(machine.configuration().contains(childOfErrorState)); + QVERIFY(machine.configuration().contains(childOfErrorState)); } @@ -631,10 +631,10 @@ void tst_QStateMachine::errorStateHasErrors() QState *initialState = new QState(); initialState->setObjectName("initialState"); machine.addState(initialState); - machine.setInitialState(initialState); + machine.setInitialState(initialState); QState *brokenState = new QState(); - brokenState->setObjectName("brokenState"); + brokenState->setObjectName("brokenState"); machine.addState(brokenState); QState *childState = new QState(brokenState); @@ -663,10 +663,10 @@ void tst_QStateMachine::errorStateIsRootState() QState *initialState = new QState(); initialState->setObjectName("initialState"); machine.addState(initialState); - machine.setInitialState(initialState); - + machine.setInitialState(initialState); + QState *brokenState = new QState(); - brokenState->setObjectName("brokenState"); + brokenState->setObjectName("brokenState"); machine.addState(brokenState); QState *childState = new QState(brokenState); @@ -703,7 +703,7 @@ void tst_QStateMachine::errorStateEntersParentFirst() QState *grandParent = new QState(greatGrandParent); grandParent->setObjectName("grandParent"); - grandParent->assignProperty(entryController, "grandParentEntered", true); + grandParent->assignProperty(entryController, "grandParentEntered", true); QState *parent = new QState(grandParent); parent->setObjectName("parent"); @@ -718,7 +718,7 @@ void tst_QStateMachine::errorStateEntersParentFirst() initialStateOfGreatGrandParent->setObjectName("initialStateOfGreatGrandParent"); greatGrandParent->setInitialState(initialStateOfGreatGrandParent); - QState *brokenState = new QState(greatGrandParent); + QState *brokenState = new QState(greatGrandParent); brokenState->setObjectName("brokenState"); QState *childState = new QState(brokenState); @@ -784,9 +784,9 @@ void tst_QStateMachine::customErrorStateIsNull() void tst_QStateMachine::clearError() { - QStateMachine machine; + QStateMachine machine; machine.setErrorState(new QState(machine.rootState())); // avoid warnings - + QState *brokenState = new QState(machine.rootState()); brokenState->setObjectName("brokenState"); machine.setInitialState(brokenState); @@ -819,10 +819,10 @@ void tst_QStateMachine::historyStateAsInitialState() QHistoryState *s2h = new QHistoryState(s2); s2->setInitialState(s2h); - + QState *s21 = new QState(s2); s2h->setDefaultState(s21); - + s1->addTransition(new EventTransition(QEvent::User, s2)); machine.start(); @@ -877,17 +877,17 @@ void tst_QStateMachine::brokenStateIsNeverEntered() entryController->setProperty("childStateEntered", false); entryController->setProperty("errorStateEntered", false); - QState *initialState = new QState(machine.rootState()); + QState *initialState = new QState(machine.rootState()); machine.setInitialState(initialState); QState *errorState = new QState(machine.rootState()); errorState->assignProperty(entryController, "errorStateEntered", true); - machine.setErrorState(errorState); + machine.setErrorState(errorState); QState *brokenState = new QState(machine.rootState()); brokenState->assignProperty(entryController, "brokenStateEntered", true); brokenState->setObjectName("brokenState"); - + QState *childState = new QState(brokenState); childState->assignProperty(entryController, "childStateEntered", true); @@ -906,7 +906,7 @@ void tst_QStateMachine::brokenStateIsNeverEntered() void tst_QStateMachine::transitionToStateNotInGraph() { - QStateMachine machine; + QStateMachine machine; QState *initialState = new QState(machine.rootState()); initialState->setObjectName("initialState"); @@ -1017,7 +1017,7 @@ void tst_QStateMachine::addAndRemoveState() { QStateMachine machine; QStatePrivate *root_d = QStatePrivate::get(machine.rootState()); - QCOMPARE(root_d->childStates().size(), 0); + QCOMPARE(root_d->childStates().size(), 0); QTest::ignoreMessage(QtWarningMsg, "QStateMachine::addState: cannot add null state"); machine.addState(0); @@ -1499,7 +1499,7 @@ public: : QAbstractTransition(QList<QAbstractState*>() << target), m_value(value) {} protected: - virtual bool eventTest(QEvent *e) + virtual bool eventTest(QEvent *e) { if (e->type() != QEvent::Type(QEvent::User+2)) return false; @@ -2387,7 +2387,7 @@ void tst_QStateMachine::targetStateWithNoParent() machine.start(); QTest::ignoreMessage(QtWarningMsg, "Unrecoverable error detected in running state machine: No common ancestor for targets and source of transition from state 's1'"); QTRY_COMPARE(startedSpy.count(), 1); - QCOMPARE(machine.isRunning(), false); + QCOMPARE(machine.isRunning(), false); QCOMPARE(stoppedSpy.count(), 1); QCOMPARE(finishedSpy.count(), 0); QCOMPARE(machine.error(), QStateMachine::NoCommonAncestorForTransitionError); @@ -2407,7 +2407,7 @@ void tst_QStateMachine::targetStateDeleted() void tst_QStateMachine::defaultGlobalRestorePolicy() { - QStateMachine machine; + QStateMachine machine; QObject *propertyHolder = new QObject(&machine); propertyHolder->setProperty("a", 1); @@ -2427,7 +2427,7 @@ void tst_QStateMachine::defaultGlobalRestorePolicy() machine.setInitialState(s1); machine.start(); QCoreApplication::processEvents(); - + QCOMPARE(propertyHolder->property("a").toInt(), 3); QCOMPARE(propertyHolder->property("b").toInt(), 2); @@ -2441,7 +2441,7 @@ void tst_QStateMachine::defaultGlobalRestorePolicy() QCoreApplication::processEvents(); QCOMPARE(propertyHolder->property("a").toInt(), 3); - QCOMPARE(propertyHolder->property("b").toInt(), 4); + QCOMPARE(propertyHolder->property("b").toInt(), 4); } void tst_QStateMachine::noInitialStateForInitialState() @@ -2466,7 +2466,7 @@ void tst_QStateMachine::noInitialStateForInitialState() /* void tst_QStateMachine::restorePolicyNotInherited() { - QStateMachine machine; + QStateMachine machine; QObject *propertyHolder = new QObject(); propertyHolder->setProperty("a", 1); @@ -2494,7 +2494,7 @@ void tst_QStateMachine::restorePolicyNotInherited() machine.setInitialState(parentState); machine.start(); QCoreApplication::processEvents(); - + QCOMPARE(propertyHolder->property("a").toInt(), 3); QCOMPARE(propertyHolder->property("b").toInt(), 2); @@ -2508,7 +2508,7 @@ void tst_QStateMachine::restorePolicyNotInherited() QCoreApplication::processEvents(); QCOMPARE(propertyHolder->property("a").toInt(), 3); - QCOMPARE(propertyHolder->property("b").toInt(), 4); + QCOMPARE(propertyHolder->property("b").toInt(), 4); }*/ @@ -2535,7 +2535,7 @@ void tst_QStateMachine::globalRestorePolicySetToDoNotRestore() machine.setInitialState(s1); machine.start(); QCoreApplication::processEvents(); - + QCOMPARE(propertyHolder->property("a").toInt(), 3); QCOMPARE(propertyHolder->property("b").toInt(), 2); @@ -2549,7 +2549,7 @@ void tst_QStateMachine::globalRestorePolicySetToDoNotRestore() QCoreApplication::processEvents(); QCOMPARE(propertyHolder->property("a").toInt(), 3); - QCOMPARE(propertyHolder->property("b").toInt(), 4); + QCOMPARE(propertyHolder->property("b").toInt(), 4); } /* @@ -2655,7 +2655,7 @@ void tst_QStateMachine::restorePolicyOnChildState() machine.setInitialState(parentState); machine.start(); QCoreApplication::processEvents(); - + QCOMPARE(propertyHolder->property("a").toInt(), 3); QCOMPARE(propertyHolder->property("b").toInt(), 2); @@ -2669,13 +2669,13 @@ void tst_QStateMachine::restorePolicyOnChildState() QCoreApplication::processEvents(); QCOMPARE(propertyHolder->property("a").toInt(), 1); - QCOMPARE(propertyHolder->property("b").toInt(), 2); + QCOMPARE(propertyHolder->property("b").toInt(), 2); } */ void tst_QStateMachine::globalRestorePolicySetToRestore() { - QStateMachine machine; + QStateMachine machine; machine.setGlobalRestorePolicy(QStateMachine::RestoreProperties); QObject *propertyHolder = new QObject(&machine); @@ -2696,7 +2696,7 @@ void tst_QStateMachine::globalRestorePolicySetToRestore() machine.setInitialState(s1); machine.start(); QCoreApplication::processEvents(); - + QCOMPARE(propertyHolder->property("a").toInt(), 3); QCOMPARE(propertyHolder->property("b").toInt(), 2); @@ -2710,16 +2710,16 @@ void tst_QStateMachine::globalRestorePolicySetToRestore() QCoreApplication::processEvents(); QCOMPARE(propertyHolder->property("a").toInt(), 1); - QCOMPARE(propertyHolder->property("b").toInt(), 2); + QCOMPARE(propertyHolder->property("b").toInt(), 2); } /* void tst_QStateMachine::mixedRestoreProperties() { - QStateMachine machine; + QStateMachine machine; QObject *propertyHolder = new QObject(); - propertyHolder->setProperty("a", 1); + propertyHolder->setProperty("a", 1); QState *s1 = new QState(machine.rootState()); s1->setRestorePolicy(QState::RestoreProperties); @@ -2746,7 +2746,7 @@ void tst_QStateMachine::mixedRestoreProperties() machine.setInitialState(s1); machine.start(); QCoreApplication::processEvents(); - + // Enter s1, save current QCOMPARE(propertyHolder->property("a").toInt(), 3); @@ -2822,7 +2822,7 @@ void tst_QStateMachine::simpleAnimation() QCOREAPPLICATION_EXEC(5000); QVERIFY(machine.configuration().contains(s3)); - QCOMPARE(object->property("fooBar").toDouble(), 2.0); + QCOMPARE(object->property("fooBar").toDouble(), 2.0); } class SlotCalledCounter: public QObject @@ -2855,7 +2855,7 @@ void tst_QStateMachine::twoAnimations() animationBar->setDuration(900); SlotCalledCounter counter; - connect(animationFoo, SIGNAL(finished()), &counter, SLOT(slot())); + connect(animationFoo, SIGNAL(finished()), &counter, SLOT(slot())); connect(animationBar, SIGNAL(finished()), &counter, SLOT(slot())); EventTransition *et = new EventTransition(QEvent::User, s2); @@ -2877,7 +2877,7 @@ void tst_QStateMachine::twoAnimations() QVERIFY(machine.configuration().contains(s3)); QCOMPARE(object->property("foo").toDouble(), 2.0); QCOMPARE(object->property("bar").toDouble(), 10.0); - + QCOMPARE(counter.counter, 2); } @@ -2990,12 +2990,12 @@ void tst_QStateMachine::nestedTargetStateForAnimation() QState *s2Child2 = new QState(s2); s2Child2->assignProperty(object, "bar", 11.0); QAbstractTransition *at = s2Child->addTransition(new EventTransition(QEvent::User, s2Child2)); - + QPropertyAnimation *animation = new QPropertyAnimation(object, "bar", s2); animation->setDuration(2000); connect(animation, SIGNAL(finished()), &counter, SLOT(slot())); at->addAnimation(animation); - + at = s1->addTransition(new EventTransition(QEvent::User, s2)); animation = new QPropertyAnimation(object, "foo", s2); @@ -3005,7 +3005,7 @@ void tst_QStateMachine::nestedTargetStateForAnimation() animation = new QPropertyAnimation(object, "bar", s2); connect(animation, SIGNAL(finished()), &counter, SLOT(slot())); at->addAnimation(animation); - + QState *s3 = new QState(machine.rootState()); s2->addTransition(s2Child, SIGNAL(polished()), s3); @@ -3047,7 +3047,7 @@ void tst_QStateMachine::animatedGlobalRestoreProperty() QPropertyAnimation *pa = new QPropertyAnimation(object, "foo", s2); connect(pa, SIGNAL(finished()), &counter, SLOT(slot())); at->addAnimation(pa); - + at = s2->addTransition(pa, SIGNAL(finished()), s3); pa = new QPropertyAnimation(object, "foo", s3); connect(pa, SIGNAL(finished()), &counter, SLOT(slot())); @@ -3089,7 +3089,7 @@ void tst_QStateMachine::specificTargetValueOfAnimation() QState *s3 = new QState(machine.rootState()); QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); - s2->addTransition(anim, SIGNAL(finished()), s3); + s2->addTransition(anim, SIGNAL(finished()), s3); machine.setInitialState(s1); machine.start(); @@ -3117,7 +3117,7 @@ void tst_QStateMachine::addDefaultAnimation() QState *s3 = new QState(machine.rootState()); QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); - + s1->addTransition(new EventTransition(QEvent::User, s2)); QPropertyAnimation *pa = new QPropertyAnimation(object, "foo", &machine); @@ -3152,7 +3152,7 @@ void tst_QStateMachine::addDefaultAnimationWithUnusedAnimation() QState *s3 = new QState(machine.rootState()); QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); - + s1->addTransition(new EventTransition(QEvent::User, s2)); QPropertyAnimation *pa = new QPropertyAnimation(object, "foo", &machine); @@ -3197,7 +3197,7 @@ void tst_QStateMachine::removeDefaultAnimation() QCOMPARE(machine.defaultAnimations().size(), 0); machine.addDefaultAnimation(anim); - + QPropertyAnimation *anim2 = new QPropertyAnimation(&propertyHolder, "foo"); machine.addDefaultAnimation(anim2); @@ -3233,8 +3233,8 @@ void tst_QStateMachine::overrideDefaultAnimationWithSpecific() QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); QAbstractTransition *at = s1->addTransition(new EventTransition(QEvent::User, s2)); - - QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); + + QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); connect(defaultAnimation, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)), &counter, SLOT(slot())); QPropertyAnimation *moreSpecificAnimation = new QPropertyAnimation(object, "foo"); @@ -3269,7 +3269,7 @@ void tst_QStateMachine::addDefaultAnimationForSource() QState *s3 = new QState(machine.rootState()); QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); - + s1->addTransition(new EventTransition(QEvent::User, s2)); QPropertyAnimation *pa = new QPropertyAnimation(object, "foo", &machine); @@ -3301,7 +3301,7 @@ void tst_QStateMachine::addDefaultAnimationForTarget() QState *s3 = new QState(machine.rootState()); QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); - + s1->addTransition(new EventTransition(QEvent::User, s2)); QPropertyAnimation *pa = new QPropertyAnimation(object, "foo", &machine); @@ -3346,7 +3346,7 @@ void tst_QStateMachine::removeDefaultAnimationForSource() QCOMPARE(machine.defaultAnimationsForSourceState(machine.rootState()).size(), 0); machine.addDefaultAnimationForSourceState(machine.rootState(), anim); - + QPropertyAnimation *anim2 = new QPropertyAnimation(this, "foo"); machine.addDefaultAnimationForSourceState(machine.rootState(), anim2); @@ -3390,7 +3390,7 @@ void tst_QStateMachine::removeDefaultAnimationForTarget() QCOMPARE(machine.defaultAnimationsForTargetState(machine.rootState()).size(), 0); machine.addDefaultAnimationForTargetState(machine.rootState(), anim); - + QPropertyAnimation *anim2 = new QPropertyAnimation(this, "foo"); machine.addDefaultAnimationForTargetState(machine.rootState(), anim2); @@ -3425,9 +3425,9 @@ void tst_QStateMachine::overrideDefaultAnimationWithSource() QState *s3 = new QState(machine.rootState()); QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); - s1->addTransition(new EventTransition(QEvent::User, s2)); - - QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); + s1->addTransition(new EventTransition(QEvent::User, s2)); + + QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); connect(defaultAnimation, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)), &counter, SLOT(slot())); QPropertyAnimation *moreSpecificAnimation = new QPropertyAnimation(object, "foo"); @@ -3465,9 +3465,9 @@ void tst_QStateMachine::overrideDefaultAnimationWithTarget() QState *s3 = new QState(machine.rootState()); QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); - s1->addTransition(new EventTransition(QEvent::User, s2)); - - QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); + s1->addTransition(new EventTransition(QEvent::User, s2)); + + QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); connect(defaultAnimation, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)), &counter, SLOT(slot())); QPropertyAnimation *moreSpecificAnimation = new QPropertyAnimation(object, "foo"); @@ -3507,8 +3507,8 @@ void tst_QStateMachine::overrideDefaultSourceAnimationWithSpecific() QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); QAbstractTransition *at = s1->addTransition(new EventTransition(QEvent::User, s2)); - - QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); + + QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); connect(defaultAnimation, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)), &counter, SLOT(slot())); QPropertyAnimation *moreSpecificAnimation = new QPropertyAnimation(object, "foo"); @@ -3547,8 +3547,8 @@ void tst_QStateMachine::overrideDefaultTargetAnimationWithSpecific() QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); QAbstractTransition *at = s1->addTransition(new EventTransition(QEvent::User, s2)); - - QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); + + QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); connect(defaultAnimation, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)), &counter, SLOT(slot())); QPropertyAnimation *moreSpecificAnimation = new QPropertyAnimation(object, "foo"); @@ -3587,8 +3587,8 @@ void tst_QStateMachine::overrideDefaultTargetAnimationWithSource() QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); s1->addTransition(new EventTransition(QEvent::User, s2)); - - QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); + + QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); connect(defaultAnimation, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)), &counter, SLOT(slot())); QPropertyAnimation *moreSpecificAnimation = new QPropertyAnimation(object, "foo"); @@ -3638,7 +3638,7 @@ void tst_QStateMachine::parallelStateAssignmentsDone() QCOMPARE(propertyHolder->property("foo").toInt(), 123); QCOMPARE(propertyHolder->property("bar").toInt(), 456); QCOMPARE(propertyHolder->property("zoot").toInt(), 789); - + machine.postEvent(new QEvent(QEvent::User)); QCoreApplication::processEvents(); @@ -3650,13 +3650,13 @@ void tst_QStateMachine::parallelStateAssignmentsDone() void tst_QStateMachine::transitionsFromParallelStateWithNoChildren() { QStateMachine machine; - + QState *parallelState = new QState(QState::ParallelStates, machine.rootState()); machine.setInitialState(parallelState); - QState *s1 = new QState(machine.rootState()); + QState *s1 = new QState(machine.rootState()); parallelState->addTransition(new EventTransition(QEvent::User, s1)); - + machine.start(); QCoreApplication::processEvents(); @@ -3687,7 +3687,7 @@ void tst_QStateMachine::parallelStateTransition() QState *s2InitialChild = new QState(s2); s2->setInitialState(s2InitialChild); - QState *s1OtherChild = new QState(s1); + QState *s1OtherChild = new QState(s1); s1->addTransition(new EventTransition(QEvent::User, s1OtherChild)); @@ -3707,12 +3707,12 @@ void tst_QStateMachine::parallelStateTransition() QVERIFY(machine.configuration().contains(parallelState)); QVERIFY(machine.configuration().contains(s1)); - + QVERIFY(machine.configuration().contains(s2)); QVERIFY(machine.configuration().contains(s1OtherChild)); QVERIFY(machine.configuration().contains(s2InitialChild)); QCOMPARE(machine.configuration().size(), 5); - + } void tst_QStateMachine::nestedRestoreProperties() @@ -3783,7 +3783,7 @@ void tst_QStateMachine::nestedRestoreProperties2() s2->assignProperty(propertyHolder, "foo", 3); QState *s21 = new QState(s2); - s21->assignProperty(propertyHolder, "bar", 4); + s21->assignProperty(propertyHolder, "bar", 4); s2->setInitialState(s21); QState *s22 = new QState(s2); diff --git a/tests/auto/qtcpserver/crashingServer/main.cpp b/tests/auto/qtcpserver/crashingServer/main.cpp index f135d26..c360fe4 100644 --- a/tests/auto/qtcpserver/crashingServer/main.cpp +++ b/tests/auto/qtcpserver/crashingServer/main.cpp @@ -61,7 +61,7 @@ int main(int argc, char *argv[]) file.close(); #else printf("Listening\n"); - fflush(stdout); + fflush(stdout); #endif server.waitForNewConnection(5000); diff --git a/tests/auto/qtcpserver/tst_qtcpserver.cpp b/tests/auto/qtcpserver/tst_qtcpserver.cpp index 51e5020..2e75353 100644 --- a/tests/auto/qtcpserver/tst_qtcpserver.cpp +++ b/tests/auto/qtcpserver/tst_qtcpserver.cpp @@ -134,7 +134,7 @@ tst_QTcpServer::tst_QTcpServer() } tst_QTcpServer::~tst_QTcpServer() -{ +{ } void tst_QTcpServer::initTestCase_data() @@ -524,7 +524,7 @@ private: //---------------------------------------------------------------------------------- void tst_QTcpServer::waitForConnectionTest() { - + QFETCH_GLOBAL(bool, setProxy); if (setProxy) { #ifdef TEST_QNETWORK_PROXY @@ -628,10 +628,10 @@ protected: void tst_QTcpServer::addressReusable() { -#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86) +#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86) QSKIP("Symbian: Emulator does not support process launching", SkipAll ); #endif - + #if defined(QT_NO_PROCESS) QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll); #else diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp index ed84273..718fcba 100644 --- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp @@ -902,12 +902,12 @@ void tst_QTcpSocket::disconnectWhileConnecting() socket->disconnectFromHost(); } - connect(socket, SIGNAL(disconnected()), SLOT(exitLoopSlot())); -#ifndef Q_OS_SYMBIAN + connect(socket, SIGNAL(disconnected()), SLOT(exitLoopSlot())); +#ifndef Q_OS_SYMBIAN enterLoop(10); -#else +#else enterLoop(30); -#endif +#endif QVERIFY2(!timeout(), "Network timeout"); QVERIFY(socket->state() == QAbstractSocket::UnconnectedState); if (!closeDirectly) { @@ -971,11 +971,11 @@ protected: QTcpSocket *socket = server->nextPendingConnection(); while (!quit) { -#ifndef Q_OS_SYMBIAN +#ifndef Q_OS_SYMBIAN if (socket->waitForDisconnected(500)) -#else +#else if (socket->waitForDisconnected(5000)) -#endif +#endif break; if (socket->error() != QAbstractSocket::SocketTimeoutError) return; @@ -1023,11 +1023,11 @@ void tst_QTcpSocket::disconnectWhileConnectingNoEventLoop() socket->disconnectFromHost(); } -#ifndef Q_OS_SYMBIAN +#ifndef Q_OS_SYMBIAN QVERIFY2(socket->waitForDisconnected(10000), "Network timeout"); -#else +#else QVERIFY2(socket->waitForDisconnected(30000), "Network timeout"); -#endif +#endif QVERIFY(socket->state() == QAbstractSocket::UnconnectedState); if (!closeDirectly) { QCOMPARE(int(socket->openMode()), int(QIODevice::ReadWrite)); @@ -1073,11 +1073,11 @@ void tst_QTcpSocket::disconnectWhileLookingUp() // let anything queued happen QEventLoop loop; -#ifndef Q_OS_SYMBIAN +#ifndef Q_OS_SYMBIAN QTimer::singleShot(50, &loop, SLOT(quit())); -#else +#else QTimer::singleShot(5000, &loop, SLOT(quit())); -#endif +#endif loop.exec(); // recheck @@ -1754,7 +1754,7 @@ void tst_QTcpSocket::waitForConnectedInHostLookupSlot2() QFAIL("Network timeout"); QVERIFY(foo.attemptedToConnect); - QCOMPARE(foo.count, 1); + QCOMPARE(foo.count, 1); } #endif @@ -1774,7 +1774,7 @@ void tst_QTcpSocket::readyReadSignalsAfterWaitForReadyRead() QCOMPARE(readyReadSpy.count(), 1); QString s = socket->readLine(); -#ifdef TEST_QNETWORK_PROXY +#ifdef TEST_QNETWORK_PROXY QNetworkProxy::ProxyType proxyType = QNetworkProxy::applicationProxy().type(); if(proxyType == QNetworkProxy::NoProxy) { QCOMPARE(s.toLatin1().constData(), "* OK [CAPABILITY IMAP4REV1] aspiriniks Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); @@ -1782,8 +1782,8 @@ void tst_QTcpSocket::readyReadSignalsAfterWaitForReadyRead() QCOMPARE(s.toLatin1().constData(), "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] aspiriniks Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); } #else - QCOMPARE(s.toLatin1().constData(), QtNetworkSettings::expectedReplyIMAP().constData()); -#endif + QCOMPARE(s.toLatin1().constData(), QtNetworkSettings::expectedReplyIMAP().constData()); +#endif QCOMPARE(socket->bytesAvailable(), qint64(0)); QCoreApplication::instance()->processEvents(); @@ -2002,7 +2002,7 @@ void tst_QTcpSocket::suddenRemoteDisconnect() #if defined(Q_OS_WINCE) QSKIP("stressTest subprocess needs Qt3Support", SkipAll); #elif defined( Q_OS_SYMBIAN ) - QSKIP("Symbian: QProcess IO is not yet supported, fix when supported", SkipAll); + QSKIP("Symbian: QProcess IO is not yet supported, fix when supported", SkipAll); #else QFETCH(QString, client); QFETCH(QString, server); diff --git a/tests/auto/qtemporaryfile/qtemporaryfile.pro b/tests/auto/qtemporaryfile/qtemporaryfile.pro index 0f2a6ea..c93a2e5 100644 --- a/tests/auto/qtemporaryfile/qtemporaryfile.pro +++ b/tests/auto/qtemporaryfile/qtemporaryfile.pro @@ -6,7 +6,7 @@ QT = core symbian { testData.sources = tst_qtemporaryfile.cpp testData.path = . - DEPLOYMENT += testData + DEPLOYMENT += testData }else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qtextcodec/test/test.pro b/tests/auto/qtextcodec/test/test.pro index 7748ce4..36cac7c 100644 --- a/tests/auto/qtextcodec/test/test.pro +++ b/tests/auto/qtextcodec/test/test.pro @@ -11,7 +11,7 @@ wince*|symbian { wince*: { DEFINES += SRCDIR=\\\"\\\" }else:symbian { - # Symbian can't define SRCDIR meaningfully here + # Symbian can't define SRCDIR meaningfully here } else { DEFINES += SRCDIR=\\\"$$PWD/../\\\" } diff --git a/tests/auto/qtextedit/tst_qtextedit.cpp b/tests/auto/qtextedit/tst_qtextedit.cpp index d68b21d..ad61015 100644 --- a/tests/auto/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/qtextedit/tst_qtextedit.cpp @@ -150,7 +150,7 @@ private slots: void preserveCharFormatInAppend(); #ifndef QT_NO_CLIPBOARD void copyAndSelectAllInReadonly(); -#endif +#endif void ctrlAltInput(); void noPropertiesOnDefaultTextEditCharFormat(); void setPlainTextShouldUseCurrentCharFormat(); diff --git a/tests/auto/qtextodfwriter/qtextodfwriter.pro b/tests/auto/qtextodfwriter/qtextodfwriter.pro index 2689894..f5e2c09 100644 --- a/tests/auto/qtextodfwriter/qtextodfwriter.pro +++ b/tests/auto/qtextodfwriter/qtextodfwriter.pro @@ -2,4 +2,4 @@ load(qttest_p4) SOURCES += tst_qtextodfwriter.cpp !symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" -symbian:INCLUDEPATH+=$$[QT_INSTALL_PREFIX]/include/QtGui/private +symbian:INCLUDEPATH+=$$[QT_INSTALL_PREFIX]/include/QtGui/private diff --git a/tests/auto/qtextstream/test/test.pro b/tests/auto/qtextstream/test/test.pro index b24708c..973c011 100644 --- a/tests/auto/qtextstream/test/test.pro +++ b/tests/auto/qtextstream/test/test.pro @@ -28,7 +28,7 @@ wince*|symbian: { wince*: { DEFINES += SRCDIR=\\\"\\\" }else:symbian { - # Symbian can't define SRCDIR meaningfully here + # Symbian can't define SRCDIR meaningfully here }else { DEFINES += SRCDIR=\\\"$$PWD/../\\\" } diff --git a/tests/auto/qtextstream/tst_qtextstream.cpp b/tests/auto/qtextstream/tst_qtextstream.cpp index 484d7c9..d8dd618 100644 --- a/tests/auto/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/qtextstream/tst_qtextstream.cpp @@ -476,7 +476,7 @@ tst_QTextStream::tst_QTextStream() } tst_QTextStream::~tst_QTextStream() -{ +{ } void tst_QTextStream::init() @@ -1251,7 +1251,7 @@ void tst_QTextStream::stillOpenWhenAtEnd() #endif QTcpSocket socket; socket.connectToHost(QtNetworkSettings::serverName(), 143); -#if defined(Q_OS_SYMBIAN) +#if defined(Q_OS_SYMBIAN) QVERIFY(socket.waitForReadyRead(30000)); #else QVERIFY(socket.waitForReadyRead(5000)); diff --git a/tests/auto/qtimer/tst_qtimer.cpp b/tests/auto/qtimer/tst_qtimer.cpp index f55e62c..2835c53 100644 --- a/tests/auto/qtimer/tst_qtimer.cpp +++ b/tests/auto/qtimer/tst_qtimer.cpp @@ -549,4 +549,3 @@ void tst_QTimer::timerFiresOnlyOncePerProcessEvents() QTEST_MAIN(tst_QTimer) #include "tst_qtimer.moc" - diff --git a/tests/auto/qudpsocket/tst_qudpsocket.cpp b/tests/auto/qudpsocket/tst_qudpsocket.cpp index db18eb5..e064967 100644 --- a/tests/auto/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/qudpsocket/tst_qudpsocket.cpp @@ -228,7 +228,7 @@ void tst_QUdpSocket::broadcasting() for (int j = 0; j < 100; ++j) { broadcastSocket.writeDatagram(message[i], strlen(message[i]), - QHostAddress::Broadcast, 5000); + QHostAddress::Broadcast, 5000); QTestEventLoop::instance().enterLoop(15); if (QTestEventLoop::instance().timeout()) { #if defined(Q_OS_FREEBSD) @@ -334,17 +334,17 @@ void tst_QUdpSocket::ipv6Loop() quint16 paulPort = 28123; if (!peter.bind(QHostAddress::LocalHostIPv6, peterPort)) { - QCOMPARE(peter.error(), QUdpSocket::UnsupportedSocketOperationError); + QCOMPARE(peter.error(), QUdpSocket::UnsupportedSocketOperationError); } else { - QVERIFY(paul.bind(QHostAddress::LocalHostIPv6, paulPort)); + QVERIFY(paul.bind(QHostAddress::LocalHostIPv6, paulPort)); - QCOMPARE(peter.writeDatagram(peterMessage.data(), peterMessage.length(), QHostAddress("::1"), + QCOMPARE(peter.writeDatagram(peterMessage.data(), peterMessage.length(), QHostAddress("::1"), paulPort), qint64(peterMessage.length())); - QCOMPARE(paul.writeDatagram(paulMessage.data(), paulMessage.length(), + QCOMPARE(paul.writeDatagram(paulMessage.data(), paulMessage.length(), QHostAddress("::1"), peterPort), qint64(paulMessage.length())); - char peterBuffer[16*1024]; - char paulBuffer[16*1024]; + char peterBuffer[16*1024]; + char paulBuffer[16*1024]; #if !defined(Q_OS_WINCE) QVERIFY(peter.waitForReadyRead(5000)); QVERIFY(paul.waitForReadyRead(5000)); @@ -352,16 +352,16 @@ void tst_QUdpSocket::ipv6Loop() QVERIFY(peter.waitForReadyRead(15000)); QVERIFY(paul.waitForReadyRead(15000)); #endif - if (success) { - QCOMPARE(peter.readDatagram(peterBuffer, sizeof(peterBuffer)), qint64(paulMessage.length())); - QCOMPARE(paul.readDatagram(paulBuffer, sizeof(peterBuffer)), qint64(peterMessage.length())); - } else { - QVERIFY(peter.readDatagram(peterBuffer, sizeof(peterBuffer)) != paulMessage.length()); - QVERIFY(paul.readDatagram(paulBuffer, sizeof(peterBuffer)) != peterMessage.length()); - } - - QCOMPARE(QByteArray(peterBuffer, paulMessage.length()), paulMessage); - QCOMPARE(QByteArray(paulBuffer, peterMessage.length()), peterMessage); + if (success) { + QCOMPARE(peter.readDatagram(peterBuffer, sizeof(peterBuffer)), qint64(paulMessage.length())); + QCOMPARE(paul.readDatagram(paulBuffer, sizeof(peterBuffer)), qint64(peterMessage.length())); + } else { + QVERIFY(peter.readDatagram(peterBuffer, sizeof(peterBuffer)) != paulMessage.length()); + QVERIFY(paul.readDatagram(paulBuffer, sizeof(peterBuffer)) != peterMessage.length()); + } + + QCOMPARE(QByteArray(peterBuffer, paulMessage.length()), paulMessage); + QCOMPARE(QByteArray(paulBuffer, peterMessage.length()), peterMessage); } } @@ -483,21 +483,21 @@ void tst_QUdpSocket::writeDatagram() void tst_QUdpSocket::performance() { #if defined(Q_OS_SYMBIAN) - // Large packets seems not to go through on Symbian - // Reason might be also fragmentation due to VPN connection etc - + // Large packets seems not to go through on Symbian + // Reason might be also fragmentation due to VPN connection etc + QFETCH_GLOBAL(bool, setProxy); - QFETCH_GLOBAL(int, proxyType); - + QFETCH_GLOBAL(int, proxyType); + int arrSize = 8192; - if (setProxy && proxyType == QNetworkProxy::Socks5Proxy) - arrSize = 1024; - - QByteArray arr(arrSize, '@'); + if (setProxy && proxyType == QNetworkProxy::Socks5Proxy) + arrSize = 1024; + + QByteArray arr(arrSize, '@'); #else - QByteArray arr(8192, '@'); + QByteArray arr(8192, '@'); #endif // Q_OS_SYMBIAN - + QUdpSocket server; QVERIFY2(server.bind(), server.errorString().toLatin1().constData()); @@ -507,13 +507,13 @@ void tst_QUdpSocket::performance() QUdpSocket client; client.connectToHost(serverAddress, server.localPort()); - + QTime stopWatch; stopWatch.start(); qint64 nbytes = 0; while (stopWatch.elapsed() < 5000) { - for (int i = 0; i < 100; ++i) { + for (int i = 0; i < 100; ++i) { if (client.write(arr.data(), arr.size()) > 0) { do { nbytes += server.readDatagram(arr.data(), arr.size()); @@ -525,14 +525,14 @@ void tst_QUdpSocket::performance() float secs = stopWatch.elapsed() / 1000.0; qDebug("\t%.2fMB/%.2fs: %.2fMB/s", float(nbytes / (1024.0*1024.0)), secs, float(nbytes / (1024.0*1024.0)) / secs); - -#if defined(Q_OS_SYMBIAN) + +#if defined(Q_OS_SYMBIAN) if(nbytes == 0) { - qDebug("No bytes passed through local UDP socket, since UDP socket write returns EWOULDBLOCK"); - qDebug("Should try with blocking sockets, but it is not currently possible due to Open C defect"); + qDebug("No bytes passed through local UDP socket, since UDP socket write returns EWOULDBLOCK"); + qDebug("Should try with blocking sockets, but it is not currently possible due to Open C defect"); } -#endif - +#endif + } void tst_QUdpSocket::bindMode() @@ -552,48 +552,48 @@ void tst_QUdpSocket::bindMode() QUdpSocket socket2; QVERIFY(!socket2.bind(socket.localPort())); #if defined(Q_OS_SYMBIAN) - + //RPRocess me; if(RProcess().HasCapability(ECapabilityNetworkControl)) { - qDebug("Test executed *with* NetworkControl capability"); - // In Symbian OS ReuseAddressHint together with NetworkControl capability - // gives application *always* right to bind to port. I.e. it does not matter - // if first socket was bound with any bind flag. Since autotests in Symbian - // are currently executed with ALL -TCB rights, this path is the one executed. - QVERIFY(socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)); - socket.close(); - socket2.close(); - - QVERIFY2(socket.bind(0, QUdpSocket::ShareAddress), socket.errorString().toLatin1().constData()); - QVERIFY(!socket2.bind(socket.localPort())); - QVERIFY2(socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint), socket2.errorString().toLatin1().constData()); - socket.close(); - socket2.close(); - - QVERIFY2(socket.bind(0, QUdpSocket::DontShareAddress), socket.errorString().toLatin1().constData()); - QVERIFY(!socket2.bind(socket.localPort())); - QVERIFY(socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)); - socket.close(); - socket2.close(); - } else { - qDebug("Test executed *without* NetworkControl capability"); - // If we don't have NetworkControl capability, attempt to bind already bound - // address will *always* fail. I.e. it does not matter if first socket was - // bound with any bind flag. - QVERIFY(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)); - socket.close(); - - QVERIFY2(socket.bind(0, QUdpSocket::ShareAddress), socket.errorString().toLatin1().constData()); - QVERIFY(!socket2.bind(socket.localPort())); - QVERIFY2(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint), socket2.errorString().toLatin1().constData()); - socket.close(); - - QVERIFY2(socket.bind(0, QUdpSocket::DontShareAddress), socket.errorString().toLatin1().constData()); - QVERIFY(!socket2.bind(socket.localPort())); - QVERIFY(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)); - socket.close(); - } -#elif defined(Q_OS_UNIX) + qDebug("Test executed *with* NetworkControl capability"); + // In Symbian OS ReuseAddressHint together with NetworkControl capability + // gives application *always* right to bind to port. I.e. it does not matter + // if first socket was bound with any bind flag. Since autotests in Symbian + // are currently executed with ALL -TCB rights, this path is the one executed. + QVERIFY(socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)); + socket.close(); + socket2.close(); + + QVERIFY2(socket.bind(0, QUdpSocket::ShareAddress), socket.errorString().toLatin1().constData()); + QVERIFY(!socket2.bind(socket.localPort())); + QVERIFY2(socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint), socket2.errorString().toLatin1().constData()); + socket.close(); + socket2.close(); + + QVERIFY2(socket.bind(0, QUdpSocket::DontShareAddress), socket.errorString().toLatin1().constData()); + QVERIFY(!socket2.bind(socket.localPort())); + QVERIFY(socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)); + socket.close(); + socket2.close(); + } else { + qDebug("Test executed *without* NetworkControl capability"); + // If we don't have NetworkControl capability, attempt to bind already bound + // address will *always* fail. I.e. it does not matter if first socket was + // bound with any bind flag. + QVERIFY(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)); + socket.close(); + + QVERIFY2(socket.bind(0, QUdpSocket::ShareAddress), socket.errorString().toLatin1().constData()); + QVERIFY(!socket2.bind(socket.localPort())); + QVERIFY2(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint), socket2.errorString().toLatin1().constData()); + socket.close(); + + QVERIFY2(socket.bind(0, QUdpSocket::DontShareAddress), socket.errorString().toLatin1().constData()); + QVERIFY(!socket2.bind(socket.localPort())); + QVERIFY(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)); + socket.close(); + } +#elif defined(Q_OS_UNIX) QVERIFY(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)); socket.close(); QVERIFY2(socket.bind(0, QUdpSocket::ShareAddress), socket.errorString().toLatin1().constData()); diff --git a/tests/auto/qvariant/tst_qvariant.cpp b/tests/auto/qvariant/tst_qvariant.cpp index 6655021..698dece 100644 --- a/tests/auto/qvariant/tst_qvariant.cpp +++ b/tests/auto/qvariant/tst_qvariant.cpp @@ -2981,9 +2981,9 @@ void tst_QVariant::toIntFromQString() const */ void tst_QVariant::toIntFromDouble() const { - double d = 2147483630; // max int 2147483647 + double d = 2147483630; // max int 2147483647 QVERIFY((int)d == 2147483630); - + QVariant var(d); QVERIFY( var.canConvert( QVariant::Int ) ); @@ -3004,7 +3004,7 @@ void tst_QVariant::task256984_setValue() QVERIFY( !v2.isDetached() ); qVariantSetValue(v2, 3); //set an integer value - + QVERIFY( v1.isDetached() ); QVERIFY( v2.isDetached() ); } diff --git a/tests/auto/qwaitcondition/tst_qwaitcondition.cpp b/tests/auto/qwaitcondition/tst_qwaitcondition.cpp index a6d272c..6ac02e7 100644 --- a/tests/auto/qwaitcondition/tst_qwaitcondition.cpp +++ b/tests/auto/qwaitcondition/tst_qwaitcondition.cpp @@ -98,10 +98,10 @@ public: void run() { - mutex.lock(); - cond.wakeOne(); - cond.wait(&mutex); - mutex.unlock(); + mutex.lock(); + cond.wakeOne(); + cond.wait(&mutex); + mutex.unlock(); } }; @@ -114,15 +114,15 @@ public: QWaitCondition *cond; inline wait_QMutex_Thread_2() - : mutex(0), cond(0) + : mutex(0), cond(0) { } void run() { - mutex->lock(); - started.wakeOne(); - cond->wait(mutex); - mutex->unlock(); + mutex->lock(); + started.wakeOne(); + cond->wait(mutex); + mutex->unlock(); } }; @@ -137,10 +137,10 @@ public: void run() { - readWriteLock.lockForWrite(); - cond.wakeOne(); - cond.wait(&readWriteLock); - readWriteLock.unlock(); + readWriteLock.lockForWrite(); + cond.wakeOne(); + cond.wait(&readWriteLock); + readWriteLock.unlock(); } }; @@ -153,15 +153,15 @@ public: QWaitCondition *cond; inline wait_QReadWriteLock_Thread_2() - : readWriteLock(0), cond(0) + : readWriteLock(0), cond(0) { } void run() { - readWriteLock->lockForRead(); - started.wakeOne(); - cond->wait(readWriteLock); - readWriteLock->unlock(); + readWriteLock->lockForRead(); + started.wakeOne(); + cond->wait(readWriteLock); + readWriteLock->unlock(); } }; @@ -169,79 +169,79 @@ void tst_QWaitCondition::wait_QMutex() { int x; for (int i = 0; i < iterations; ++i) { - { - QMutex mutex; - QWaitCondition cond; - - mutex.lock(); - - cond.wakeOne(); - QVERIFY(!cond.wait(&mutex, 1)); - - cond.wakeAll(); - QVERIFY(!cond.wait(&mutex, 1)); - - mutex.unlock(); - } - - { - // test multiple threads waiting on separate wait conditions - wait_QMutex_Thread_1 thread[ThreadCount]; - - for (x = 0; x < ThreadCount; ++x) { - thread[x].mutex.lock(); - thread[x].start(); - // wait for thread to start - QVERIFY(thread[x].cond.wait(&thread[x].mutex, 1000)); - thread[x].mutex.unlock(); - } - - for (x = 0; x < ThreadCount; ++x) { - QVERIFY(thread[x].isRunning()); - QVERIFY(!thread[x].isFinished()); - } - - for (x = 0; x < ThreadCount; ++x) { - thread[x].mutex.lock(); - thread[x].cond.wakeOne(); - thread[x].mutex.unlock(); - } - - for (x = 0; x < ThreadCount; ++x) { - QVERIFY(thread[x].wait(1000)); - } - } - - { - // test multiple threads waiting on a wait condition - QMutex mutex; - QWaitCondition cond1, cond2; - wait_QMutex_Thread_2 thread[ThreadCount]; - - mutex.lock(); - for (x = 0; x < ThreadCount; ++x) { - thread[x].mutex = &mutex; - thread[x].cond = (x < ThreadCount / 2) ? &cond1 : &cond2; - thread[x].start(); - // wait for thread to start - QVERIFY(thread[x].started.wait(&mutex, 1000)); - } - mutex.unlock(); - - for (x = 0; x < ThreadCount; ++x) { - QVERIFY(thread[x].isRunning()); - QVERIFY(!thread[x].isFinished()); - } - - mutex.lock(); - cond1.wakeAll(); - cond2.wakeAll(); - mutex.unlock(); - - for (x = 0; x < ThreadCount; ++x) { - QVERIFY(thread[x].wait(1000)); - } - } + { + QMutex mutex; + QWaitCondition cond; + + mutex.lock(); + + cond.wakeOne(); + QVERIFY(!cond.wait(&mutex, 1)); + + cond.wakeAll(); + QVERIFY(!cond.wait(&mutex, 1)); + + mutex.unlock(); + } + + { + // test multiple threads waiting on separate wait conditions + wait_QMutex_Thread_1 thread[ThreadCount]; + + for (x = 0; x < ThreadCount; ++x) { + thread[x].mutex.lock(); + thread[x].start(); + // wait for thread to start + QVERIFY(thread[x].cond.wait(&thread[x].mutex, 1000)); + thread[x].mutex.unlock(); + } + + for (x = 0; x < ThreadCount; ++x) { + QVERIFY(thread[x].isRunning()); + QVERIFY(!thread[x].isFinished()); + } + + for (x = 0; x < ThreadCount; ++x) { + thread[x].mutex.lock(); + thread[x].cond.wakeOne(); + thread[x].mutex.unlock(); + } + + for (x = 0; x < ThreadCount; ++x) { + QVERIFY(thread[x].wait(1000)); + } + } + + { + // test multiple threads waiting on a wait condition + QMutex mutex; + QWaitCondition cond1, cond2; + wait_QMutex_Thread_2 thread[ThreadCount]; + + mutex.lock(); + for (x = 0; x < ThreadCount; ++x) { + thread[x].mutex = &mutex; + thread[x].cond = (x < ThreadCount / 2) ? &cond1 : &cond2; + thread[x].start(); + // wait for thread to start + QVERIFY(thread[x].started.wait(&mutex, 1000)); + } + mutex.unlock(); + + for (x = 0; x < ThreadCount; ++x) { + QVERIFY(thread[x].isRunning()); + QVERIFY(!thread[x].isFinished()); + } + + mutex.lock(); + cond1.wakeAll(); + cond2.wakeAll(); + mutex.unlock(); + + for (x = 0; x < ThreadCount; ++x) { + QVERIFY(thread[x].wait(1000)); + } + } } } @@ -288,99 +288,99 @@ void tst_QWaitCondition::wait_QReadWriteLock() int x; for (int i = 0; i < iterations; ++i) { - { + { QReadWriteLock readWriteLock; QWaitCondition waitCondition; - readWriteLock.lockForRead(); + readWriteLock.lockForRead(); - waitCondition.wakeOne(); - QVERIFY(!waitCondition.wait(&readWriteLock, 1)); + waitCondition.wakeOne(); + QVERIFY(!waitCondition.wait(&readWriteLock, 1)); - waitCondition.wakeAll(); - QVERIFY(!waitCondition.wait(&readWriteLock, 1)); + waitCondition.wakeAll(); + QVERIFY(!waitCondition.wait(&readWriteLock, 1)); - readWriteLock.unlock(); - } + readWriteLock.unlock(); + } { QReadWriteLock readWriteLock; - QWaitCondition waitCondition; + QWaitCondition waitCondition; - readWriteLock.lockForWrite(); + readWriteLock.lockForWrite(); - waitCondition.wakeOne(); - QVERIFY(!waitCondition.wait(&readWriteLock, 1)); + waitCondition.wakeOne(); + QVERIFY(!waitCondition.wait(&readWriteLock, 1)); - waitCondition.wakeAll(); - QVERIFY(!waitCondition.wait(&readWriteLock, 1)); + waitCondition.wakeAll(); + QVERIFY(!waitCondition.wait(&readWriteLock, 1)); - readWriteLock.unlock(); - } + readWriteLock.unlock(); + } - { - // test multiple threads waiting on separate wait conditions - wait_QReadWriteLock_Thread_1 thread[ThreadCount]; + { + // test multiple threads waiting on separate wait conditions + wait_QReadWriteLock_Thread_1 thread[ThreadCount]; - for (x = 0; x < ThreadCount; ++x) { - thread[x].readWriteLock.lockForRead(); - thread[x].start(); - // wait for thread to start + for (x = 0; x < ThreadCount; ++x) { + thread[x].readWriteLock.lockForRead(); + thread[x].start(); + // wait for thread to start #if defined(Q_OS_SYMBIAN) && defined(Q_CC_WINSCW) // Symbian emulator startup simultaneously with this thread causes additional delay - QVERIFY(thread[x].cond.wait(&thread[x].readWriteLock, 10000)); + QVERIFY(thread[x].cond.wait(&thread[x].readWriteLock, 10000)); #else - QVERIFY(thread[x].cond.wait(&thread[x].readWriteLock, 1000)); + QVERIFY(thread[x].cond.wait(&thread[x].readWriteLock, 1000)); #endif - thread[x].readWriteLock.unlock(); - } - - for (x = 0; x < ThreadCount; ++x) { - QVERIFY(thread[x].isRunning()); - QVERIFY(!thread[x].isFinished()); - } - - for (x = 0; x < ThreadCount; ++x) { - thread[x].readWriteLock.lockForRead(); - thread[x].cond.wakeOne(); - thread[x].readWriteLock.unlock(); - } - - for (x = 0; x < ThreadCount; ++x) { - QVERIFY(thread[x].wait(1000)); - } - } - - { - // test multiple threads waiting on a wait condition - QReadWriteLock readWriteLock; - QWaitCondition cond1, cond2; - wait_QReadWriteLock_Thread_2 thread[ThreadCount]; - - readWriteLock.lockForWrite(); - for (x = 0; x < ThreadCount; ++x) { - thread[x].readWriteLock = &readWriteLock; - thread[x].cond = (x < ThreadCount / 2) ? &cond1 : &cond2; - thread[x].start(); - // wait for thread to start - QVERIFY(thread[x].started.wait(&readWriteLock, 1000)); - } - readWriteLock.unlock(); - - for (x = 0; x < ThreadCount; ++x) { - QVERIFY(thread[x].isRunning()); - QVERIFY(!thread[x].isFinished()); - } - - readWriteLock.lockForWrite(); - cond1.wakeAll(); - cond2.wakeAll(); - readWriteLock.unlock(); - - for (x = 0; x < ThreadCount; ++x) { - QVERIFY(thread[x].wait(1000)); - } - } + thread[x].readWriteLock.unlock(); + } + + for (x = 0; x < ThreadCount; ++x) { + QVERIFY(thread[x].isRunning()); + QVERIFY(!thread[x].isFinished()); + } + + for (x = 0; x < ThreadCount; ++x) { + thread[x].readWriteLock.lockForRead(); + thread[x].cond.wakeOne(); + thread[x].readWriteLock.unlock(); + } + + for (x = 0; x < ThreadCount; ++x) { + QVERIFY(thread[x].wait(1000)); + } + } + + { + // test multiple threads waiting on a wait condition + QReadWriteLock readWriteLock; + QWaitCondition cond1, cond2; + wait_QReadWriteLock_Thread_2 thread[ThreadCount]; + + readWriteLock.lockForWrite(); + for (x = 0; x < ThreadCount; ++x) { + thread[x].readWriteLock = &readWriteLock; + thread[x].cond = (x < ThreadCount / 2) ? &cond1 : &cond2; + thread[x].start(); + // wait for thread to start + QVERIFY(thread[x].started.wait(&readWriteLock, 1000)); + } + readWriteLock.unlock(); + + for (x = 0; x < ThreadCount; ++x) { + QVERIFY(thread[x].isRunning()); + QVERIFY(!thread[x].isFinished()); + } + + readWriteLock.lockForWrite(); + cond1.wakeAll(); + cond2.wakeAll(); + readWriteLock.unlock(); + + for (x = 0; x < ThreadCount; ++x) { + QVERIFY(thread[x].wait(1000)); + } + } } } @@ -397,7 +397,7 @@ public: QWaitCondition *cond; inline wake_Thread() - : mutex(0), cond(0) + : mutex(0), cond(0) { } static inline void sleep(ulong s) @@ -405,14 +405,14 @@ public: void run() { - mutex->lock(); - ++count; + mutex->lock(); + ++count; dummy.wakeOne(); // this wakeup should be lost - started.wakeOne(); + started.wakeOne(); dummy.wakeAll(); // this one too - cond->wait(mutex); + cond->wait(mutex); --count; - mutex->unlock(); + mutex->unlock(); } }; @@ -430,7 +430,7 @@ public: QWaitCondition *cond; inline wake_Thread_2() - : readWriteLock(0), cond(0) + : readWriteLock(0), cond(0) { } static inline void sleep(ulong s) @@ -438,14 +438,14 @@ public: void run() { - readWriteLock->lockForWrite(); - ++count; + readWriteLock->lockForWrite(); + ++count; dummy.wakeOne(); // this wakeup should be lost started.wakeOne(); dummy.wakeAll(); // this one too - cond->wait(readWriteLock); + cond->wait(readWriteLock); --count; - readWriteLock->unlock(); + readWriteLock->unlock(); } }; @@ -456,194 +456,194 @@ void tst_QWaitCondition::wakeOne() int x; // wake up threads, one at a time for (int i = 0; i < iterations; ++i) { - QMutex mutex; - QWaitCondition cond; + QMutex mutex; + QWaitCondition cond; // QMutex - wake_Thread thread[ThreadCount]; - bool thread_exited[ThreadCount]; - - mutex.lock(); - for (x = 0; x < ThreadCount; ++x) { - thread[x].mutex = &mutex; - thread[x].cond = &cond; - thread_exited[x] = FALSE; - thread[x].start(); - // wait for thread to start - QVERIFY(thread[x].started.wait(&mutex, 1000)); + wake_Thread thread[ThreadCount]; + bool thread_exited[ThreadCount]; + + mutex.lock(); + for (x = 0; x < ThreadCount; ++x) { + thread[x].mutex = &mutex; + thread[x].cond = &cond; + thread_exited[x] = FALSE; + thread[x].start(); + // wait for thread to start + QVERIFY(thread[x].started.wait(&mutex, 1000)); // make sure wakeups are not queued... if nothing is // waiting at the time of the wakeup, nothing happens QVERIFY(!thread[x].dummy.wait(&mutex, 1)); - } - mutex.unlock(); + } + mutex.unlock(); - QCOMPARE(wake_Thread::count, ThreadCount); + QCOMPARE(wake_Thread::count, ThreadCount); - // wake up threads one at a time - for (x = 0; x < ThreadCount; ++x) { - mutex.lock(); - cond.wakeOne(); - QVERIFY(!cond.wait(&mutex, COND_WAIT_TIME)); + // wake up threads one at a time + for (x = 0; x < ThreadCount; ++x) { + mutex.lock(); + cond.wakeOne(); + QVERIFY(!cond.wait(&mutex, COND_WAIT_TIME)); QVERIFY(!thread[x].dummy.wait(&mutex, 1)); - mutex.unlock(); + mutex.unlock(); - int exited = 0; - for (int y = 0; y < ThreadCount; ++y) { - if (thread_exited[y]) + int exited = 0; + for (int y = 0; y < ThreadCount; ++y) { + if (thread_exited[y]) continue; - if (thread[y].wait(exited > 0 ? 1 : 1000)) { - thread_exited[y] = TRUE; - ++exited; - } - } + if (thread[y].wait(exited > 0 ? 1 : 1000)) { + thread_exited[y] = TRUE; + ++exited; + } + } - QCOMPARE(exited, 1); - QCOMPARE(wake_Thread::count, ThreadCount - (x + 1)); - } + QCOMPARE(exited, 1); + QCOMPARE(wake_Thread::count, ThreadCount - (x + 1)); + } - QCOMPARE(wake_Thread::count, 0); + QCOMPARE(wake_Thread::count, 0); // QReadWriteLock QReadWriteLock readWriteLock; wake_Thread_2 rwthread[ThreadCount]; readWriteLock.lockForWrite(); - for (x = 0; x < ThreadCount; ++x) { - rwthread[x].readWriteLock = &readWriteLock; - rwthread[x].cond = &cond; - thread_exited[x] = FALSE; - rwthread[x].start(); - // wait for thread to start - QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000)); + for (x = 0; x < ThreadCount; ++x) { + rwthread[x].readWriteLock = &readWriteLock; + rwthread[x].cond = &cond; + thread_exited[x] = FALSE; + rwthread[x].start(); + // wait for thread to start + QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000)); // make sure wakeups are not queued... if nothing is // waiting at the time of the wakeup, nothing happens QVERIFY(!rwthread[x].dummy.wait(&readWriteLock, 1)); - } - readWriteLock.unlock(); + } + readWriteLock.unlock(); - QCOMPARE(wake_Thread_2::count, ThreadCount); + QCOMPARE(wake_Thread_2::count, ThreadCount); - // wake up threads one at a time - for (x = 0; x < ThreadCount; ++x) { - readWriteLock.lockForWrite(); - cond.wakeOne(); - QVERIFY(!cond.wait(&readWriteLock, COND_WAIT_TIME)); + // wake up threads one at a time + for (x = 0; x < ThreadCount; ++x) { + readWriteLock.lockForWrite(); + cond.wakeOne(); + QVERIFY(!cond.wait(&readWriteLock, COND_WAIT_TIME)); QVERIFY(!rwthread[x].dummy.wait(&readWriteLock, 1)); - readWriteLock.unlock(); + readWriteLock.unlock(); - int exited = 0; - for (int y = 0; y < ThreadCount; ++y) { - if (thread_exited[y]) + int exited = 0; + for (int y = 0; y < ThreadCount; ++y) { + if (thread_exited[y]) continue; - if (rwthread[y].wait(exited > 0 ? 1 : 1000)) { - thread_exited[y] = TRUE; - ++exited; - } - } + if (rwthread[y].wait(exited > 0 ? 1 : 1000)) { + thread_exited[y] = TRUE; + ++exited; + } + } - QCOMPARE(exited, 1); - QCOMPARE(wake_Thread_2::count, ThreadCount - (x + 1)); - } + QCOMPARE(exited, 1); + QCOMPARE(wake_Thread_2::count, ThreadCount - (x + 1)); + } - QCOMPARE(wake_Thread_2::count, 0); + QCOMPARE(wake_Thread_2::count, 0); } // wake up threads, two at a time for (int i = 0; i < iterations; ++i) { - QMutex mutex; - QWaitCondition cond; + QMutex mutex; + QWaitCondition cond; // QMutex - wake_Thread thread[ThreadCount]; - bool thread_exited[ThreadCount]; - - mutex.lock(); - for (x = 0; x < ThreadCount; ++x) { - thread[x].mutex = &mutex; - thread[x].cond = &cond; - thread_exited[x] = FALSE; - thread[x].start(); - // wait for thread to start - QVERIFY(thread[x].started.wait(&mutex, 1000)); + wake_Thread thread[ThreadCount]; + bool thread_exited[ThreadCount]; + + mutex.lock(); + for (x = 0; x < ThreadCount; ++x) { + thread[x].mutex = &mutex; + thread[x].cond = &cond; + thread_exited[x] = FALSE; + thread[x].start(); + // wait for thread to start + QVERIFY(thread[x].started.wait(&mutex, 1000)); // make sure wakeups are not queued... if nothing is // waiting at the time of the wakeup, nothing happens QVERIFY(!thread[x].dummy.wait(&mutex, 1)); - } - mutex.unlock(); + } + mutex.unlock(); - QCOMPARE(wake_Thread::count, ThreadCount); + QCOMPARE(wake_Thread::count, ThreadCount); - // wake up threads one at a time - for (x = 0; x < ThreadCount; x += 2) { - mutex.lock(); - cond.wakeOne(); - cond.wakeOne(); - QVERIFY(!cond.wait(&mutex, COND_WAIT_TIME)); + // wake up threads one at a time + for (x = 0; x < ThreadCount; x += 2) { + mutex.lock(); + cond.wakeOne(); + cond.wakeOne(); + QVERIFY(!cond.wait(&mutex, COND_WAIT_TIME)); QVERIFY(!thread[x].dummy.wait(&mutex, 1)); QVERIFY(!thread[x + 1].dummy.wait(&mutex, 1)); - mutex.unlock(); + mutex.unlock(); - int exited = 0; - for (int y = 0; y < ThreadCount; ++y) { - if (thread_exited[y]) + int exited = 0; + for (int y = 0; y < ThreadCount; ++y) { + if (thread_exited[y]) continue; - if (thread[y].wait(exited > 0 ? 1 : 1000)) { - thread_exited[y] = TRUE; - ++exited; - } - } + if (thread[y].wait(exited > 0 ? 1 : 1000)) { + thread_exited[y] = TRUE; + ++exited; + } + } - QCOMPARE(exited, 2); - QCOMPARE(wake_Thread::count, ThreadCount - (x + 2)); - } + QCOMPARE(exited, 2); + QCOMPARE(wake_Thread::count, ThreadCount - (x + 2)); + } - QCOMPARE(wake_Thread::count, 0); + QCOMPARE(wake_Thread::count, 0); // QReadWriteLock QReadWriteLock readWriteLock; wake_Thread_2 rwthread[ThreadCount]; - readWriteLock.lockForWrite(); - for (x = 0; x < ThreadCount; ++x) { - rwthread[x].readWriteLock = &readWriteLock; - rwthread[x].cond = &cond; - thread_exited[x] = FALSE; - rwthread[x].start(); - // wait for thread to start - QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000)); + readWriteLock.lockForWrite(); + for (x = 0; x < ThreadCount; ++x) { + rwthread[x].readWriteLock = &readWriteLock; + rwthread[x].cond = &cond; + thread_exited[x] = FALSE; + rwthread[x].start(); + // wait for thread to start + QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000)); // make sure wakeups are not queued... if nothing is // waiting at the time of the wakeup, nothing happens QVERIFY(!rwthread[x].dummy.wait(&readWriteLock, 1)); - } - readWriteLock.unlock(); + } + readWriteLock.unlock(); - QCOMPARE(wake_Thread_2::count, ThreadCount); + QCOMPARE(wake_Thread_2::count, ThreadCount); - // wake up threads one at a time - for (x = 0; x < ThreadCount; x += 2) { - readWriteLock.lockForWrite(); - cond.wakeOne(); - cond.wakeOne(); - QVERIFY(!cond.wait(&readWriteLock, COND_WAIT_TIME)); + // wake up threads one at a time + for (x = 0; x < ThreadCount; x += 2) { + readWriteLock.lockForWrite(); + cond.wakeOne(); + cond.wakeOne(); + QVERIFY(!cond.wait(&readWriteLock, COND_WAIT_TIME)); QVERIFY(!rwthread[x].dummy.wait(&readWriteLock, 1)); QVERIFY(!rwthread[x + 1].dummy.wait(&readWriteLock, 1)); - readWriteLock.unlock(); + readWriteLock.unlock(); - int exited = 0; - for (int y = 0; y < ThreadCount; ++y) { - if (thread_exited[y]) + int exited = 0; + for (int y = 0; y < ThreadCount; ++y) { + if (thread_exited[y]) continue; - if (rwthread[y].wait(exited > 0 ? 1 : 1000)) { - thread_exited[y] = TRUE; - ++exited; - } - } + if (rwthread[y].wait(exited > 0 ? 1 : 1000)) { + thread_exited[y] = TRUE; + ++exited; + } + } - QCOMPARE(exited, 2); - QCOMPARE(wake_Thread_2::count, ThreadCount - (x + 2)); - } + QCOMPARE(exited, 2); + QCOMPARE(wake_Thread_2::count, ThreadCount - (x + 2)); + } - QCOMPARE(wake_Thread_2::count, 0); + QCOMPARE(wake_Thread_2::count, 0); } } @@ -651,69 +651,69 @@ void tst_QWaitCondition::wakeAll() { int x; for (int i = 0; i < iterations; ++i) { - QMutex mutex; - QWaitCondition cond; + QMutex mutex; + QWaitCondition cond; // QMutex - wake_Thread thread[ThreadCount]; - - mutex.lock(); - for (x = 0; x < ThreadCount; ++x) { - thread[x].mutex = &mutex; - thread[x].cond = &cond; - thread[x].start(); - // wait for thread to start - QVERIFY(thread[x].started.wait(&mutex, 1000)); - } - mutex.unlock(); - - QCOMPARE(wake_Thread::count, ThreadCount); - - // wake up all threads at once - mutex.lock(); - cond.wakeAll(); - QVERIFY(!cond.wait(&mutex, COND_WAIT_TIME)); - mutex.unlock(); - - int exited = 0; - for (x = 0; x < ThreadCount; ++x) { - if (thread[x].wait(1000)) - ++exited; - } - - QCOMPARE(exited, ThreadCount); - QCOMPARE(wake_Thread::count, 0); + wake_Thread thread[ThreadCount]; + + mutex.lock(); + for (x = 0; x < ThreadCount; ++x) { + thread[x].mutex = &mutex; + thread[x].cond = &cond; + thread[x].start(); + // wait for thread to start + QVERIFY(thread[x].started.wait(&mutex, 1000)); + } + mutex.unlock(); + + QCOMPARE(wake_Thread::count, ThreadCount); + + // wake up all threads at once + mutex.lock(); + cond.wakeAll(); + QVERIFY(!cond.wait(&mutex, COND_WAIT_TIME)); + mutex.unlock(); + + int exited = 0; + for (x = 0; x < ThreadCount; ++x) { + if (thread[x].wait(1000)) + ++exited; + } + + QCOMPARE(exited, ThreadCount); + QCOMPARE(wake_Thread::count, 0); // QReadWriteLock QReadWriteLock readWriteLock; - wake_Thread_2 rwthread[ThreadCount]; - - readWriteLock.lockForWrite(); - for (x = 0; x < ThreadCount; ++x) { - rwthread[x].readWriteLock = &readWriteLock; - rwthread[x].cond = &cond; - rwthread[x].start(); - // wait for thread to start - QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000)); - } - readWriteLock.unlock(); - - QCOMPARE(wake_Thread_2::count, ThreadCount); - - // wake up all threads at once - readWriteLock.lockForWrite(); - cond.wakeAll(); - QVERIFY(!cond.wait(&readWriteLock, COND_WAIT_TIME)); - readWriteLock.unlock(); + wake_Thread_2 rwthread[ThreadCount]; + + readWriteLock.lockForWrite(); + for (x = 0; x < ThreadCount; ++x) { + rwthread[x].readWriteLock = &readWriteLock; + rwthread[x].cond = &cond; + rwthread[x].start(); + // wait for thread to start + QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000)); + } + readWriteLock.unlock(); + + QCOMPARE(wake_Thread_2::count, ThreadCount); + + // wake up all threads at once + readWriteLock.lockForWrite(); + cond.wakeAll(); + QVERIFY(!cond.wait(&readWriteLock, COND_WAIT_TIME)); + readWriteLock.unlock(); exited = 0; - for (x = 0; x < ThreadCount; ++x) { - if (rwthread[x].wait(1000)) - ++exited; - } + for (x = 0; x < ThreadCount; ++x) { + if (rwthread[x].wait(1000)) + ++exited; + } - QCOMPARE(exited, ThreadCount); - QCOMPARE(wake_Thread_2::count, 0); + QCOMPARE(exited, ThreadCount); + QCOMPARE(wake_Thread_2::count, 0); } } diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index e148fdb..2b1c24c 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -3464,7 +3464,7 @@ QString textPropertyToString(Display *display, XTextProperty& text_prop) static CCoeControl* GetStatusPaneControl( TInt aPaneId ) { const TUid paneUid = { aPaneId }; - + CEikStatusPane* statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane(); if (statusPane && statusPane->PaneCapabilities(paneUid).IsPresent()){ CCoeControl* control = NULL; @@ -3474,17 +3474,17 @@ static CCoeControl* GetStatusPaneControl( TInt aPaneId ) } return NULL; } -// Returns the application's title pane, if not present returns NULL. +// Returns the application's title pane, if not present returns NULL. static CAknTitlePane* TitlePane() { return static_cast<CAknTitlePane*>(GetStatusPaneControl(EEikStatusPaneUidTitle)); } - -// Returns the application's title pane, if not present returns NULL. + +// Returns the application's title pane, if not present returns NULL. static CAknContextPane* ContextPane() { return static_cast<CAknContextPane*>(GetStatusPaneControl(EEikStatusPaneUidContext)); -} +} #endif static QString visibleWindowTitle(QWidget *window, Qt::WindowState state = Qt::WindowNoState) @@ -3549,7 +3549,7 @@ static QString visibleWindowTitle(QWidget *window, Qt::WindowState state = Qt::W if (win) vTitle = win->caption(); } -#elif defined (Q_WS_S60) +#elif defined (Q_WS_S60) CAknTitlePane* titlePane = TitlePane(); if(titlePane) { diff --git a/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp b/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp index e0c183c..54ba29e 100644 --- a/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp +++ b/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp @@ -575,10 +575,10 @@ void tst_QXmlSimpleReader::inputFromSocket_data() void tst_QXmlSimpleReader::inputFromSocket() { QFETCH(QString, file_name); - + #if defined(Q_OS_SYMBIAN) QSKIP("Symbian: Skipped due to problems in Open C and QtNetwork", SkipAll); -#endif +#endif #if defined(Q_OS_WIN32) && (defined(Q_CC_INTEL) || defined(Q_CC_MINGW) || defined(Q_CC_MSVC_NET)) QSKIP("Regression caused by QHOstInfo change 294548, see task 202231.", SkipAll); diff --git a/tests/auto/symbian/orientationchange/orientationchange.pro b/tests/auto/symbian/orientationchange/orientationchange.pro index d240fa1..08b34f9 100644 --- a/tests/auto/symbian/orientationchange/orientationchange.pro +++ b/tests/auto/symbian/orientationchange/orientationchange.pro @@ -1,7 +1,7 @@ load(qttest_p4) -HEADERS += +HEADERS += SOURCES += tst_orientationchange.cpp -symbian { +symbian { INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE } diff --git a/tests/auto/symbian/orientationchange/tst_orientationchange.cpp b/tests/auto/symbian/orientationchange/tst_orientationchange.cpp index 9d57ae1..ff371fa 100644 --- a/tests/auto/symbian/orientationchange/tst_orientationchange.cpp +++ b/tests/auto/symbian/orientationchange/tst_orientationchange.cpp @@ -61,11 +61,11 @@ class TestWidget : public QWidget { public: TestWidget(QWidget *parent = 0); - + void reset(); public: void resizeEvent(QResizeEvent *event); - + public: QSize resizeEventSize; int resizeEventCount; @@ -86,58 +86,58 @@ void TestWidget::reset() void TestWidget::resizeEvent(QResizeEvent *event) { QWidget::resizeEvent(event); - + // Size delivered in first resize event is stored. - if (!resizeEventCount) + if (!resizeEventCount) resizeEventSize = event->size(); - resizeEventCount++; + resizeEventCount++; } void tst_orientationchange::resizeEventOnOrientationChange() { // This will test that when orientation 'changes', then // at most one resize event is generated. - + TestWidget *normalWidget = new TestWidget(); TestWidget *fullScreenWidget = new TestWidget(); TestWidget *maximizedWidget = new TestWidget(); - + fullScreenWidget->showFullScreen(); maximizedWidget->showMaximized(); normalWidget->show(); - + QCoreApplication::sendPostedEvents(); QCoreApplication::sendPostedEvents(); - + QCOMPARE(fullScreenWidget->resizeEventCount, 1); QCOMPARE(fullScreenWidget->size(), fullScreenWidget->resizeEventSize); QCOMPARE(maximizedWidget->resizeEventCount, 1); QCOMPARE(maximizedWidget->size(), maximizedWidget->resizeEventSize); QCOMPARE(normalWidget->resizeEventCount, 1); QCOMPARE(normalWidget->size(), normalWidget->resizeEventSize); - + fullScreenWidget->reset(); maximizedWidget->reset(); normalWidget->reset(); - + // Assumes that Qt application is AVKON application. CAknAppUi *appUi = static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi()); - + // Determine 'opposite' orientation to the current orientation. - + CAknAppUi::TAppUiOrientation orientation = CAknAppUi::EAppUiOrientationLandscape; if (fullScreenWidget->size().width() > fullScreenWidget->size().height()) { orientation = CAknAppUi::EAppUiOrientationPortrait; } - + TRAPD(err, appUi->SetOrientationL(orientation)); QCoreApplication::sendPostedEvents(); QCoreApplication::sendPostedEvents(); - // setOrientationL is not guaranteed to change orientation - // (if emulator configured to support just portrait or landscape, then + // setOrientationL is not guaranteed to change orientation + // (if emulator configured to support just portrait or landscape, then // setOrientationL call shouldn't do anything). // So let's ensure that we do not get resize event twice. @@ -150,9 +150,9 @@ void tst_orientationchange::resizeEventOnOrientationChange() QCOMPARE(maximizedWidget->size(), maximizedWidget->resizeEventSize); } QCOMPARE(normalWidget->resizeEventCount, 0); - + TRAP(err, appUi->SetOrientationL(CAknAppUi::EAppUiOrientationUnspecified)); - + delete normalWidget; delete fullScreenWidget; delete maximizedWidget; diff --git a/tests/auto/symbian/qmainexceptions/qmainexceptions.pro b/tests/auto/symbian/qmainexceptions/qmainexceptions.pro index 7533dd4..16111c1 100644 --- a/tests/auto/symbian/qmainexceptions/qmainexceptions.pro +++ b/tests/auto/symbian/qmainexceptions/qmainexceptions.pro @@ -1,5 +1,3 @@ load(qttest_p4) -HEADERS += +HEADERS += SOURCES += tst_qmainexceptions.cpp - - diff --git a/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp b/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp index 1601b7e..bfe092b 100644 --- a/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp +++ b/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp @@ -423,7 +423,7 @@ void HybridFuncLX(THybridAction aAction) void tst_qmainexceptions::testHybrid() { - TRAPD(error, + TRAPD(error, QT_TRYCATCH_LEAVING( HybridFuncLX(EHybridLeave); ) ); @@ -432,8 +432,8 @@ void tst_qmainexceptions::testHybrid() QCOMPARE(int(sizeof(expected1)/sizeof(int)), int(recDtor - dtorFired)); for (int i=0; i<sizeof(expected1)/sizeof(int); i++) QCOMPARE(expected1[i], dtorFired[i]); - - TRAP(error, + + TRAP(error, QT_TRYCATCH_LEAVING( HybridFuncLX(EHybridThrow); ) ); @@ -443,7 +443,7 @@ void tst_qmainexceptions::testHybrid() for (int i=0; i<sizeof(expected2)/sizeof(int); i++) QCOMPARE(expected2[i], dtorFired[i]); - TRAP(error, + TRAP(error, QT_TRYCATCH_LEAVING( HybridFuncLX(EHybridPass); ) ); |