From 796c049e3842923a986b8db43429677d2397beb0 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 23 Aug 2012 16:55:09 +0200 Subject: [PATCH 01/37] welcomescreen: remove behaviour on opacity It's effectively an single-step from almost-off to on my screen (perhaps a bug?), but there is no need to make an otherwise quick startup artifically appear 0.45 s longer. Change-Id: Iecd583d03393a56b49a0da446920682ce02bfdb4 Reviewed-by: Kai Koehne --- share/qtcreator/welcomescreen/welcomescreen.qml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/share/qtcreator/welcomescreen/welcomescreen.qml b/share/qtcreator/welcomescreen/welcomescreen.qml index b960e61259d..046e8f093b1 100644 --- a/share/qtcreator/welcomescreen/welcomescreen.qml +++ b/share/qtcreator/welcomescreen/welcomescreen.qml @@ -40,17 +40,6 @@ Rectangle { Rectangle { id: canvas - - opacity: 0 - - Component.onCompleted: canvas.opacity = 1 - - Behavior on opacity { - PropertyAnimation { - duration: 450 - } - } - width: Math.min(1024, parent.width) //this is a workaround for QTCREATORBUG-6803 anchors.topMargin: (root.height > 700) ? 0 : 0 From c636fc2efed8ec16ce8e7ac6e86ccd4154db527d Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 27 Aug 2012 12:48:51 +0200 Subject: [PATCH 02/37] Core: Fix MSVC compiler warning about strdup Fix warning: C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup. By just using qstrdup. Change-Id: I40664b6ed763b27951d983ec13dcc638270a1beb Reviewed-by: hjk --- src/plugins/coreplugin/id.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/id.cpp b/src/plugins/coreplugin/id.cpp index 7c72042df74..1c3d10f5239 100644 --- a/src/plugins/coreplugin/id.cpp +++ b/src/plugins/coreplugin/id.cpp @@ -107,7 +107,7 @@ static int theId(const char *str) if (lastUid == 0) stringFromId.append(QByteArray()); res = ++lastUid; - sh.str = strdup(sh.str); + sh.str = qstrdup(sh.str); idFromString[sh] = res; stringFromId.append(QByteArray::fromRawData(sh.str, sh.n)); } From 250b8e4934ae8cfb2bf80617f15c94199fe2624b Mon Sep 17 00:00:00 2001 From: Leandro Melo Date: Mon, 27 Aug 2012 09:29:40 +0200 Subject: [PATCH 03/37] C++: Fix base template argument/param matching Change-Id: I8c6be9e023a757c43eb4b8669ca8c37239ab579d Reviewed-by: hjk --- src/libs/cplusplus/LookupContext.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp index 5fb0e2e3eca..743e9a0fca1 100644 --- a/src/libs/cplusplus/LookupContext.cpp +++ b/src/libs/cplusplus/LookupContext.cpp @@ -668,6 +668,7 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac // It gets a bit complicated if the reference is actually a class template because we // now must worry about dependent names in base classes. if (Template *templ = referenceClass->enclosingTemplate()) { + const unsigned argumentCount = templId->templateArgumentCount(); QHash templParams; for (unsigned i = 0; i < templ->templateParameterCount(); ++i) templParams.insert(templ->templateParameterAt(i)->name(), i); @@ -679,15 +680,20 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac // This is the simple case in which a template parameter is itself a base. // Ex.: template class A : public T {}; if (templParams.contains(nameId)) { - const FullySpecifiedType &fullType = - templId->templateArgumentAt(templParams.value(nameId)); - if (NamedType *namedType = fullType.type()->asNamedType()) - baseBinding = lookupType(namedType->name()); + const unsigned parameterIndex = templParams.value(nameId); + if (parameterIndex < argumentCount) { + const FullySpecifiedType &fullType = + templId->templateArgumentAt(parameterIndex); + if (fullType.isValid()) { + if (NamedType *namedType = fullType.type()->asNamedType()) + baseBinding = lookupType(namedType->name()); + } + } } } else { SubstitutionMap map; for (unsigned i = 0; - i < templ->templateParameterCount() && i < templId->templateArgumentCount(); + i < templ->templateParameterCount() && i < argumentCount; ++i) { map.bind(templ->templateParameterAt(i)->name(), templId->templateArgumentAt(i)); From 03ddd0e540d196f92b220a8a8c9cdc6d22cd11c9 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 27 Aug 2012 10:26:53 +0300 Subject: [PATCH 04/37] ClearCase: Trust lsactivity ordering for rebase/deliver activities lsactivity outputs activities sorted by creation time. Latest rebase/deliver will be last in this output, so no need to compare it to previous values. Also place rebase and deliver activities last in the activities list. Change-Id: I4c90d4210751101a5f53b6d85ff3d0e86bb28d08 Reviewed-by: Knut Petter Svendsen Reviewed-by: Tobias Hunger --- src/plugins/clearcase/clearcaseplugin.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/clearcase/clearcaseplugin.cpp b/src/plugins/clearcase/clearcaseplugin.cpp index 26953cab715..c29f23de2ed 100644 --- a/src/plugins/clearcase/clearcaseplugin.cpp +++ b/src/plugins/clearcase/clearcaseplugin.cpp @@ -1542,31 +1542,31 @@ QList ClearCasePlugin::ccGetActivities() const // Maintain latest deliver and rebase activities only QStringPair rebaseAct; QStringPair deliverAct; - QStringList args(QLatin1String("lsactivity")); // Retrieve all activities + QStringList args(QLatin1String("lsactivity")); args << QLatin1String("-fmt") << QLatin1String("%n\\t%[headline]p\\n"); const QString response = runCleartoolSync(currentState().topLevel(), args); QStringList acts = response.split(QLatin1Char('\n'), QString::SkipEmptyParts); foreach (QString activity, acts) { QStringList act = activity.split(QLatin1Char('\t')); - // exclude deliver/rebase activities (and include only the latest ones) - QRegExp deliverRebase(QLatin1String("deliver\\.|rebase\\.")); if (act.size() >= 2) { QString actName = act.at(0); - if (actName.indexOf(deliverRebase) == -1) - result.append(QStringPair(actName, act.at(1).trimmed())); - else if ((actName.at(0) == QLatin1Char('r')) && (actName > rebaseAct.first)) + // include only latest deliver/rebase activities. Activities are sorted + // by creation time + if (actName.startsWith(QLatin1String("rebase."))) rebaseAct = QStringPair(actName, act.at(1)); - else if ((actName.at(0) == QLatin1Char('d')) && (actName > deliverAct.first)) + else if (actName.startsWith(QLatin1String("deliver."))) deliverAct = QStringPair(actName, act.at(1)); + else + result.append(QStringPair(actName, act.at(1).trimmed())); } } + qSort(result); if (!rebaseAct.first.isEmpty()) result.append(rebaseAct); if (!deliverAct.first.isEmpty()) result.append(deliverAct); - qSort(result); return result; } From c5745c6e78a71c261604f9956788e9875f2a5888 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 27 Aug 2012 10:32:06 +0300 Subject: [PATCH 05/37] ClearCase: Optimize lookup for top level ...when opening files in the same dynamic view Change-Id: I2713eb613b8077a86aaddf0a2a0eee52959800ac Reviewed-by: Tobias Hunger --- src/plugins/clearcase/clearcaseplugin.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/clearcase/clearcaseplugin.cpp b/src/plugins/clearcase/clearcaseplugin.cpp index c29f23de2ed..a103ad599d9 100644 --- a/src/plugins/clearcase/clearcaseplugin.cpp +++ b/src/plugins/clearcase/clearcaseplugin.cpp @@ -216,6 +216,8 @@ QString ClearCasePlugin::findTopLevel(const QString &directory) const if (!topLevel.isEmpty() || !clearCaseControl()->isConfigured()) return topLevel; // Dynamic view + if (directory.startsWith(m_topLevel) && directory.at(m_topLevel.size()) == QLatin1Char('/')) + return m_topLevel; bool isDynamic; ccGetView(directory, &isDynamic); if (isDynamic) { From cb87ce786b65edd053f40d8fd34ba91b9109ffab Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 27 Aug 2012 12:24:23 +0200 Subject: [PATCH 06/37] Translation fixes in the ClearCase plugin. - Add translator's comments. - Capitalize Dialog titles. - Replace Qt Designer's generated rich text (hardcoded font) by simple HTML. - Remove exclamation marks (do not shout at users). Change-Id: I01623a336dfd7bdf24f7d5c0d3a2ed48454d8205 Reviewed-by: Orgad Shaneh Reviewed-by: Tobias Hunger --- src/plugins/clearcase/checkoutdialog.ui | 2 +- src/plugins/clearcase/clearcaseplugin.cpp | 8 ++++---- src/plugins/clearcase/settingspage.ui | 2 +- src/plugins/clearcase/undocheckout.ui | 2 +- src/plugins/clearcase/versionselector.cpp | 3 +++ src/plugins/clearcase/versionselector.ui | 12 ++---------- 6 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/plugins/clearcase/checkoutdialog.ui b/src/plugins/clearcase/checkoutdialog.ui index 691a9b0de02..41a5fdef460 100644 --- a/src/plugins/clearcase/checkoutdialog.ui +++ b/src/plugins/clearcase/checkoutdialog.ui @@ -91,7 +91,7 @@ - Use &Hijacked file + Use &Hijacked file true diff --git a/src/plugins/clearcase/clearcaseplugin.cpp b/src/plugins/clearcase/clearcaseplugin.cpp index a103ad599d9..79f5662297f 100644 --- a/src/plugins/clearcase/clearcaseplugin.cpp +++ b/src/plugins/clearcase/clearcaseplugin.cpp @@ -710,7 +710,7 @@ void ClearCasePlugin::undoHijackCurrent() Ui::UndoCheckOut unhijackUi; QDialog unhijackDlg; unhijackUi.setupUi(&unhijackDlg); - unhijackDlg.setWindowTitle(tr("Undo hijack file")); + unhijackDlg.setWindowTitle(tr("Undo Hijack File")); unhijackUi.lblMessage->setText(tr("Do you want to undo hijack of '%1'?") .arg(QDir::toNativeSeparators(fileName))); if (unhijackDlg.exec() != QDialog::Accepted) @@ -1185,7 +1185,7 @@ ClearCaseResponse ClearCaseResponse response; if (executable.isEmpty()) { response.error = true; - response.message = tr("No ClearCase executable specified!"); + response.message = tr("No ClearCase executable specified."); return response; } @@ -1269,7 +1269,7 @@ bool ClearCasePlugin::vcsOpen(const QString &workingDir, const QString &fileName (fi.isWritable() || s_statusMap[relFile].status == FileStatus::Unknown)) QtConcurrent::run(&sync, topLevel, QStringList(relFile)).waitForFinished(); if (s_statusMap[relFile].status == FileStatus::CheckedOut) { - QMessageBox::information(0, tr("ClearCase Checkout"), tr("File is already checked out!")); + QMessageBox::information(0, tr("ClearCase Checkout"), tr("File is already checked out.")); return true; } bool isHijacked = (s_statusMap[relFile].status & FileStatus::Hijacked); @@ -1492,7 +1492,7 @@ bool ClearCasePlugin::vcsAdd(const QString &workingDir, const QString &fileName) bool ClearCasePlugin::vcsDelete(const QString &workingDir, const QString &fileName) { const QString title(tr("ClearCase Remove Element")); - if (QMessageBox::warning(0, title, tr("This operation is irreversible! Are you sure?"), + if (QMessageBox::warning(0, title, tr("This operation is irreversible. Are you sure?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) return true; diff --git a/src/plugins/clearcase/settingspage.ui b/src/plugins/clearcase/settingspage.ui index 06cb74647ab..7f4c3247089 100644 --- a/src/plugins/clearcase/settingspage.ui +++ b/src/plugins/clearcase/settingspage.ui @@ -161,7 +161,7 @@ - &Index only VOBs: + &Index only VOBs: indexOnlyVOBsEdit diff --git a/src/plugins/clearcase/undocheckout.ui b/src/plugins/clearcase/undocheckout.ui index a830f840913..af28f7ed0a6 100644 --- a/src/plugins/clearcase/undocheckout.ui +++ b/src/plugins/clearcase/undocheckout.ui @@ -63,7 +63,7 @@ - The file was changed! + The file was changed. diff --git a/src/plugins/clearcase/versionselector.cpp b/src/plugins/clearcase/versionselector.cpp index 281ae2901f8..cf9614ae269 100644 --- a/src/plugins/clearcase/versionselector.cpp +++ b/src/plugins/clearcase/versionselector.cpp @@ -45,6 +45,9 @@ VersionSelector::VersionSelector(const QString &fileName, const QString &message { ui->setupUi(this); ui->headerLabel->setText(ui->headerLabel->text().arg(fileName)); + ui->loadedText->setHtml(tr("

NOTE: You will not be able to check in " + "this file without merging the changes (not supported by the " + "plugin)

")); m_stream = new QTextStream(message.toLocal8Bit(), QIODevice::ReadOnly | QIODevice::Text); QString line; while (!m_stream->atEnd() && !line.contains(QLatin1String("1) Loaded version"))) diff --git a/src/plugins/clearcase/versionselector.ui b/src/plugins/clearcase/versionselector.ui index 38336a02e5d..b120bcf944a 100644 --- a/src/plugins/clearcase/versionselector.ui +++ b/src/plugins/clearcase/versionselector.ui @@ -75,15 +75,7 @@
- - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-weight:600;">NOTE: You will not be able to check in this file without merging the changes (not supported by the plugin)</span></p></body></html> - - + @@ -113,7 +105,7 @@ p, li { white-space: pre-wrap; } - Created On: + Created On: From 282f2e400d7fd00f1fe8468b791db1c7f0a681af Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 27 Aug 2012 14:05:46 +0200 Subject: [PATCH 07/37] Fix QFSFileEngine warning about trying to open an empty file. Change-Id: I3cda6965c10924bc611c2d7d73fb309a63976e18 Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/settingsaccessor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/settingsaccessor.cpp b/src/plugins/projectexplorer/settingsaccessor.cpp index 1816a9bb3c7..9b5ac386187 100644 --- a/src/plugins/projectexplorer/settingsaccessor.cpp +++ b/src/plugins/projectexplorer/settingsaccessor.cpp @@ -658,7 +658,7 @@ QVariantMap SettingsAccessor::restoreSettings() const // Time to consider shared settings... SettingsData sharedSettings; - if (m_sharedFileAcessor.readFile(&sharedSettings)) { + if (!sharedSettings.m_fileName.isEmpty() && m_sharedFileAcessor.readFile(&sharedSettings)) { bool useSharedSettings = true; if (sharedSettings.m_version != settings.m_version) { int baseFileVersion; From a208cebdcc3fa439400b825bff6b71da40621040 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 27 Aug 2012 10:45:20 +0200 Subject: [PATCH 08/37] Fix host ABI detection with MinGW 4.6. Fix warning: "Unable to completely determine the host ABI (x86-windows-unknown-pe-32bit).". It seems mingw32 is no longer defined in MinGW 4.6; use the more reliable Q_CC_MINGW. Change-Id: I2d4f84a62b2fe829b3a8d755a76429b94c0109f5 Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/abi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index 2cd816a9125..538e3101a08 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -643,7 +643,7 @@ Abi Abi::hostAbi() subos = WindowsMsvc2008Flavor; #elif _MSC_VER == 1400 subos = WindowsMsvc2005Flavor; -#elif defined (mingw32) +#elif defined (Q_CC_MINGW) subos = WindowsMSysFlavor; #endif format = PEFormat; From fc878896b47c1efce474c409b745ed05428973e4 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 27 Aug 2012 13:58:47 +0200 Subject: [PATCH 09/37] Fix exit crash when showing GDB options page. The options page deleted the widget, which it does not own. Remove the deletion, rename GdbOptionsPagePrivate to GdbOptionsPageWidget and use a QPointer in the GdbOptionsPage, rename the member to m_widget for clarity. Change-Id: I211a7cf4d59015c540335bd6313eaff13f1999a4 Reviewed-by: hjk --- src/plugins/debugger/gdb/gdboptionspage.cpp | 22 ++++++++++----------- src/plugins/debugger/gdb/gdboptionspage.h | 5 +++-- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/plugins/debugger/gdb/gdboptionspage.cpp b/src/plugins/debugger/gdb/gdboptionspage.cpp index 2e0b4cb756e..65ec57e08dd 100644 --- a/src/plugins/debugger/gdb/gdboptionspage.cpp +++ b/src/plugins/debugger/gdb/gdboptionspage.cpp @@ -54,10 +54,10 @@ namespace Debugger { namespace Internal { -class GdbOptionsPagePrivate : public QWidget +class GdbOptionsPageWidget : public QWidget { public: - explicit GdbOptionsPagePrivate(QWidget *parent); + explicit GdbOptionsPageWidget(QWidget *parent); QGroupBox *groupBoxGeneral; QLabel *labelGdbWatchdogTimeout; @@ -91,7 +91,7 @@ public: QString searchKeywords; }; -GdbOptionsPagePrivate::GdbOptionsPagePrivate(QWidget *parent) +GdbOptionsPageWidget::GdbOptionsPageWidget(QWidget *parent) : QWidget(parent) { groupBoxGeneral = new QGroupBox(this); @@ -338,7 +338,6 @@ GdbOptionsPagePrivate::GdbOptionsPagePrivate(QWidget *parent) } GdbOptionsPage::GdbOptionsPage() - : d(0) { setId(QLatin1String("M.Gdb")); setDisplayName(tr("GDB")); @@ -349,30 +348,29 @@ GdbOptionsPage::GdbOptionsPage() GdbOptionsPage::~GdbOptionsPage() { - delete d; } QWidget *GdbOptionsPage::createPage(QWidget *parent) { - d = new GdbOptionsPagePrivate(parent); - return d; + m_widget = new GdbOptionsPageWidget(parent); + return m_widget; } void GdbOptionsPage::apply() { - if (d) - d->group.apply(Core::ICore::settings()); + if (m_widget) + m_widget->group.apply(Core::ICore::settings()); } void GdbOptionsPage::finish() { - if (d) - d->group.finish(); + if (m_widget) + m_widget->group.finish(); } bool GdbOptionsPage::matches(const QString &s) const { - return d && d->searchKeywords.contains(s, Qt::CaseInsensitive); + return m_widget && m_widget->searchKeywords.contains(s, Qt::CaseInsensitive); } } // namespace Internal diff --git a/src/plugins/debugger/gdb/gdboptionspage.h b/src/plugins/debugger/gdb/gdboptionspage.h index f796ddba41c..dc94f13f59a 100644 --- a/src/plugins/debugger/gdb/gdboptionspage.h +++ b/src/plugins/debugger/gdb/gdboptionspage.h @@ -32,11 +32,12 @@ #define GDBOPTIONSPAGE_H #include +#include namespace Debugger { namespace Internal { -class GdbOptionsPagePrivate; +class GdbOptionsPageWidget; class GdbOptionsPage : public Core::IOptionsPage { @@ -51,7 +52,7 @@ public: bool matches(const QString &) const; private: - GdbOptionsPagePrivate *d; + QPointer m_widget; }; } // namespace Internal From 3b192d1fcf415b9919a940aab55b4d2de45e435d Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Mon, 27 Aug 2012 11:14:15 +0200 Subject: [PATCH 10/37] Doc: debugger is now selected for each target Change-Id: I6c033c047d134a953291747f2cf044dcaab1d858 Reviewed-by: hjk --- doc/src/debugger/creator-debugger-setup.qdoc | 39 +++++++------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/doc/src/debugger/creator-debugger-setup.qdoc b/doc/src/debugger/creator-debugger-setup.qdoc index 0509010073c..016b21c9c3d 100644 --- a/doc/src/debugger/creator-debugger-setup.qdoc +++ b/doc/src/debugger/creator-debugger-setup.qdoc @@ -32,24 +32,21 @@ \title Setting Up Debugger - The main debugger settings are associated with the \l{glossary-tool-chain} - {tool chains} used to build your project. - - To configure tool chains, select \gui{Tools > Options > Build and Run > - Tool Chains}. The view lists the tool chains that \QC detected - automatically. You can add tool chains. + The main debugger settings are associated with the build + \l{glossary-development-target}{target} of your project. To specify the + debugger and compiler to use for each build target, select \gui Tools > + \gui Options > \gui {Build and Run} > \gui Targets. You need to set up the debugger only if the automatic setup fails, because the native debugger is missing (as is usually the case for the CDB debugger on Windows, which you always must install - yourself) or because the installed version is not supported (e.g. + yourself) or because the installed version is not supported (for example, when your system contains no, or an outdated version of GDB and you want to use a locally installed replacement instead). - \note If you need to change parameters of an automatically detected - toolchain, you can \gui{Clone} the tool chain and change the - parameters in the clone. Make sure to select the cloned tool chain - in the build settings of your project. + \note If you need to change the debugger to use for an automatically + detected target, you can \gui{Clone} the target and change the parameters in + the clone. Make sure to select the cloned target for your project. \note To use the debugging tools for Windows, you must install them and add the Symbol Server provided by Microsoft to the symbol search @@ -57,7 +54,7 @@ Server in Windows}. \note To use the Free Software Foundation (FSF) version of GDB on - Mac OS, you must sign it and modify your tool chain settings. + Mac OS, you must sign it and modify your target settings. This section explains the options you have for debugging C++ code and provides installation notes for the supported native debuggers. @@ -237,7 +234,7 @@ supports Python from \l{ftp://ftp.qt.nokia.com/misc/gdb/7.2/gdb72_mac_platform.tar.bz2}. To use FSF GDB on Mac OS, you must sign it and add it to the \QC - tool chains. For more information, see + targets. For more information, see \l{Setting up FSF GDB for Mac OS}. \note The Mac OS X Snow Leopard (10.6) has a bug that might cause the @@ -275,8 +272,7 @@ \section1 Setting up FSF GDB for Mac OS - To use FSF GDB on Mac OS, you must sign it and add it to the \QC tool - chains. + To use FSF GDB on Mac OS, you must sign it and add it to the \QC targets. \list 1 @@ -317,21 +313,14 @@ \endcode \o In \QC, select \gui {Qt Creator > Preferences > Build & Run > - Tool Chains}, to add a tool chain that uses the debugger: - - \list 1 - - \o Select a native tool chain (usually, a x86 64-bit tool chain) - and click \gui Clone to clone it. + Targets} > \gui Add to create a build target that uses FSF GDB. \o In the \gui Debugger field, specify the path to FSF GDB (\c $HOME/gdb72/bin/fsfgdb, but with an explicit value for \c $HOME). - \endlist - - \o To use the debugger, select the tool chain in the \gui {Tool chain} - field in the \gui {Build Settings} of the project. + \o To use the debugger, add the target in the \gui {Build Settings} + of the project. \endlist From 972399830a2cfc8ce889ebd582a6c0c66a7f78fb Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 27 Aug 2012 10:02:07 +0200 Subject: [PATCH 11/37] Bump version of the CDB extension. Change-Id: Ie7b86009f47b2bb3ae300d1496b3c22cce58f03d Reviewed-by: hjk --- src/libs/qtcreatorcdbext/qtcreatorcdbextension.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/qtcreatorcdbext/qtcreatorcdbextension.cpp b/src/libs/qtcreatorcdbext/qtcreatorcdbextension.cpp index 76269256fa0..86267356345 100644 --- a/src/libs/qtcreatorcdbext/qtcreatorcdbextension.cpp +++ b/src/libs/qtcreatorcdbext/qtcreatorcdbextension.cpp @@ -276,7 +276,7 @@ extern "C" HRESULT CALLBACK pid(CIDebugClient *client, PCSTR args) int token; commandTokens(args, &token); - dprintf("Qt Creator CDB extension version 0.11 (Qt 5 support) %d bit built %s.\n", sizeof(void *) > 4 ? 64 : 32, __DATE__); + dprintf("Qt Creator CDB extension version 2.6 (Qt 5 support) %d bit built %s.\n", sizeof(void *) > 4 ? 64 : 32, __DATE__); if (const ULONG pid = currentProcessId(client)) { ExtensionContext::instance().report('R', token, 0, "pid", "%u", pid); } else { From d80b608d5226f89730e9fdcea36dc1becff4b670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20N=C3=A4tterlund?= Date: Mon, 27 Aug 2012 15:07:34 +0200 Subject: [PATCH 12/37] RemoteLinux/QNX: Fixed signal-slot connection Change-Id: I6f060880db7b9360b3d9c548f42cee46468eb4ab Reviewed-by: Daniel Teske --- src/plugins/qnx/blackberrydeployinformation.cpp | 6 +++--- src/plugins/remotelinux/deploymentinfo.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/qnx/blackberrydeployinformation.cpp b/src/plugins/qnx/blackberrydeployinformation.cpp index 284afad35ee..5e65e4a6dfc 100644 --- a/src/plugins/qnx/blackberrydeployinformation.cpp +++ b/src/plugins/qnx/blackberrydeployinformation.cpp @@ -48,7 +48,7 @@ BlackBerryDeployInformation::BlackBerryDeployInformation(Qt4ProjectManager::Qt4P : QAbstractTableModel(project) , m_project(project) { - connect(m_project, SIGNAL(buildSystemEvaluated()), this, SLOT(initModel())); + connect(m_project, SIGNAL(proFilesEvaluated()), this, SLOT(initModel())); } int BlackBerryDeployInformation::rowCount(const QModelIndex &parent) const @@ -175,7 +175,7 @@ void BlackBerryDeployInformation::initModel() if (!rootNode || rootNode->parseInProgress()) // Can be null right after project creation by wizard. return; - disconnect(m_project, SIGNAL(buildSystemEvaluated()), this, SLOT(initModel())); + disconnect(m_project, SIGNAL(proFilesEvaluated()), this, SLOT(initModel())); beginResetModel(); m_deployInformation.clear(); @@ -193,5 +193,5 @@ void BlackBerryDeployInformation::initModel() } endResetModel(); - connect(m_project, SIGNAL(buildSystemEvaluated()), SLOT(initModel())); + connect(m_project, SIGNAL(proFilesEvaluated()), SLOT(initModel())); } diff --git a/src/plugins/remotelinux/deploymentinfo.cpp b/src/plugins/remotelinux/deploymentinfo.cpp index 7c69ef89fa3..5ddf83336a1 100644 --- a/src/plugins/remotelinux/deploymentinfo.cpp +++ b/src/plugins/remotelinux/deploymentinfo.cpp @@ -61,7 +61,7 @@ using namespace Internal; DeploymentInfo::DeploymentInfo(Qt4ProjectManager::Qt4Project *project, const QString &installPrefix) : QAbstractListModel(project), d(new DeploymentInfoPrivate(project)) { - connect(project, SIGNAL(buildSystemEvaluated()), SLOT(createModels())); + connect(project, SIGNAL(proFilesEvaluated()), SLOT(createModels())); setInstallPrefix(installPrefix); } @@ -89,13 +89,13 @@ void DeploymentInfo::createModels() const Qt4ProFileNode *const rootNode = d->project->rootQt4ProjectNode(); if (!rootNode || rootNode->parseInProgress()) // Can be null right after project creation by wizard. return; - disconnect(d->project, SIGNAL(buildSystemEvaluated()), this, SLOT(createModels())); + disconnect(d->project, SIGNAL(proFilesEvaluated()), this, SLOT(createModels())); beginResetModel(); qDeleteAll(d->listModels); d->listModels.clear(); createModels(rootNode); endResetModel(); - connect (d->project, SIGNAL(buildSystemEvaluated()), SLOT(createModels())); + connect (d->project, SIGNAL(proFilesEvaluated()), SLOT(createModels())); } void DeploymentInfo::createModels(const Qt4ProFileNode *proFileNode) From 790cc8947caefd01d5ff2a33c944128a882903e1 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 22 Aug 2012 16:12:57 +0200 Subject: [PATCH 13/37] Pick better targets when importing projects Task-number: QTCREATORBUG-7721 Change-Id: Ib444d233d99a5121129671debab18557135559f4 Reviewed-by: Tobias Hunger --- .../projectexplorer/settingsaccessor.cpp | 50 +++++++++++++------ 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/src/plugins/projectexplorer/settingsaccessor.cpp b/src/plugins/projectexplorer/settingsaccessor.cpp index 9b5ac386187..9beb42d014d 100644 --- a/src/plugins/projectexplorer/settingsaccessor.cpp +++ b/src/plugins/projectexplorer/settingsaccessor.cpp @@ -48,7 +48,6 @@ #include #include -#include #include #include @@ -2327,23 +2326,34 @@ QVariantMap Version11Handler::update(Project *project, const QVariantMap &map) if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.AndroidDeviceTarget")) { tmpProfile->setIconPath(QLatin1String(":/android/images/QtAndroid.png")); tmpProfile->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("Desktop")); + tmpProfile->setValue(Core::Id("PE.Profile.Device"), QString()); } else if (oldTargetId == QLatin1String("RemoteLinux.EmbeddedLinuxTarget")) { tmpProfile->setIconPath(QLatin1String(":///DESKTOP///")); tmpProfile->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("GenericLinuxOsType")); + tmpProfile->setValue(Core::Id("PE.Profile.Device"), QString()); } else if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.HarmattanDeviceTarget")) { tmpProfile->setIconPath(QLatin1String(":/projectexplorer/images/MaemoDevice.png")); tmpProfile->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("HarmattanOsType")); + tmpProfile->setValue(Core::Id("PE.Profile.Device"), QString()); } else if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.MaemoDeviceTarget")) { tmpProfile->setIconPath(QLatin1String(":/projectexplorer/images/MaemoDevice.png")); tmpProfile->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("Maemo5OsType")); + tmpProfile->setValue(Core::Id("PE.Profile.Device"), QString()); } else if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.MeegoDeviceTarget")) { tmpProfile->setIconPath(QLatin1String(":/projectexplorer/images/MaemoDevice.png")); tmpProfile->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("MeegoOsType")); + tmpProfile->setValue(Core::Id("PE.Profile.Device"), QString()); + } else if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.S60DeviceTarget")) { + tmpProfile->setIconPath(QLatin1String(":/projectexplorer/images/SymbianDevice.png")); + tmpProfile->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("Qt4ProjectManager.SymbianDevice")); + tmpProfile->setValue(Core::Id("PE.Profile.Device"), QString::fromLatin1("Symbian Device")); } else if (oldTargetId == QLatin1String("Qt4ProjectManager.Target.QtSimulatorTarget")) { tmpProfile->setIconPath(QLatin1String(":/projectexplorer/images/Simulator.png")); tmpProfile->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("Desktop")); + tmpProfile->setValue(Core::Id("PE.Profile.Device"), QString::fromLatin1("Desktop Device")); } else { tmpProfile->setIconPath(QLatin1String(":///DESKTOP///")); + tmpProfile->setValue(Core::Id("PE.Profile.DeviceType"), QString::fromLatin1("Desktop")); tmpProfile->setValue(Core::Id("PE.Profile.Device"), QString::fromLatin1("Desktop Device")); } @@ -2429,24 +2439,34 @@ QVariantMap Version11Handler::update(Project *project, const QVariantMap &map) Profile *Version11Handler::uniqueProfile(Profile *p) { + const QString tc = p->value(Core::Id("PE.Profile.ToolChain")).toString(); + const int qt = p->value(Core::Id("QtSupport.QtInformation")).toInt(); + const QString debugger = p->value(Core::Id("Debugger.Information")).toString(); + const QString mkspec = p->value(Core::Id("QtPM4.mkSpecInformation")).toString(); + const QString deviceType = p->value(Core::Id("PE.Profile.DeviceType")).toString(); + const QString device = p->value(Core::Id("PE.Profile.Device")).toString(); + const QString sysroot = p->value(Core::Id("PE.Profile.SysRoot")).toString(); + foreach (Profile *i, m_targets.keys()) { - const QString tc = i->value(Core::Id("PE.Profile.ToolChain")).toString(); - const int qt = i->value(Core::Id("QtSupport.QtInformation")).toInt(); - const QString debugger = i->value(Core::Id("Debugger.Information")).toString(); - const QString mkspec = i->value(Core::Id("QtPM4.mkSpecInformation")).toString(); - const QString device = i->value(Core::Id("PE.Profile.Device")).toString(); + const QString currentTc = i->value(Core::Id("PE.Profile.ToolChain")).toString(); + const int currentQt = i->value(Core::Id("QtSupport.QtInformation")).toInt(); + const QString currentDebugger = i->value(Core::Id("Debugger.Information")).toString(); + const QString currentMkspec = i->value(Core::Id("QtPM4.mkSpecInformation")).toString(); + const QString currentDeviceType = i->value(Core::Id("PE.Profile.DeviceType")).toString(); + const QString currentDevice = i->value(Core::Id("PE.Profile.Device")).toString(); + const QString currentSysroot = i->value(Core::Id("PE.Profile.SysRoot")).toString(); - if ((i->value(Core::Id("PE.Profile.DeviceType")).toString() == p->value(Core::Id("PE.Profile.DeviceType")).toString()) - && (tc.isEmpty() || (tc == p->value(Core::Id("PE.Profile.ToolChain")).toString())) - && (qt == p->value(Core::Id("QtSupport.QtInformation")).toInt()) - && (debugger.isEmpty() || (debugger == p->value(Core::Id("Debugger.Information")).toString())) - && (mkspec.isEmpty() || (mkspec == p->value(Core::Id("QtPM4.mkSpecInformation")).toString())) - && (i->value(Core::Id("PE.Profile.SysRoot")).toString() == p->value(Core::Id("PE.Profile.SysRoot")).toString()) - && (device == p->value(Core::Id("PE.Profile.Device")))) { + bool deviceTypeOk = deviceType == currentDeviceType; + bool deviceOk = device.isEmpty() || currentDevice == device; + bool tcOk = tc.isEmpty() || currentTc.isEmpty() || currentTc == tc; + bool qtOk = qt == -1 || currentQt == qt; + bool debuggerOk = debugger.isEmpty() || currentDebugger.isEmpty() || currentDebugger == debugger; + bool mkspecOk = mkspec.isEmpty() || currentMkspec.isEmpty() || currentMkspec == mkspec; + bool sysrootOk = sysroot.isEmpty() || currentSysroot == sysroot; + + if (deviceTypeOk && deviceOk && tcOk && qtOk && debuggerOk && mkspecOk && sysrootOk) return i; - } } - return p->clone(true); } From edf4a975df3bbd6c550b17026e4166d0381ab6ad Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 27 Aug 2012 15:11:28 +0200 Subject: [PATCH 14/37] Fix warning about disconnecting from 0 when importing a project. Change-Id: I2b2edbad5b59fdad8a537c82d675cdc8b59eaa82 Reviewed-by: Tobias Hunger --- src/plugins/qt4projectmanager/qt4project.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp index f66c2d5d53d..4e061af1e6b 100644 --- a/src/plugins/qt4projectmanager/qt4project.cpp +++ b/src/plugins/qt4projectmanager/qt4project.cpp @@ -1097,8 +1097,10 @@ QStringList Qt4Project::applicationProFilePathes(const QString &prepend) const void Qt4Project::activeTargetWasChanged() { - disconnect(m_activeTarget, SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)), - this, SLOT(scheduleAsyncUpdate())); + if (m_activeTarget) { + disconnect(m_activeTarget, SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)), + this, SLOT(scheduleAsyncUpdate())); + } m_activeTarget = activeTarget(); From 4e66baa6ffdee0c66cb8f4f0cd00f29e26181649 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sun, 26 Aug 2012 11:40:32 +0300 Subject: [PATCH 15/37] HistoryCompleter: Correct reaction for Key_Down Change-Id: I9b0d56b6f615f567391349404250d05b5c0b9113 Reviewed-by: hjk --- src/libs/utils/historycompleter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/historycompleter.cpp b/src/libs/utils/historycompleter.cpp index 8fcfa1436ba..8b1357a872c 100644 --- a/src/libs/utils/historycompleter.cpp +++ b/src/libs/utils/historycompleter.cpp @@ -180,7 +180,9 @@ HistoryCompleter::~HistoryCompleter() bool HistoryCompleter::eventFilter(QObject *obj, QEvent *event) { - if (event->type() == QEvent::KeyPress && static_cast(event)->key() == Qt::Key_Down) { + if (event->type() == QEvent::KeyPress && + static_cast(event)->key() == Qt::Key_Down && + static_cast(widget())->text().isEmpty()) { setCompletionPrefix(QString()); complete(); } From 09d173b188cf92613f209444492b9d36ae6200e0 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 24 Aug 2012 18:33:02 +0200 Subject: [PATCH 16/37] debugger: add dumper for some internal classes CPlusPlus::{Literal,Identifier,IntegerType,NamedType,TemplateNameId} Change-Id: I1c71be1e284c69c09d8257696feda2974f083c33 Reviewed-by: hjk --- share/qtcreator/dumper/qttypes.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/share/qtcreator/dumper/qttypes.py b/share/qtcreator/dumper/qttypes.py index e68011950cc..6dad694aaca 100644 --- a/share/qtcreator/dumper/qttypes.py +++ b/share/qtcreator/dumper/qttypes.py @@ -2417,6 +2417,28 @@ def qdump__CPlusPlus__ByteArrayRef(d, value): Hex2EncodedLatin1) d.putPlainChildren(value) +def qdump__CPlusPlus__Identifier(d, value): + d.putValue(encodeCharArray(value["_chars"]), Hex2EncodedLatin1) + d.putPlainChildren(value) + +def qdump__CPlusPlus__IntegerType(d, value): + d.putValue(value["_kind"]) + d.putPlainChildren(value) + +def qdump__CPlusPlus__NamedType(d, value): + literal = downcast(value["_name"]) + d.putValue(encodeCharArray(literal["_chars"]), Hex2EncodedLatin1) + d.putPlainChildren(value) + +def qdump__CPlusPlus__TemplateNameId(d, value): + s = encodeCharArray(value["_identifier"]["_chars"]) + d.putValue(s + "3c2e2e2e3e", Hex2EncodedLatin1) + d.putPlainChildren(value) + +def qdump__CPlusPlus__Literal(d, value): + d.putValue(encodeCharArray(value["_chars"]), Hex2EncodedLatin1) + d.putPlainChildren(value) + def qdump__CPlusPlus__Internal__Value(d, value): d.putValue(value["l"]) d.putPlainChildren(value) From 81b431cdcaacf2951bdc4315cf1459615857ca03 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 27 Aug 2012 15:49:08 +0300 Subject: [PATCH 17/37] HistoryCompleter: Accept parent Change-Id: Ifbbd2b7af06eec620a765614792547fff6303f06 Reviewed-by: hjk --- src/libs/utils/fancylineedit.cpp | 2 +- src/libs/utils/historycompleter.cpp | 5 +++-- src/libs/utils/historycompleter.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libs/utils/fancylineedit.cpp b/src/libs/utils/fancylineedit.cpp index 47fdcfced86..acb6ae006e9 100644 --- a/src/libs/utils/fancylineedit.cpp +++ b/src/libs/utils/fancylineedit.cpp @@ -305,7 +305,7 @@ bool FancyLineEdit::hasAutoHideButton(Side side) const void FancyLineEdit::setHistoryCompleter(const QString &historyKey) { QTC_ASSERT(!d->m_historyCompleter, return); - d->m_historyCompleter = new HistoryCompleter(this, historyKey); + d->m_historyCompleter = new HistoryCompleter(this, historyKey, this); QLineEdit::setCompleter(d->m_historyCompleter); } diff --git a/src/libs/utils/historycompleter.cpp b/src/libs/utils/historycompleter.cpp index 8b1357a872c..c79a52ecb7d 100644 --- a/src/libs/utils/historycompleter.cpp +++ b/src/libs/utils/historycompleter.cpp @@ -156,8 +156,9 @@ void HistoryCompleterPrivate::saveEntry(const QString &str) theSettings->setValue(historyKey, list); } -HistoryCompleter::HistoryCompleter(QLineEdit *lineEdit, const QString &historyKey) - : d(new HistoryCompleterPrivate) +HistoryCompleter::HistoryCompleter(QLineEdit *lineEdit, const QString &historyKey, QObject *parent) + : QCompleter(parent), + d(new HistoryCompleterPrivate) { QTC_ASSERT(lineEdit, return); QTC_ASSERT(!historyKey.isEmpty(), return); diff --git a/src/libs/utils/historycompleter.h b/src/libs/utils/historycompleter.h index 8446262cc39..6a3e3fb654d 100644 --- a/src/libs/utils/historycompleter.h +++ b/src/libs/utils/historycompleter.h @@ -49,7 +49,7 @@ class QTCREATOR_UTILS_EXPORT HistoryCompleter : public QCompleter public: static void setSettings(QSettings *settings); - HistoryCompleter(QLineEdit *lineEdit, const QString &historyKey); + HistoryCompleter(QLineEdit *lineEdit, const QString &historyKey, QObject *parent = 0); private: ~HistoryCompleter(); From a8ba7054f5a6ff117edb43d50574d3de150a92d3 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 28 Aug 2012 10:44:19 +0200 Subject: [PATCH 18/37] Catch std::bad_alloc thrown by ElfReader on MinGW. Change-Id: Ide5445e1cf488c29be620287759147251bc7c26a Reviewed-by: hjk --- src/plugins/debugger/moduleshandler.cpp | 29 +++++++++++++++---------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/plugins/debugger/moduleshandler.cpp b/src/plugins/debugger/moduleshandler.cpp index c32e1680fb7..7c9dcc06cbd 100644 --- a/src/plugins/debugger/moduleshandler.cpp +++ b/src/plugins/debugger/moduleshandler.cpp @@ -228,19 +228,24 @@ void ModulesModel::removeModule(const QString &modulePath) void ModulesModel::updateModule(const Module &module) { const int row = indexOfModule(module.modulePath); - ElfReader reader(module.modulePath); - ElfData elfData = reader.readHeaders(); + try { // MinGW occasionallly throws std::bad_alloc. + ElfReader reader(module.modulePath); + ElfData elfData = reader.readHeaders(); - if (row == -1) { - const int n = m_modules.size(); - beginInsertRows(QModelIndex(), n, n); - m_modules.push_back(module); - m_modules.back().elfData = elfData; - endInsertRows(); - } else { - m_modules[row] = module; - m_modules[row].elfData = elfData; - dataChanged(index(row, 0, QModelIndex()), index(row, 4, QModelIndex())); + if (row == -1) { + const int n = m_modules.size(); + beginInsertRows(QModelIndex(), n, n); + m_modules.push_back(module); + m_modules.back().elfData = elfData; + endInsertRows(); + } else { + m_modules[row] = module; + m_modules[row].elfData = elfData; + dataChanged(index(row, 0, QModelIndex()), index(row, 4, QModelIndex())); + } + } catch(...) { + qWarning("%s: An exception occurred while reading module '%s'", + Q_FUNC_INFO, qPrintable(module.modulePath)); } } From bc0f02c6b8db36d0b8cd549bbc7b3ff08c4437ea Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 28 Aug 2012 10:53:33 +0200 Subject: [PATCH 19/37] debugger: make ModulesHandler aware of its DebuggerEngine Change-Id: I5f59eed83ac45a2d90c079101158e7e306fd9a3e Reviewed-by: Friedemann Kleint --- src/plugins/debugger/debuggerengine.cpp | 2 +- src/plugins/debugger/moduleshandler.cpp | 3 ++- src/plugins/debugger/moduleshandler.h | 6 +++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 0ee1117ba99..e6d18bb79f3 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -163,7 +163,7 @@ public: m_targetState(DebuggerNotReady), m_remoteSetupState(RemoteSetupNone), m_inferiorPid(0), - m_modulesHandler(), + m_modulesHandler(engine), m_registerHandler(), m_sourceFilesHandler(), m_stackHandler(), diff --git a/src/plugins/debugger/moduleshandler.cpp b/src/plugins/debugger/moduleshandler.cpp index 7c9dcc06cbd..75642d0e3f7 100644 --- a/src/plugins/debugger/moduleshandler.cpp +++ b/src/plugins/debugger/moduleshandler.cpp @@ -255,8 +255,9 @@ void ModulesModel::updateModule(const Module &module) // ////////////////////////////////////////////////////////////////// -ModulesHandler::ModulesHandler() +ModulesHandler::ModulesHandler(DebuggerEngine *engine) { + m_engine = engine; m_model = new ModulesModel(this); m_proxyModel = new QSortFilterProxyModel(this); m_proxyModel->setSourceModel(m_model); diff --git a/src/plugins/debugger/moduleshandler.h b/src/plugins/debugger/moduleshandler.h index 063e2275eca..b51ca0f6e4a 100644 --- a/src/plugins/debugger/moduleshandler.h +++ b/src/plugins/debugger/moduleshandler.h @@ -42,6 +42,9 @@ class QSortFilterProxyModel; QT_END_NAMESPACE namespace Debugger { + +class DebuggerEngine; + namespace Internal { class ModulesModel; @@ -105,7 +108,7 @@ class ModulesHandler : public QObject Q_OBJECT public: - ModulesHandler(); + explicit ModulesHandler(DebuggerEngine *engine); QAbstractItemModel *model() const; @@ -117,6 +120,7 @@ public: void removeAll(); private: + DebuggerEngine *m_engine; ModulesModel *m_model; QSortFilterProxyModel *m_proxyModel; }; From 69059fef8a0d13374ca9321732dcbe1039f805fb Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 28 Aug 2012 11:51:08 +0200 Subject: [PATCH 20/37] debugger: handle type code "Method" Seems to be new use in mingw 4.6. Change-Id: I7331e3be3c14fed86d4eebf333ab4b01d1b237bf Reviewed-by: Friedemann Kleint --- share/qtcreator/dumper/dumper.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/dumper/dumper.py b/share/qtcreator/dumper/dumper.py index 5301e48fe8c..4d4f747dd5f 100644 --- a/share/qtcreator/dumper/dumper.py +++ b/share/qtcreator/dumper/dumper.py @@ -1633,7 +1633,9 @@ class Dumper: self.putPointerValue(value.address) return - if type.code == MethodPointerCode or type.code == MemberPointerCode: + if type.code == MethodPointerCode \ + or type.code == MethodCode \ + or type.code == MemberPointerCode: self.putType(typeName) self.putAddress(value.address) self.putValue(value) From d7202a5bf9a128c2a12d3abb95c2edcb5f1a0b53 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Tue, 28 Aug 2012 12:17:10 +0200 Subject: [PATCH 21/37] Fix initial qtVersionsChanged signal Change-Id: I9df9f158382f4ab7152130d7fb0ef9be311f12bd Reviewed-by: Christian Kandeler --- src/plugins/qtsupport/qtversionmanager.cpp | 8 +++++--- src/plugins/qtsupport/qtversionmanager.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index 14ec9a7659c..7d93a1d04be 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -136,7 +136,7 @@ QtVersionManager::QtVersionManager() : void QtVersionManager::extensionsInitialized() { bool success = restoreQtVersions(); - updateFromInstaller(); + updateFromInstaller(false); if (!success) { // We did neither restore our settings or upgraded // in that case figure out if there's a qt in path @@ -144,6 +144,7 @@ void QtVersionManager::extensionsInitialized() findSystemQt(); } + emit qtVersionsChanged(m_versions.keys(), QList(), QList()); saveQtVersions(); const Utils::FileName configFileName = globalSettingsFileName(); @@ -231,7 +232,7 @@ bool QtVersionManager::restoreQtVersions() return true; } -void QtVersionManager::updateFromInstaller() +void QtVersionManager::updateFromInstaller(bool emitSignal) { m_fileWatcherTimer->stop(); @@ -353,7 +354,8 @@ void QtVersionManager::updateFromInstaller() qDebug() << ""; } } - emit qtVersionsChanged(added, removed, changed); + if (emitSignal) + emit qtVersionsChanged(added, removed, changed); saveQtVersions(); } diff --git a/src/plugins/qtsupport/qtversionmanager.h b/src/plugins/qtsupport/qtversionmanager.h index f2f4697c446..a13b5cd8d3f 100644 --- a/src/plugins/qtsupport/qtversionmanager.h +++ b/src/plugins/qtsupport/qtversionmanager.h @@ -109,7 +109,7 @@ public slots: void updateDumpFor(const Utils::FileName &qmakeCommand); private slots: - void updateFromInstaller(); + void updateFromInstaller(bool emitSignal = true); private: // This function is really simplistic... From 584c8d417b03ee8202b00197d9c593d11ca871a9 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 27 Aug 2012 16:20:42 +0200 Subject: [PATCH 22/37] Madde: Only get values once they are needed Change-Id: I5235df0110454d246b44e7d6e05b667be4fdb0bc Reviewed-by: Christian Kandeler --- src/plugins/madde/qt4maemodeployconfiguration.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/madde/qt4maemodeployconfiguration.cpp b/src/plugins/madde/qt4maemodeployconfiguration.cpp index a48668f6440..65f36203655 100644 --- a/src/plugins/madde/qt4maemodeployconfiguration.cpp +++ b/src/plugins/madde/qt4maemodeployconfiguration.cpp @@ -162,16 +162,16 @@ void Qt4MaemoDeployConfiguration::setupDebianPackaging() return; Utils::FileName debianDir = DebianManager::debianDirectory(target()); - Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target()->profile()); - DebianManager *dm = DebianManager::instance(); - QString projectName = target()->project()->displayName(); - DebianManager::ActionStatus status = DebianManager::createTemplate(bc, debianDir); if (status == DebianManager::NoActionRequired || status == DebianManager::ActionFailed) return; + Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target()->profile()); + DebianManager *dm = DebianManager::instance(); + QString projectName = target()->project()->displayName(); + if (!DebianManager::hasPackageManagerIcon(debianDir)) { // Such a file is created by the mobile wizards. Utils::FileName iconPath = Utils::FileName::fromString(target()->project()->projectDirectory()); From c5b7726f524f413e8240e0e6c073745eaf2b1d48 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 27 Aug 2012 16:20:57 +0200 Subject: [PATCH 23/37] Madde: Set debian packaging up Set debian packaging up when adding a target requiring it are added. Task-number: QTCREATORBUG-7627 Change-Id: I2e88131f486f6792f38474ed5809dfa5ac7bf0e0 Reviewed-by: Tobias Hunger --- src/plugins/madde/qt4maemodeployconfiguration.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/madde/qt4maemodeployconfiguration.cpp b/src/plugins/madde/qt4maemodeployconfiguration.cpp index 65f36203655..afe60a1fbda 100644 --- a/src/plugins/madde/qt4maemodeployconfiguration.cpp +++ b/src/plugins/madde/qt4maemodeployconfiguration.cpp @@ -299,7 +299,9 @@ DeployConfiguration *Qt4MaemoDeployConfigurationFactory::create(Target *parent, Q_ASSERT(canCreate(parent, id)); const QString displayName = displayNameForId(id); - DeployConfiguration * const dc = new Qt4MaemoDeployConfiguration(parent, id, displayName); + Qt4MaemoDeployConfiguration * const dc = new Qt4MaemoDeployConfiguration(parent, id, displayName); + dc->setupDebianPackaging(); + if (id == Qt4MaemoDeployConfiguration::fremantleWithoutPackagingId()) { dc->stepList()->insertStep(0, new MaemoMakeInstallToSysrootStep(dc->stepList())); dc->stepList()->insertStep(1, new RemoteLinuxCheckForFreeDiskSpaceStep(dc->stepList())); From 4c96bd67916fbde48e5235c3f792fc21c606ebe8 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Tue, 28 Aug 2012 13:18:50 +0200 Subject: [PATCH 24/37] Fix source strings Change-Id: Ib56082091a1f7e3062ff48e981bb4ee8e2dd9357 Reviewed-by: Oswald Buddenhagen --- src/plugins/debugger/gdb/gdboptionspage.cpp | 4 ++-- src/plugins/debugger/qml/qmlengine.cpp | 2 +- src/plugins/debugger/stackframe.cpp | 2 +- src/plugins/help/filtersettingspage.ui | 2 +- src/plugins/madde/maemodeviceconfigwizard.cpp | 4 ++-- src/plugins/qmlprofiler/qmlprofilertool.cpp | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/debugger/gdb/gdboptionspage.cpp b/src/plugins/debugger/gdb/gdboptionspage.cpp index 65ec57e08dd..5f3bc80efa4 100644 --- a/src/plugins/debugger/gdb/gdboptionspage.cpp +++ b/src/plugins/debugger/gdb/gdboptionspage.cpp @@ -145,7 +145,7 @@ GdbOptionsPageWidget::GdbOptionsPageWidget(QWidget *parent) checkBoxUseDynamicType->setText(GdbOptionsPage::tr( "Use dynamic object type for display")); checkBoxUseDynamicType->setToolTip(GdbOptionsPage::tr( - "Specifies whether the dynamic or the static type of objects will be" + "Specifies whether the dynamic or the static type of objects will be " "displayed. Choosing the dynamic type might be slower.")); checkBoxLoadGdbInit = new QCheckBox(groupBoxGeneral); @@ -190,7 +190,7 @@ GdbOptionsPageWidget::GdbOptionsPageWidget(QWidget *parent) checkBoxBreakOnFatal->setText(GdbOptionsPage::tr("Stop when qFatal() is called")); checkBoxBreakOnFatal->setToolTip(GdbOptionsPage::tr( "Always add a breakpoint on the qFatal() function." - "/body>")); + "")); checkBoxBreakOnAbort = new QCheckBox(groupBoxGeneral); checkBoxBreakOnAbort->setText(GdbOptionsPage::tr("Stop when abort() is called")); diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 9fb7e8167d4..a1a9af9ea9e 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -741,7 +741,7 @@ void QmlEngine::executeNextI() void QmlEngine::executeRunToLine(const ContextData &data) { QTC_ASSERT(state() == InferiorStopOk, qDebug() << state()); - showStatusMessage(tr("Run to line %1 (%2) requested...").arg(data.lineNumber).arg(data.fileName), 5000); + showStatusMessage(tr("Run to line %1 (%2) requested...").arg(data.lineNumber).arg(data.fileName), 5000); resetLocation(); ContextData modifiedData = data; quint32 line = data.lineNumber; diff --git a/src/plugins/debugger/stackframe.cpp b/src/plugins/debugger/stackframe.cpp index 2a9441bde0e..f1fa8d61b9d 100644 --- a/src/plugins/debugger/stackframe.cpp +++ b/src/plugins/debugger/stackframe.cpp @@ -116,7 +116,7 @@ QString StackFrame::toToolTip() const } else { str << tr("Binary debug information is accessible for this " "frame. However, matching sources have not been found. " - "Note that some distributions ship debug sources in " + "Note that some distributions ship debug sources " "in separate packages."); } diff --git a/src/plugins/help/filtersettingspage.ui b/src/plugins/help/filtersettingspage.ui index af7fd81c8f9..86a118b6ca6 100644 --- a/src/plugins/help/filtersettingspage.ui +++ b/src/plugins/help/filtersettingspage.ui @@ -13,7 +13,7 @@ <html><body> <p> -Add, modify, and remove document filters, which determine the documentation set displayed in the Help mode. The attributes are defined in the documents. Select them to display a set of relevant documentation. Note that some attributes are defined in several documents. +Add, modify, and remove document filters, which determine the documentation set displayed in the Help mode. The attributes are defined in the documents. Select them to display a set of relevant documentation. Note that some attributes are defined in several documents. </p></body></html> diff --git a/src/plugins/madde/maemodeviceconfigwizard.cpp b/src/plugins/madde/maemodeviceconfigwizard.cpp index 85aac311509..493eaca1a15 100644 --- a/src/plugins/madde/maemodeviceconfigwizard.cpp +++ b/src/plugins/madde/maemodeviceconfigwizard.cpp @@ -339,7 +339,7 @@ private: m_ui->keyDirPathChooser->setEnabled(false); m_ui->createKeysButton->setEnabled(false); - m_ui->statusLabel->setText(tr("Creating keys... ")); + m_ui->statusLabel->setText(tr("Creating keys...")); SshKeyGenerator keyGenerator; if (!keyGenerator.generateKeys(SshKeyGenerator::Rsa, SshKeyGenerator::Mixed, 1024)) { @@ -447,7 +447,7 @@ private: sshParams.password = password(); sshParams.timeout = 10; sshParams.userName = defaultUser(); - m_ui->statusLabel->setText(tr("Deploying... ")); + m_ui->statusLabel->setText(tr("Deploying...")); m_keyDeployer->deployPublicKey(sshParams, m_wizardData.publicKeyFilePath); } diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 0843297cd43..21342fde50a 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -692,7 +692,7 @@ void QmlProfilerTool::profilerStateChanged() break; } case QmlProfilerStateManager::AppKilled : { - showNonmodalWarning(tr("Application finished before loading profiled data.\n Please use the stop button instead.")); + showNonmodalWarning(tr("Application finished before loading profiled data.\nPlease use the stop button instead.")); break; } case QmlProfilerStateManager::Idle : From fe87e222fb01fa90333184fa143028d8340ec79a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 24 Aug 2012 16:17:03 +0200 Subject: [PATCH 25/37] unbreak infinite recursion check for fromfile() & co. i broke this by switching to using a separate evaluator. the new evaluator has an empty file stack, so the check would be pointless. fix it by recoding and traversing the call chain. Change-Id: Icb1f19adc6e66a865cd5be78eeb1c10072b4f8fc Reviewed-by: Daniel Teske --- src/shared/proparser/qmakeevaluator.cpp | 15 ++++++++++----- src/shared/proparser/qmakeevaluator.h | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/shared/proparser/qmakeevaluator.cpp b/src/shared/proparser/qmakeevaluator.cpp index 28ea220197b..d92f5ea1c79 100644 --- a/src/shared/proparser/qmakeevaluator.cpp +++ b/src/shared/proparser/qmakeevaluator.cpp @@ -170,6 +170,7 @@ QMakeEvaluator::QMakeEvaluator(QMakeGlobals *option, initStatics(); // Configuration, more or less + m_caller = 0; #ifdef PROEVALUATOR_CUMULATIVE m_cumulative = false; #endif @@ -1626,11 +1627,14 @@ bool QMakeEvaluator::evaluateFile( { if (fileName.isEmpty()) return false; - foreach (const ProFile *pf, m_profileStack) - if (pf->fileName() == fileName) { - evalError(fL1S("Circular inclusion of %1.").arg(fileName)); - return false; - } + QMakeEvaluator *ref = this; + do { + foreach (const ProFile *pf, ref->m_profileStack) + if (pf->fileName() == fileName) { + evalError(fL1S("Circular inclusion of %1.").arg(fileName)); + return false; + } + } while ((ref = ref->m_caller)); return evaluateFileDirect(fileName, type, flags); } @@ -1695,6 +1699,7 @@ bool QMakeEvaluator::evaluateFileInto(const QString &fileName, QMakeHandler::Eva ProValueMap *values, LoadFlags flags) { QMakeEvaluator visitor(m_option, m_parser, m_handler); + visitor.m_caller = this; visitor.m_outputDir = m_outputDir; if (!visitor.evaluateFile(fileName, type, flags)) return false; diff --git a/src/shared/proparser/qmakeevaluator.h b/src/shared/proparser/qmakeevaluator.h index 294e66aad9e..d62e2765fdd 100644 --- a/src/shared/proparser/qmakeevaluator.h +++ b/src/shared/proparser/qmakeevaluator.h @@ -195,6 +195,7 @@ public: static void removeEach(ProStringList *varlist, const ProStringList &value); + QMakeEvaluator *m_caller; int m_loopLevel; // To report unexpected break() and next()s #ifdef PROEVALUATOR_CUMULATIVE bool m_cumulative; From 2debcc288171b529d873c2fdfd8315fd4492c3a5 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 24 Aug 2012 17:08:59 +0200 Subject: [PATCH 26/37] make code run from $$fromfile() & infile() find features there is actually a qmake test for that. don't copy anything which is related to loading a qmakespec to the new evaluator, though - either it will actually load a spec (include(,into)) anyway, or it has a clean slate ($$fromfile() and infile()) and anything spec-related would be pointless. Change-Id: I291201a2bf823e863b3ec94be91762954612417d Reviewed-by: Daniel Teske --- src/shared/proparser/qmakeevaluator.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/shared/proparser/qmakeevaluator.cpp b/src/shared/proparser/qmakeevaluator.cpp index d92f5ea1c79..1872965436c 100644 --- a/src/shared/proparser/qmakeevaluator.cpp +++ b/src/shared/proparser/qmakeevaluator.cpp @@ -1701,6 +1701,7 @@ bool QMakeEvaluator::evaluateFileInto(const QString &fileName, QMakeHandler::Eva QMakeEvaluator visitor(m_option, m_parser, m_handler); visitor.m_caller = this; visitor.m_outputDir = m_outputDir; + visitor.m_featureRoots = m_featureRoots; if (!visitor.evaluateFile(fileName, type, flags)) return false; *values = visitor.m_valuemapStack.top(); From 662e6f111932a5715a4f575dbbab190a930e3776 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 24 Aug 2012 18:25:46 +0200 Subject: [PATCH 27/37] resolve relative paths in $QMAKEPATH & $QMAKEFEATURES we use the actual current directory as the base dir, as that's closest to what qmake would do so far. it's completely arbitrary what will happen when shadow-building or specifying an output directory, and in creator context it's pretty much meaningless. Change-Id: I8c490c86fa2606fcee5d176c90c5a84a4783e87b Reviewed-by: Daniel Teske --- src/shared/proparser/qmakeglobals.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/proparser/qmakeglobals.cpp b/src/shared/proparser/qmakeglobals.cpp index 4face864558..ea2dde36890 100644 --- a/src/shared/proparser/qmakeglobals.cpp +++ b/src/shared/proparser/qmakeglobals.cpp @@ -182,10 +182,11 @@ QStringList QMakeGlobals::getPathListEnv(const QString &var) const QStringList ret; QString val = getEnv(var); if (!val.isEmpty()) { + QDir bdir; QStringList vals = val.split(dirlist_sep); ret.reserve(vals.length()); foreach (const QString &it, vals) - ret << QDir::cleanPath(it); + ret << QDir::cleanPath(bdir.absoluteFilePath(it)); } return ret; } From e3821380524f1fa75a6e38a3d1dad728ff3b48e8 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 24 Aug 2012 14:49:13 +0200 Subject: [PATCH 28/37] fix ProString::mid() without second parameter we need to interpret the -1 as unsigned for it to mean "unlimited". Change-Id: I130b809749fa1679a5b2444286baf48cc095c7bf Reviewed-by: Daniel Teske --- src/shared/proparser/proitems.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/proparser/proitems.cpp b/src/shared/proparser/proitems.cpp index e51e724eee5..962268ca7da 100644 --- a/src/shared/proparser/proitems.cpp +++ b/src/shared/proparser/proitems.cpp @@ -299,7 +299,7 @@ ProString ProString::mid(int off, int len) const off = m_length; ret.m_offset += off; ret.m_length -= off; - if (ret.m_length > len) + if ((uint)ret.m_length > (uint)len) // Unsigned comparison to interpret < 0 as infinite ret.m_length = len; return ret; } From 43aa104e948c45bb8d6aa61100d7a3cb4635e197 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 22 Aug 2012 20:12:50 +0200 Subject: [PATCH 29/37] fix non-global s/// QString::replace(QRegExp) pretty much always detaches, so the equality check was bogus. Change-Id: Iee9043c1ee3083edaf289886ac11b3e3a501d623 Reviewed-by: Daniel Teske --- src/shared/proparser/qmakeevaluator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/proparser/qmakeevaluator.cpp b/src/shared/proparser/qmakeevaluator.cpp index 1872965436c..801a2278353 100644 --- a/src/shared/proparser/qmakeevaluator.cpp +++ b/src/shared/proparser/qmakeevaluator.cpp @@ -329,7 +329,7 @@ static void replaceInList(ProStringList *varlist, QString val = varit->toQString(tmp); QString copy = val; // Force detach and have a reference value val.replace(regexp, replace); - if (!val.isSharedWith(copy)) { + if (!val.isSharedWith(copy) && val != copy) { if (val.isEmpty()) { varit = varlist->erase(varit); } else { From 12e94729349be5a7d6bd03aedcfb35a366d9a88d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 24 Aug 2012 21:23:02 +0200 Subject: [PATCH 30/37] unbreak $$system() in bootstrapped mode Change-Id: I43eb4a7a94b6df3d964b7bfd1747f953f436ba10 Reviewed-by: Daniel Teske --- src/shared/proparser/qmakebuiltins.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/proparser/qmakebuiltins.cpp b/src/shared/proparser/qmakebuiltins.cpp index 5d9f25606d0..0192f2b6967 100644 --- a/src/shared/proparser/qmakebuiltins.cpp +++ b/src/shared/proparser/qmakebuiltins.cpp @@ -352,7 +352,7 @@ QByteArray QMakeEvaluator::getCommandOutput(const QString &args) const QByteArray out; if (FILE *proc = QT_POPEN(QString(QLatin1String("cd ") + IoUtils::shellQuote(currentDirectory()) - + QLatin1String(" && ") + args[0]).toLocal8Bit().constData(), "r")) { + + QLatin1String(" && ") + args).toLocal8Bit().constData(), "r")) { while (!feof(proc)) { char buff[10 * 1024]; int read_in = int(fread(buff, 1, sizeof(buff), proc)); From fddd20ffad95b8cc92fb3eeb010953be22ab6120 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 24 Aug 2012 21:52:24 +0200 Subject: [PATCH 31/37] fix return() sanity check the value map stack always has at least one map on it. Change-Id: I836de07a14754b995403065443d3758bfc6a8683 Reviewed-by: Daniel Teske Reviewed-by: Oswald Buddenhagen --- src/shared/proparser/qmakebuiltins.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/proparser/qmakebuiltins.cpp b/src/shared/proparser/qmakebuiltins.cpp index 0192f2b6967..4e41e3f4833 100644 --- a/src/shared/proparser/qmakebuiltins.cpp +++ b/src/shared/proparser/qmakebuiltins.cpp @@ -1091,7 +1091,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConditionalFunction( // they cannot be used to terminate loops anyway. if (m_cumulative) return ReturnTrue; - if (m_valuemapStack.isEmpty()) { + if (m_valuemapStack.size() == 1) { evalError(fL1S("unexpected return().")); return ReturnFalse; } From d97de7e43f6432a0c4a611c7268d06cd3741593d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 21 Aug 2012 19:23:53 +0200 Subject: [PATCH 32/37] make ProString c'tors explicit only when not building qmake otherwise it's impossible to migrate the qmake generators to this. Change-Id: I70c848da2ce428706b960c3c1434c26f7e3a9447 Reviewed-by: Daniel Teske --- src/shared/proparser/proitems.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/shared/proparser/proitems.h b/src/shared/proparser/proitems.h index 3b52de6c4de..52cd76a371b 100644 --- a/src/shared/proparser/proitems.h +++ b/src/shared/proparser/proitems.h @@ -52,6 +52,12 @@ private: }; #endif +#ifndef QT_BUILD_QMAKE +# define PROITEM_EXPLICIT explicit +#else +# define PROITEM_EXPLICIT +#endif + class ProKey; class ProStringList; class ProFile; @@ -60,8 +66,8 @@ class ProString { public: ProString(); ProString(const ProString &other); - explicit ProString(const QString &str); - explicit ProString(const char *str); + PROITEM_EXPLICIT ProString(const QString &str); + PROITEM_EXPLICIT ProString(const char *str); ProString(const QString &str, int offset, int length); void setValue(const QString &str); ProString &setSource(const ProString &other) { m_file = other.m_file; return *this; } @@ -122,7 +128,7 @@ class ProKey : public ProString { public: ALWAYS_INLINE ProKey() : ProString() {} explicit ProKey(const QString &str); - explicit ProKey(const char *str); + PROITEM_EXPLICIT ProKey(const char *str); ProKey(const QString &str, int off, int len); ProKey(const QString &str, int off, int len, uint hash); void setValue(const QString &str); From 85dc06662e77a7e1a61300888ecf2af5ff29e4c3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 22 Aug 2012 11:44:20 +0200 Subject: [PATCH 33/37] simplify ProString::operator==() implementations we can trivially construct a QStringRef from a ProString, so take advantage of that. Change-Id: I9aaa1f6d910590872b250a145f16e90984beeb94 Reviewed-by: Daniel Teske --- src/shared/proparser/proitems.cpp | 33 ------------------------------- src/shared/proparser/proitems.h | 8 +++++--- 2 files changed, 5 insertions(+), 36 deletions(-) diff --git a/src/shared/proparser/proitems.cpp b/src/shared/proparser/proitems.cpp index 962268ca7da..1b16ded4d58 100644 --- a/src/shared/proparser/proitems.cpp +++ b/src/shared/proparser/proitems.cpp @@ -155,39 +155,6 @@ QString &ProString::toQString(QString &tmp) const return tmp.setRawData(m_string.constData() + m_offset, m_length); } -bool ProString::operator==(const ProString &other) const -{ - if (m_length != other.m_length) - return false; - return !memcmp(m_string.constData() + m_offset, - other.m_string.constData() + other.m_offset, m_length * 2); -} - -bool ProString::operator==(const QString &other) const -{ - if (m_length != other.length()) - return false; - return !memcmp(m_string.constData() + m_offset, other.constData(), m_length * 2); -} - -bool ProString::operator==(const QLatin1String &other) const -{ - const ushort *uc = (ushort *)m_string.constData() + m_offset; - const ushort *e = uc + m_length; - const uchar *c = (uchar *)other.latin1(); - - if (!c) - return isEmpty(); - - while (*c) { - if (uc == e || *uc != *c) - return false; - ++uc; - ++c; - } - return (uc == e); -} - QChar *ProString::prepareAppend(int extraLen) { if (m_string.isDetached() && m_length + extraLen <= m_string.capacity()) { diff --git a/src/shared/proparser/proitems.h b/src/shared/proparser/proitems.h index 52cd76a371b..fd48bb4eb00 100644 --- a/src/shared/proparser/proitems.h +++ b/src/shared/proparser/proitems.h @@ -78,9 +78,9 @@ public: ProString &operator+=(const ProString &other); ProString &append(const ProString &other, bool *pending = 0); ProString &append(const ProStringList &other, bool *pending = 0, bool skipEmpty1st = false); - bool operator==(const ProString &other) const; - bool operator==(const QString &other) const; - bool operator==(const QLatin1String &other) const; + bool operator==(const ProString &other) const { return toQStringRef() == other.toQStringRef(); } + bool operator==(const QString &other) const { return toQStringRef() == other; } + bool operator==(const QLatin1String &other) const { return toQStringRef() == other; } bool operator!=(const ProString &other) const { return !(*this == other); } bool operator!=(const QString &other) const { return !(*this == other); } bool operator!=(const QLatin1String &other) const { return !(*this == other); } @@ -96,6 +96,8 @@ public: static uint hash(const QChar *p, int n); + ALWAYS_INLINE QStringRef toQStringRef() const { return QStringRef(&m_string, m_offset, m_length); } + ALWAYS_INLINE ProKey &toKey() { return *(ProKey *)this; } ALWAYS_INLINE const ProKey &toKey() const { return *(const ProKey *)this; } From 1f2189d5a048b4dc8b4f900c227ed1e2bcf0a4f0 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 27 Aug 2012 22:12:15 +0200 Subject: [PATCH 34/37] don't pass QLatin1String by ref it's pointless Change-Id: Ia02762a1f79399970cbdf43b3b20e08b4e54fd3b Reviewed-by: Daniel Teske --- src/shared/proparser/proitems.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/proparser/proitems.h b/src/shared/proparser/proitems.h index fd48bb4eb00..7aa893a0a83 100644 --- a/src/shared/proparser/proitems.h +++ b/src/shared/proparser/proitems.h @@ -80,10 +80,10 @@ public: ProString &append(const ProStringList &other, bool *pending = 0, bool skipEmpty1st = false); bool operator==(const ProString &other) const { return toQStringRef() == other.toQStringRef(); } bool operator==(const QString &other) const { return toQStringRef() == other; } - bool operator==(const QLatin1String &other) const { return toQStringRef() == other; } + bool operator==(QLatin1String other) const { return toQStringRef() == other; } bool operator!=(const ProString &other) const { return !(*this == other); } bool operator!=(const QString &other) const { return !(*this == other); } - bool operator!=(const QLatin1String &other) const { return !(*this == other); } + bool operator!=(QLatin1String other) const { return !(*this == other); } bool isNull() const { return m_string.isNull(); } bool isEmpty() const { return !m_length; } int size() const { return m_length; } From 2db6609556a7f080669070f4497e1a85904bf739 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 21 Aug 2012 19:57:09 +0200 Subject: [PATCH 35/37] beef up Pro* APIs so they match the Q* counterparts more closely: ProString: startsWith(), endsWith(), indexOf(), lastIndexOf(), contains(), at(), length(), QTextStream::operator<<(), toLatin1(), toInt() & toShort() ProStringList: length(), removeAt(), contains() Change-Id: Iab78236f7152f6a4b93709abbf59b9027c44ba2c Reviewed-by: Daniel Teske --- src/shared/proparser/proitems.cpp | 44 +++++++++++++++++ src/shared/proparser/proitems.h | 81 +++++++++++++++++++++++++++++-- 2 files changed, 120 insertions(+), 5 deletions(-) diff --git a/src/shared/proparser/proitems.cpp b/src/shared/proparser/proitems.cpp index 1b16ded4d58..5dd7898cd0f 100644 --- a/src/shared/proparser/proitems.cpp +++ b/src/shared/proparser/proitems.cpp @@ -33,6 +33,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -289,6 +290,12 @@ ProString ProString::trimmed() const return ret; } +QTextStream &operator<<(QTextStream &t, const ProString &str) +{ + t << str.toQString(); // XXX optimize ... somehow + return t; +} + QString ProStringList::join(const QString &sep) const { int totalLength = 0; @@ -313,6 +320,20 @@ QString ProStringList::join(const QString &sep) const return res; } +void ProStringList::removeAll(const ProString &str) +{ + for (int i = size(); --i >= 0; ) + if (at(i) == str) + remove(i); +} + +void ProStringList::removeAll(const char *str) +{ + for (int i = size(); --i >= 0; ) + if (at(i) == str) + remove(i); +} + void ProStringList::removeDuplicates() { int n = size(); @@ -332,6 +353,13 @@ void ProStringList::removeDuplicates() erase(begin() + j, end()); } +ProStringList::ProStringList(const QStringList &list) +{ + reserve(list.size()); + foreach (const QString &str, list) + *this << ProString(str); +} + QStringList ProStringList::toQStringList() const { QStringList ret; @@ -341,6 +369,22 @@ QStringList ProStringList::toQStringList() const return ret; } +bool ProStringList::contains(const ProString &str, Qt::CaseSensitivity cs) const +{ + for (int i = 0; i < size(); i++) + if (!at(i).compare(str, cs)) + return true; + return false; +} + +bool ProStringList::contains(const char *str, Qt::CaseSensitivity cs) const +{ + for (int i = 0; i < size(); i++) + if (!at(i).compare(str, cs)) + return true; + return false; +} + ProFile::ProFile(const QString &fileName) : m_refCount(1), m_fileName(fileName), diff --git a/src/shared/proparser/proitems.h b/src/shared/proparser/proitems.h index 7aa893a0a83..3a4b69b5b6e 100644 --- a/src/shared/proparser/proitems.h +++ b/src/shared/proparser/proitems.h @@ -32,12 +32,15 @@ #define PROITEMS_H #include "qmake_global.h" + #include #include #include QT_BEGIN_NAMESPACE +class QTextStream; + #ifdef PROPARSER_THREAD_SAFE typedef QAtomicInt ProItemRefCount; #else @@ -70,29 +73,58 @@ public: PROITEM_EXPLICIT ProString(const char *str); ProString(const QString &str, int offset, int length); void setValue(const QString &str); + void clear() { m_string.clear(); m_length = 0; } ProString &setSource(const ProString &other) { m_file = other.m_file; return *this; } ProString &setSource(const ProFile *pro) { m_file = pro; return *this; } const ProFile *sourceFile() const { return m_file; } - QString toQString() const; - QString &toQString(QString &tmp) const; + ProString &operator+=(const ProString &other); ProString &append(const ProString &other, bool *pending = 0); ProString &append(const ProStringList &other, bool *pending = 0, bool skipEmpty1st = false); + + void chop(int n) { Q_ASSERT(n <= m_length); m_length -= n; } + void chopFront(int n) { Q_ASSERT(n <= m_length); m_offset += n; m_length -= n; } + bool operator==(const ProString &other) const { return toQStringRef() == other.toQStringRef(); } bool operator==(const QString &other) const { return toQStringRef() == other; } bool operator==(QLatin1String other) const { return toQStringRef() == other; } + bool operator==(const char *other) const { return toQStringRef() == QLatin1String(other); } bool operator!=(const ProString &other) const { return !(*this == other); } bool operator!=(const QString &other) const { return !(*this == other); } bool operator!=(QLatin1String other) const { return !(*this == other); } + bool operator!=(const char *other) const { return !(*this == other); } bool isNull() const { return m_string.isNull(); } bool isEmpty() const { return !m_length; } + int length() const { return m_length; } int size() const { return m_length; } + QChar at(int i) const { Q_ASSERT((uint)i < (uint)m_length); return constData()[i]; } const QChar *constData() const { return m_string.constData() + m_offset; } ProString mid(int off, int len = -1) const; ProString left(int len) const { return mid(0, len); } ProString right(int len) const { return mid(qMax(0, size() - len)); } ProString trimmed() const; - void clear() { m_string.clear(); m_length = 0; } + int compare(const ProString &sub, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringRef().compare(sub.toQStringRef(), cs); } + int compare(const QString &sub, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringRef().compare(sub, cs); } + int compare(const char *sub, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringRef().compare(QLatin1String(sub), cs); } + bool startsWith(const ProString &sub) const { return toQStringRef().startsWith(sub.toQStringRef()); } + bool startsWith(const QString &sub) const { return toQStringRef().startsWith(sub); } + bool startsWith(const char *sub) const { return toQStringRef().startsWith(QLatin1String(sub)); } + bool startsWith(QChar c) const { return toQStringRef().startsWith(c); } + bool endsWith(const ProString &sub) const { return toQStringRef().endsWith(sub.toQStringRef()); } + bool endsWith(const QString &sub) const { return toQStringRef().endsWith(sub); } + bool endsWith(const char *sub) const { return toQStringRef().endsWith(QLatin1String(sub)); } + bool endsWith(QChar c) const { return toQStringRef().endsWith(c); } + int indexOf(const QString &s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringRef().indexOf(s, from, cs); } + int indexOf(const char *s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringRef().indexOf(QLatin1String(s), from, cs); } + int indexOf(QChar c, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringRef().indexOf(c, from, cs); } + int lastIndexOf(const QString &s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringRef().lastIndexOf(s, from, cs); } + int lastIndexOf(const char *s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringRef().lastIndexOf(QLatin1String(s), from, cs); } + int lastIndexOf(QChar c, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return toQStringRef().lastIndexOf(c, from, cs); } + bool contains(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(s, 0, cs) >= 0; } + bool contains(const char *s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(QLatin1String(s), 0, cs) >= 0; } + bool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(c, 0, cs) >= 0; } + int toInt(bool *ok = 0) const { return toQString().toInt(ok); } // XXX optimize + short toShort(bool *ok = 0) const { return toQString().toShort(ok); } // XXX optimize static uint hash(const QChar *p, int n); @@ -101,6 +133,11 @@ public: ALWAYS_INLINE ProKey &toKey() { return *(ProKey *)this; } ALWAYS_INLINE const ProKey &toKey() const { return *(const ProKey *)this; } + QString toQString() const; + QString &toQString(QString &tmp) const; + + QByteArray toLatin1() const { return toQStringRef().toLatin1(); } + private: ProString(const ProKey &other); ProString &operator=(const ProKey &other); @@ -160,15 +197,49 @@ inline QString operator+(const ProString &one, const QString &two) inline QString operator+(const QString &one, const ProString &two) { return ProString(one) + two; } +inline QString operator+(const ProString &one, const char *two) + { return one + ProString(two); } // XXX optimize +inline QString operator+(const char *one, const ProString &two) + { return ProString(one) + two; } // XXX optimize + +inline QString &operator+=(QString &that, const ProString &other) + { return that += other.toQStringRef(); } + +inline bool operator==(const QString &that, const ProString &other) + { return other == that; } +inline bool operator!=(const QString &that, const ProString &other) + { return !(other == that); } + +QTextStream &operator<<(QTextStream &t, const ProString &str); + class ProStringList : public QVector { public: ProStringList() {} ProStringList(const ProString &str) { *this << str; } - QString join(const QString &sep) const; - void removeDuplicates(); + explicit ProStringList(const QStringList &list); QStringList toQStringList() const; + + ProStringList &operator<<(const ProString &str) + { QVector::operator<<(str); return *this; } + + int length() const { return size(); } + + QString join(const QString &sep) const; + + void removeAll(const ProString &str); + void removeAll(const char *str); + void removeAt(int idx) { remove(idx); } + void removeDuplicates(); + + bool contains(const ProString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; + bool contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const + { return contains(ProString(str), cs); } + bool contains(const char *str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; }; +inline ProStringList operator+(const ProStringList &one, const ProStringList &two) + { ProStringList ret = one; ret += two; return ret; } + typedef QHash ProValueMap; // These token definitions affect both ProFileEvaluator and ProWriter From c5e87aa0c1b9e623b9c4e625baeffc9ea9bccfe1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 21 Aug 2012 17:28:52 +0200 Subject: [PATCH 36/37] make $$shell_{path,quote}() use correct path separator follow suit with qmake ... Change-Id: I0221f6c81bc770c37f501d79c31860549c0c0076 Reviewed-by: Daniel Teske --- src/shared/proparser/qmakebuiltins.cpp | 4 ++-- src/shared/proparser/qmakeevaluator.cpp | 3 +++ src/shared/proparser/qmakeevaluator.h | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/shared/proparser/qmakebuiltins.cpp b/src/shared/proparser/qmakebuiltins.cpp index 4e41e3f4833..38ebcdc4c77 100644 --- a/src/shared/proparser/qmakebuiltins.cpp +++ b/src/shared/proparser/qmakebuiltins.cpp @@ -1009,7 +1009,7 @@ ProStringList QMakeEvaluator::evaluateExpandFunction( evalError(fL1S("shell_path(path) requires one argument.")); } else { QString rstr = args.at(0).toQString(m_tmp1); - if (m_option->dir_sep.at(0) != QLatin1Char('/')) + if (m_dirSep.startsWith(QLatin1Char('\\'))) rstr.replace(QLatin1Char('/'), QLatin1Char('\\')); else rstr.replace(QLatin1Char('\\'), QLatin1Char('/')); @@ -1029,7 +1029,7 @@ ProStringList QMakeEvaluator::evaluateExpandFunction( evalError(fL1S("shell_quote(arg) requires one argument.")); } else { QString rstr = args.at(0).toQString(m_tmp1); - if (m_option->dir_sep.at(0) != QLatin1Char('/')) + if (m_dirSep.startsWith(QLatin1Char('\\'))) rstr = IoUtils::shellQuoteWin(rstr); else rstr = IoUtils::shellQuoteUnix(rstr); diff --git a/src/shared/proparser/qmakeevaluator.cpp b/src/shared/proparser/qmakeevaluator.cpp index 801a2278353..b017dcdcadb 100644 --- a/src/shared/proparser/qmakeevaluator.cpp +++ b/src/shared/proparser/qmakeevaluator.cpp @@ -201,6 +201,7 @@ void QMakeEvaluator::initFrom(const QMakeEvaluator &other) m_qmakespecName = other.m_qmakespecName; m_mkspecPaths = other.m_mkspecPaths; m_featureRoots = other.m_featureRoots; + m_dirSep = other.m_dirSep; } //////// Evaluator tools ///////// @@ -1105,6 +1106,8 @@ bool QMakeEvaluator::loadSpec() if (!evaluateFeatureFile(QLatin1String("spec_post.prf"))) return false; updateFeaturePaths(); // The spec extends the feature search path, so rebuild the cache. + // The MinGW and x-build specs may change the separator; $$shell_{path,quote}() need it + m_dirSep = first(ProKey("QMAKE_DIR_SEP")); if (!m_conffile.isEmpty() && !evaluateFileDirect(m_conffile, QMakeHandler::EvalConfigFile, LoadProOnly)) { return false; diff --git a/src/shared/proparser/qmakeevaluator.h b/src/shared/proparser/qmakeevaluator.h index d62e2765fdd..970a18b0115 100644 --- a/src/shared/proparser/qmakeevaluator.h +++ b/src/shared/proparser/qmakeevaluator.h @@ -233,6 +233,7 @@ public: QStringList m_qmakefeatures; QStringList m_mkspecPaths; QStringList m_featureRoots; + ProString m_dirSep; ProFunctionDefs m_functionDefs; ProStringList m_returnValue; QStack m_valuemapStack; // VariableName must be us-ascii, the content however can be non-us-ascii. From f35f55091d985b1285af8530267de3bd3bcc1073 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 15 Aug 2012 16:42:21 +0200 Subject: [PATCH 37/37] complain about missing input file the parser explicitly excludes complaints about missing files (because they are pretty common in cumulative mode), so we need to do it ourselves. Change-Id: I3c36819ab7b26152271e4557b67fb36b0a595b60 Reviewed-by: Daniel Teske --- tests/manual/proparser/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/manual/proparser/main.cpp b/tests/manual/proparser/main.cpp index fe993ee978e..94f1f4069fe 100644 --- a/tests/manual/proparser/main.cpp +++ b/tests/manual/proparser/main.cpp @@ -82,8 +82,13 @@ static int evaluate(const QString &fileName, const QString &in_pwd, const QStrin visitor.setOutputDir(out_pwd); ProFile *pro; - if (!(pro = parser->parsedProFile(fileName))) + if (!(pro = parser->parsedProFile(fileName))) { + if (!QFile::exists(fileName)) { + qCritical("Input file %s does not exist.", qPrintable(fileName)); + return 3; + } return 2; + } if (!visitor.accept(pro)) { pro->deref(); return 2;