From 317e2c9199da58879b083b5561a69612ae0a4a41 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 30 Jun 2010 12:09:05 +0200 Subject: SSL backend: correct ordering of root CA certificates in the store Some CAs have several root certificates with the same SubjectInfo, but different expiration date. This means that OpenSSL needs to choose the valid root certificate over the expired ones when verifying a certificate chain. Apparently, the certs added to the store first are the ones that get used first, so we add the expired ones at the end. Reviewed-by: Thiago Macieira Task-number: QTBUG-11664 --- src/network/ssl/qsslsocket_openssl.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index fa26fe8..30428ff 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -299,8 +299,20 @@ init_context: } // Add all our CAs to this store. - foreach (const QSslCertificate &caCertificate, q->caCertificates()) + QList expiredCerts; + foreach (const QSslCertificate &caCertificate, q->caCertificates()) { + // add expired certs later, so that the + // valid ones are used before the expired ones + if (! caCertificate.isValid()) { + expiredCerts.append(caCertificate); + } else { + q_X509_STORE_add_cert(ctx->cert_store, (X509 *)caCertificate.handle()); + } + } + // now add the expired certs + foreach (const QSslCertificate &caCertificate, expiredCerts) { q_X509_STORE_add_cert(ctx->cert_store, (X509 *)caCertificate.handle()); + } // Register a custom callback to get all verification errors. X509_STORE_set_verify_cb_func(ctx->cert_store, q_X509Callback); @@ -597,7 +609,7 @@ QList QSslSocketPrivate::systemCaCertificates() if(!pc) break; QByteArray der((const char *)(pc->pbCertEncoded), static_cast(pc->cbCertEncoded)); - QSslCertificate cert(der,QSsl::Der); + QSslCertificate cert(der, QSsl::Der); systemCerts.append(cert); } ptrCertCloseStore(hSystemStore, 0); -- cgit v0.12 From 08e2c776bf2ce6976276bcdcce342ae8c4675565 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Wed, 9 Jun 2010 13:08:32 +0200 Subject: Fix regression in popup behavior on Windows Popups without a parent would unintentionally deactivate their parents following af7d2b2127d. In order to avoid this, we do not activate popups when there is an active application window. System tray popups are still activated. Reviewed-by: denis Task-number: QTBUG-11061 --- src/gui/kernel/qwidget_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 9c65aa0..0f05c6b 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -1167,7 +1167,7 @@ void QWidgetPrivate::show_sys() // This is to resolve the problem where popups are opened from the // system tray and not being implicitly activated if (q->windowType() == Qt::Popup && - (!q->parentWidget() || !q->parentWidget()->isActiveWindow())) + !q->parentWidget() && !qApp->activeWindow()) q->activateWindow(); } -- cgit v0.12 From c2bbf335d13d490697578010cee0810de159dcb9 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Wed, 30 Jun 2010 11:02:37 +1000 Subject: Fix build failure on Symbian^3. --- src/plugins/bearer/symbian/qnetworksession_impl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp index b6e11df..f89ed0a 100644 --- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp +++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp @@ -1303,7 +1303,8 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint #ifdef OCC_FUNCTIONALITY_AVAILABLE // If the retVal is not true here, it means that the status update may apply to an IAP outside of // SNAP (session is based on SNAP but follows IAP outside of it), which may occur on Symbian^3 EasyWlan. - if (retVal == false && activeConfig.d.data() && activeConfig.d.data()->numericId == accessPointId) { + if (retVal == false && activeConfig.isValid() && + toSymbianConfig(privateConfiguration(activeConfig))->numericIdentifier() == accessPointId) { #ifdef QT_BEARERMGMT_SYMBIAN_DEBUG qDebug() << "QNS this : " << QString::number((uint)this) << " - " << "===> EMIT State changed G to: " << state; #endif @@ -1311,7 +1312,7 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint activeConfig = QNetworkConfiguration(); } state = newState; - emit q->stateChanged(state); + emit stateChanged(state); retVal = true; } #endif -- cgit v0.12 From 524c61de5238d58a4019a54001736d60c2daf1ce Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 30 Jun 2010 14:17:40 +0300 Subject: Fixed pre-built resources deployment in Symbian Pre-built resources didn't get properly copied under \epoc32\data\z. Task-number: QTBUG-11519 Reviewed-by: Janne Koskinen --- qmake/generators/symbian/initprojectdeploy_symbian.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp index 2750ecb..382e012 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp +++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp @@ -198,6 +198,7 @@ void initProjectDeploySymbian(QMakeProject* project, devicePathWithoutDrive.remove(0,2); } if (!deployBinaries + && 0 != platform.compare(QLatin1String(ROM_DEPLOYMENT_PLATFORM)) && !devicePathWithoutDrive.isEmpty() && (0 == devicePathWithoutDrive.compare(project->values("APP_RESOURCE_DIR").join(""), Qt::CaseInsensitive) || 0 == devicePathWithoutDrive.compare(project->values("REG_RESOURCE_IMPORT_DIR").join(""), Qt::CaseInsensitive))) { @@ -343,4 +344,17 @@ void initProjectDeploySymbian(QMakeProject* project, } } } + + // Remove deployments that do not actually do anything + if (0 == platform.compare(QLatin1String(EMULATOR_DEPLOYMENT_PLATFORM)) + || 0 == platform.compare(QLatin1String(ROM_DEPLOYMENT_PLATFORM))) { + QMutableListIterator i(deploymentList); + while(i.hasNext()) { + CopyItem &item = i.next(); + QFileInfo fromItem(item.from); + QFileInfo toItem(item.to); + if (fromItem == toItem) + i.remove(); + } + } } -- cgit v0.12 From 329f02fbba05221e76aff1e0d217d1599664dffa Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 30 Jun 2010 16:40:51 +0300 Subject: Fix invalid bookmark in anomaly demo BBC news bookmark was no longer valid. Task-number: QTBUG-11795 Reviewed-by: Janne Koskinen --- demos/embedded/anomaly/src/BookmarksView.cpp | 2 +- demos/embedded/anomaly/src/BrowserView.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/demos/embedded/anomaly/src/BookmarksView.cpp b/demos/embedded/anomaly/src/BookmarksView.cpp index 729bf73..d6e6035 100644 --- a/demos/embedded/anomaly/src/BookmarksView.cpp +++ b/demos/embedded/anomaly/src/BookmarksView.cpp @@ -55,7 +55,7 @@ BookmarksView::BookmarksView(QWidget *parent) m_iconView->addItem("www.google.com"); m_iconView->addItem("qt.nokia.com/doc/4.5"); - m_iconView->addItem("news.bbc.co.uk/text_only.stm"); + m_iconView->addItem("news.bbc.co.uk/2/mobile/default.stm"); m_iconView->addItem("mobile.wikipedia.org"); m_iconView->addItem("qt.nokia.com"); m_iconView->addItem("en.wikipedia.org"); diff --git a/demos/embedded/anomaly/src/BrowserView.cpp b/demos/embedded/anomaly/src/BrowserView.cpp index 41318ad..a6e6f7a 100644 --- a/demos/embedded/anomaly/src/BrowserView.cpp +++ b/demos/embedded/anomaly/src/BrowserView.cpp @@ -177,7 +177,6 @@ void BrowserView::resizeEvent(QResizeEvent *event) void BrowserView::setDefaultIap() { qt_SetDefaultIap(); - m_webView->load(QUrl("http://news.bbc.co.uk/text_only.stm")); } #endif -- cgit v0.12 From 84756e043fa2bd9c83b24abffb280290ad3667cd Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Wed, 30 Jun 2010 16:10:59 +0200 Subject: Crash while changing the windows flags from a Qt::Drawer window on Cocoa The crash was caused while checking the visibility of the toolbar inside a native cocoa window. There is no toolbar for a drawer window. Task-number: QTBUG-11138 Reviewed-by: Denis --- src/gui/kernel/qwidget_mac.mm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index a9bb691..e57ec77 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -2861,9 +2861,11 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) } if (wasWindow) { oldToolbar = [oldWindow toolbar]; - [oldToolbar retain]; - oldToolbarVisible = [oldToolbar isVisible]; - [oldWindow setToolbar:nil]; + if (oldToolbar) { + [oldToolbar retain]; + oldToolbarVisible = [oldToolbar isVisible]; + [oldWindow setToolbar:nil]; + } } #endif } -- cgit v0.12 From f6cd0264c6e6f0bdb451e4f44284372e32e1db91 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Fri, 18 Jun 2010 16:05:16 +0200 Subject: QGraphicsProxyWidget: Fixes QComboBox popup closing issue. This happens when the QComboBox popup gets closed by QGraphicsScenePrivate::removePopup and then the QComboBox gets hidden. If the QComboBox gets shown again, the popup will be shown as well since it was not explicitly hidden. Reviewed-by: Yoann Lopes --- src/gui/graphicsview/qgraphicsscene.cpp | 3 +-- src/gui/widgets/qcombobox.cpp | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index ca3b56f..b821551 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -885,8 +885,7 @@ void QGraphicsScenePrivate::removePopup(QGraphicsWidget *widget, bool itemIsDyin ungrabKeyboard(static_cast(widget), itemIsDying); } if (!itemIsDying && widget->isVisible()) { - widget->hide(); - widget->QGraphicsItem::d_ptr->explicitlyHidden = 0; + widget->QGraphicsItem::d_ptr->setVisibleHelper(false, /* explicit = */ false); } } } diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index 1504066..dcc328f 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -704,6 +704,11 @@ void QComboBoxPrivateContainer::hideEvent(QHideEvent *) { emit resetButton(); combo->update(); + // QGraphicsScenePrivate::removePopup closes the combo box popup, it hides it non-explicitly. + // Hiding/showing the QComboBox after this will unexpectedly show the popup as well. + // Re-hiding the popup container makes sure it is explicitly hidden. + if (QGraphicsProxyWidget *proxy = graphicsProxyWidget()) + proxy->hide(); } void QComboBoxPrivateContainer::mousePressEvent(QMouseEvent *e) -- cgit v0.12 From bed06332190147b4061a563aedcbf103ae155830 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Wed, 23 Jun 2010 19:13:58 +0200 Subject: QGraphicsView: Handle wheelEvents correctly with Qt::Popup widgets. This fixes an issue in QtWebKit where scrolling with the wheel while a combo box is opened cause the page to scroll while the popup don't move. This patch either ignore the event on Mac or close the popup on other platforms. Reviewed-by: Yoann Lopes --- src/gui/graphicsview/qgraphicsscene.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index b821551..e5264da 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -4162,6 +4162,25 @@ void QGraphicsScene::wheelEvent(QGraphicsSceneWheelEvent *wheelEvent) wheelEvent->scenePos(), wheelEvent->widget()); +#ifdef Q_WS_MAC + // On Mac, ignore the event if the first item under the mouse is not the last opened + // popup (or one of its descendant) + if (!d->popupWidgets.isEmpty() && !wheelCandidates.isEmpty() && wheelCandidates.first() != d->popupWidgets.back() && !d->popupWidgets.back()->isAncestorOf(wheelCandidates.first())) { + wheelEvent->accept(); + return; + } +#else + // Find the first popup under the mouse (including the popup's descendants) starting from the last. + // Remove all popups after the one found, or all or them if no popup is under the mouse. + // Then continue with the event. + QList::const_iterator iter = d->popupWidgets.end(); + while (--iter >= d->popupWidgets.begin() && !wheelCandidates.isEmpty()) { + if (wheelCandidates.first() == *iter || (*iter)->isAncestorOf(wheelCandidates.first())) + break; + d->removePopup(*iter); + } +#endif + bool hasSetFocus = false; foreach (QGraphicsItem *item, wheelCandidates) { if (!hasSetFocus && item->isEnabled() -- cgit v0.12 From ec50421c7c592b2365a1f3d4c3dd251b145681e7 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Wed, 30 Jun 2010 20:00:03 +0200 Subject: Reformat whitespace according to coding style Mostly indentation affected, but also standardized spaces adjacent to () in configureapp.cpp. Merge-request: 715 Reviewed-by: Oswald Buddenhagen --- src/gui/image/image.pri | 4 +- src/gui/image/qimagereader.cpp | 2 +- src/plugins/imageformats/jpeg/jpeg.pro | 10 +- src/plugins/imageformats/mng/mng.pro | 46 +- src/plugins/imageformats/tiff/tiff.pro | 98 +-- tools/configure/configureapp.cpp | 1192 ++++++++++++++++---------------- 6 files changed, 676 insertions(+), 676 deletions(-) diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri index c4eac95..f5f1bc0 100644 --- a/src/gui/image/image.pri +++ b/src/gui/image/image.pri @@ -63,7 +63,7 @@ embedded { } x11 { HEADERS += image/qpixmap_x11_p.h - SOURCES += image/qpixmap_x11.cpp + SOURCES += image/qpixmap_x11.cpp } mac { HEADERS += image/qpixmap_mac_p.h @@ -96,7 +96,7 @@ SOURCES += \ unix|win32-g++*:LIBS_PRIVATE += -lpng win32:!win32-g++*:LIBS += libpng.lib } else { - DEFINES *= QT_USE_BUNDLED_LIBPNG + DEFINES *= QT_USE_BUNDLED_LIBPNG !isEqual(QT_ARCH, i386):!isEqual(QT_ARCH, x86_64):DEFINES += PNG_NO_ASSEMBLER_CODE INCLUDEPATH += ../3rdparty/libpng SOURCES += ../3rdparty/libpng/png.c \ diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index 93d5cd3..af43e90 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -301,7 +301,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device, if (!handler && !testFormat.isEmpty()) { if (false) { #ifndef QT_NO_IMAGEFORMAT_PNG - } else if (testFormat == "png") { + } else if (testFormat == "png") { handler = new QPngHandler; #endif #ifndef QT_NO_IMAGEFORMAT_BMP diff --git a/src/plugins/imageformats/jpeg/jpeg.pro b/src/plugins/imageformats/jpeg/jpeg.pro index 0b5d389..d4b0fef 100644 --- a/src/plugins/imageformats/jpeg/jpeg.pro +++ b/src/plugins/imageformats/jpeg/jpeg.pro @@ -7,10 +7,10 @@ HEADERS += qjpeghandler.h SOURCES += main.cpp \ qjpeghandler.cpp -wince*: { - DEFINES += NO_GETENV - contains(CE_ARCH,x86):CONFIG -= stl exceptions - contains(CE_ARCH,x86):CONFIG += exceptions_off +wince*: { + DEFINES += NO_GETENV + contains(CE_ARCH,x86):CONFIG -= stl exceptions + contains(CE_ARCH,x86):CONFIG += exceptions_off } #Disable warnings in 3rdparty code due to unused arguments @@ -18,7 +18,7 @@ symbian: { QMAKE_CXXFLAGS.CW += -W nounusedarg TARGET.UID3=0x2001E61B } else:contains(QMAKE_CC, gcc): { - QMAKE_CFLAGS_WARN_ON += -Wno-unused-parameter -Wno-main + QMAKE_CFLAGS_WARN_ON += -Wno-unused-parameter -Wno-main } contains(QT_CONFIG, system-jpeg) { diff --git a/src/plugins/imageformats/mng/mng.pro b/src/plugins/imageformats/mng/mng.pro index c188b47..158f41a 100644 --- a/src/plugins/imageformats/mng/mng.pro +++ b/src/plugins/imageformats/mng/mng.pro @@ -17,29 +17,29 @@ contains(QT_CONFIG, system-mng) { unix|win32-g++*:LIBS += -lmng win32:!win32-g++*:LIBS += libmng.lib } else { - DEFINES += MNG_BUILD_SO - DEFINES += MNG_NO_INCLUDE_JNG - INCLUDEPATH += ../../../3rdparty/libmng - SOURCES += \ - ../../../3rdparty/libmng/libmng_callback_xs.c \ - ../../../3rdparty/libmng/libmng_chunk_io.c \ - ../../../3rdparty/libmng/libmng_chunk_descr.c \ - ../../../3rdparty/libmng/libmng_chunk_prc.c \ - ../../../3rdparty/libmng/libmng_chunk_xs.c \ - ../../../3rdparty/libmng/libmng_cms.c \ - ../../../3rdparty/libmng/libmng_display.c \ - ../../../3rdparty/libmng/libmng_dither.c \ - ../../../3rdparty/libmng/libmng_error.c \ - ../../../3rdparty/libmng/libmng_filter.c \ - ../../../3rdparty/libmng/libmng_hlapi.c \ - ../../../3rdparty/libmng/libmng_jpeg.c \ - ../../../3rdparty/libmng/libmng_object_prc.c \ - ../../../3rdparty/libmng/libmng_pixels.c \ - ../../../3rdparty/libmng/libmng_prop_xs.c \ - ../../../3rdparty/libmng/libmng_read.c \ - ../../../3rdparty/libmng/libmng_trace.c \ - ../../../3rdparty/libmng/libmng_write.c \ - ../../../3rdparty/libmng/libmng_zlib.c + DEFINES += MNG_BUILD_SO + DEFINES += MNG_NO_INCLUDE_JNG + INCLUDEPATH += ../../../3rdparty/libmng + SOURCES += \ + ../../../3rdparty/libmng/libmng_callback_xs.c \ + ../../../3rdparty/libmng/libmng_chunk_io.c \ + ../../../3rdparty/libmng/libmng_chunk_descr.c \ + ../../../3rdparty/libmng/libmng_chunk_prc.c \ + ../../../3rdparty/libmng/libmng_chunk_xs.c \ + ../../../3rdparty/libmng/libmng_cms.c \ + ../../../3rdparty/libmng/libmng_display.c \ + ../../../3rdparty/libmng/libmng_dither.c \ + ../../../3rdparty/libmng/libmng_error.c \ + ../../../3rdparty/libmng/libmng_filter.c \ + ../../../3rdparty/libmng/libmng_hlapi.c \ + ../../../3rdparty/libmng/libmng_jpeg.c \ + ../../../3rdparty/libmng/libmng_object_prc.c \ + ../../../3rdparty/libmng/libmng_pixels.c \ + ../../../3rdparty/libmng/libmng_prop_xs.c \ + ../../../3rdparty/libmng/libmng_read.c \ + ../../../3rdparty/libmng/libmng_trace.c \ + ../../../3rdparty/libmng/libmng_write.c \ + ../../../3rdparty/libmng/libmng_zlib.c } contains(QT_CONFIG, system-zlib) { diff --git a/src/plugins/imageformats/tiff/tiff.pro b/src/plugins/imageformats/tiff/tiff.pro index 90868e8..08e471c 100644 --- a/src/plugins/imageformats/tiff/tiff.pro +++ b/src/plugins/imageformats/tiff/tiff.pro @@ -16,55 +16,55 @@ contains(QT_CONFIG, system-tiff) { win32:!win32-g++*:LIBS += libjpeg.lib } } else { - INCLUDEPATH += ../../../3rdparty/libtiff/libtiff - SOURCES += \ - ../../../3rdparty/libtiff/libtiff/tif_aux.c \ - ../../../3rdparty/libtiff/libtiff/tif_close.c \ - ../../../3rdparty/libtiff/libtiff/tif_codec.c \ - ../../../3rdparty/libtiff/libtiff/tif_color.c \ - ../../../3rdparty/libtiff/libtiff/tif_compress.c \ - ../../../3rdparty/libtiff/libtiff/tif_dir.c \ - ../../../3rdparty/libtiff/libtiff/tif_dirinfo.c \ - ../../../3rdparty/libtiff/libtiff/tif_dirread.c \ - ../../../3rdparty/libtiff/libtiff/tif_dirwrite.c \ - ../../../3rdparty/libtiff/libtiff/tif_dumpmode.c \ - ../../../3rdparty/libtiff/libtiff/tif_error.c \ - ../../../3rdparty/libtiff/libtiff/tif_extension.c \ - ../../../3rdparty/libtiff/libtiff/tif_fax3.c \ - ../../../3rdparty/libtiff/libtiff/tif_fax3sm.c \ - ../../../3rdparty/libtiff/libtiff/tif_flush.c \ - ../../../3rdparty/libtiff/libtiff/tif_getimage.c \ - ../../../3rdparty/libtiff/libtiff/tif_luv.c \ - ../../../3rdparty/libtiff/libtiff/tif_lzw.c \ - ../../../3rdparty/libtiff/libtiff/tif_next.c \ - ../../../3rdparty/libtiff/libtiff/tif_open.c \ - ../../../3rdparty/libtiff/libtiff/tif_packbits.c \ - ../../../3rdparty/libtiff/libtiff/tif_pixarlog.c \ - ../../../3rdparty/libtiff/libtiff/tif_predict.c \ - ../../../3rdparty/libtiff/libtiff/tif_print.c \ - ../../../3rdparty/libtiff/libtiff/tif_read.c \ - ../../../3rdparty/libtiff/libtiff/tif_strip.c \ - ../../../3rdparty/libtiff/libtiff/tif_swab.c \ - ../../../3rdparty/libtiff/libtiff/tif_thunder.c \ - ../../../3rdparty/libtiff/libtiff/tif_tile.c \ - ../../../3rdparty/libtiff/libtiff/tif_version.c \ - ../../../3rdparty/libtiff/libtiff/tif_warning.c \ - ../../../3rdparty/libtiff/libtiff/tif_write.c \ - ../../../3rdparty/libtiff/libtiff/tif_zip.c - win32:!wince*: { - SOURCES += ../../../3rdparty/libtiff/libtiff/tif_win32.c - } - unix: { - SOURCES += ../../../3rdparty/libtiff/libtiff/tif_unix.c - } - wince*: { - SOURCES += ../../../corelib/kernel/qfunctions_wince.cpp \ - ../../../3rdparty/libtiff/libtiff/tif_wince.c \ - ../../../3rdparty/libtiff/libtiff/tif_win32.c - } - symbian: { - SOURCES += ../../../3rdparty/libtiff/port/lfind.c - } + INCLUDEPATH += ../../../3rdparty/libtiff/libtiff + SOURCES += \ + ../../../3rdparty/libtiff/libtiff/tif_aux.c \ + ../../../3rdparty/libtiff/libtiff/tif_close.c \ + ../../../3rdparty/libtiff/libtiff/tif_codec.c \ + ../../../3rdparty/libtiff/libtiff/tif_color.c \ + ../../../3rdparty/libtiff/libtiff/tif_compress.c \ + ../../../3rdparty/libtiff/libtiff/tif_dir.c \ + ../../../3rdparty/libtiff/libtiff/tif_dirinfo.c \ + ../../../3rdparty/libtiff/libtiff/tif_dirread.c \ + ../../../3rdparty/libtiff/libtiff/tif_dirwrite.c \ + ../../../3rdparty/libtiff/libtiff/tif_dumpmode.c \ + ../../../3rdparty/libtiff/libtiff/tif_error.c \ + ../../../3rdparty/libtiff/libtiff/tif_extension.c \ + ../../../3rdparty/libtiff/libtiff/tif_fax3.c \ + ../../../3rdparty/libtiff/libtiff/tif_fax3sm.c \ + ../../../3rdparty/libtiff/libtiff/tif_flush.c \ + ../../../3rdparty/libtiff/libtiff/tif_getimage.c \ + ../../../3rdparty/libtiff/libtiff/tif_luv.c \ + ../../../3rdparty/libtiff/libtiff/tif_lzw.c \ + ../../../3rdparty/libtiff/libtiff/tif_next.c \ + ../../../3rdparty/libtiff/libtiff/tif_open.c \ + ../../../3rdparty/libtiff/libtiff/tif_packbits.c \ + ../../../3rdparty/libtiff/libtiff/tif_pixarlog.c \ + ../../../3rdparty/libtiff/libtiff/tif_predict.c \ + ../../../3rdparty/libtiff/libtiff/tif_print.c \ + ../../../3rdparty/libtiff/libtiff/tif_read.c \ + ../../../3rdparty/libtiff/libtiff/tif_strip.c \ + ../../../3rdparty/libtiff/libtiff/tif_swab.c \ + ../../../3rdparty/libtiff/libtiff/tif_thunder.c \ + ../../../3rdparty/libtiff/libtiff/tif_tile.c \ + ../../../3rdparty/libtiff/libtiff/tif_version.c \ + ../../../3rdparty/libtiff/libtiff/tif_warning.c \ + ../../../3rdparty/libtiff/libtiff/tif_write.c \ + ../../../3rdparty/libtiff/libtiff/tif_zip.c + win32:!wince*: { + SOURCES += ../../../3rdparty/libtiff/libtiff/tif_win32.c + } + unix: { + SOURCES += ../../../3rdparty/libtiff/libtiff/tif_unix.c + } + wince*: { + SOURCES += ../../../corelib/kernel/qfunctions_wince.cpp \ + ../../../3rdparty/libtiff/libtiff/tif_wince.c \ + ../../../3rdparty/libtiff/libtiff/tif_win32.c + } + symbian: { + SOURCES += ../../../3rdparty/libtiff/port/lfind.c + } } contains(QT_CONFIG, system-zlib) { diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index c66eb53..c3de09e 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE -std::ostream &operator<<( std::ostream &s, const QString &val ) { +std::ostream &operator<<(std::ostream &s, const QString &val) { s << val.toLocal8Bit().data(); return s; } @@ -89,7 +89,7 @@ bool writeToFile(const char* text, const QString &filename) return true; } -Configure::Configure( int& argc, char** argv ) +Configure::Configure(int& argc, char** argv) { useUnixSeparators = false; // Default values for indentation @@ -111,7 +111,7 @@ Configure::Configure( int& argc, char** argv ) */ dictionary[ "CONFIGCMD" ] = argv[ 0 ]; - for ( i = 1; i < argc; i++ ) + for (i = 1; i < argc; i++) configCmdLine += argv[ i ]; @@ -127,7 +127,7 @@ Configure::Configure( int& argc, char** argv ) #else const QString installPath = buildPath; #endif - if(sourceDir != buildDir) { //shadow builds! + if (sourceDir != buildDir) { //shadow builds! if (!findFile("perl") && !findFile("perl.exe")) { cout << "Error: Creating a shadow build of Qt requires" << endl << "perl to be in the PATH environment"; @@ -140,37 +140,37 @@ Configure::Configure( int& argc, char** argv ) { //duplicate qmake QStack qmake_dirs; qmake_dirs.push("qmake"); - while(!qmake_dirs.isEmpty()) { + while (!qmake_dirs.isEmpty()) { QString dir = qmake_dirs.pop(); QString od(buildPath + "/" + dir); QString id(sourcePath + "/" + dir); QFileInfoList entries = QDir(id).entryInfoList(QDir::NoDotAndDotDot|QDir::AllEntries); - for(int i = 0; i < entries.size(); ++i) { + for (int i = 0; i < entries.size(); ++i) { QFileInfo fi(entries.at(i)); - if(fi.isDir()) { + if (fi.isDir()) { qmake_dirs.push(dir + "/" + fi.fileName()); QDir().mkpath(od + "/" + fi.fileName()); } else { - QDir().mkpath(od ); + QDir().mkpath(od); bool justCopy = true; const QString fname = fi.fileName(); const QString outFile(od + "/" + fname), inFile(id + "/" + fname); - if(fi.fileName() == "Makefile") { //ignore - } else if(fi.suffix() == "h" || fi.suffix() == "cpp") { + if (fi.fileName() == "Makefile") { //ignore + } else if (fi.suffix() == "h" || fi.suffix() == "cpp") { QTemporaryFile tmpFile; - if(tmpFile.open()) { + if (tmpFile.open()) { QTextStream stream(&tmpFile); stream << "#include \"" << inFile << "\"" << endl; justCopy = false; stream.flush(); tmpFile.flush(); - if(filesDiffer(tmpFile.fileName(), outFile)) { + if (filesDiffer(tmpFile.fileName(), outFile)) { QFile::remove(outFile); tmpFile.copy(outFile); } } } - if(justCopy && filesDiffer(inFile, outFile)) + if (justCopy && filesDiffer(inFile, outFile)) QFile::copy(inFile, outFile); } } @@ -179,13 +179,13 @@ Configure::Configure( int& argc, char** argv ) { //make a syncqt script(s) that can be used in the shadow QFile syncqt(buildPath + "/bin/syncqt"); - if(syncqt.open(QFile::WriteOnly)) { + if (syncqt.open(QFile::WriteOnly)) { QTextStream stream(&syncqt); stream << "#!/usr/bin/perl -w" << endl << "require \"" << sourcePath + "/bin/syncqt\";" << endl; } QFile syncqt_bat(buildPath + "/bin/syncqt.bat"); - if(syncqt_bat.open(QFile::WriteOnly)) { + if (syncqt_bat.open(QFile::WriteOnly)) { QTextStream stream(&syncqt_bat); stream << "@echo off" << endl << "set QTDIR=" << QDir::toNativeSeparators(sourcePath) << endl @@ -197,26 +197,26 @@ Configure::Configure( int& argc, char** argv ) // make patch_capabilities and createpackage scripts for Symbian that can be used from the shadow build QFile patch_capabilities(buildPath + "/bin/patch_capabilities"); - if(patch_capabilities.open(QFile::WriteOnly)) { + if (patch_capabilities.open(QFile::WriteOnly)) { QTextStream stream(&patch_capabilities); stream << "#!/usr/bin/perl -w" << endl << "require \"" << sourcePath + "/bin/patch_capabilities\";" << endl; } QFile patch_capabilities_bat(buildPath + "/bin/patch_capabilities.bat"); - if(patch_capabilities_bat.open(QFile::WriteOnly)) { + if (patch_capabilities_bat.open(QFile::WriteOnly)) { QTextStream stream(&patch_capabilities_bat); stream << "@echo off" << endl << "call " << fixSeparators(sourcePath) << fixSeparators("/bin/patch_capabilities.bat %*") << endl; patch_capabilities_bat.close(); } QFile createpackage(buildPath + "/bin/createpackage"); - if(createpackage.open(QFile::WriteOnly)) { + if (createpackage.open(QFile::WriteOnly)) { QTextStream stream(&createpackage); stream << "#!/usr/bin/perl -w" << endl << "require \"" << sourcePath + "/bin/createpackage\";" << endl; } QFile createpackage_bat(buildPath + "/bin/createpackage.bat"); - if(createpackage_bat.open(QFile::WriteOnly)) { + if (createpackage_bat.open(QFile::WriteOnly)) { QTextStream stream(&createpackage_bat); stream << "@echo off" << endl << "call " << fixSeparators(sourcePath) << fixSeparators("/bin/createpackage.bat %*") << endl; @@ -228,7 +228,7 @@ Configure::Configure( int& argc, char** argv ) QFile::copy(sourcePath + "/bin/setcepaths.bat" , buildPath + "/bin/setcepaths.bat"); //copy the mkspecs buildDir.mkpath("mkspecs"); - if(!Environment::cpdir(sourcePath + "/mkspecs", buildPath + "/mkspecs")){ + if (!Environment::cpdir(sourcePath + "/mkspecs", buildPath + "/mkspecs")){ cout << "Couldn't copy mkspecs!" << sourcePath << " " << buildPath << endl; dictionary["DONE"] = "error"; return; @@ -304,7 +304,7 @@ Configure::Configure( int& argc, char** argv ) dictionary[ "VERSION" ] = version; { QRegExp version_re("([0-9]*)\\.([0-9]*)\\.([0-9]*)(|-.*)"); - if(version_re.exactMatch(version)) { + if (version_re.exactMatch(version)) { dictionary[ "VERSION_MAJOR" ] = version_re.cap(1); dictionary[ "VERSION_MINOR" ] = version_re.cap(2); dictionary[ "VERSION_PATCH" ] = version_re.cap(3); @@ -372,9 +372,9 @@ Configure::Configure( int& argc, char** argv ) QString tmp = dictionary[ "QMAKESPEC" ]; if (tmp.contains("\\")) { - tmp = tmp.mid( tmp.lastIndexOf( "\\" ) + 1 ); + tmp = tmp.mid(tmp.lastIndexOf("\\") + 1); } else { - tmp = tmp.mid( tmp.lastIndexOf("/") + 1 ); + tmp = tmp.mid(tmp.lastIndexOf("/") + 1); } dictionary[ "QMAKESPEC" ] = tmp; @@ -439,12 +439,12 @@ void Configure::parseCmdLine() #if !defined(EVAL) if (argCount < 1) // skip rest if no arguments ; - else if( configCmdLine.at(i) == "-redo" ) { + else if (configCmdLine.at(i) == "-redo") { dictionary[ "REDO" ] = "yes"; configCmdLine.clear(); reloadCmdLine(); } - else if( configCmdLine.at(i) == "-loadconfig" ) { + else if (configCmdLine.at(i) == "-loadconfig") { ++i; if (i != argCount) { dictionary[ "REDO" ] = "yes"; @@ -460,9 +460,9 @@ void Configure::parseCmdLine() #endif // Look first for XQMAKESPEC - for(int j = 0 ; j < argCount; ++j) + for (int j = 0 ; j < argCount; ++j) { - if( configCmdLine.at(j) == "-xplatform") { + if (configCmdLine.at(j) == "-xplatform") { ++j; if (j == argCount) break; @@ -472,46 +472,46 @@ void Configure::parseCmdLine() } } - for( ; iremove("qconfig-").remove(".h"); allConfigs << "full"; @@ -1335,11 +1335,11 @@ void Configure::validateArgs() // If the internal configurations failed, try others. QStringList::Iterator config; - for( config = allConfigs.begin(); config != allConfigs.end(); ++config ) { - if( (*config) == dictionary[ "QCONFIG" ] ) + for (config = allConfigs.begin(); config != allConfigs.end(); ++config) { + if ((*config) == dictionary[ "QCONFIG" ]) break; } - if( config == allConfigs.end() ) { + if (config == allConfigs.end()) { dictionary[ "HELP" ] = "yes"; cout << "No such configuration \"" << qPrintable(dictionary[ "QCONFIG" ]) << "\"" << endl ; } @@ -1492,7 +1492,7 @@ void Configure::applySpecSpecifics() dictionary[ "QT_HOST_PREFIX" ] = dictionary[ "QT_INSTALL_PREFIX" ]; dictionary[ "QT_INSTALL_PREFIX" ] = ""; - } else if(dictionary[ "XQMAKESPEC" ].startsWith("symbian")) { + } else if (dictionary[ "XQMAKESPEC" ].startsWith("symbian")) { dictionary[ "ACCESSIBILITY" ] = "no"; dictionary[ "STYLE_WINDOWSXP" ] = "no"; dictionary[ "STYLE_WINDOWSVISTA" ] = "no"; @@ -1541,7 +1541,7 @@ void Configure::applySpecSpecifics() // Disable building docs and translations for now disabledBuildParts << "docs" << "translations"; - } else if(dictionary[ "XQMAKESPEC" ].startsWith("linux")) { //TODO actually wrong. + } else if (dictionary[ "XQMAKESPEC" ].startsWith("linux")) { //TODO actually wrong. //TODO dictionary[ "STYLE_WINDOWSXP" ] = "no"; dictionary[ "STYLE_WINDOWSVISTA" ] = "no"; @@ -1567,22 +1567,22 @@ void Configure::applySpecSpecifics() QString Configure::locateFileInPaths(const QString &fileName, const QStringList &paths) { QDir d; - for( QStringList::ConstIterator it = paths.begin(); it != paths.end(); ++it ) { + for (QStringList::ConstIterator it = paths.begin(); it != paths.end(); ++it) { // Remove any leading or trailing ", this is commonly used in the environment // variables QString path = (*it); - if ( path.startsWith( "\"" ) ) - path = path.right( path.length() - 1 ); - if ( path.endsWith( "\"" ) ) - path = path.left( path.length() - 1 ); - if( d.exists(path + QDir::separator() + fileName) ) { + if (path.startsWith("\"")) + path = path.right(path.length() - 1); + if (path.endsWith("\"")) + path = path.left(path.length() - 1); + if (d.exists(path + QDir::separator() + fileName)) { return (path); } } return QString(); } -QString Configure::locateFile( const QString &fileName ) +QString Configure::locateFile(const QString &fileName) { QString file = fileName.toLower(); QStringList paths; @@ -1593,7 +1593,7 @@ QString Configure::locateFile( const QString &fileName ) #endif if (file.endsWith(".h")) paths = QString::fromLocal8Bit(getenv("INCLUDE")).split(splitReg, QString::SkipEmptyParts); - else if ( file.endsWith( ".lib" ) ) + else if (file.endsWith(".lib")) paths = QString::fromLocal8Bit(getenv("LIB")).split(splitReg, QString::SkipEmptyParts); else paths = QString::fromLocal8Bit(getenv("PATH")).split(splitReg, QString::SkipEmptyParts); @@ -1605,7 +1605,7 @@ QString Configure::locateFile( const QString &fileName ) bool Configure::displayHelp() { - if( dictionary[ "HELP" ] == "yes" ) { + if (dictionary[ "HELP" ] == "yes") { desc("Usage: configure [-buildkey ]\n" // desc("Usage: configure [-prefix dir] [-bindir ] [-libdir ]\n" // "[-docdir ] [-headerdir ] [-plugindir ]\n" @@ -1898,21 +1898,21 @@ QString Configure::findFileInPaths(const QString &fileName, const QString &paths #endif QStringList pathList = paths.split(splitReg, QString::SkipEmptyParts); QDir d; - for( QStringList::ConstIterator it = pathList.begin(); it != pathList.end(); ++it ) { + for (QStringList::ConstIterator it = pathList.begin(); it != pathList.end(); ++it) { // Remove any leading or trailing ", this is commonly used in the environment // variables QString path = (*it); - if ( path.startsWith( '\"' ) ) - path = path.right( path.length() - 1 ); - if ( path.endsWith( '\"' ) ) - path = path.left( path.length() - 1 ); - if( d.exists( path + QDir::separator() + fileName ) ) + if (path.startsWith('\"')) + path = path.right(path.length() - 1); + if (path.endsWith('\"')) + path = path.left(path.length() - 1); + if (d.exists(path + QDir::separator() + fileName)) return path; } return QString(); } -bool Configure::findFile( const QString &fileName ) +bool Configure::findFile(const QString &fileName) { const QString file = fileName.toLower(); const QString pathEnvVar = QString::fromLocal8Bit(getenv("PATH")); @@ -1923,7 +1923,7 @@ bool Configure::findFile( const QString &fileName ) if (file.endsWith(".h")) { if (!mingwPath.isNull()) { if (!findFileInPaths(file, mingwPath + QLatin1String("/../include")).isNull()) - return true; + return true; //now let's try the additional compiler path QDir mingwLibDir = mingwPath + QLatin1String("/../lib/gcc/mingw32"); foreach(const QFileInfo &version, mingwLibDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) { @@ -1932,9 +1932,9 @@ bool Configure::findFile( const QString &fileName ) } } paths = QString::fromLocal8Bit(getenv("INCLUDE")); - } else if ( file.endsWith( ".lib" ) || file.endsWith( ".a" ) ) { + } else if (file.endsWith(".lib") || file.endsWith(".a")) { if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../lib")).isNull()) - return true; + return true; paths = QString::fromLocal8Bit(getenv("LIB")); } else { paths = pathEnvVar; @@ -2041,15 +2041,15 @@ bool Configure::checkAvailability(const QString &part) available = true; // Built in, we have a fork else if (part == "SQL_SQLITE_LIB") { if (dictionary[ "SQL_SQLITE_LIB" ] == "system") { - // Symbian has multiple .lib/.dll files we need to find + // Symbian has multiple .lib/.dll files we need to find if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) { - available = true; // There is sqlite_symbian plugin which exports the necessary stuff - dictionary[ "QT_LFLAGS_SQLITE" ] += "-lsqlite3"; - } else { - available = findFile("sqlite3.h") && findFile("sqlite3.lib"); - if (available) - dictionary[ "QT_LFLAGS_SQLITE" ] += "sqlite3.lib"; - } + available = true; // There is sqlite_symbian plugin which exports the necessary stuff + dictionary[ "QT_LFLAGS_SQLITE" ] += "-lsqlite3"; + } else { + available = findFile("sqlite3.h") && findFile("sqlite3.lib"); + if (available) + dictionary[ "QT_LFLAGS_SQLITE" ] += "sqlite3.lib"; + } } else available = true; } else if (part == "SQL_SQLITE2") @@ -2066,7 +2066,7 @@ bool Configure::checkAvailability(const QString &part) available = (dictionary[ "ARCHITECTURE" ] == "windowsce"); else if (part == "SSE2") available = (dictionary.value("QMAKESPEC") != "win32-msvc"); - else if (part == "3DNOW" ) + else if (part == "3DNOW") available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-icc") && findFile("mm3dnow.h"); else if (part == "MMX" || part == "SSE") available = (dictionary.value("QMAKESPEC") != "win32-msvc"); @@ -2125,7 +2125,7 @@ bool Configure::checkAvailability(const QString &part) available = true; } else if (part == "WEBKIT") { available = (dictionary.value("QMAKESPEC") == "win32-msvc2005") || (dictionary.value("QMAKESPEC") == "win32-msvc2008") || (dictionary.value("QMAKESPEC") == "win32-msvc2010") || (dictionary.value("QMAKESPEC") == "win32-g++"); - if( dictionary[ "SHARED" ] == "no" ) { + if (dictionary[ "SHARED" ] == "no") { cout << endl << "WARNING: Using static linking will disable the WebKit module." << endl << endl; available = false; @@ -2290,7 +2290,7 @@ bool Configure::verifyConfiguration() cout << "WARNING: Configure could not detect the presence of a system SQLite3 lib." << endl << "Configure will therefore continue with the SQLite3 lib bundled with Qt." << endl << "(Press any key to continue..)"; - if(_getch() == 3) // _Any_ keypress w/no echo(eat for stdout) + if (_getch() == 3) // _Any_ keypress w/no echo(eat for stdout) exit(0); // Exit cleanly for Ctrl+C dictionary["SQL_SQLITE_LIB"] = "qt"; // Set to Qt's bundled lib an continue @@ -2301,14 +2301,14 @@ bool Configure::verifyConfiguration() << "MinGW, due to lack of such support from Oracle. Consider disabling the" << endl << "Oracle driver, as the current build will most likely fail." << endl; cout << "(Press any key to continue..)"; - if(_getch() == 3) // _Any_ keypress w/no echo(eat for stdout) + if (_getch() == 3) // _Any_ keypress w/no echo(eat for stdout) exit(0); // Exit cleanly for Ctrl+C } if (dictionary["QMAKESPEC"].endsWith("win32-msvc.net")) { cout << "WARNING: The makespec win32-msvc.net is deprecated. Consider using" << endl << "win32-msvc2002 or win32-msvc2003 instead." << endl; cout << "(Press any key to continue..)"; - if(_getch() == 3) // _Any_ keypress w/no echo(eat for stdout) + if (_getch() == 3) // _Any_ keypress w/no echo(eat for stdout) exit(0); // Exit cleanly for Ctrl+C } if (0 != dictionary["ARM_FPU_TYPE"].size()) { @@ -2323,7 +2323,7 @@ bool Configure::verifyConfiguration() cout << "WARNING: To be able to compile QtDeclarative we need to also compile the" << endl << "QtScript module. If you continue, we will turn on the QtScript module." << endl << "(Press any key to continue..)"; - if(_getch() == 3) // _Any_ keypress w/no echo(eat for stdout) + if (_getch() == 3) // _Any_ keypress w/no echo(eat for stdout) exit(0); // Exit cleanly for Ctrl+C dictionary["SCRIPT"] = "yes"; @@ -2423,13 +2423,13 @@ void Configure::generateOutputVars() { // Generate variables for output // Build key ---------------------------------------------------- - if ( dictionary.contains("BUILD_KEY") ) { + if (dictionary.contains("BUILD_KEY")) { qmakeVars += dictionary.value("BUILD_KEY"); } QString build = dictionary[ "BUILD" ]; bool buildAll = (dictionary[ "BUILDALL" ] == "yes"); - if ( build == "debug") { + if (build == "debug") { if (buildAll) qtConfig += "release"; qtConfig += "debug"; @@ -2440,142 +2440,142 @@ void Configure::generateOutputVars() } // Compression -------------------------------------------------- - if( dictionary[ "ZLIB" ] == "qt" ) + if (dictionary[ "ZLIB" ] == "qt") qtConfig += "zlib"; - else if( dictionary[ "ZLIB" ] == "system" ) + else if (dictionary[ "ZLIB" ] == "system") qtConfig += "system-zlib"; // Image formates ----------------------------------------------- - if( dictionary[ "GIF" ] == "no" ) + if (dictionary[ "GIF" ] == "no") qtConfig += "no-gif"; - else if( dictionary[ "GIF" ] == "yes" ) + else if (dictionary[ "GIF" ] == "yes") qtConfig += "gif"; - else if( dictionary[ "GIF" ] == "plugin" ) + else if (dictionary[ "GIF" ] == "plugin") qmakeFormatPlugins += "gif"; - if( dictionary[ "TIFF" ] == "no" ) + if (dictionary[ "TIFF" ] == "no") qtConfig += "no-tiff"; - else if( dictionary[ "TIFF" ] == "plugin" ) + else if (dictionary[ "TIFF" ] == "plugin") qmakeFormatPlugins += "tiff"; - if( dictionary[ "LIBTIFF" ] == "system" ) + if (dictionary[ "LIBTIFF" ] == "system") qtConfig += "system-tiff"; - if( dictionary[ "JPEG" ] == "no" ) + if (dictionary[ "JPEG" ] == "no") qtConfig += "no-jpeg"; - else if( dictionary[ "JPEG" ] == "plugin" ) + else if (dictionary[ "JPEG" ] == "plugin") qmakeFormatPlugins += "jpeg"; - if( dictionary[ "LIBJPEG" ] == "system" ) + if (dictionary[ "LIBJPEG" ] == "system") qtConfig += "system-jpeg"; - if( dictionary[ "PNG" ] == "no" ) + if (dictionary[ "PNG" ] == "no") qtConfig += "no-png"; else if( dictionary[ "PNG" ] == "qt" ) qtConfig += "png"; - if( dictionary[ "LIBPNG" ] == "system" ) + if (dictionary[ "LIBPNG" ] == "system") qtConfig += "system-png"; - if( dictionary[ "MNG" ] == "no" ) + if (dictionary[ "MNG" ] == "no") qtConfig += "no-mng"; else if( dictionary[ "MNG" ] == "qt" ) qtConfig += "mng"; - if( dictionary[ "LIBMNG" ] == "system" ) + if (dictionary[ "LIBMNG" ] == "system") qtConfig += "system-mng"; // Text rendering -------------------------------------------------- - if( dictionary[ "FREETYPE" ] == "yes" ) + if (dictionary[ "FREETYPE" ] == "yes") qtConfig += "freetype"; // Styles ------------------------------------------------------- - if ( dictionary[ "STYLE_WINDOWS" ] == "yes" ) + if (dictionary[ "STYLE_WINDOWS" ] == "yes") qmakeStyles += "windows"; - if ( dictionary[ "STYLE_PLASTIQUE" ] == "yes" ) + if (dictionary[ "STYLE_PLASTIQUE" ] == "yes") qmakeStyles += "plastique"; - if ( dictionary[ "STYLE_CLEANLOOKS" ] == "yes" ) + if (dictionary[ "STYLE_CLEANLOOKS" ] == "yes") qmakeStyles += "cleanlooks"; - if ( dictionary[ "STYLE_WINDOWSXP" ] == "yes" ) + if (dictionary[ "STYLE_WINDOWSXP" ] == "yes") qmakeStyles += "windowsxp"; - if ( dictionary[ "STYLE_WINDOWSVISTA" ] == "yes" ) + if (dictionary[ "STYLE_WINDOWSVISTA" ] == "yes") qmakeStyles += "windowsvista"; - if ( dictionary[ "STYLE_MOTIF" ] == "yes" ) + if (dictionary[ "STYLE_MOTIF" ] == "yes") qmakeStyles += "motif"; - if ( dictionary[ "STYLE_SGI" ] == "yes" ) + if (dictionary[ "STYLE_SGI" ] == "yes") qmakeStyles += "sgi"; - if ( dictionary[ "STYLE_WINDOWSCE" ] == "yes" ) + if (dictionary[ "STYLE_WINDOWSCE" ] == "yes") qmakeStyles += "windowsce"; - if ( dictionary[ "STYLE_WINDOWSMOBILE" ] == "yes" ) + if (dictionary[ "STYLE_WINDOWSMOBILE" ] == "yes") qmakeStyles += "windowsmobile"; - if ( dictionary[ "STYLE_CDE" ] == "yes" ) + if (dictionary[ "STYLE_CDE" ] == "yes") qmakeStyles += "cde"; - if ( dictionary[ "STYLE_S60" ] == "yes" ) + if (dictionary[ "STYLE_S60" ] == "yes") qmakeStyles += "s60"; // Databases ---------------------------------------------------- - if ( dictionary[ "SQL_MYSQL" ] == "yes" ) + if (dictionary[ "SQL_MYSQL" ] == "yes") qmakeSql += "mysql"; - else if ( dictionary[ "SQL_MYSQL" ] == "plugin" ) + else if (dictionary[ "SQL_MYSQL" ] == "plugin") qmakeSqlPlugins += "mysql"; - if ( dictionary[ "SQL_ODBC" ] == "yes" ) + if (dictionary[ "SQL_ODBC" ] == "yes") qmakeSql += "odbc"; - else if ( dictionary[ "SQL_ODBC" ] == "plugin" ) + else if (dictionary[ "SQL_ODBC" ] == "plugin") qmakeSqlPlugins += "odbc"; - if ( dictionary[ "SQL_OCI" ] == "yes" ) + if (dictionary[ "SQL_OCI" ] == "yes") qmakeSql += "oci"; - else if ( dictionary[ "SQL_OCI" ] == "plugin" ) + else if (dictionary[ "SQL_OCI" ] == "plugin") qmakeSqlPlugins += "oci"; - if ( dictionary[ "SQL_PSQL" ] == "yes" ) + if (dictionary[ "SQL_PSQL" ] == "yes") qmakeSql += "psql"; - else if ( dictionary[ "SQL_PSQL" ] == "plugin" ) + else if (dictionary[ "SQL_PSQL" ] == "plugin") qmakeSqlPlugins += "psql"; - if ( dictionary[ "SQL_TDS" ] == "yes" ) + if (dictionary[ "SQL_TDS" ] == "yes") qmakeSql += "tds"; - else if ( dictionary[ "SQL_TDS" ] == "plugin" ) + else if (dictionary[ "SQL_TDS" ] == "plugin") qmakeSqlPlugins += "tds"; - if ( dictionary[ "SQL_DB2" ] == "yes" ) + if (dictionary[ "SQL_DB2" ] == "yes") qmakeSql += "db2"; - else if ( dictionary[ "SQL_DB2" ] == "plugin" ) + else if (dictionary[ "SQL_DB2" ] == "plugin") qmakeSqlPlugins += "db2"; - if ( dictionary[ "SQL_SQLITE" ] == "yes" ) + if (dictionary[ "SQL_SQLITE" ] == "yes") qmakeSql += "sqlite"; - else if ( dictionary[ "SQL_SQLITE" ] == "plugin" ) + else if (dictionary[ "SQL_SQLITE" ] == "plugin") qmakeSqlPlugins += "sqlite"; - if ( dictionary[ "SQL_SQLITE_LIB" ] == "system" ) + if (dictionary[ "SQL_SQLITE_LIB" ] == "system") qmakeConfig += "system-sqlite"; - if ( dictionary[ "SQL_SQLITE2" ] == "yes" ) + if (dictionary[ "SQL_SQLITE2" ] == "yes") qmakeSql += "sqlite2"; - else if ( dictionary[ "SQL_SQLITE2" ] == "plugin" ) + else if (dictionary[ "SQL_SQLITE2" ] == "plugin") qmakeSqlPlugins += "sqlite2"; - if ( dictionary[ "SQL_IBASE" ] == "yes" ) + if (dictionary[ "SQL_IBASE" ] == "yes") qmakeSql += "ibase"; - else if ( dictionary[ "SQL_IBASE" ] == "plugin" ) + else if (dictionary[ "SQL_IBASE" ] == "plugin") qmakeSqlPlugins += "ibase"; // Other options ------------------------------------------------ - if( dictionary[ "BUILDALL" ] == "yes" ) { + if (dictionary[ "BUILDALL" ] == "yes") { qmakeConfig += "build_all"; } qmakeConfig += dictionary[ "BUILD" ]; dictionary[ "QMAKE_OUTDIR" ] = dictionary[ "BUILD" ]; - if ( dictionary[ "SHARED" ] == "yes" ) { + if (dictionary[ "SHARED" ] == "yes") { QString version = dictionary[ "VERSION" ]; if (!version.isEmpty()) { qmakeVars += "QMAKE_QT_VERSION_OVERRIDE = " + version.left(version.indexOf(".")); @@ -2586,13 +2586,13 @@ void Configure::generateOutputVars() dictionary[ "QMAKE_OUTDIR" ] += "_static"; } - if( dictionary[ "ACCESSIBILITY" ] == "yes" ) + if (dictionary[ "ACCESSIBILITY" ] == "yes") qtConfig += "accessibility"; - if( !qmakeLibs.isEmpty() ) - qmakeVars += "LIBS += " + escapeSeparators(qmakeLibs.join( " " )); + if (!qmakeLibs.isEmpty()) + qmakeVars += "LIBS += " + escapeSeparators(qmakeLibs.join(" ")); - if( !dictionary["QT_LFLAGS_SQLITE"].isEmpty() ) + if (!dictionary["QT_LFLAGS_SQLITE"].isEmpty()) qmakeVars += "QT_LFLAGS_SQLITE += " + escapeSeparators(dictionary["QT_LFLAGS_SQLITE"]); if (dictionary[ "QT3SUPPORT" ] == "yes") @@ -2601,26 +2601,26 @@ void Configure::generateOutputVars() if (dictionary[ "OPENGL" ] == "yes") qtConfig += "opengl"; - if ( dictionary["OPENGL_ES_CM"] == "yes" ) { + if (dictionary["OPENGL_ES_CM"] == "yes") { qtConfig += "opengles1"; qtConfig += "egl"; } - if ( dictionary["OPENGL_ES_2"] == "yes" ) { + if (dictionary["OPENGL_ES_2"] == "yes") { qtConfig += "opengles2"; qtConfig += "egl"; } - if ( dictionary["OPENVG"] == "yes" ) { + if (dictionary["OPENVG"] == "yes") { qtConfig += "openvg"; qtConfig += "egl"; } - if ( dictionary["S60"] == "yes" ) { + if (dictionary["S60"] == "yes") { qtConfig += "s60"; } - if ( dictionary["DIRECTSHOW"] == "yes" ) + if (dictionary["DIRECTSHOW"] == "yes") qtConfig += "directshow"; if (dictionary[ "OPENSSL" ] == "yes") @@ -2680,7 +2680,7 @@ void Configure::generateOutputVars() qtConfig += "declarative"; } - if( dictionary[ "NATIVE_GESTURES" ] == "yes" ) + if (dictionary[ "NATIVE_GESTURES" ] == "yes") qtConfig += "native-gestures"; // We currently have no switch for QtSvg, so add it unconditionally. @@ -2703,7 +2703,7 @@ void Configure::generateOutputVars() } } - if (dictionary.contains("XQMAKESPEC") && ( dictionary["QMAKESPEC"] != dictionary["XQMAKESPEC"] ) ) + if (dictionary.contains("XQMAKESPEC") && (dictionary["QMAKESPEC"] != dictionary["XQMAKESPEC"])) qmakeConfig += "cross_compile"; // Directories and settings for .qmake.cache -------------------- @@ -2711,31 +2711,31 @@ void Configure::generateOutputVars() // if QT_INSTALL_* have not been specified on commandline, define them now from QT_INSTALL_PREFIX // if prefix is empty (WINCE), make all of them empty, if they aren't set bool qipempty = false; - if(dictionary[ "QT_INSTALL_PREFIX" ].isEmpty()) + if (dictionary[ "QT_INSTALL_PREFIX" ].isEmpty()) qipempty = true; - if( !dictionary[ "QT_INSTALL_DOCS" ].size() ) - dictionary[ "QT_INSTALL_DOCS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/doc" ); - if( !dictionary[ "QT_INSTALL_HEADERS" ].size() ) - dictionary[ "QT_INSTALL_HEADERS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/include" ); - if( !dictionary[ "QT_INSTALL_LIBS" ].size() ) - dictionary[ "QT_INSTALL_LIBS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/lib" ); - if( !dictionary[ "QT_INSTALL_BINS" ].size() ) - dictionary[ "QT_INSTALL_BINS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/bin" ); - if( !dictionary[ "QT_INSTALL_PLUGINS" ].size() ) - dictionary[ "QT_INSTALL_PLUGINS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/plugins" ); - if( !dictionary[ "QT_INSTALL_IMPORTS" ].size() ) - dictionary[ "QT_INSTALL_IMPORTS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/imports" ); - if( !dictionary[ "QT_INSTALL_DATA" ].size() ) - dictionary[ "QT_INSTALL_DATA" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] ); - if( !dictionary[ "QT_INSTALL_TRANSLATIONS" ].size() ) - dictionary[ "QT_INSTALL_TRANSLATIONS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/translations" ); - if( !dictionary[ "QT_INSTALL_EXAMPLES" ].size() ) - dictionary[ "QT_INSTALL_EXAMPLES" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/examples"); - if( !dictionary[ "QT_INSTALL_DEMOS" ].size() ) - dictionary[ "QT_INSTALL_DEMOS" ] = qipempty ? "" : fixSeparators( dictionary[ "QT_INSTALL_PREFIX" ] + "/demos" ); - - if(dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("linux")) + if (!dictionary[ "QT_INSTALL_DOCS" ].size()) + dictionary[ "QT_INSTALL_DOCS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/doc"); + if (!dictionary[ "QT_INSTALL_HEADERS" ].size()) + dictionary[ "QT_INSTALL_HEADERS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/include"); + if (!dictionary[ "QT_INSTALL_LIBS" ].size()) + dictionary[ "QT_INSTALL_LIBS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/lib"); + if (!dictionary[ "QT_INSTALL_BINS" ].size()) + dictionary[ "QT_INSTALL_BINS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/bin"); + if (!dictionary[ "QT_INSTALL_PLUGINS" ].size()) + dictionary[ "QT_INSTALL_PLUGINS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/plugins"); + if (!dictionary[ "QT_INSTALL_IMPORTS" ].size()) + dictionary[ "QT_INSTALL_IMPORTS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/imports"); + if (!dictionary[ "QT_INSTALL_DATA" ].size()) + dictionary[ "QT_INSTALL_DATA" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ]); + if (!dictionary[ "QT_INSTALL_TRANSLATIONS" ].size()) + dictionary[ "QT_INSTALL_TRANSLATIONS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/translations"); + if (!dictionary[ "QT_INSTALL_EXAMPLES" ].size()) + dictionary[ "QT_INSTALL_EXAMPLES" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/examples"); + if (!dictionary[ "QT_INSTALL_DEMOS" ].size()) + dictionary[ "QT_INSTALL_DEMOS" ] = qipempty ? "" : fixSeparators(dictionary[ "QT_INSTALL_PREFIX" ] + "/demos"); + + if (dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("linux")) dictionary[ "QMAKE_RPATHDIR" ] = dictionary[ "QT_INSTALL_LIBS" ]; qmakeVars += QString("OBJECTS_DIR = ") + fixSeparators("tmp/obj/" + dictionary[ "QMAKE_OUTDIR" ], true); @@ -2743,13 +2743,13 @@ void Configure::generateOutputVars() qmakeVars += QString("RCC_DIR = ") + fixSeparators("tmp/rcc/" + dictionary["QMAKE_OUTDIR"], true); if (!qmakeDefines.isEmpty()) - qmakeVars += QString("DEFINES += ") + qmakeDefines.join( " " ); + qmakeVars += QString("DEFINES += ") + qmakeDefines.join(" "); if (!qmakeIncludes.isEmpty()) - qmakeVars += QString("INCLUDEPATH += ") + escapeSeparators(qmakeIncludes.join( " " )); + qmakeVars += QString("INCLUDEPATH += ") + escapeSeparators(qmakeIncludes.join(" ")); if (!opensslLibs.isEmpty()) qmakeVars += opensslLibs; else if (dictionary[ "OPENSSL" ] == "linked") { - if(dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("symbian") ) + if (dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("symbian")) qmakeVars += QString("OPENSSL_LIBS = -llibssl -llibcrypto"); else qmakeVars += QString("OPENSSL_LIBS = -lssleay32 -llibeay32"); @@ -2757,15 +2757,15 @@ void Configure::generateOutputVars() if (!psqlLibs.isEmpty()) qmakeVars += QString("QT_LFLAGS_PSQL=") + psqlLibs.section("=", 1); if (!qmakeSql.isEmpty()) - qmakeVars += QString("sql-drivers += ") + qmakeSql.join( " " ); + qmakeVars += QString("sql-drivers += ") + qmakeSql.join(" "); if (!qmakeSqlPlugins.isEmpty()) - qmakeVars += QString("sql-plugins += ") + qmakeSqlPlugins.join( " " ); + qmakeVars += QString("sql-plugins += ") + qmakeSqlPlugins.join(" "); if (!qmakeStyles.isEmpty()) - qmakeVars += QString("styles += ") + qmakeStyles.join( " " ); + qmakeVars += QString("styles += ") + qmakeStyles.join(" "); if (!qmakeStylePlugins.isEmpty()) - qmakeVars += QString("style-plugins += ") + qmakeStylePlugins.join( " " ); + qmakeVars += QString("style-plugins += ") + qmakeStylePlugins.join(" "); if (!qmakeFormatPlugins.isEmpty()) - qmakeVars += QString("imageformat-plugins += ") + qmakeFormatPlugins.join( " " ); + qmakeVars += QString("imageformat-plugins += ") + qmakeFormatPlugins.join(" "); if (dictionary["QMAKESPEC"].endsWith("-g++")) { QString includepath = qgetenv("INCLUDE"); @@ -2777,22 +2777,22 @@ void Configure::generateOutputVars() qmakeVars += QString("QMAKE_LIBDIR_POST += $$split(TMPPATH,\"%1\")").arg(separator); } - if( !dictionary[ "QMAKESPEC" ].length() ) { + if (!dictionary[ "QMAKESPEC" ].length()) { cout << "Configure could not detect your compiler. QMAKESPEC must either" << endl << "be defined as an environment variable, or specified as an" << endl << "argument with -platform" << endl; dictionary[ "HELP" ] = "yes"; QStringList winPlatforms; - QDir mkspecsDir( sourcePath + "/mkspecs" ); + QDir mkspecsDir(sourcePath + "/mkspecs"); const QFileInfoList &specsList = mkspecsDir.entryInfoList(); - for(int i = 0; i < specsList.size(); ++i) { + for (int i = 0; i < specsList.size(); ++i) { const QFileInfo &fi = specsList.at(i); - if( fi.fileName().left( 5 ) == "win32" ) { + if (fi.fileName().left(5) == "win32") { winPlatforms += fi.fileName(); } } - cout << "Available platforms are: " << qPrintable(winPlatforms.join( ", " )) << endl; + cout << "Available platforms are: " << qPrintable(winPlatforms.join(", ")) << endl; dictionary[ "DONE" ] = "error"; } } @@ -2801,24 +2801,24 @@ void Configure::generateOutputVars() void Configure::generateCachefile() { // Generate .qmake.cache - QFile cacheFile( buildPath + "/.qmake.cache" ); - if( cacheFile.open( QFile::WriteOnly | QFile::Text ) ) { // Truncates any existing file. - QTextStream cacheStream( &cacheFile ); - for( QStringList::Iterator var = qmakeVars.begin(); var != qmakeVars.end(); ++var ) { + QFile cacheFile(buildPath + "/.qmake.cache"); + if (cacheFile.open(QFile::WriteOnly | QFile::Text)) { // Truncates any existing file. + QTextStream cacheStream(&cacheFile); + for (QStringList::Iterator var = qmakeVars.begin(); var != qmakeVars.end(); ++var) { cacheStream << (*var) << endl; } - cacheStream << "CONFIG += " << qmakeConfig.join( " " ) << " incremental create_prl link_prl depend_includepath QTDIR_build" << endl; + cacheStream << "CONFIG += " << qmakeConfig.join(" ") << " incremental create_prl link_prl depend_includepath QTDIR_build" << endl; QStringList buildParts; buildParts << "libs" << "tools" << "examples" << "demos" << "docs" << "translations"; foreach(QString item, disabledBuildParts) { buildParts.removeAll(item); } - cacheStream << "QT_BUILD_PARTS = " << buildParts.join( " " ) << endl; + cacheStream << "QT_BUILD_PARTS = " << buildParts.join(" ") << endl; QString targetSpec = dictionary.contains("XQMAKESPEC") ? dictionary[ "XQMAKESPEC" ] : dictionary[ "QMAKESPEC" ]; QString mkspec_path = fixSeparators(sourcePath + "/mkspecs/" + targetSpec); - if(QFile::exists(mkspec_path)) + if (QFile::exists(mkspec_path)) cacheStream << "QMAKESPEC = " << escapeSeparators(mkspec_path) << endl; else cacheStream << "QMAKESPEC = " << fixSeparators(targetSpec, true) << endl; @@ -2843,60 +2843,60 @@ void Configure::generateCachefile() } // embedded - if( !dictionary["KBD_DRIVERS"].isEmpty()) + if (!dictionary["KBD_DRIVERS"].isEmpty()) cacheStream << "kbd-drivers += "<< dictionary["KBD_DRIVERS"]<directory + "/" ); + QString dirPath = fixSeparators(it->directory + "/"); QString projectName = it->proFile; QString makefileName = buildPath + "/" + dirPath + it->target; @@ -3773,7 +3773,7 @@ void Configure::generateMakefiles() QStringList args; - args << fixSeparators( buildPath + "/bin/qmake" ); + args << fixSeparators(buildPath + "/bin/qmake"); args << sourcePath + "/" + dirPath + projectName; args << dictionary[ "QMAKE_ALL_ARGS" ]; @@ -3782,10 +3782,10 @@ void Configure::generateMakefiles() args << it->target; args << "-spec"; args << spec; - if(!dictionary[ "QMAKEADDITIONALARGS" ].isEmpty()) + if (!dictionary[ "QMAKEADDITIONALARGS" ].isEmpty()) args << dictionary[ "QMAKEADDITIONALARGS" ]; - QDir::setCurrent( fixSeparators( dirPath ) ); + QDir::setCurrent(fixSeparators(dirPath)); QFile file(makefileName); if (!file.open(QFile::WriteOnly)) { @@ -3803,7 +3803,7 @@ void Configure::generateMakefiles() } } } - QDir::setCurrent( pwd ); + QDir::setCurrent(pwd); } else { cout << "Processing of project files have been disabled." << endl; cout << "Only use this option if you really know what you're doing." << endl << endl; @@ -3817,7 +3817,7 @@ void Configure::showSummary() if (!dictionary.contains("XQMAKESPEC")) { cout << endl << endl << "Qt is now configured for building. Just run " << qPrintable(make) << "." << endl; cout << "To reconfigure, run " << qPrintable(make) << " confclean and configure." << endl << endl; - } else if(dictionary.value("QMAKESPEC").startsWith("wince")) { + } else if (dictionary.value("QMAKESPEC").startsWith("wince")) { // we are cross compiling for Windows CE cout << endl << endl << "Qt is now configured for building. To start the build run:" << endl << "\tsetcepaths " << dictionary.value("XQMAKESPEC") << endl @@ -3829,24 +3829,24 @@ void Configure::showSummary() } } -Configure::ProjectType Configure::projectType( const QString& proFileName ) +Configure::ProjectType Configure::projectType(const QString& proFileName) { - QFile proFile( proFileName ); - if( proFile.open( QFile::ReadOnly ) ) { + QFile proFile(proFileName); + if (proFile.open(QFile::ReadOnly)) { QString buffer = proFile.readLine(1024); while (!buffer.isEmpty()) { - QStringList segments = buffer.split(QRegExp( "\\s" )); + QStringList segments = buffer.split(QRegExp("\\s")); QStringList::Iterator it = segments.begin(); - if(segments.size() >= 3) { + if (segments.size() >= 3) { QString keyword = (*it++); QString operation = (*it++); QString value = (*it++); - if( keyword == "TEMPLATE" ) { - if( value == "lib" ) + if (keyword == "TEMPLATE") { + if (value == "lib") return Lib; - else if( value == "subdirs" ) + else if (value == "subdirs") return Subdirs; } } @@ -3932,11 +3932,11 @@ bool Configure::showLicense(QString orgLicenseFile) return false; } QStringList licenseContent = QString(file.readAll()).split('\n'); - while(i < licenseContent.size()) { + while (i < licenseContent.size()) { cout << licenseContent.at(i) << endl; if (++i % screenHeight == 0) { cout << "(Press any key for more..)"; - if(_getch() == 3) // _Any_ keypress w/no echo(eat for stdout) + if (_getch() == 3) // _Any_ keypress w/no echo(eat for stdout) exit(0); // Exit cleanly for Ctrl+C cout << "\r"; // Overwrite text above } @@ -4018,13 +4018,13 @@ void Configure::readLicense() void Configure::reloadCmdLine() { - if( dictionary[ "REDO" ] == "yes" ) { - QFile inFile( buildPath + "/configure" + dictionary[ "CUSTOMCONFIG" ] + ".cache" ); - if( inFile.open( QFile::ReadOnly ) ) { - QTextStream inStream( &inFile ); + if (dictionary[ "REDO" ] == "yes") { + QFile inFile(buildPath + "/configure" + dictionary[ "CUSTOMCONFIG" ] + ".cache"); + if (inFile.open(QFile::ReadOnly)) { + QTextStream inStream(&inFile); QString buffer; inStream >> buffer; - while( buffer.length() ) { + while (buffer.length()) { configCmdLine += buffer; inStream >> buffer; } @@ -4035,11 +4035,11 @@ void Configure::reloadCmdLine() void Configure::saveCmdLine() { - if( dictionary[ "REDO" ] != "yes" ) { - QFile outFile( buildPath + "/configure" + dictionary[ "CUSTOMCONFIG" ] + ".cache" ); - if( outFile.open( QFile::WriteOnly | QFile::Text ) ) { - QTextStream outStream( &outFile ); - for( QStringList::Iterator it = configCmdLine.begin(); it != configCmdLine.end(); ++it ) { + if (dictionary[ "REDO" ] != "yes") { + QFile outFile(buildPath + "/configure" + dictionary[ "CUSTOMCONFIG" ] + ".cache"); + if (outFile.open(QFile::WriteOnly | QFile::Text)) { + QTextStream outStream(&outFile); + for (QStringList::Iterator it = configCmdLine.begin(); it != configCmdLine.end(); ++it) { outStream << (*it) << " " << endl; } outStream.flush(); @@ -4063,23 +4063,23 @@ bool Configure::filesDiffer(const QString &fn1, const QString &fn2) { QFile file1(fn1), file2(fn2); - if(!file1.open(QFile::ReadOnly) || !file2.open(QFile::ReadOnly)) + if (!file1.open(QFile::ReadOnly) || !file2.open(QFile::ReadOnly)) return true; const int chunk = 2048; int used1 = 0, used2 = 0; char b1[chunk], b2[chunk]; - while(!file1.atEnd() && !file2.atEnd()) { - if(!used1) + while (!file1.atEnd() && !file2.atEnd()) { + if (!used1) used1 = file1.read(b1, chunk); - if(!used2) + if (!used2) used2 = file2.read(b2, chunk); - if(used1 > 0 && used2 > 0) { + if (used1 > 0 && used2 > 0) { const int cmp = qMin(used1, used2); - if(memcmp(b1, b2, cmp)) + if (memcmp(b1, b2, cmp)) return true; - if((used1 -= cmp)) + if ((used1 -= cmp)) memcpy(b1, b1+cmp, used1); - if((used2 -= cmp)) + if ((used2 -= cmp)) memcpy(b2, b2+cmp, used2); } } -- cgit v0.12