From a48ee6f7a8cb8d1d2c49724e9cf2f86957f9c3ce Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 5 Dec 2008 10:39:08 +0100 Subject: [PATCH 01/77] Fixes: Allow directories to be entered into the class wizard file names Task: 237390 Details: Add 'allowDirectories' property to the widgets involved. --- src/libs/utils/filenamevalidatinglineedit.cpp | 86 ++++++++++++++----- src/libs/utils/filenamevalidatinglineedit.h | 13 ++- src/libs/utils/filewizardpage.cpp | 2 +- src/libs/utils/newclasswidget.cpp | 15 ++++ src/libs/utils/newclasswidget.h | 4 +- .../utils/projectnamevalidatinglineedit.cpp | 2 +- src/plugins/cppeditor/cppclasswizard.cpp | 1 + .../designer/cpp/formclasswizardpage.cpp | 1 + 8 files changed, 96 insertions(+), 28 deletions(-) diff --git a/src/libs/utils/filenamevalidatinglineedit.cpp b/src/libs/utils/filenamevalidatinglineedit.cpp index 57a0ed7a5f9..5b308f5ce47 100644 --- a/src/libs/utils/filenamevalidatinglineedit.cpp +++ b/src/libs/utils/filenamevalidatinglineedit.cpp @@ -33,26 +33,65 @@ #include "filenamevalidatinglineedit.h" +#include +#include + namespace Core { namespace Utils { -FileNameValidatingLineEdit::FileNameValidatingLineEdit(QWidget *parent) : - BaseValidatingLineEdit(parent) -{ - -} - -/* Validate a file base name, check for forbidden characters/strings. */ - -static const char *notAllowedChars = "/?:&\\*\"|#%<> "; -static const char *notAllowedSubStrings[] = {".."}; - // Naming a file like a device name will break on Windows, even if it is // "com1.txt". Since we are cross-platform, we generally disallow such file // names. -static const char *notAllowedStrings[] = {"CON", "AUX", "PRN", "COM1", "COM2", "LPT1", "LPT2" }; +static const QRegExp &windowsDeviceNoSubDirPattern() +{ + static const QRegExp rc(QLatin1String("CON|AUX|PRN|COM1|COM2|LPT1|LPT2|NUL"), + Qt::CaseInsensitive); + Q_ASSERT(rc.isValid()); + return rc; +} -bool FileNameValidatingLineEdit::validateFileName(const QString &name, QString *errorMessage /* = 0*/) +static const QRegExp &windowsDeviceSubDirPattern() +{ + static const QRegExp rc(QLatin1String(".*[/\\\\]CON|.*[/\\\\]AUX|.*[/\\\\]PRN|.*[/\\\\]COM1|.*[/\\\\]COM2|.*[/\\\\]LPT1|.*[/\\\\]LPT2|.*[/\\\\]NUL"), + Qt::CaseInsensitive); + Q_ASSERT(rc.isValid()); + return rc; +} + +// ----------- FileNameValidatingLineEdit +FileNameValidatingLineEdit::FileNameValidatingLineEdit(QWidget *parent) : + BaseValidatingLineEdit(parent), + m_allowDirectories(false), + m_unused(0) +{ +} + +bool FileNameValidatingLineEdit::allowDirectories() const +{ + return m_allowDirectories; +} + +void FileNameValidatingLineEdit::setAllowDirectories(bool v) +{ + m_allowDirectories = v; +} + +/* Validate a file base name, check for forbidden characters/strings. */ + +#ifdef Q_OS_WIN +# define SLASHES "/\\" +#else +# define SLASHES "/" +#endif + +static const char *notAllowedCharsSubDir = "?:&*\"|#%<> "; +static const char *notAllowedCharsNoSubDir = "?:&*\"|#%<> "SLASHES; + +static const char *notAllowedSubStrings[] = {".."}; + +bool FileNameValidatingLineEdit::validateFileName(const QString &name, + bool allowDirectories, + QString *errorMessage /* = 0*/) { if (name.isEmpty()) { if (errorMessage) @@ -60,6 +99,7 @@ bool FileNameValidatingLineEdit::validateFileName(const QString &name, QString * return false; } // Characters + const char *notAllowedChars = allowDirectories ? notAllowedCharsSubDir : notAllowedCharsNoSubDir; for (const char *c = notAllowedChars; *c; c++) if (name.contains(QLatin1Char(*c))) { if (errorMessage) @@ -76,22 +116,22 @@ bool FileNameValidatingLineEdit::validateFileName(const QString &name, QString * return false; } } - // Strings - const int notAllowedStringCount = sizeof(notAllowedStrings)/sizeof(const char *); - for (int s = 0; s < notAllowedStringCount; s++) { - const QLatin1String notAllowedString(notAllowedStrings[s]); - if (name == notAllowedString) { - if (errorMessage) - *errorMessage = tr("The name must not be '%1'.").arg(QString(notAllowedString)); - return false; - } + // Windows devices + bool matchesWinDevice = windowsDeviceNoSubDirPattern().exactMatch(name); + if (!matchesWinDevice && allowDirectories) + matchesWinDevice = windowsDeviceSubDirPattern().exactMatch(name); + if (matchesWinDevice) { + if (errorMessage) + *errorMessage = tr("The name must not match that of a MS Windows device. (%1)."). + arg(windowsDeviceNoSubDirPattern().pattern().replace(QLatin1Char('|'), QLatin1Char(','))); + return false; } return true; } bool FileNameValidatingLineEdit::validate(const QString &value, QString *errorMessage) const { - return validateFileName(value, errorMessage); + return validateFileName(value, m_allowDirectories, errorMessage); } } // namespace Utils diff --git a/src/libs/utils/filenamevalidatinglineedit.h b/src/libs/utils/filenamevalidatinglineedit.h index 5476e3cd5e9..042a48fc5f1 100644 --- a/src/libs/utils/filenamevalidatinglineedit.h +++ b/src/libs/utils/filenamevalidatinglineedit.h @@ -43,14 +43,23 @@ class QWORKBENCH_UTILS_EXPORT FileNameValidatingLineEdit : public BaseValidating { Q_OBJECT Q_DISABLE_COPY(FileNameValidatingLineEdit) - + Q_PROPERTY(bool allowDirectories READ allowDirectories WRITE setAllowDirectories) public: explicit FileNameValidatingLineEdit(QWidget *parent = 0); - static bool validateFileName(const QString &name, QString *errorMessage /* = 0*/); + static bool validateFileName(const QString &name, + bool allowDirectories = false, + QString *errorMessage = 0); + + bool allowDirectories() const; + void setAllowDirectories(bool v); protected: virtual bool validate(const QString &value, QString *errorMessage) const; + +private: + bool m_allowDirectories; + void *m_unused; }; } // namespace Utils diff --git a/src/libs/utils/filewizardpage.cpp b/src/libs/utils/filewizardpage.cpp index 8a12e4c0f3c..3e85b34d44b 100644 --- a/src/libs/utils/filewizardpage.cpp +++ b/src/libs/utils/filewizardpage.cpp @@ -123,7 +123,7 @@ void FileWizardPage::slotActivated() bool FileWizardPage::validateBaseName(const QString &name, QString *errorMessage /* = 0*/) { - return FileNameValidatingLineEdit::validateFileName(name, errorMessage); + return FileNameValidatingLineEdit::validateFileName(name, false, errorMessage); } } // namespace Utils diff --git a/src/libs/utils/newclasswidget.cpp b/src/libs/utils/newclasswidget.cpp index df7d81e7b39..b34ee40d4fe 100644 --- a/src/libs/utils/newclasswidget.cpp +++ b/src/libs/utils/newclasswidget.cpp @@ -346,6 +346,21 @@ void NewClassWidget::setFormExtension(const QString &e) m_d->m_formExtension = fixSuffix(e); } +bool NewClassWidget::allowDirectories() const +{ + return m_d->m_ui.headerFileLineEdit->allowDirectories(); +} + +void NewClassWidget::setAllowDirectories(bool v) +{ + // We keep all in sync + if (allowDirectories() != v) { + m_d->m_ui.sourceFileLineEdit->setAllowDirectories(v); + m_d->m_ui.headerFileLineEdit->setAllowDirectories(v); + m_d->m_ui.formFileLineEdit->setAllowDirectories(v); + } +} + void NewClassWidget::slotValidChanged() { const bool newValid = isValid(); diff --git a/src/libs/utils/newclasswidget.h b/src/libs/utils/newclasswidget.h index 04c2aaf58a4..40c850d28e9 100644 --- a/src/libs/utils/newclasswidget.h +++ b/src/libs/utils/newclasswidget.h @@ -73,6 +73,7 @@ class QWORKBENCH_UTILS_EXPORT NewClassWidget : public QWidget Q_PROPERTY(QString formExtension READ formExtension WRITE setFormExtension DESIGNABLE true) Q_PROPERTY(bool formInputCheckable READ formInputCheckable WRITE setFormInputCheckable DESIGNABLE true) Q_PROPERTY(bool formInputChecked READ formInputChecked WRITE setFormInputChecked DESIGNABLE true) + Q_PROPERTY(bool allowDirectories READ allowDirectories WRITE setAllowDirectories) // Utility "USER" property for wizards containing file names. Q_PROPERTY(QStringList files READ files DESIGNABLE false USER true) public: @@ -97,7 +98,7 @@ public: QString sourceExtension() const; QString headerExtension() const; QString formExtension() const; - + bool allowDirectories() const; bool isValid(QString *error = 0) const; @@ -125,6 +126,7 @@ public slots: void setSourceExtension(const QString &e); void setHeaderExtension(const QString &e); void setFormExtension(const QString &e); + void setAllowDirectories(bool v); /* Suggest a class name from the base class by stripping the leading 'Q' * character. This will happen automagically if the base class combo diff --git a/src/libs/utils/projectnamevalidatinglineedit.cpp b/src/libs/utils/projectnamevalidatinglineedit.cpp index df77af8e832..4160bc18792 100644 --- a/src/libs/utils/projectnamevalidatinglineedit.cpp +++ b/src/libs/utils/projectnamevalidatinglineedit.cpp @@ -45,7 +45,7 @@ ProjectNameValidatingLineEdit::ProjectNameValidatingLineEdit(QWidget *parent) bool ProjectNameValidatingLineEdit::validateProjectName(const QString &name, QString *errorMessage /* = 0*/) { // Validation is file name + checking for dots - if (!FileNameValidatingLineEdit::validateFileName(name, errorMessage)) + if (!FileNameValidatingLineEdit::validateFileName(name, false, errorMessage)) return false; // We don't want dots in the directory name for some legacy Windows diff --git a/src/plugins/cppeditor/cppclasswizard.cpp b/src/plugins/cppeditor/cppclasswizard.cpp index 6730f5b9ed9..652eec535f1 100644 --- a/src/plugins/cppeditor/cppclasswizard.cpp +++ b/src/plugins/cppeditor/cppclasswizard.cpp @@ -73,6 +73,7 @@ ClassNamePage::ClassNamePage(const QString &sourceSuffix, m_newClassWidget->setBaseClassEditable(true); m_newClassWidget->setFormInputVisible(false); m_newClassWidget->setNamespacesEnabled(true); + m_newClassWidget->setAllowDirectories(true); connect(m_newClassWidget, SIGNAL(validChanged()), this, SLOT(slotValidChanged())); diff --git a/src/plugins/designer/cpp/formclasswizardpage.cpp b/src/plugins/designer/cpp/formclasswizardpage.cpp index d076753374b..eac7271b404 100644 --- a/src/plugins/designer/cpp/formclasswizardpage.cpp +++ b/src/plugins/designer/cpp/formclasswizardpage.cpp @@ -63,6 +63,7 @@ FormClassWizardPage::FormClassWizardPage(QWidget * parent) : m_ui->newClassWidget->setBaseClassInputVisible(false); m_ui->newClassWidget->setNamespacesEnabled(true); + m_ui->newClassWidget->setAllowDirectories(true); connect(m_ui->newClassWidget, SIGNAL(validChanged()), this, SLOT(slotValidChanged())); From f9fbfb8f8322b8c8d7eb22100cb2c9e27b7ca871 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 5 Dec 2008 11:24:18 +0100 Subject: [PATCH 02/77] increas alert time for breakpoints to 300 --- src/plugins/debugger/gdbengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp index 80d0a046fc3..1802c018001 100644 --- a/src/plugins/debugger/gdbengine.cpp +++ b/src/plugins/debugger/gdbengine.cpp @@ -1276,7 +1276,7 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data) m_currentFrame = frame.findChild("addr").data() + '%' + frame.findChild("func").data() + '%'; - QApplication::alert(q->mainWindow(), 200); + QApplication::alert(q->mainWindow(), 3000); sendCommand("-file-list-exec-source-files", GdbQuerySources); sendCommand("-break-list", BreakList); QVariant var = QVariant::fromValue(data); From 0c3a7df7465890a4634051aa2dad83ce9eeb0c0a Mon Sep 17 00:00:00 2001 From: Kavindra Palaraja Date: Thu, 4 Dec 2008 17:27:29 +0100 Subject: [PATCH 03/77] Fixes: More documentation fixes (cherry picked from commit a02c5e61962a64ca3ebe455f9b7f1b67cb338515) --- doc/qtcreator.qdoc | 80 ++++++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 38 deletions(-) diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index a1f7ab3ed6f..4521b7e2fa4 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -814,21 +814,26 @@ a pointer to some private data structure, you will see a list of children, signals and slots. - Similarily, instead of showing a bunch of pointers and ints, - a QHash or QMap will display its contents in an orderly fashion, - a QFileInfo will expose e.g. access data, and the otherwise - "opaque" QVariant gives access to the "real" contents. + Similarly, instead of displaying many pointers and integers, Qt Creator's + debugger will display the contents of a QHash or QMap in an orderly manner. + Also, the debugger will display access data for QFileInfo and provide + access to the "real" contents of QVariant. - The \gui{Locals and Watchers View} can be used to change the - contents of variables of simple data types like int or float - while the program is stopped. To do so, click into the 'Value' - column, modify the value there, and hit \key{Return}. + The \gui{Locals and Watchers} view can be used to change the contents of + variables of simple data types such as \c int or \c float when the program + is stopped. To do so, click on the \gui Value column, modify the value + with the inplace editor, and hit \key Enter (or \key Return). - \section2 Modules - The \gui{Modules View} is hidden by default and only useful in + By default, the \gui Modules view is hidden as it is only useful with the + experimental delayed debug information loading feature. You can turn this + feature on by selecting \gui{Fast Debugger Start} + + + + The \gui Modules view is hidden by default and only useful in connection with the experimental feature of delayed debug information loading. This feature is accessible by selecting \gui{Debug} and \gui{Fast Debugger Start}. When using the @@ -849,29 +854,28 @@ commands + \section1 A Walkthrough for the Debugger Frontend - \section1 A short walk through the debugger frontend - - In our \l{Writing a Simple Program with Qt Creator}{TextFinder} - example, we read a text file into a QString and then display it with a - QTextEdit. Suppose, you would like to look at this QString, \c{line}, - and see what data it actually stores. Follow the steps described below - to place a break point and view the QString object's data. + In our \l{Writing a Simple Program with Qt Creator}{TextFinder} example, we + read a text file into a QString and then display it with a QTextEdit. + Suppose, you would like to look at this QString, \c{line}, and see what + data it actually stores. Follow the steps described below to place a + breakpoint and view the QString object's data. \table \row - \i \inlineimage qtcreator-setting-breakpoint1.png + \i \inlineimage qtcreator-setting-breakpoint1.png \i \bold{Setting a Breakpoint} First, we set a breakpoint on the line where we invoke - \l{QTextEdit::}{setPlainText()} by clicking between the line number and - the window border. Then, select \gui{Start Debugging} from the - \gui{Debug} menu or press \key{F5}. + \l{QTextEdit::}{setPlainText()} by clicking between the line number and the + window border. Then, select \gui{Start Debugging} from the \gui{Debug} menu + or press \key{F5}. \endtable Breakpoints are visible in the \gui{Breakpoints} view, shown below, in - \gui{Debug} mode. If you wish to remove a breakpoint, simply right - click on it and select \gui{Delete breakpoint} from the context menu. + \gui{Debug} mode. If you wish to remove a breakpoint, simply right-click on + it and select \gui{Delete breakpoint} from the context menu. \image qtcreator-setting-breakpoint2.png @@ -880,10 +884,10 @@ \image qtcreator-watcher.png - Suppose we modify our \c{on_findButton_clicked()} function to move back - to the start of the document and continue searching once the cursor - hits the end of the document. Adding this functionality can be done - with the code snippet below: + Suppose we modify our \c{on_findButton_clicked()} function to move back to + the start of the document and continue searching once the cursor hits the + end of the document. Adding this functionality can be done with the code + snippet below: \code void TextFinder::on_findButton_clicked() @@ -915,9 +919,9 @@ } \endcode - However, if you compile and run this code, the application will not - work correctly due to a logic error. To locate this logic error, you - can step through the code using the following buttons: + However, if you compile and run this code, the application will not work + correctly due to a logic error. To locate this logic error, you can step + through the code using the following buttons: \image qtcreator-debugging-buttons.png */ @@ -931,20 +935,20 @@ \title Tips and Tricks - \bold{Quick mode switch} + \bold{Quickly Switching between Modes} You can quickly switch between modes by pressing \key{Ctrl+1}, - \key{Ctrl+2}, etc. + \key{Ctrl+2}, and so on. - \bold{Other keyboard shortcuts} + \bold{Keyboard Shortcuts} - There are a lot of other \l{keyboard-shortcuts}{keyboard shortcuts}. + Qt Creator provides a lot of useful keyboard shortcuts. A complete list can + be found \l{Keyboard Shortcuts}{here}. - \bold{Command line} + \bold{Running Qt Creator from the Command Line} - You can start Qt Creator from a command prompt with an already - existing session or \c{.pro} file by giving the name as argument on the - command line. + You can start Qt Creator from a command prompt with an existing session or + \c{.pro} file by giving the name as argument on the command line. \bold{Sidebar} From 786e183aa67729e4d465bab77c77c394a231b85f Mon Sep 17 00:00:00 2001 From: mae Date: Fri, 5 Dec 2008 12:12:20 +0100 Subject: [PATCH 04/77] markContextMenuRequested signal in ITextEditor --- src/plugins/texteditor/basetexteditor.cpp | 9 +++------ src/plugins/texteditor/basetexteditor.h | 2 -- src/plugins/texteditor/itexteditor.h | 2 ++ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 1e6a266e6da..ea9da5cb6bd 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -488,10 +488,6 @@ ITextEditable *BaseTextEditor::editableInterface() const d->m_editable, SIGNAL(contentsChanged())); connect(this, SIGNAL(changed()), d->m_editable, SIGNAL(changed())); - connect(this, - SIGNAL(markRequested(TextEditor::ITextEditor *, int)), - d->m_editable, - SIGNAL(markRequested(TextEditor::ITextEditor *, int))); } return d->m_editable; } @@ -2434,9 +2430,10 @@ void BaseTextEditor::extraAreaMouseEvent(QMouseEvent *e) } } else if (e->button() == Qt::RightButton) { QMenu * contextMenu = new QMenu(this); - emit lineContextMenuRequested(editableInterface(), cursor.blockNumber(), contextMenu); + emit d->m_editable->markContextMenuRequested(editableInterface(), cursor.blockNumber(), contextMenu); if (!contextMenu->isEmpty()) contextMenu->exec(e->globalPos()); + delete contextMenu; } } else if (d->extraAreaSelectionAnchorBlockNumber >= 0) { QTextCursor selection = cursor; @@ -2471,7 +2468,7 @@ void BaseTextEditor::extraAreaMouseEvent(QMouseEvent *e) d->extraAreaToggleMarkBlockNumber = -1; if (cursor.blockNumber() == n) { int line = n + 1; - emit markRequested(editableInterface(), line); + emit d->m_editable->markRequested(editableInterface(), line); } } } diff --git a/src/plugins/texteditor/basetexteditor.h b/src/plugins/texteditor/basetexteditor.h index a6cc14f36e4..714b1a507c8 100644 --- a/src/plugins/texteditor/basetexteditor.h +++ b/src/plugins/texteditor/basetexteditor.h @@ -431,8 +431,6 @@ protected slots: signals: - void markRequested(TextEditor::ITextEditor *editor, int line); - void lineContextMenuRequested(TextEditor::ITextEditor *editor, int line, QMenu *menu); void requestBlockUpdate(const QTextBlock &); void requestAutoCompletion(ITextEditable *editor, bool forced); diff --git a/src/plugins/texteditor/itexteditor.h b/src/plugins/texteditor/itexteditor.h index 432c3c9c585..514f311472a 100644 --- a/src/plugins/texteditor/itexteditor.h +++ b/src/plugins/texteditor/itexteditor.h @@ -44,6 +44,7 @@ #include QT_BEGIN_NAMESPACE +class QMenu; class QTextBlock; QT_END_NAMESPACE @@ -124,6 +125,7 @@ public: signals: void contentsChanged(); void markRequested(TextEditor::ITextEditor *editor, int line); + void markContextMenuRequested(TextEditor::ITextEditor *editor, int line, QMenu *menu); void tooltipRequested(TextEditor::ITextEditor *editor, const QPoint &globalPos, int position); void contextHelpIdRequested(TextEditor::ITextEditor *editor, int position); }; From 5c6be3a83cf5045b2584a46fe1661a09251df851 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 5 Dec 2008 12:19:04 +0100 Subject: [PATCH 05/77] Fixes: Do not display f1, f2 while waiting for wizard extension page data --- src/plugins/projectexplorer/projectwizardpage.ui | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/projectwizardpage.ui b/src/plugins/projectexplorer/projectwizardpage.ui index bc31f8c49e1..7c21ec5a910 100644 --- a/src/plugins/projectexplorer/projectwizardpage.ui +++ b/src/plugins/projectexplorer/projectwizardpage.ui @@ -104,8 +104,9 @@ The following files will be added: -f1 -f2 + + + From 6d37029be86594ce1721452c49a04d04d6e5b879 Mon Sep 17 00:00:00 2001 From: mae Date: Fri, 5 Dec 2008 13:19:57 +0100 Subject: [PATCH 06/77] support different selection kinds in basetexteditor. enum ExtraSelectionKind { CurrentLineSelection, ParenthesesMatchingSelection, CodeWarningsSelection, CodeSemanticsSelection, OtherSelection, NExtraSelectionKinds }; void setExtraSelections(ExtraSelectionKind kind, const QList &selections); QList extraSelections(ExtraSelectionKind kind) const; This is mainly for the benefit of the cppmodelmanager. --- src/plugins/cpptools/cppmodelmanager.cpp | 2 +- src/plugins/texteditor/basetexteditor.cpp | 30 +++++++++++++---------- src/plugins/texteditor/basetexteditor.h | 13 +++++++--- src/plugins/texteditor/basetexteditor_p.h | 3 +-- src/plugins/vcsbase/vcsbaseeditor.cpp | 21 ++++------------ 5 files changed, 34 insertions(+), 35 deletions(-) diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index b3f9fb604c3..042b93cc74d 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -683,7 +683,7 @@ void CppModelManager::onDocumentUpdated(Document::Ptr doc) sel.cursor = c; selections.append(sel); } - ed->setExtraExtraSelections(selections); + ed->setExtraSelections(TextEditor::BaseTextEditor::CodeWarningsSelection, selections); break; } } diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index ea9da5cb6bd..49d29b75c93 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -2477,6 +2477,9 @@ void BaseTextEditor::extraAreaMouseEvent(QMouseEvent *e) void BaseTextEditor::slotCursorPositionChanged() { QList extraSelections; + setExtraSelections(ParenthesesMatchingSelection, extraSelections); // clear + if (d->m_parenthesesMatchingEnabled) + d->m_parenthesesMatchingTimer->start(50); if (d->m_highlightCurrentLine) { QTextEdit::ExtraSelection sel; @@ -2487,11 +2490,7 @@ void BaseTextEditor::slotCursorPositionChanged() extraSelections.append(sel); } - if (d->m_parenthesesMatchingEnabled) - d->m_parenthesesMatchingTimer->start(50); - - d->m_extraSelections = extraSelections; - setExtraSelections(d->m_extraSelections + d->m_extraExtraSelections); + setExtraSelections(CurrentLineSelection, extraSelections); } QTextBlock TextBlockUserData::testCollapse(const QTextBlock& block) @@ -3133,7 +3132,7 @@ void BaseTextEditor::_q_matchParentheses() if (backwardMatchType == TextBlockUserData::NoMatch && forwardMatchType == TextBlockUserData::NoMatch) return; - QList extraSelections = d->m_extraSelections; + QList extraSelections; if (backwardMatch.hasSelection()) { QTextEdit::ExtraSelection sel; @@ -3186,8 +3185,7 @@ void BaseTextEditor::_q_matchParentheses() } extraSelections.append(sel); } - d->m_extraSelections = extraSelections; - setExtraSelections(d->m_extraSelections + d->m_extraExtraSelections); + setExtraSelections(ParenthesesMatchingSelection, extraSelections); } void BaseTextEditor::setActionHack(QObject *hack) @@ -3234,15 +3232,21 @@ void BaseTextEditor::deleteLine() cut(); } -void BaseTextEditor::setExtraExtraSelections(const QList &selections) +void BaseTextEditor::setExtraSelections(ExtraSelectionKind kind, const QList &selections) { - d->m_extraExtraSelections = selections; - setExtraSelections(d->m_extraSelections + d->m_extraExtraSelections); + if (selections.isEmpty() && d->m_extraSelections[kind].isEmpty()) + return; + d->m_extraSelections[kind] = selections; + + QList all; + for (int i = 0; i < NExtraSelectionKinds; ++i) + all += d->m_extraSelections[i]; + QPlainTextEdit::setExtraSelections(all); } -QList BaseTextEditor::extraExtraSelections() const +QList BaseTextEditor::extraSelections(ExtraSelectionKind kind) const { - return d->m_extraExtraSelections; + return d->m_extraSelections[kind]; } diff --git a/src/plugins/texteditor/basetexteditor.h b/src/plugins/texteditor/basetexteditor.h index 714b1a507c8..40454a9c7d4 100644 --- a/src/plugins/texteditor/basetexteditor.h +++ b/src/plugins/texteditor/basetexteditor.h @@ -369,7 +369,6 @@ private: Internal::BaseTextEditorPrivate *d; friend class Internal::BaseTextEditorPrivate; - public: QWidget *extraArea() const; virtual int extraAreaWidth(int *markWidthPtr = 0) const; @@ -385,8 +384,16 @@ public: void ensureCursorVisible(); - void setExtraExtraSelections(const QList &selections); - QList extraExtraSelections() const; + enum ExtraSelectionKind { + CurrentLineSelection, + ParenthesesMatchingSelection, + CodeWarningsSelection, + CodeSemanticsSelection, + OtherSelection, + NExtraSelectionKinds + }; + void setExtraSelections(ExtraSelectionKind kind, const QList &selections); + QList extraSelections(ExtraSelectionKind kind) const; struct BlockRange { BlockRange():first(0), last(-1){} diff --git a/src/plugins/texteditor/basetexteditor_p.h b/src/plugins/texteditor/basetexteditor_p.h index 56b1071e1c6..9f1e5a7eb67 100644 --- a/src/plugins/texteditor/basetexteditor_p.h +++ b/src/plugins/texteditor/basetexteditor_p.h @@ -204,8 +204,7 @@ public: QObject *m_actionHack; - QList m_extraSelections; - QList m_extraExtraSelections; + QList m_extraSelections[BaseTextEditor::NExtraSelectionKinds]; // block selection mode bool m_inBlockSelectionMode; diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index dcfe55d195b..eb65457c109 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -225,23 +225,12 @@ void VCSBaseEditor::mouseMoveEvent(QMouseEvent *e) sel.format.setFontUnderline(true); change = changeUnderCursor(cursor); sel.format.setProperty(QTextFormat::UserProperty, change); - bool found = false; - foreach (QTextEdit::ExtraSelection es, extraSelections()) { - if (es.format.stringProperty(QTextFormat::UserProperty) == sel.format.stringProperty(QTextFormat::UserProperty)) { - found = true; - break; - } - } - if (!found) { - setExtraSelections(QList() << sel); - viewport()->setCursor(Qt::PointingHandCursor); - } - } else { - if (!extraSelections().isEmpty()) { - setExtraSelections(QList()); - viewport()->setCursor(Qt::IBeamCursor); - } + setExtraSelections(OtherSelection, QList() << sel); + viewport()->setCursor(Qt::PointingHandCursor); } + } else { + setExtraSelections(OtherSelection, QList()); + viewport()->setCursor(Qt::IBeamCursor); } TextEditor::BaseTextEditor::mouseMoveEvent(e); } From ecfb77d469e3410f06c093a7696fe8939f4f0632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Fri, 5 Dec 2008 12:21:18 +0100 Subject: [PATCH 07/77] Separate scope in classes quickopen filter The scope of the classes is now separated and displayed in the second column, and not included in the search. --- src/libs/cplusplus/Icons.cpp | 4 +- src/libs/cplusplus/Icons.h | 2 +- src/libs/utils/pathchooser.h | 1 + src/plugins/cpptools/cppclassesfilter.cpp | 1 + src/plugins/cpptools/searchsymbols.cpp | 79 +++++++++++++++-------- src/plugins/cpptools/searchsymbols.h | 14 ++++ 6 files changed, 70 insertions(+), 31 deletions(-) diff --git a/src/libs/cplusplus/Icons.cpp b/src/libs/cplusplus/Icons.cpp index 94b6469ea46..3b7ee24da3c 100644 --- a/src/libs/cplusplus/Icons.cpp +++ b/src/libs/cplusplus/Icons.cpp @@ -61,11 +61,11 @@ Icons::Icons() { } -QIcon Icons::iconForSymbol(Symbol *symbol) const +QIcon Icons::iconForSymbol(const Symbol *symbol) const { if (symbol->isFunction() || (symbol->isDeclaration() && symbol->type()->isFunction())) { - Function *function = symbol->asFunction(); + const Function *function = symbol->asFunction(); if (!function) function = symbol->type()->asFunction(); diff --git a/src/libs/cplusplus/Icons.h b/src/libs/cplusplus/Icons.h index c49bcde12d1..6d4e0bb25d6 100644 --- a/src/libs/cplusplus/Icons.h +++ b/src/libs/cplusplus/Icons.h @@ -47,7 +47,7 @@ class CPLUSPLUS_EXPORT Icons public: Icons(); - QIcon iconForSymbol(Symbol *symbol) const; + QIcon iconForSymbol(const Symbol *symbol) const; QIcon keywordIcon() const; QIcon macroIcon() const; diff --git a/src/libs/utils/pathchooser.h b/src/libs/utils/pathchooser.h index 7ae60a255bf..ab821d5df1e 100644 --- a/src/libs/utils/pathchooser.h +++ b/src/libs/utils/pathchooser.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef PATHCHOOSER_H #define PATHCHOOSER_H diff --git a/src/plugins/cpptools/cppclassesfilter.cpp b/src/plugins/cpptools/cppclassesfilter.cpp index 3d8da9a7387..6aa6734fca9 100644 --- a/src/plugins/cpptools/cppclassesfilter.cpp +++ b/src/plugins/cpptools/cppclassesfilter.cpp @@ -42,6 +42,7 @@ CppClassesFilter::CppClassesFilter(CppModelManager *manager, Core::EditorManager setIncludedByDefault(false); search.setSymbolsToSearchFor(SearchSymbols::Classes); + search.setSeparateScope(true); } CppClassesFilter::~CppClassesFilter() diff --git a/src/plugins/cpptools/searchsymbols.cpp b/src/plugins/cpptools/searchsymbols.cpp index 4b1e48abdf7..670d0d6d471 100644 --- a/src/plugins/cpptools/searchsymbols.cpp +++ b/src/plugins/cpptools/searchsymbols.cpp @@ -40,7 +40,8 @@ using namespace CPlusPlus; using namespace CppTools::Internal; SearchSymbols::SearchSymbols(): - symbolsToSearchFor(Classes | Functions | Enums) + symbolsToSearchFor(Classes | Functions | Enums), + separateScope(false) { } @@ -49,6 +50,11 @@ void SearchSymbols::setSymbolsToSearchFor(SymbolTypes types) symbolsToSearchFor = types; } +void SearchSymbols::setSeparateScope(bool separateScope) +{ + this->separateScope = separateScope; +} + QList SearchSymbols::operator()(Document::Ptr doc, const QString &scope) { QString previousScope = switchScope(scope); @@ -73,13 +79,12 @@ bool SearchSymbols::visit(Enum *symbol) return false; QString name = symbolName(symbol); - QString previousScope = switchScope(name); - QIcon icon = icons.iconForSymbol(symbol); + QString scopedName = scopedSymbolName(name); + QString previousScope = switchScope(scopedName); + appendItem(separateScope ? name : scopedName, + separateScope ? previousScope : QString(), + ModelItemInfo::Enum, symbol); Scope *members = symbol->members(); - items.append(ModelItemInfo(name, QString(), ModelItemInfo::Enum, - QString::fromUtf8(symbol->fileName(), symbol->fileNameLength()), - symbol->line(), - icon)); for (unsigned i = 0; i < members->symbolCount(); ++i) { accept(members->symbolAt(i)); } @@ -93,18 +98,18 @@ bool SearchSymbols::visit(Function *symbol) return false; QString name = symbolName(symbol); - QString type = overview.prettyType(symbol->type()); - QIcon icon = icons.iconForSymbol(symbol); - items.append(ModelItemInfo(name, type, ModelItemInfo::Method, - QString::fromUtf8(symbol->fileName(), symbol->fileNameLength()), - symbol->line(), - icon)); + QString scopedName = scopedSymbolName(name); + QString type = overview.prettyType(symbol->type(), + separateScope ? symbol->name() : 0); + appendItem(separateScope ? type : scopedName, + separateScope ? _scope : type, + ModelItemInfo::Method, symbol); return false; } bool SearchSymbols::visit(Namespace *symbol) { - QString name = symbolName(symbol); + QString name = findOrInsert(scopedSymbolName(symbol)); QString previousScope = switchScope(name); Scope *members = symbol->members(); for (unsigned i = 0; i < members->symbolCount(); ++i) { @@ -118,12 +123,9 @@ bool SearchSymbols::visit(Namespace *symbol) bool SearchSymbols::visit(Declaration *symbol) { if (symbol->type()->isFunction()) { - QString name = symbolName(symbol); + QString name = scopedSymbolName(symbol); QString type = overview.prettyType(symbol->type()); - //QIcon icon = ...; - items.append(ModelItemInfo(name, type, ModelItemInfo::Method, - QString::fromUtf8(symbol->fileName(), symbol->line()), - symbol->line())); + appendItems(name, type, ModelItemInfo::Method, symbol->fileName()); } return false; } @@ -135,12 +137,11 @@ bool SearchSymbols::visit(Class *symbol) return false; QString name = symbolName(symbol); - QString previousScope = switchScope(name); - QIcon icon = icons.iconForSymbol(symbol); - items.append(ModelItemInfo(name, QString(), ModelItemInfo::Class, - QString::fromUtf8(symbol->fileName(), symbol->fileNameLength()), - symbol->line(), - icon)); + QString scopedName = scopedSymbolName(name); + QString previousScope = switchScope(scopedName); + appendItem(separateScope ? name : scopedName, + separateScope ? previousScope : QString(), + ModelItemInfo::Class, symbol); Scope *members = symbol->members(); for (unsigned i = 0; i < members->symbolCount(); ++i) { accept(members->symbolAt(i)); @@ -149,11 +150,22 @@ bool SearchSymbols::visit(Class *symbol) return false; } -QString SearchSymbols::symbolName(const Symbol *symbol) const +QString SearchSymbols::scopedSymbolName(const QString &symbolName) const { QString name = _scope; if (! name.isEmpty()) name += QLatin1String("::"); + name += symbolName; + return name; +} + +QString SearchSymbols::scopedSymbolName(const Symbol *symbol) const +{ + return scopedSymbolName(symbolName(symbol)); +} + +QString SearchSymbols::symbolName(const Symbol *symbol) const +{ QString symbolName = overview.prettyName(symbol->name()); if (symbolName.isEmpty()) { QString type; @@ -176,6 +188,17 @@ QString SearchSymbols::symbolName(const Symbol *symbol) const symbolName += type; symbolName += QLatin1String(">"); } - name += symbolName; - return name; + return symbolName; +} + +void SearchSymbols::appendItem(const QString &name, + const QString &info, + ModelItemInfo::ItemType type, + const CPlusPlus::Symbol *symbol) +{ + const QIcon icon = icons.iconForSymbol(symbol); + items.append(ModelItemInfo(name, info, type, + QString::fromUtf8(symbol->fileName(), symbol->fileNameLength()), + symbol->line(), + icon)); } diff --git a/src/plugins/cpptools/searchsymbols.h b/src/plugins/cpptools/searchsymbols.h index 948f9d78e84..d82f2859721 100644 --- a/src/plugins/cpptools/searchsymbols.h +++ b/src/plugins/cpptools/searchsymbols.h @@ -90,6 +90,7 @@ public: SearchSymbols(); void setSymbolsToSearchFor(SymbolTypes types); + void setSeparateScope(bool separateScope); QList operator()(CPlusPlus::Document::Ptr doc) { return operator()(doc, QString()); } @@ -111,14 +112,27 @@ protected: virtual bool visit(CPlusPlus::Declaration *symbol); #endif virtual bool visit(CPlusPlus::Class *symbol); + + QString scopedSymbolName(const QString &symbolName) const; + QString scopedSymbolName(const CPlusPlus::Symbol *symbol) const; QString symbolName(const CPlusPlus::Symbol *symbol) const; + void appendItem(const QString &name, + const QString &info, + ModelItemInfo::ItemType type, + const CPlusPlus::Symbol *symbol); private: + QString findOrInsert(const QString &s) + { return *strings.insert(s); } + + QSet strings; // Used to avoid QString duplication + QString _scope; CPlusPlus::Overview overview; CPlusPlus::Icons icons; QList items; SymbolTypes symbolsToSearchFor; + bool separateScope; }; Q_DECLARE_OPERATORS_FOR_FLAGS(SearchSymbols::SymbolTypes) From d6e726ec68968c0bd64cc2d3350394afe808608a Mon Sep 17 00:00:00 2001 From: dt Date: Fri, 5 Dec 2008 14:29:18 +0100 Subject: [PATCH 08/77] Fixes: Memory usage for loading projects.pro Details: Free the whole ProFile*, ProItem*, ProValue* and etc structure after parsing, that frees around 200Mb for projects.pro. --- .../qt4projectmanager/profilereader.cpp | 32 ++-- src/plugins/qt4projectmanager/profilereader.h | 2 +- src/plugins/qt4projectmanager/qt4nodes.cpp | 175 +++++++++--------- src/plugins/qt4projectmanager/qt4nodes.h | 21 +-- src/plugins/qt4projectmanager/qt4project.cpp | 39 ++-- src/plugins/qt4projectmanager/qt4project.h | 2 +- 6 files changed, 126 insertions(+), 145 deletions(-) diff --git a/src/plugins/qt4projectmanager/profilereader.cpp b/src/plugins/qt4projectmanager/profilereader.cpp index 0e7dd7ece2a..9f65cc890d0 100644 --- a/src/plugins/qt4projectmanager/profilereader.cpp +++ b/src/plugins/qt4projectmanager/profilereader.cpp @@ -61,14 +61,6 @@ void ProFileReader::setQtVersion(QtVersion *qtVersion) { bool ProFileReader::readProFile(const QString &fileName) { //disable caching -> list of include files is not updated otherwise -// ProFile *pro = proFileFromCache(fileName); -// if (!pro) { -// pro = new ProFile(fileName); -// if (!queryProFile(pro)) { -// delete pro; -// return false; -// } -// } QString fn = QFileInfo(fileName).filePath(); ProFile *pro = new ProFile(fn); if (!queryProFile(pro)) { @@ -82,9 +74,6 @@ bool ProFileReader::readProFile(const QString &fileName) ProFile *ProFileReader::parsedProFile(const QString &fileName) { -// ProFile *pro = proFileFromCache(fileName); -// if (pro) -// return pro; QString fn = QFileInfo(fileName).filePath(); ProFile *pro = ProFileEvaluator::parsedProFile(fn); if (pro) { @@ -99,16 +88,6 @@ void ProFileReader::releaseParsedProFile(ProFile *) return; } -ProFile *ProFileReader::proFileFromCache(const QString &fileName) const -{ - - QString fn = QFileInfo(fileName).filePath(); - ProFile *pro = 0; - if (m_includeFiles.contains(fn)) - pro = m_includeFiles.value(fn); - return pro; -} - QList ProFileReader::includeFiles() const { QString qmakeMkSpecDir = propertyValue("QMAKE_MKSPECS"); @@ -196,3 +175,14 @@ void ProFileReader::errorMessage(const QString &message) { emit errorFound(message); } + +ProFile *ProFileReader::proFileFor(const QString &name) +{ + qDebug()<<"Asking for "<::const_iterator it = m_includeFiles.constFind(name); + if (it == m_includeFiles.constEnd()) + return 0; + else + return it.value(); +} diff --git a/src/plugins/qt4projectmanager/profilereader.h b/src/plugins/qt4projectmanager/profilereader.h index 46e1f600386..ace88866041 100644 --- a/src/plugins/qt4projectmanager/profilereader.h +++ b/src/plugins/qt4projectmanager/profilereader.h @@ -63,7 +63,7 @@ public: const QString &baseDirectory, PathValuesMode mode, const ProFile *pro = 0) const; - ProFile *proFileFromCache(const QString &fileName) const; + ProFile *proFileFor(const QString &name); signals: void errorFound(const QString &error); diff --git a/src/plugins/qt4projectmanager/qt4nodes.cpp b/src/plugins/qt4projectmanager/qt4nodes.cpp index 8c4010aac5e..73e3620f9bc 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.cpp +++ b/src/plugins/qt4projectmanager/qt4nodes.cpp @@ -79,35 +79,22 @@ namespace { Implements abstract ProjectNode class */ -Qt4PriFileNode::Qt4PriFileNode(Qt4Project *project, - const QString &filePath) +Qt4PriFileNode::Qt4PriFileNode(Qt4Project *project, Qt4ProFileNode* qt4ProFileNode, const QString &filePath) : ProjectNode(filePath), - m_core(project->qt4ProjectManager()->core()), m_project(project), + m_qt4ProFileNode(qt4ProFileNode), m_projectFilePath(QDir::fromNativeSeparators(filePath)), - m_projectDir(QFileInfo(filePath).absolutePath()), - m_includeFile(0), - m_saveTimer(new QTimer(this)), - m_reader(0) + m_projectDir(QFileInfo(filePath).absolutePath()) { Q_ASSERT(project); setFolderName(QFileInfo(filePath).baseName()); setIcon(QIcon(":/qt4projectmanager/images/qt_project.png")); - - // m_saveTimer is used for the delayed saving of the pro file - // so that multiple insert/remove calls in one event loop run - // trigger just one save call. - m_saveTimer->setSingleShot(true); - connect(m_saveTimer, SIGNAL(timeout()), this, SLOT(save())); } void Qt4PriFileNode::update(ProFile *includeFile, ProFileReader *reader) { Q_ASSERT(includeFile); Q_ASSERT(reader); - m_reader = reader; - - m_includeFile = includeFile; // add project file node if (m_fileNodes.isEmpty()) @@ -175,47 +162,42 @@ void Qt4PriFileNode::update(ProFile *includeFile, ProFileReader *reader) QList Qt4PriFileNode::supportedActions() const { QList actions; - if (m_includeFile) { - const FolderNode *folderNode = this; - const Qt4ProFileNode *proFileNode; - while (!(proFileNode = qobject_cast(folderNode))) - folderNode = folderNode->parentFolderNode(); - Q_ASSERT(proFileNode); - switch (proFileNode->projectType()) { - case ApplicationTemplate: - case LibraryTemplate: - actions << AddFile << RemoveFile; - break; - case SubDirsTemplate: - actions << AddSubProject << RemoveSubProject; - break; - default: - break; - } + const FolderNode *folderNode = this; + const Qt4ProFileNode *proFileNode; + while (!(proFileNode = qobject_cast(folderNode))) + folderNode = folderNode->parentFolderNode(); + Q_ASSERT(proFileNode); + + switch (proFileNode->projectType()) { + case ApplicationTemplate: + case LibraryTemplate: + actions << AddFile << RemoveFile; + break; + case SubDirsTemplate: + actions << AddSubProject << RemoveSubProject; + break; + default: + break; } return actions; } bool Qt4PriFileNode::addSubProjects(const QStringList &proFilePaths) { - if (!m_includeFile) - return false; - return changeIncludes(m_includeFile, proFilePaths, AddToProFile); + Q_UNUSED(proFilePaths); + return false; //changeIncludes(m_includeFile, proFilePaths, AddToProFile); } bool Qt4PriFileNode::removeSubProjects(const QStringList &proFilePaths) { - if (!m_includeFile) - return false; - return changeIncludes(m_includeFile, proFilePaths, RemoveFromProFile); + Q_UNUSED(proFilePaths); + return false; //changeIncludes(m_includeFile, proFilePaths, RemoveFromProFile); } bool Qt4PriFileNode::addFiles(const FileType fileType, const QStringList &filePaths, QStringList *notAdded) { - if (!m_includeFile) - return false; QStringList failedFiles; changeFiles(fileType, filePaths, &failedFiles, AddToProFile); @@ -227,8 +209,6 @@ bool Qt4PriFileNode::addFiles(const FileType fileType, const QStringList &filePa bool Qt4PriFileNode::removeFiles(const FileType fileType, const QStringList &filePaths, QStringList *notRemoved) { - if (!m_includeFile) - return false; QStringList failedFiles; changeFiles(fileType, filePaths, &failedFiles, RemoveFromProFile); if (notRemoved) @@ -239,7 +219,7 @@ bool Qt4PriFileNode::removeFiles(const FileType fileType, const QStringList &fil bool Qt4PriFileNode::renameFile(const FileType fileType, const QString &filePath, const QString &newFilePath) { - if (!m_includeFile || newFilePath.isEmpty()) + if (newFilePath.isEmpty()) return false; if (!QFile::rename(filePath, newFilePath)) @@ -268,18 +248,19 @@ bool Qt4PriFileNode::changeIncludes(ProFile *includeFile, const QStringList &pro bool Qt4PriFileNode::priFileWritable(const QString &path) { const QString dir = QFileInfo(path).dir().path(); - Core::IVersionControl *versionControl = m_core->vcsManager()->findVersionControlForDirectory(dir); - switch (Core::EditorManager::promptReadOnlyFile(path, versionControl, m_core->mainWindow(), false)) { + Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject(); + Core::IVersionControl *versionControl = core->vcsManager()->findVersionControlForDirectory(dir); + switch (Core::EditorManager::promptReadOnlyFile(path, versionControl, core->mainWindow(), false)) { case Core::EditorManager::RO_OpenVCS: if (!versionControl->vcsOpen(path)) { - QMessageBox::warning(m_core->mainWindow(), tr("Failed!"), tr("Could not open the file for edit with SCC.")); + QMessageBox::warning(core->mainWindow(), tr("Failed!"), tr("Could not open the file for edit with SCC.")); return false; } break; case Core::EditorManager::RO_MakeWriteable: { const bool permsOk = QFile::setPermissions(path, QFile::permissions(path) | QFile::WriteUser); if (!permsOk) { - QMessageBox::warning(m_core->mainWindow(), tr("Failed!"), tr("Could not set permissions to writable.")); + QMessageBox::warning(core->mainWindow(), tr("Failed!"), tr("Could not set permissions to writable.")); return false; } break; @@ -296,11 +277,13 @@ bool Qt4PriFileNode::saveModifiedEditors(const QString &path) QList allFileHandles; QList modifiedFileHandles; - foreach (Core::IFile *file, m_core->fileManager()->managedFiles(path)) { + Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject(); + + foreach (Core::IFile *file, core->fileManager()->managedFiles(path)) { allFileHandles << file; } - foreach (Core::IEditor *editor, m_core->editorManager()->editorsForFileName(path)) { + foreach (Core::IEditor *editor, core->editorManager()->editorsForFileName(path)) { if (Core::IFile *editorFile = editor->file()) { if (editorFile->isModified()) modifiedFileHandles << editorFile; @@ -309,7 +292,7 @@ bool Qt4PriFileNode::saveModifiedEditors(const QString &path) if (!modifiedFileHandles.isEmpty()) { bool cancelled; - m_core->fileManager()->saveModifiedFiles(modifiedFileHandles, &cancelled, + core->fileManager()->saveModifiedFiles(modifiedFileHandles, &cancelled, tr("There are unsaved changes for project file %1.").arg(path)); if (cancelled) return false; @@ -330,6 +313,18 @@ void Qt4PriFileNode::changeFiles(const FileType fileType, if (filePaths.isEmpty()) return; + ProFileReader *reader = m_qt4ProFileNode->createProFileReader(); + if (!reader->readProFile(m_qt4ProFileNode->path())) { + m_project->proFileParseError(tr("Error while parsing file %1. Giving up.").arg(m_projectFilePath)); + delete reader; + return; + } + + ProFile *includeFile = reader->proFileFor(m_projectFilePath); + if(!includeFile) { + m_project->proFileParseError(tr("Error while changing pro file %1.").arg(m_projectFilePath)); + } + *notChanged = filePaths; // Check for modified editors @@ -338,7 +333,7 @@ void Qt4PriFileNode::changeFiles(const FileType fileType, // Check if file is readonly ProEditorModel proModel; - proModel.setProFiles(QList() << m_includeFile); + proModel.setProFiles(QList() << includeFile); const QStringList vars = varNames(fileType); QDir priFileDir = QDir(m_projectDir); @@ -413,26 +408,27 @@ void Qt4PriFileNode::changeFiles(const FileType fileType, } // save file - if (!m_saveTimer->isActive()) - m_saveTimer->start(); + save(includeFile); + delete reader; } -void Qt4PriFileNode::save() +void Qt4PriFileNode::save(ProFile *includeFile) { - Core::FileManager *fileManager = m_core->fileManager(); - QList allFileHandles = fileManager->managedFiles(m_includeFile->fileName()); + Core::ICore *core = ExtensionSystem::PluginManager::instance()->getObject(); + Core::FileManager *fileManager = core->fileManager(); + QList allFileHandles = fileManager->managedFiles(includeFile->fileName()); Core::IFile *modifiedFileHandle = 0; foreach(Core::IFile *file, allFileHandles) - if (file->fileName() == m_includeFile->fileName()) + if (file->fileName() == includeFile->fileName()) modifiedFileHandle = file; if (modifiedFileHandle) fileManager->blockFileChange(modifiedFileHandle); ProWriter pw; - const bool ok = pw.write(m_includeFile, m_includeFile->fileName()); + const bool ok = pw.write(includeFile, includeFile->fileName()); Q_UNUSED(ok) - m_includeFile->setModified(false); - m_project->qt4ProjectManager()->notifyChanged(m_includeFile->fileName()); + includeFile->setModified(false); + m_project->qt4ProjectManager()->notifyChanged(includeFile->fileName()); if (modifiedFileHandle) fileManager->unblockFileChange(modifiedFileHandle); @@ -487,12 +483,11 @@ QStringList Qt4PriFileNode::varNames(FileType type) Qt4ProFileNode::Qt4ProFileNode(Qt4Project *project, const QString &filePath, QObject *parent) - : Qt4PriFileNode(project, filePath), + : Qt4PriFileNode(project, this, filePath), // own stuff m_projectType(InvalidProject), m_isQBuildProject(false), - m_dirWatcher(new DirectoryWatcher(this)), - m_reader(0) + m_dirWatcher(new DirectoryWatcher(this)) { if (parent) setParent(parent); @@ -507,7 +502,7 @@ Qt4ProFileNode::Qt4ProFileNode(Qt4Project *project, Qt4ProFileNode::~Qt4ProFileNode() { - delete m_reader; + } bool Qt4ProFileNode::hasTargets() const @@ -527,11 +522,10 @@ QStringList Qt4ProFileNode::variableValue(const Qt4Variable var) const void Qt4ProFileNode::update() { - delete m_reader; - m_reader = createProFileReader(); - if (!m_reader->readProFile(m_projectFilePath)) { + ProFileReader *reader = createProFileReader(); + if (!reader->readProFile(m_projectFilePath)) { m_project->proFileParseError(tr("Error while parsing file %1. Giving up.").arg(m_projectFilePath)); - delete m_reader; + delete reader; invalidate(); return; } @@ -546,7 +540,7 @@ void Qt4ProFileNode::update() #endif Qt4ProjectType projectType = InvalidProject; - switch (m_reader->templateType()) { + switch (reader->templateType()) { case ProFileEvaluator::TT_Unknown: case ProFileEvaluator::TT_Application: { projectType = ApplicationTemplate; @@ -585,11 +579,11 @@ void Qt4ProFileNode::update() ProFile *fileForCurrentProject = 0; { if (projectType == SubDirsTemplate) { - foreach (const QString &subDirProject, subDirsPaths(m_reader)) + foreach (const QString &subDirProject, subDirsPaths(reader)) newProjectFiles << subDirProject; } - foreach (ProFile *includeFile, m_reader->includeFiles()) { + foreach (ProFile *includeFile, reader->includeFiles()) { if (includeFile->fileName() == m_projectFilePath) { // this file fileForCurrentProject = includeFile; } else { @@ -616,9 +610,9 @@ void Qt4ProFileNode::update() } else if ((*existingNodeIter)->path() > *newProjectFileIter) { if (ProFile *file = includeFiles.value(*newProjectFileIter)) { Qt4PriFileNode *priFileNode - = new Qt4PriFileNode(m_project, + = new Qt4PriFileNode(m_project, this, *newProjectFileIter); - priFileNode->update(file, m_reader); + priFileNode->update(file, reader); toAdd << priFileNode; } else { toAdd << createSubProFileNode(*newProjectFileIter); @@ -627,7 +621,7 @@ void Qt4ProFileNode::update() } else { // *existingNodeIter->path() == *newProjectFileIter if (ProFile *file = includeFiles.value(*newProjectFileIter)) { Qt4PriFileNode *priFileNode = static_cast(*existingNodeIter); - priFileNode->update(file, m_reader); + priFileNode->update(file, reader); } ++existingNodeIter; @@ -641,9 +635,9 @@ void Qt4ProFileNode::update() while (newProjectFileIter != newProjectFiles.constEnd()) { if (ProFile *file = includeFiles.value(*newProjectFileIter)) { Qt4PriFileNode *priFileNode - = new Qt4PriFileNode(m_project, + = new Qt4PriFileNode(m_project, this, *newProjectFileIter); - priFileNode->update(file, m_reader); + priFileNode->update(file, reader); toAdd << priFileNode; } else { toAdd << createSubProFileNode(*newProjectFileIter); @@ -656,15 +650,15 @@ void Qt4ProFileNode::update() if (!toAdd.isEmpty()) addProjectNodes(toAdd); - Qt4PriFileNode::update(fileForCurrentProject, m_reader); + Qt4PriFileNode::update(fileForCurrentProject, reader); // update other variables QHash newVarValues; - newVarValues[CxxCompilerVar] << m_reader->value(QLatin1String("QMAKE_CXX")); - newVarValues[DefinesVar] = m_reader->values(QLatin1String("DEFINES")); - newVarValues[IncludePathVar] = includePaths(m_reader); - newVarValues[UiDirVar] = uiDirPaths(m_reader); - newVarValues[MocDirVar] = mocDirPaths(m_reader); + newVarValues[CxxCompilerVar] << reader->value(QLatin1String("QMAKE_CXX")); + newVarValues[DefinesVar] = reader->values(QLatin1String("DEFINES")); + newVarValues[IncludePathVar] = includePaths(reader); + newVarValues[UiDirVar] = uiDirPaths(reader); + newVarValues[MocDirVar] = mocDirPaths(reader); if (m_varValues != newVarValues) { m_varValues = newVarValues; @@ -678,12 +672,14 @@ void Qt4ProFileNode::update() foreach (NodesWatcher *watcher, watchers()) if (Qt4NodesWatcher *qt4Watcher = qobject_cast(watcher)) emit qt4Watcher->proFileUpdated(this); + + delete reader; } void Qt4ProFileNode::fileChanged(const QString &filePath) { CppTools::CppModelManagerInterface *modelManager = - m_core->pluginManager()->getObject(); + ExtensionSystem::PluginManager::instance()->getObject(); modelManager->updateSourceFiles(QStringList() << filePath); } @@ -789,7 +785,7 @@ void Qt4ProFileNode::updateGeneratedFiles() } } -ProFileReader *Qt4ProFileNode::createProFileReader() const +ProFileReader *Qt4PriFileNode::createProFileReader() const { ProFileReader *reader = new ProFileReader(); connect(reader, SIGNAL(errorFound(const QString &)), @@ -801,7 +797,7 @@ ProFileReader *Qt4ProFileNode::createProFileReader() const } QHash variables; - variables.insert(QLatin1String("OUT_PWD"), QStringList(buildDir())); + variables.insert(QLatin1String("OUT_PWD"), QStringList(m_qt4ProFileNode->buildDir())); reader->addVariables(variables); return reader; @@ -916,7 +912,7 @@ QStringList Qt4ProFileNode::qBuildSubDirsPaths(const QString &scanDir) const return subProjectPaths; } -QString Qt4ProFileNode::buildDir() const +QString Qt4PriFileNode::buildDir() const { const QDir srcDirRoot = QFileInfo(m_project->rootProjectNode()->path()).absoluteDir(); const QString relativeDir = srcDirRoot.relativeFilePath(m_projectDir); @@ -951,11 +947,6 @@ void Qt4ProFileNode::invalidate() } -ProFile *Qt4ProFileNode::proFileFromCache(const QString &fileName) -{ - return m_reader->proFileFromCache(fileName); -} - Qt4NodesWatcher::Qt4NodesWatcher(QObject *parent) : NodesWatcher(parent) { diff --git a/src/plugins/qt4projectmanager/qt4nodes.h b/src/plugins/qt4projectmanager/qt4nodes.h index f4d7c9bd17f..97bc06a08f4 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.h +++ b/src/plugins/qt4projectmanager/qt4nodes.h @@ -102,8 +102,7 @@ class Qt4PriFileNode : public ProjectExplorer::ProjectNode { Q_OBJECT Q_DISABLE_COPY(Qt4PriFileNode) public: - Qt4PriFileNode(Qt4Project *project, - const QString &filePath); + Qt4PriFileNode(Qt4Project *project, Qt4ProFileNode* qt4ProFileNode, const QString &filePath); void update(ProFile *includeFile, ProFileReader *reader); @@ -122,9 +121,6 @@ public: bool renameFile(const FileType fileType, const QString &filePath, const QString &newFilePath); -private slots: - void save(); - protected: void clear(); static QStringList varNames(FileType type); @@ -142,18 +138,20 @@ protected: const QStringList &filePaths, QStringList *notChanged, ChangeType change); - + + QString buildDir() const; + ProFileReader *createProFileReader() const; + private: + void save(ProFile *includeFile); bool priFileWritable(const QString &path); bool saveModifiedEditors(const QString &path); - Core::ICore *m_core; Qt4Project *m_project; + Qt4ProFileNode *m_qt4ProFileNode; QString m_projectFilePath; QString m_projectDir; - ProFile *m_includeFile; QTimer *m_saveTimer; - ProFileReader *m_reader; // managed by Qt4ProFileNode friend class Qt4ProFileNode; @@ -174,7 +172,6 @@ public: Qt4ProjectType projectType() const; QStringList variableValue(const Qt4Variable var) const; - ProFile *proFileFromCache(const QString &fileName); public slots: void update(); @@ -185,7 +182,6 @@ private slots: private: void updateGeneratedFiles(); - ProFileReader *createProFileReader() const; Qt4ProFileNode *createSubProFileNode(const QString &path); QStringList uiDirPaths(ProFileReader *reader) const; @@ -194,7 +190,7 @@ private: QStringList subDirsPaths(ProFileReader *reader) const; QStringList qBuildSubDirsPaths(const QString &scanDir) const; - QString buildDir() const; + void invalidate(); @@ -203,7 +199,6 @@ private: bool m_isQBuildProject; DirectoryWatcher *m_dirWatcher; - ProFileReader *m_reader; friend class Qt4NodeHierarchy; }; diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp index b07900f9103..501068af004 100644 --- a/src/plugins/qt4projectmanager/qt4project.cpp +++ b/src/plugins/qt4projectmanager/qt4project.cpp @@ -179,12 +179,8 @@ Qt4ProjectFile::Qt4ProjectFile(Qt4Project *project, const QString &filePath, QOb bool Qt4ProjectFile::save(const QString &) { - ProFile *file = m_project->proFileFromCache(m_filePath); - ProWriter pw; - bool ok = pw.write(file, file->fileName()); - file->setModified(false); - m_project->qt4ProjectManager()->notifyChanged(file->fileName()); - return ok; + // This is never used + return false; } QString Qt4ProjectFile::fileName() const @@ -209,7 +205,7 @@ QString Qt4ProjectFile::mimeType() const bool Qt4ProjectFile::isModified() const { - return m_project->proFileFromCache(m_filePath)->isModified(); + return false; // we save after changing anyway } bool Qt4ProjectFile::isReadOnly() const @@ -895,16 +891,24 @@ MakeStep *Qt4Project::makeStep() const return 0; } -ProFile *Qt4Project::proFileFromCache(const QString &fileName) +bool Qt4Project::hasSubNode(Qt4PriFileNode *root, const QString &path) { - return rootProjectNode()->proFileFromCache(fileName); + if (root->path() == path) + return true; + foreach (FolderNode *fn, root->subFolderNodes()) { + if (qobject_cast(fn)) { + // we aren't interested in pro file nodes + } else if(Qt4PriFileNode *qt4prifilenode = qobject_cast(fn)) { + if (hasSubNode(qt4prifilenode, path)) + return true; + } + } + return false; } void Qt4Project::findProFile(const QString& fileName, Qt4ProFileNode *root, QList &list) { - if (root->path() == fileName) - list.append(root); - else if (root->proFileFromCache(fileName)) + if (hasSubNode(root, fileName)) list.append(root); foreach (FolderNode *fn, root->subFolderNodes()) @@ -914,9 +918,10 @@ void Qt4Project::findProFile(const QString& fileName, Qt4ProFileNode *root, QLis void Qt4Project::notifyChanged(const QString &name) { - QList list; - findProFile(name, rootProjectNode(), list); - foreach(Qt4ProFileNode *node, list) - node->update(); - + if (files(Qt4Project::ExcludeGeneratedFiles).contains(name)) { + QList list; + findProFile(name, rootProjectNode(), list); + foreach(Qt4ProFileNode *node, list) + node->update(); + } } diff --git a/src/plugins/qt4projectmanager/qt4project.h b/src/plugins/qt4projectmanager/qt4project.h index 18a7bf7f4f5..2a236a84c63 100644 --- a/src/plugins/qt4projectmanager/qt4project.h +++ b/src/plugins/qt4projectmanager/qt4project.h @@ -180,7 +180,6 @@ public: QMakeStep *qmakeStep() const; MakeStep *makeStep() const; - ProFile *proFileFromCache(const QString &fileName); void notifyChanged(const QString &name); public slots: @@ -209,6 +208,7 @@ protected: private: static void collectApplicationProFiles(QList &list, Internal::Qt4ProFileNode *node); static void findProFile(const QString& fileName, Internal::Qt4ProFileNode *root, QList &list); + static bool hasSubNode(Internal::Qt4PriFileNode *root, const QString &path); QList m_applicationProFileChange; ProjectExplorer::ProjectExplorerPlugin *projectExplorer() const; From 376e2983d2615504e0036b6fcb4e8c69393115c2 Mon Sep 17 00:00:00 2001 From: Kavindra Palaraja Date: Fri, 5 Dec 2008 15:24:45 +0100 Subject: [PATCH 09/77] Fixes: Some documentation fixes --- doc/qtcreator.qdoc | 78 ++++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index 4521b7e2fa4..4dd7a5fb53c 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -950,24 +950,23 @@ You can start Qt Creator from a command prompt with an existing session or \c{.pro} file by giving the name as argument on the command line. - \bold{Sidebar} + \bold{Show and Hide the Sidebar} - You can hide/unhide the sidebar in the edit and debug mode - by clicking on the corresponding icon on the left bottom. - Keyboard shortcut is \key{Alt+0}. + You can show and hide the the sidebar in \gui Edit and \gui Debug mode by + clicking on the corresponding icon, or by pressing \key{Alt+0}. - \bold{Display signals and slots} + \bold{Display Signals and Slots} - If you have an instance of a class derived from QObject and - want to find all other objects connected to one of its - slots by Qt's signals-and-slots mechanism, enable - \gui{Debug} and \gui{Use Custom Display for Qt Objects}. - In the \gui{Locals and Watchers View}, expand the object's - entry and open the wanted slot in the "slots" subitem. The - objects connect to this slot are exposed as children of - this slot. The same works with signals. + If you have an instance of a class that is derived from QObject, and you + you would like to find all other objects connected to one of your object's + slots using Qt's signals and slots mechanism -- you can enable + \gui{Use Custom Display for Qt Objects} feature under the \gui Debug menu. - \bold{Low level display} + In the \gui{Locals and Watchers} view, expand the object's entry and open + the slot in the \e slots subitem. The objects connected to this slot are + exposed as children of the slot. This method works with signals too. + + \bold{Display Low Level Data} If the special debugging of Qt objects fails due to data corruption within the debugged objects, you can switch the @@ -983,33 +982,38 @@ \title Glossary - \bold{System Qt} + \table + \header + \o Term + \o Meaning - \target glossary-system-qt - The version of Qt installed on your system. - This is the one whose \c qmake command is found in the \c PATH. + \row + \o System Qt \target glossary-system-qt + \o The version of Qt installed on your system. This is the Qt + version for the \c qmake command found in your \c PATH. - \bold{Default Qt} + \row + \o Default Qt \target glossary-default-qt + \o The version of Qt configured in \gui{Tools -> Options -> Qt 4 + -> Default Qt Version}. This is the Qt version used by your + new projects. It defaults to System Qt. - \target glossary-default-qt - The version of Qt configured in \gui{Tools - -> Options -> Qt 4 -> Default Qt Version}. This is the version - used by new projects. It defaults to the System Qt. + \row + \o Project Qt \target glossary-project-qt + \o The version of Qt configured in \gui{Build&Run -> Build + Settings -> Build Configurations}. This is the Qt version that + is actually used by a particular project. It defaults to + Default Qt. - \bold{Project Qt} - - \target glossary-project-qt - The version of Qt configured in \gui{Build&Run - -> Build Settings -> Build Configurations}. This is the version - actually used by the project. It defaults to the Default Qt. - - \bold{Shadow Build} - - \target glossary-shadow-build - Shadow building means building the project not in the source directory, - but in a seperate \bold{build directory}. This has the benefit of keeping - the source directory clean. It is also considered "best practice" if - you need many build configurations for a single set of sources. + \row + \o Shadow Build \target glossary-shadow-build + \o Shadow building means building a project in a separate + directory, the \e{build directory}. The build directory is + different from the source directory. One of the benefits of + shadow building is that it keeps your source directory clean. + Shadow building is the best practice if you need many build + configurations for a single set of source. + \endtable */ From 04f79bc9659663238594d8c725def0b0f1a93a06 Mon Sep 17 00:00:00 2001 From: con Date: Fri, 5 Dec 2008 15:06:11 +0100 Subject: [PATCH 10/77] Fixes: - Show in method combo box if there aren't any MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task: - 234321 RevBy: - Thorbjørn --- src/plugins/cppeditor/cppeditor.cpp | 24 +++++++++++++++++++----- src/plugins/cppeditor/cppeditor.h | 2 ++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index da52bb3d601..8567f81d751 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -79,6 +79,7 @@ #include #include #include +#include using namespace CPlusPlus; using namespace CppEditor::Internal; @@ -202,7 +203,9 @@ void CPPEditor::createToolBar(CPPEditorEditable *editable) m_methodCombo->setMaxVisibleItems(20); m_overviewModel = new OverviewModel(this); - m_methodCombo->setModel(m_overviewModel); + m_noSymbolsModel = new QStringListModel(this); + m_noSymbolsModel->setStringList(QStringList() << tr("")); + m_methodCombo->setModel(m_noSymbolsModel); connect(m_methodCombo, SIGNAL(activated(int)), this, SLOT(jumpToMethod(int))); connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(updateMethodBoxIndex())); @@ -315,9 +318,16 @@ void CPPEditor::onDocumentUpdated(Document::Ptr doc) return; m_overviewModel->rebuild(doc); - OverviewTreeView *treeView = static_cast(m_methodCombo->view()); - treeView->sync(); - updateMethodBoxIndex(); + if (m_overviewModel->rowCount() > 0) { + if (m_methodCombo->model() != m_overviewModel) + m_methodCombo->setModel(m_overviewModel); + OverviewTreeView *treeView = static_cast(m_methodCombo->view()); + treeView->sync(); + updateMethodBoxIndex(); + } else { + if (m_methodCombo->model() != m_noSymbolsModel) + m_methodCombo->setModel(m_noSymbolsModel); + } } void CPPEditor::updateFileName() @@ -325,6 +335,8 @@ void CPPEditor::updateFileName() void CPPEditor::jumpToMethod(int) { + if (m_methodCombo->model() != m_overviewModel) + return; QModelIndex index = m_methodCombo->view()->currentIndex(); Symbol *symbol = m_overviewModel->symbolFromIndex(index); if (! symbol) @@ -339,12 +351,14 @@ void CPPEditor::jumpToMethod(int) void CPPEditor::updateMethodBoxIndex() { + if (m_methodCombo->model() != m_overviewModel) + return; int line = 0, column = 0; convertPosition(position(), &line, &column); QModelIndex lastIndex; - const int rc = m_overviewModel->rowCount(QModelIndex()); + const int rc = m_overviewModel->rowCount(); for (int row = 0; row < rc; ++row) { const QModelIndex index = m_overviewModel->index(row, 0, QModelIndex()); Symbol *symbol = m_overviewModel->symbolFromIndex(index); diff --git a/src/plugins/cppeditor/cppeditor.h b/src/plugins/cppeditor/cppeditor.h index 2420bcf4e5e..33745eddef2 100644 --- a/src/plugins/cppeditor/cppeditor.h +++ b/src/plugins/cppeditor/cppeditor.h @@ -42,6 +42,7 @@ QT_BEGIN_NAMESPACE class QAction; class QComboBox; +class QStringListModel; QT_END_NAMESPACE namespace Core { @@ -138,6 +139,7 @@ private: QList m_contexts; QComboBox *m_methodCombo; CPlusPlus::OverviewModel *m_overviewModel; + QStringListModel *m_noSymbolsModel; }; } // namespace Internal From 1b33b75fc3441d668d1b25e5a3110eee8f9015ec Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 5 Dec 2008 12:55:31 +0100 Subject: [PATCH 11/77] Fixes: Build on msvc RevBy: Found by me. (cherry picked from commit 58827feb20c58ae39c610149d94df5b1f739ce01) --- src/plugins/qt4projectmanager/qtversionmanager.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp index 0c68fcd98eb..012e05b858a 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.cpp +++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp @@ -963,7 +963,7 @@ void QtVersion::updateVersionInfo() const QString line = stream.readLine(); int index = line.indexOf(":"); if (index != -1) - m_versionInfo.insert(line.left(index), line.mid(index+1)); + m_versionInfo.insert(line.left(index), QDir::fromNativeSeparators(line.mid(index+1))); } } @@ -1035,6 +1035,7 @@ void QtVersion::updateMkSpec() const mkspec = mkspec.mid(QString("$$QT_BUILD_TREE/mkspecs/").length()); else if (mkspec.startsWith("$$QT_BUILD_TREE\\mkspecs\\")) mkspec = mkspec.mid(QString("$$QT_BUILD_TREE\\mkspecs\\").length()); + mkspec = QDir::fromNativeSeparators(mkspec); } break; } @@ -1097,10 +1098,11 @@ void QtVersion::updateMkSpec() const #endif } - int index =mkspec.lastIndexOf('/'); + int index = mkspec.lastIndexOf('/'); if(index == -1) index = mkspec.lastIndexOf('\\'); - if (index >= 0 && QDir(mkspec.left(index)).canonicalPath() == QDir(m_path + "/mkspecs/").canonicalPath()) + QString mkspecDir = QDir(m_path + "/mkspecs/").canonicalPath(); + if (index >= 0 && QDir(mkspec.left(index)).canonicalPath() == mkspecDir) mkspec = mkspec.mid(index+1).trimmed(); m_mkspec = mkspec; @@ -1112,7 +1114,7 @@ QString QtVersion::makeCommand() const { #ifdef Q_OS_WIN const QString &spec = mkspec(); - if (spec.startsWith("win32-msvc") || spec == QLatin1String("win32-icc")) + if (spec.contains("win32-msvc") || spec.contains(QLatin1String("win32-icc"))) return "nmake.exe"; else if(spec.startsWith("wince")) return "nmake.exe"; @@ -1149,7 +1151,7 @@ QtVersion::ToolchainType QtVersion::toolchainType() const if (!isValid()) return INVALID; const QString &spec = mkspec(); - if(spec.startsWith("win32-msvc") || spec == QLatin1String("win32-icc")) + if(spec.contains("win32-msvc") || spec.contains(QLatin1String("win32-icc"))) return MSVC; else if(spec == "win32-g++") return MinGW; From 440053f71e52c630ddf2da72d186b5c4f2f0d215 Mon Sep 17 00:00:00 2001 From: dt Date: Fri, 5 Dec 2008 16:30:26 +0100 Subject: [PATCH 12/77] Fixes: Add the cmakestep and makestep to a buildconfigratuion. Task: - RevBy: - AutoTest: - Details: Actually building only works on unix (since the generator is hardcoded.) and make is called without any parameters which is wrong. A lot is missing for basic build support, but this is a start. --- .../cmakeprojectmanager/cmakeproject.cpp | 22 +++++++++++++++++-- src/plugins/cmakeprojectmanager/cmakestep.cpp | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 1268c57b967..fe591fa0041 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -34,6 +34,8 @@ #include "cmakeproject.h" #include "cmakeprojectconstants.h" #include "cmakeprojectnodes.h" +#include "cmakestep.h" +#include "makestep.h" #include #include @@ -187,7 +189,7 @@ QString CMakeProject::buildDirectory(const QString &buildConfiguration) const { Q_UNUSED(buildConfiguration) //TODO - return ""; + return QFileInfo(m_fileName).absolutePath(); } ProjectExplorer::BuildStepConfigWidget *CMakeProject::createConfigWidget() @@ -230,7 +232,23 @@ void CMakeProject::saveSettingsImpl(ProjectExplorer::PersistentSettingsWriter &w void CMakeProject::restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader &reader) { // TODO - Q_UNUSED(reader) + Q_UNUSED(reader); + if (buildConfigurations().isEmpty()) { + // No build configuration, adding those + + // TODO do we want to create one build configuration per target? + // or how do we want to handle that? + + CMakeStep *cmakeStep = new CMakeStep(this); + MakeStep *makeStep = new MakeStep(this); + + insertBuildStep(0, cmakeStep); + insertBuildStep(1, makeStep); + + addBuildConfiguration("all"); + setActiveBuildConfiguration("all"); + } + // Restoring is fine } diff --git a/src/plugins/cmakeprojectmanager/cmakestep.cpp b/src/plugins/cmakeprojectmanager/cmakestep.cpp index 523741c92ba..0c267ca2c4c 100644 --- a/src/plugins/cmakeprojectmanager/cmakestep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakestep.cpp @@ -54,7 +54,7 @@ bool CMakeStep::init(const QString &buildConfiguration) setEnabled(buildConfiguration, true); setWorkingDirectory(buildConfiguration, m_pro->buildDirectory(buildConfiguration)); setCommand(buildConfiguration, "cmake"); // TODO give full path here? - setArguments(buildConfiguration, QStringList()); // TODO + setArguments(buildConfiguration, QStringList() << "-GUnix Makefiles"); // TODO setEnvironment(buildConfiguration, m_pro->environment(buildConfiguration)); return AbstractProcessStep::init(buildConfiguration); } From 0e8d02aab400f4cec14c29026350248d346874c1 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 5 Dec 2008 16:39:33 +0100 Subject: [PATCH 13/77] populate texteditor margin context menu --- shared/help/bookmarkmanager.h | 16 +++--- src/plugins/bookmarks/bookmarkmanager.cpp | 11 +++-- src/plugins/bookmarks/bookmarkmanager.h | 29 ++++++----- src/plugins/bookmarks/bookmarksplugin.cpp | 49 ++++++++++++++++++- src/plugins/bookmarks/bookmarksplugin.h | 29 +++++++++-- .../coreplugin/editormanager/ieditor.h | 2 +- src/plugins/cpptools/searchsymbols.h | 2 + src/plugins/debugger/debuggerplugin.cpp | 26 ++++++++++ src/plugins/debugger/debuggerplugin.h | 8 +++ 9 files changed, 143 insertions(+), 29 deletions(-) diff --git a/shared/help/bookmarkmanager.h b/shared/help/bookmarkmanager.h index a8afa867e65..c40d8672db0 100644 --- a/shared/help/bookmarkmanager.h +++ b/shared/help/bookmarkmanager.h @@ -95,8 +95,10 @@ private: QSortFilterProxyModel *proxyModel; }; -class TreeView : public QTreeView { +class TreeView : public QTreeView +{ Q_OBJECT + public: TreeView(QWidget* parent = 0) : QTreeView(parent) {} void subclassKeyPressEvent(QKeyEvent* event) @@ -159,18 +161,18 @@ class BookmarkManager : public QObject Q_OBJECT public: - BookmarkManager(QHelpEngineCore* helpEngine); + BookmarkManager(QHelpEngineCore *helpEngine); ~BookmarkManager(); - BookmarkModel* treeBookmarkModel(); - BookmarkModel* listBookmarkModel(); + BookmarkModel *treeBookmarkModel(); + BookmarkModel *listBookmarkModel(); void saveBookmarks(); QStringList bookmarkFolders() const; - QModelIndex addNewFolder(const QModelIndex& index); + QModelIndex addNewFolder(const QModelIndex &index); void removeBookmarkItem(QTreeView *treeView, const QModelIndex& index); - void showBookmarkDialog(QWidget* parent, const QString &name, const QString &url); - void addNewBookmark(const QModelIndex& index, const QString &name, const QString &url); + void showBookmarkDialog(QWidget *parent, const QString &name, const QString &url); + void addNewBookmark(const QModelIndex &index, const QString &name, const QString &url); void setupBookmarkModels(); private slots: diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp index 0e8482b6f98..fd4541a01dd 100644 --- a/src/plugins/bookmarks/bookmarkmanager.cpp +++ b/src/plugins/bookmarks/bookmarkmanager.cpp @@ -396,11 +396,16 @@ void BookmarkManager::toggleBookmark() if (!editor) return; - const QFileInfo fi(editor->file()->fileName()); - const int editorLine = editor->currentLine(); + toggleBookmark(editor->file()->fileName(), editor->currentLine()); +} + +void BookmarkManager::toggleBookmark(const QString &fileName, int lineNumber) +{ + const QFileInfo fi(fileName); + const int editorLine = lineNumber; // Remove any existing bookmark on this line - if (Bookmark *mark = findBookmark(fi.path(), fi.fileName(), editorLine)) { + if (Bookmark *mark = findBookmark(fi.path(), fi.fileName(), lineNumber)) { // TODO check if the bookmark is really on the same markable Interface removeBookmark(mark); return; diff --git a/src/plugins/bookmarks/bookmarkmanager.h b/src/plugins/bookmarks/bookmarkmanager.h index 3b03e32d670..d3a2fc9a322 100644 --- a/src/plugins/bookmarks/bookmarkmanager.h +++ b/src/plugins/bookmarks/bookmarkmanager.h @@ -34,15 +34,15 @@ #ifndef BOOKMARKMANAGER_H #define BOOKMARKMANAGER_H -#include -#include -#include -#include -#include - #include #include +#include +#include +#include +#include +#include + namespace ProjectExplorer { class SessionManager; } @@ -89,10 +89,16 @@ public: // this QItemSelectionModel is shared by all views QItemSelectionModel *selectionModel() const; - enum Roles {Filename = Qt::UserRole, LineNumber = Qt::UserRole + 1, Directory = Qt::UserRole + 2, LineText = Qt::UserRole + 3}; + enum Roles { + Filename = Qt::UserRole, + LineNumber = Qt::UserRole + 1, + Directory = Qt::UserRole + 2, + LineText = Qt::UserRole + 3 + }; public slots: void toggleBookmark(); + void toggleBookmark(const QString &fileName, int lineNumber); void nextInDocument(); void prevInDocument(); void next(); @@ -108,6 +114,7 @@ private slots: void updateActionStatus(); void gotoBookmark(Bookmark *bookmark); void loadBookmarks(); + private: TextEditor::ITextEditor *currentTextEditor() const; ProjectExplorer::SessionManager* sessionManager() const; @@ -120,8 +127,8 @@ private: static QString bookmarkToString(const Bookmark *b); void saveBookmarks(); - typedef QMultiMap FileNameBookmarksMap; - typedef QMap DirectoryFileBookmarksMap; + typedef QMultiMap FileNameBookmarksMap; + typedef QMap DirectoryFileBookmarksMap; DirectoryFileBookmarksMap m_bookmarksMap; Core::ICore *m_core; @@ -138,7 +145,7 @@ class BookmarkView : public QListView public: BookmarkView(QWidget *parent = 0); ~BookmarkView(); - void setModel(QAbstractItemModel * model); + void setModel(QAbstractItemModel *model); public slots: void gotoBookmark(const QModelIndex &index); protected slots: @@ -146,7 +153,7 @@ protected slots: void removeAll(); protected: void contextMenuEvent(QContextMenuEvent *event); - void removeBookmark(const QModelIndex& index); + void removeBookmark(const QModelIndex &index); private: BookmarkContext *m_bookmarkContext; QModelIndex m_contextMenuIndex; diff --git a/src/plugins/bookmarks/bookmarksplugin.cpp b/src/plugins/bookmarks/bookmarksplugin.cpp index fa749f7bef9..83c8ec397ee 100644 --- a/src/plugins/bookmarks/bookmarksplugin.cpp +++ b/src/plugins/bookmarks/bookmarksplugin.cpp @@ -36,17 +36,22 @@ #include "bookmarks_global.h" #include +#include #include +#include +#include #include #include #include #include +#include + #include -#include using namespace Bookmarks::Constants; using namespace Bookmarks::Internal; +using namespace TextEditor; BookmarksPlugin *BookmarksPlugin::m_instance = 0; @@ -159,6 +164,19 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *) updateActions(m_bookmarkManager->state()); addAutoReleasedObject(new BookmarkViewFactory(m_bookmarkManager)); + m_bookmarkMarginAction = new QAction(this); + m_bookmarkMarginAction->setText("Toggle Bookmark"); + //m_bookmarkAction->setIcon(QIcon(":/gdbdebugger/images/breakpoint.svg")); + connect(m_bookmarkMarginAction, SIGNAL(triggered()), + this, SLOT(bookmarkMarginActionTriggered())); + + // EditorManager + QObject *editorManager = m_core->editorManager(); + connect(editorManager, SIGNAL(editorAboutToClose(Core::IEditor*)), + this, SLOT(editorAboutToClose(Core::IEditor*))); + connect(editorManager, SIGNAL(editorOpened(Core::IEditor*)), + this, SLOT(editorOpened(Core::IEditor*))); + return true; } @@ -169,7 +187,6 @@ BookmarksPlugin::~BookmarksPlugin() void BookmarksPlugin::updateActions(int state) { - const bool hasbm = state >= BookmarkManager::HasBookMarks; const bool hasdocbm = state == BookmarkManager::HasBookmarksInDocument; @@ -182,4 +199,32 @@ void BookmarksPlugin::updateActions(int state) m_moveDownAction->setEnabled(hasbm); } +void BookmarksPlugin::editorOpened(Core::IEditor *editor) +{ + connect(editor, SIGNAL(markContextMenuRequested(TextEditor::ITextEditor*,int,QMenu*)), + this, SLOT(requestContextMenu(TextEditor::ITextEditor*,int,QMenu*))); +} + +void BookmarksPlugin::editorAboutToClose(Core::IEditor *editor) +{ + disconnect(editor, SIGNAL(markContextMenuRequested(TextEditor::ITextEditor*,int,QMenu*)), + this, SLOT(requestContextMenu(TextEditor::ITextEditor*,int,QMenu*))); +} + +void BookmarksPlugin::requestContextMenu(TextEditor::ITextEditor *editor, + int lineNumber, QMenu *menu) +{ + m_bookmarkMarginActionLineNumber = lineNumber; + m_bookmarkMarginActionFileName = editor->file()->fileName(); + menu->addAction(m_bookmarkMarginAction); +} + +void BookmarksPlugin::bookmarkMarginActionTriggered() +{ + m_bookmarkManager->toggleBookmark( + m_bookmarkMarginActionFileName, + m_bookmarkMarginActionLineNumber + ); +} + Q_EXPORT_PLUGIN(BookmarksPlugin) diff --git a/src/plugins/bookmarks/bookmarksplugin.h b/src/plugins/bookmarks/bookmarksplugin.h index a5d919eb974..2a60bb04a34 100644 --- a/src/plugins/bookmarks/bookmarksplugin.h +++ b/src/plugins/bookmarks/bookmarksplugin.h @@ -31,18 +31,26 @@ ** ***************************************************************************/ -#ifndef BOOKMARKS_H -#define BOOKMARKS_H +#ifndef BOOKMARKSPLUGIN_H +#define BOOKMARKSPLUGIN_H + +#include #include #include -#include - -QT_FORWARD_DECLARE_CLASS(QAction) +QT_BEGIN_NAMESPACE +class QAction; +class QMenu; +QT_END_NAMESPACE namespace Core { class ICore; +class IEditor; +} + +namespace TextEditor { +class ITextEditor; } namespace Bookmarks { @@ -67,6 +75,13 @@ public: public slots: void updateActions(int stateMask); +private slots: + void editorOpened(Core::IEditor *editor); + void editorAboutToClose(Core::IEditor *editor); + void requestContextMenu(TextEditor::ITextEditor *editor, + int lineNumber, QMenu *menu); + void bookmarkMarginActionTriggered(); + private: static BookmarksPlugin *m_instance; BookmarkManager *m_bookmarkManager; @@ -79,6 +94,10 @@ private: QAction *m_docNextAction; QAction *m_moveUpAction; QAction *m_moveDownAction; + + QAction *m_bookmarkMarginAction; + int m_bookmarkMarginActionLineNumber; + QString m_bookmarkMarginActionFileName; }; } // namespace Internal diff --git a/src/plugins/coreplugin/editormanager/ieditor.h b/src/plugins/coreplugin/editormanager/ieditor.h index 7cbac8130ff..1f087e67e97 100644 --- a/src/plugins/coreplugin/editormanager/ieditor.h +++ b/src/plugins/coreplugin/editormanager/ieditor.h @@ -100,4 +100,4 @@ signals: } // namespace Core -#endif //IEDITOR_H +#endif // IEDITOR_H diff --git a/src/plugins/cpptools/searchsymbols.h b/src/plugins/cpptools/searchsymbols.h index 948f9d78e84..1fe276b6bea 100644 --- a/src/plugins/cpptools/searchsymbols.h +++ b/src/plugins/cpptools/searchsymbols.h @@ -44,6 +44,8 @@ #include #include +#include + namespace CppTools { namespace Internal { diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index b11472a5243..feb63fa0c30 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -250,6 +250,12 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes m_gdbRunningContext = uidm->uniqueIdentifier(Constants::GDBRUNNING); + m_breakpointMarginAction = new QAction(this); + m_breakpointMarginAction->setText("Toggle Breakpoint"); + //m_breakpointMarginAction->setIcon(QIcon(":/gdbdebugger/images/breakpoint.svg")); + connect(m_breakpointMarginAction, SIGNAL(triggered()), + this, SLOT(breakpointMarginActionTriggered())); + //Core::IActionContainer *mcppcontext = // actionManager->actionContainer(CppEditor::Constants::M_CONTEXT); @@ -502,6 +508,8 @@ void DebuggerPlugin::editorOpened(Core::IEditor *editor) this, SLOT(requestMark(TextEditor::ITextEditor*,int))); connect(editor, SIGNAL(tooltipRequested(TextEditor::ITextEditor*,QPoint,int)), this, SLOT(showToolTip(TextEditor::ITextEditor*,QPoint,int))); + connect(textEditor, SIGNAL(markContextMenuRequested(TextEditor::ITextEditor*,int,QMenu*)), + this, SLOT(requestContextMenu(TextEditor::ITextEditor*,int,QMenu*))); } } @@ -512,9 +520,27 @@ void DebuggerPlugin::editorAboutToClose(Core::IEditor *editor) this, SLOT(requestMark(TextEditor::ITextEditor*,int))); disconnect(editor, SIGNAL(tooltipRequested(TextEditor::ITextEditor*,QPoint,int)), this, SLOT(showToolTip(TextEditor::ITextEditor*,QPoint,int))); + disconnect(textEditor, SIGNAL(markContextMenuRequested(TextEditor::ITextEditor*,int,QMenu*)), + this, SLOT(requestContextMenu(TextEditor::ITextEditor*,int,QMenu*))); } } +void DebuggerPlugin::requestContextMenu(TextEditor::ITextEditor *editor, + int lineNumber, QMenu *menu) +{ + m_breakpointMarginActionLineNumber = lineNumber; + m_breakpointMarginActionFileName = editor->file()->fileName(); + menu->addAction(m_breakpointMarginAction); +} + +void DebuggerPlugin::breakpointMarginActionTriggered() +{ + m_manager->toggleBreakpoint( + m_breakpointMarginActionFileName, + m_breakpointMarginActionLineNumber + ); +} + void DebuggerPlugin::requestMark(TextEditor::ITextEditor *editor, int lineNumber) { m_manager->toggleBreakpoint(editor->file()->fileName(), lineNumber); diff --git a/src/plugins/debugger/debuggerplugin.h b/src/plugins/debugger/debuggerplugin.h index 7dfcae1ffe7..91ffe4dbf77 100644 --- a/src/plugins/debugger/debuggerplugin.h +++ b/src/plugins/debugger/debuggerplugin.h @@ -84,10 +84,14 @@ private slots: void setSessionValue(const QString &name, const QVariant &value); void queryConfigValue(const QString &name, QVariant *value); void setConfigValue(const QString &name, const QVariant &value); + void requestContextMenu(TextEditor::ITextEditor *editor, + int lineNumber, QMenu *menu); void resetLocation(); void gotoLocation(const QString &fileName, int line, bool setMarker); + void breakpointMarginActionTriggered(); + private: friend class DebuggerManager; friend class DebugMode; // FIXME: Just a hack now so that it can access the views @@ -104,6 +108,10 @@ private: QString m_previousMode; LocationMark *m_locationMark; int m_gdbRunningContext; + + QAction *m_breakpointMarginAction; + int m_breakpointMarginActionLineNumber; + QString m_breakpointMarginActionFileName; }; } // namespace Internal From 9ef62848ac042fce4f38e1e0779c249c42f600ad Mon Sep 17 00:00:00 2001 From: mae Date: Fri, 5 Dec 2008 17:06:17 +0100 Subject: [PATCH 14/77] avoid parentheses matching flicker when navigationt to block end / start. --- src/plugins/texteditor/basetexteditor.cpp | 29 ++++++++++++++++++----- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 49d29b75c93..82a4201b264 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -602,29 +602,44 @@ void BaseTextEditor::slotSelectionChanged() void BaseTextEditor::gotoBlockStart() { QTextCursor cursor = textCursor(); - if (TextBlockUserData::findPreviousOpenParenthesis(&cursor, false)) + if (TextBlockUserData::findPreviousOpenParenthesis(&cursor, false)) { setTextCursor(cursor); + _q_matchParentheses(); + } } void BaseTextEditor::gotoBlockEnd() { QTextCursor cursor = textCursor(); - if (TextBlockUserData::findNextClosingParenthesis(&cursor, false)) + if (TextBlockUserData::findNextClosingParenthesis(&cursor, false)) { setTextCursor(cursor); + _q_matchParentheses(); + } } void BaseTextEditor::gotoBlockStartWithSelection() { QTextCursor cursor = textCursor(); - if (TextBlockUserData::findPreviousOpenParenthesis(&cursor, true)) + if (TextBlockUserData::findPreviousOpenParenthesis(&cursor, true)) { setTextCursor(cursor); + _q_matchParentheses(); + } } void BaseTextEditor::gotoBlockEndWithSelection() { QTextCursor cursor = textCursor(); - if (TextBlockUserData::findNextClosingParenthesis(&cursor, true)) + if (TextBlockUserData::findNextClosingParenthesis(&cursor, true)) { setTextCursor(cursor); + _q_matchParentheses(); + } +} + +static QTextCursor flippedCursor(const QTextCursor &cursor) { + QTextCursor flipped = cursor; + flipped.clearSelection(); + flipped.setPosition(cursor.anchor(), QTextCursor::KeepAnchor); + return flipped; } void BaseTextEditor::selectBlockUp() @@ -640,7 +655,8 @@ void BaseTextEditor::selectBlockUp() return; if (!TextBlockUserData::findNextClosingParenthesis(&cursor, true)) return; - setTextCursor(cursor); + setTextCursor(flippedCursor(cursor)); + _q_matchParentheses(); } void BaseTextEditor::selectBlockDown() @@ -663,7 +679,8 @@ void BaseTextEditor::selectBlockDown() if ( cursor != d->m_selectBlockAnchor) TextBlockUserData::findNextClosingParenthesis(&cursor, true); - setTextCursor(cursor); + setTextCursor(flippedCursor(cursor)); + _q_matchParentheses(); } From 38b04c737be4adfc51a5ba157950da1d5c103214 Mon Sep 17 00:00:00 2001 From: goro Date: Fri, 5 Dec 2008 17:55:09 +0100 Subject: [PATCH 15/77] Bump two plugins from version 0.1 to 0.9.1 --- src/plugins/cpaster/CodePaster.pluginspec | 2 +- src/plugins/git/ScmGit.pluginspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/cpaster/CodePaster.pluginspec b/src/plugins/cpaster/CodePaster.pluginspec index 2ddd73902e5..7a1be0b8763 100644 --- a/src/plugins/cpaster/CodePaster.pluginspec +++ b/src/plugins/cpaster/CodePaster.pluginspec @@ -1,4 +1,4 @@ - + Nokia Corporation (C) 2008 Nokia Corporation Nokia Technology Preview License Agreement diff --git a/src/plugins/git/ScmGit.pluginspec b/src/plugins/git/ScmGit.pluginspec index 689cc30a579..1f511448a07 100644 --- a/src/plugins/git/ScmGit.pluginspec +++ b/src/plugins/git/ScmGit.pluginspec @@ -1,4 +1,4 @@ - + Nokia Corporation (C) 2008 Nokia Corporation Nokia Technology Preview License Agreement From d8b343afa1fc753b5f2f68377b06e7e3bf406baf Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 5 Dec 2008 18:27:45 +0100 Subject: [PATCH 16/77] silence warning --- bin/gdbmacros/gdbmacros.cpp | 5 ++++- src/plugins/cpptools/rpp/pp-fwd.h | 0 src/plugins/debugger/debuggeroutputwindow.cpp | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 src/plugins/cpptools/rpp/pp-fwd.h diff --git a/bin/gdbmacros/gdbmacros.cpp b/bin/gdbmacros/gdbmacros.cpp index 0d6575db5b7..2043f65973d 100644 --- a/bin/gdbmacros/gdbmacros.cpp +++ b/bin/gdbmacros/gdbmacros.cpp @@ -1674,7 +1674,10 @@ static void qDumpQObjectSignal(QDumper &d) d.beginHash(); P(d, "name", "[" << i << "] slot"); P(d, "type", ""); - P(d, "value", conn.receiver->metaObject()->method(conn.method).signature()); + if (conn.receiver) + P(d, "value", conn.receiver->metaObject()->method(conn.method).signature()); + else + P(d, "value", ""); P(d, "numchild", "0"); d.endHash(); d.beginHash(); diff --git a/src/plugins/cpptools/rpp/pp-fwd.h b/src/plugins/cpptools/rpp/pp-fwd.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/debugger/debuggeroutputwindow.cpp b/src/plugins/debugger/debuggeroutputwindow.cpp index 7dc293cf35a..cfcd8df36d8 100644 --- a/src/plugins/debugger/debuggeroutputwindow.cpp +++ b/src/plugins/debugger/debuggeroutputwindow.cpp @@ -285,6 +285,7 @@ void DebuggerOutputWindow::showOutput(const QString &prefix, const QString &outp void DebuggerOutputWindow::showInput(const QString &prefix, const QString &input) { + Q_UNUSED(prefix); m_inputText->append(input); QTextCursor cursor = m_inputText->textCursor(); cursor.movePosition(QTextCursor::End); From 5b3e95fe77e16de6f93ad198a245fa4698c940ad Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 5 Dec 2008 18:29:19 +0100 Subject: [PATCH 17/77] tiny whitespace --- src/app/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index 68dfa3e3b23..ad61ab0c750 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -212,9 +212,9 @@ int main(int argc, char **argv) pluginManager.setPluginPaths(pluginPaths); const QStringList arguments = app.arguments(); - QMap foundAppOptions; + QMap foundAppOptions; if (arguments.size() > 1) { - QMap appOptions; + QMap appOptions; appOptions.insert(QLatin1String(HELP_OPTION1), false); appOptions.insert(QLatin1String(HELP_OPTION2), false); appOptions.insert(QLatin1String(HELP_OPTION3), false); From 0d46571eb3b4777abde3921d763551a917955017 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 5 Dec 2008 18:44:09 +0100 Subject: [PATCH 18/77] fix QSet custom dumper for namespaced Qt --- bin/gdbmacros/gdbmacros.cpp | 4 ++-- tests/manual/gdbdebugger/simple/app.cpp | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/bin/gdbmacros/gdbmacros.cpp b/bin/gdbmacros/gdbmacros.cpp index 2043f65973d..05488a85125 100644 --- a/bin/gdbmacros/gdbmacros.cpp +++ b/bin/gdbmacros/gdbmacros.cpp @@ -1869,8 +1869,8 @@ static void qDumpQSet(QDumper &d) d.beginHash(); P(d, "name", "[" << i << "]"); P(d, "type", d.innertype); - P(d, "exp", "(('QHashNode<" << d.innertype - << ",QHashDummyValue>'*)" + P(d, "exp", "(('"NS"QHashNode<" << d.innertype + << ","NS"QHashDummyValue>'*)" << static_cast(node) << ")->key" ); d.endHash(); diff --git a/tests/manual/gdbdebugger/simple/app.cpp b/tests/manual/gdbdebugger/simple/app.cpp index b00a259457e..4a1ec67e7ab 100644 --- a/tests/manual/gdbdebugger/simple/app.cpp +++ b/tests/manual/gdbdebugger/simple/app.cpp @@ -351,6 +351,23 @@ void testPlugin() } } +void testSet() +{ + QSet hgg0; + hgg0.insert(11); + hgg0.insert(22); + + QSet hgg1; + hgg1.insert("22.0"); + + QObject ob; + QSet > hash; + QPointer ptr(&ob); + //hash.insert(ptr); + //hash.insert(ptr); + //hash.insert(ptr); +} + void stringRefTest(const QString &refstring) { Q_UNUSED(refstring); @@ -759,6 +776,7 @@ int main(int argc, char *argv[]) testImage(); testMap(); testString(); + testSet(); testStringList(); testStruct(); //testThreads(); From 881610dfd2ee0f8450b3f1aec78c9a5a6ff76b43 Mon Sep 17 00:00:00 2001 From: goro Date: Fri, 5 Dec 2008 18:51:07 +0100 Subject: [PATCH 19/77] Migrate subversion plugin to extended PathChooser --- src/libs/utils/pathchooser.cpp | 133 +++++++++++++++++++----- src/libs/utils/pathchooser.h | 20 +++- src/plugins/subversion/settingspage.cpp | 17 ++- src/plugins/subversion/settingspage.h | 3 - src/plugins/subversion/settingspage.ui | 20 ++-- 5 files changed, 144 insertions(+), 49 deletions(-) diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index 340dbcad36a..68ebe9cbbfd 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -48,40 +48,54 @@ namespace Core { namespace Utils { +#ifdef Q_OS_OSX +/*static*/ const char * const PathChooser::browseButtonLabel = "Choose..."; +#else +/*static*/ const char * const PathChooser::browseButtonLabel = "Browse..."; +#endif + // ------------------ PathValidatingLineEdit class PathValidatingLineEdit : public BaseValidatingLineEdit { public: - explicit PathValidatingLineEdit(QWidget *parent = 0); + explicit PathValidatingLineEdit(PathChooser *chooser, QWidget *parent = 0); protected: virtual bool validate(const QString &value, QString *errorMessage) const; + +private: + PathChooser *m_chooser; }; -PathValidatingLineEdit::PathValidatingLineEdit(QWidget *parent) : - BaseValidatingLineEdit(parent) +PathValidatingLineEdit::PathValidatingLineEdit(PathChooser *chooser, QWidget *parent) : + BaseValidatingLineEdit(parent), + m_chooser(chooser) { + Q_ASSERT(chooser != NULL); } bool PathValidatingLineEdit::validate(const QString &value, QString *errorMessage) const { - return PathChooser::validatePath(value, errorMessage); + return m_chooser->validatePath(value, errorMessage); } // ------------------ PathChooserPrivate struct PathChooserPrivate { - PathChooserPrivate(); + PathChooserPrivate(PathChooser *chooser); PathValidatingLineEdit *m_lineEdit; + PathChooser::Kind m_acceptingKind; + QString m_dialogTitleOverride; }; -PathChooserPrivate::PathChooserPrivate() : - m_lineEdit(new PathValidatingLineEdit) +PathChooserPrivate::PathChooserPrivate(PathChooser *chooser) : + m_lineEdit(new PathValidatingLineEdit(chooser)), + m_acceptingKind(PathChooser::Directory) { } PathChooser::PathChooser(QWidget *parent) : QWidget(parent), - m_d(new PathChooserPrivate) + m_d(new PathChooserPrivate(this)) { QHBoxLayout *hLayout = new QHBoxLayout; hLayout->setContentsMargins(0, 0, 0, 0); @@ -90,11 +104,12 @@ PathChooser::PathChooser(QWidget *parent) : connect(m_d->m_lineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(changed())); connect(m_d->m_lineEdit, SIGNAL(validChanged()), this, SIGNAL(validChanged())); - m_d->m_lineEdit->setMinimumWidth(300); + m_d->m_lineEdit->setMinimumWidth(260); hLayout->addWidget(m_d->m_lineEdit); + hLayout->setSizeConstraint(QLayout::SetMinimumSize); QToolButton *browseButton = new QToolButton; - browseButton->setText(tr("...")); + browseButton->setText(tr(browseButtonLabel)); connect(browseButton, SIGNAL(clicked()), this, SLOT(slotBrowse())); hLayout->addWidget(browseButton); @@ -123,8 +138,28 @@ void PathChooser::slotBrowse() QString predefined = path(); if (!predefined.isEmpty() && !QFileInfo(predefined).isDir()) predefined.clear(); - // Prompt for a directory, delete trailing slashes unless it is "/", only - QString newPath = QFileDialog::getExistingDirectory(this, tr("Choose a path"), predefined); + + // Prompt for a file/dir + QString dialogTitle; + QString newPath; + switch (m_d->m_acceptingKind) { + case PathChooser::Directory: + newPath = QFileDialog::getExistingDirectory(this, + makeDialogTitle(tr("Choose a directory")), predefined); + break; + + case PathChooser::File: // fall through + case PathChooser::Command: + newPath = QFileDialog::getOpenFileName(this, + makeDialogTitle(tr("Choose a file")), predefined); + break; + + default: + ; + } + + // TODO make cross-platform + // Delete trailing slashes unless it is "/", only if (!newPath .isEmpty()) { if (newPath .size() > 1 && newPath .endsWith(QDir::separator())) newPath .truncate(newPath .size() - 1); @@ -149,20 +184,52 @@ bool PathChooser::validatePath(const QString &path, QString *errorMessage) *errorMessage = tr("The path must not be empty."); return false; } - // Must be a directory? - const QFileInfo fi(path); - if (fi.isDir()) - return true; // Happy! - if (!fi.exists()) { - if (errorMessage) - *errorMessage = tr("The path '%1' does not exist.").arg(path); - return false; + const QFileInfo fi(path); + const bool isDir = fi.isDir(); + + // Check if existing + switch (m_d->m_acceptingKind) { + case PathChooser::Directory: // fall through + case PathChooser::File: + if (!fi.exists()) { + if (errorMessage) + *errorMessage = tr("The path '%1' does not exist.").arg(path); + return false; + } + break; + + case PathChooser::Command: // fall through + default: + ; } - // Must be something weird - if (errorMessage) - *errorMessage = tr("The path '%1' is not a directory.").arg(path); - return false; + + // Check expected kind + switch (m_d->m_acceptingKind) { + case PathChooser::Directory: + if (!isDir) + if (errorMessage) + *errorMessage = tr("The path '%1' is not a directory.").arg(path); + return false; + break; + + case PathChooser::File: + if (isDir) + if (errorMessage) + *errorMessage = tr("The path '%1' is not a file.").arg(path); + return false; + break; + + case PathChooser::Command: + // TODO do proper command validation + // i.e. search $PATH for a matching file + break; + + default: + ; + } + + return true; } QString PathChooser::label() @@ -182,5 +249,23 @@ QString PathChooser::homePath() #endif } +void PathChooser::setExpectedKind(Kind expected) +{ + m_d->m_acceptingKind = expected; +} + +void PathChooser::setPromptDialogTitle(const QString &title) +{ + m_d->m_dialogTitleOverride = title; +} + +QString PathChooser::makeDialogTitle(const QString &title) +{ + if (m_d->m_dialogTitleOverride.isNull()) + return title; + else + return m_d->m_dialogTitleOverride; +} + } // namespace Utils } // namespace Core diff --git a/src/libs/utils/pathchooser.h b/src/libs/utils/pathchooser.h index ab821d5df1e..d4bd098e908 100644 --- a/src/libs/utils/pathchooser.h +++ b/src/libs/utils/pathchooser.h @@ -54,9 +54,23 @@ class QWORKBENCH_UTILS_EXPORT PathChooser : public QWidget Q_PROPERTY(QString path READ path WRITE setPath DESIGNABLE true) public: + static const char * const browseButtonLabel; + explicit PathChooser(QWidget *parent = 0); virtual ~PathChooser(); + enum Kind { + Directory, + File, + Command, + // ,Any + }; + + // Default is + void setExpectedKind(Kind expected); + + void setPromptDialogTitle(const QString &title); + bool isValid() const; QString errorMessage() const; @@ -65,11 +79,15 @@ public: // Returns the suggested label title when used in a form layout static QString label(); - static bool validatePath(const QString &path, QString *errorMessage = 0); + bool validatePath(const QString &path, QString *errorMessage = 0); // Return the home directory, which needs some fixing under Windows. static QString homePath(); +private: + // Returns overridden title or the one from + QString makeDialogTitle(const QString &title); + signals: void validChanged(); void changed(); diff --git a/src/plugins/subversion/settingspage.cpp b/src/plugins/subversion/settingspage.cpp index ab785db796e..4621928b963 100644 --- a/src/plugins/subversion/settingspage.cpp +++ b/src/plugins/subversion/settingspage.cpp @@ -39,20 +39,24 @@ #include <extensionsystem/pluginmanager.h> #include <QtGui/QFileDialog> +#include <utils/pathchooser.h> using namespace Subversion::Internal; +using namespace Core::Utils; + SettingsPageWidget::SettingsPageWidget(QWidget *parent) : QWidget(parent) { m_ui.setupUi(this); - connect(m_ui.browseButton, SIGNAL(clicked()), this, SLOT(browseForCommand())); + m_ui.pathChooser->setExpectedKind(PathChooser::Command); + m_ui.pathChooser->setPromptDialogTitle(tr("Subversion Command")); } SubversionSettings SettingsPageWidget::settings() const { SubversionSettings rc; - rc.svnCommand = m_ui.svnCmdLineEdit->text(); + rc.svnCommand = m_ui.pathChooser->path(); rc.useAuthentication = m_ui.userGroupBox->isChecked(); rc.user = m_ui.usernameLineEdit->text(); rc.password = m_ui.passwordLineEdit->text(); @@ -63,19 +67,12 @@ SubversionSettings SettingsPageWidget::settings() const void SettingsPageWidget::setSettings(const SubversionSettings &s) { - m_ui.svnCmdLineEdit->setText(s.svnCommand); + m_ui.pathChooser->setPath(s.svnCommand); m_ui.usernameLineEdit->setText(s.user); m_ui.passwordLineEdit->setText(s.password); m_ui.userGroupBox->setChecked(s.useAuthentication); } -void SettingsPageWidget::browseForCommand() -{ - QString cmd = QFileDialog::getOpenFileName(window(), tr("Subversion Command")); - if (!cmd.isEmpty()) - m_ui.svnCmdLineEdit->setText(cmd); -} - SettingsPage::SettingsPage() { } diff --git a/src/plugins/subversion/settingspage.h b/src/plugins/subversion/settingspage.h index f32401b6d93..8ac704f0727 100644 --- a/src/plugins/subversion/settingspage.h +++ b/src/plugins/subversion/settingspage.h @@ -59,9 +59,6 @@ public: SubversionSettings settings() const; void setSettings(const SubversionSettings &); -private slots:; - void browseForCommand(); - private: Ui::SettingsPage m_ui; }; diff --git a/src/plugins/subversion/settingspage.ui b/src/plugins/subversion/settingspage.ui index 14e5ebce87e..21b20187bbd 100644 --- a/src/plugins/subversion/settingspage.ui +++ b/src/plugins/subversion/settingspage.ui @@ -32,14 +32,7 @@ </widget> </item> <item> - <widget class="QLineEdit" name="svnCmdLineEdit"/> - </item> - <item> - <widget class="QToolButton" name="browseButton"> - <property name="text"> - <string>...</string> - </property> - </widget> + <widget class="Core::Utils::PathChooser" name="pathChooser" native="true"/> </item> </layout> </item> @@ -109,9 +102,14 @@ </item> </layout> </widget> - <tabstops> - <tabstop>svnCmdLineEdit</tabstop> - </tabstops> + <customwidgets> + <customwidget> + <class>Core::Utils::PathChooser</class> + <extends>QWidget</extends> + <header location="global">utils/pathchooser.h</header> + <container>1</container> + </customwidget> + </customwidgets> <resources/> <connections/> </ui> From 9bfb54f59a325bd3fb6fdbaca85a3a342e0b1ef8 Mon Sep 17 00:00:00 2001 From: goro <qtc-committer@nokia.com> Date: Fri, 5 Dec 2008 19:11:06 +0100 Subject: [PATCH 20/77] Migrate Perforce plugin to PathChooser --- src/plugins/perforce/settingspage.cpp | 16 +++++----------- src/plugins/perforce/settingspage.h | 3 --- src/plugins/perforce/settingspage.ui | 18 +++++++++--------- 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/src/plugins/perforce/settingspage.cpp b/src/plugins/perforce/settingspage.cpp index 5fd7dda4862..b5cbd7fa000 100644 --- a/src/plugins/perforce/settingspage.cpp +++ b/src/plugins/perforce/settingspage.cpp @@ -39,18 +39,20 @@ #include <QtGui/QFileDialog> using namespace Perforce::Internal; +using namespace Core::Utils; SettingsPageWidget::SettingsPageWidget(QWidget *parent) : QWidget(parent) { m_ui.setupUi(this); - connect(m_ui.browseButton, SIGNAL(clicked()), this, SLOT(browseForCommand())); + m_ui.pathChooser->setPromptDialogTitle(tr("Perforce Command")); + m_ui.pathChooser->setExpectedKind(PathChooser::Command); } PerforceSettings SettingsPageWidget::settings() const { PerforceSettings rc; - rc.p4Command = m_ui.p4CmdLineEdit->text(); + rc.p4Command = m_ui.pathChooser->path(); rc.defaultEnv = m_ui.defaultCheckBox->isChecked(); rc.p4Port = m_ui.portLineEdit->text(); rc.p4Client = m_ui.clientLineEdit->text(); @@ -60,21 +62,13 @@ PerforceSettings SettingsPageWidget::settings() const void SettingsPageWidget::setSettings(const PerforceSettings &s) { - m_ui.p4CmdLineEdit->setText(s.p4Command); + m_ui.pathChooser->setPath(s.p4Command); m_ui.defaultCheckBox->setChecked(s.defaultEnv); m_ui.portLineEdit->setText(s.p4Port); m_ui.clientLineEdit->setText(s.p4Client); m_ui.userLineEdit->setText(s.p4User); } -void SettingsPageWidget::browseForCommand() -{ - const QString cmd = QFileDialog::getOpenFileName(window(), tr("Perforce Command")); - if (!cmd.isEmpty()) - m_ui.p4CmdLineEdit->setText(cmd); -} - - SettingsPage::SettingsPage() { } diff --git a/src/plugins/perforce/settingspage.h b/src/plugins/perforce/settingspage.h index f73a205e112..23e96812573 100644 --- a/src/plugins/perforce/settingspage.h +++ b/src/plugins/perforce/settingspage.h @@ -54,9 +54,6 @@ public: PerforceSettings settings() const; void setSettings(const PerforceSettings &); -private slots:; - void browseForCommand(); - private: Ui::SettingsPage m_ui; }; diff --git a/src/plugins/perforce/settingspage.ui b/src/plugins/perforce/settingspage.ui index 1379b7b6666..b2d6bf10e35 100644 --- a/src/plugins/perforce/settingspage.ui +++ b/src/plugins/perforce/settingspage.ui @@ -36,14 +36,7 @@ </widget> </item> <item> - <widget class="QLineEdit" name="p4CmdLineEdit"/> - </item> - <item> - <widget class="QToolButton" name="browseButton"> - <property name="text"> - <string>...</string> - </property> - </widget> + <widget class="Core::Utils::PathChooser" name="pathChooser" native="true"/> </item> </layout> </item> @@ -120,11 +113,18 @@ </item> </layout> </widget> + <customwidgets> + <customwidget> + <class>Core::Utils::PathChooser</class> + <extends>QWidget</extends> + <header location="global">utils/pathchooser.h</header> + <container>1</container> + </customwidget> + </customwidgets> <tabstops> <tabstop>portLineEdit</tabstop> <tabstop>clientLineEdit</tabstop> <tabstop>userLineEdit</tabstop> - <tabstop>p4CmdLineEdit</tabstop> </tabstops> <resources/> <connections> From 44cc9a2b400a4c695d9f21cce9cebee0d571318a Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Mon, 8 Dec 2008 10:25:39 +0100 Subject: [PATCH 21/77] fix expansion state of "dummy" items in locals&watchers after frame changes --- bin/gdbmacros/gdbmacros.cpp | 10 +- src/plugins/debugger/watchhandler.cpp | 128 ++++++++++++++------------ src/plugins/debugger/watchhandler.h | 1 - src/plugins/debugger/watchwindow.cpp | 14 +-- src/plugins/debugger/watchwindow.h | 1 - 5 files changed, 84 insertions(+), 70 deletions(-) diff --git a/bin/gdbmacros/gdbmacros.cpp b/bin/gdbmacros/gdbmacros.cpp index 05488a85125..199b783f45d 100644 --- a/bin/gdbmacros/gdbmacros.cpp +++ b/bin/gdbmacros/gdbmacros.cpp @@ -1864,7 +1864,7 @@ static void qDumpQSet(QDumper &d) n = 100; d << ",children=["; int i = 0; - for (int bucket = 0; bucket != hd->numBuckets; ++bucket) { + for (int bucket = 0; bucket != hd->numBuckets && i <= 10000; ++bucket) { for (node = hd->buckets[bucket]; node->next; node = node->next) { d.beginHash(); P(d, "name", "[" << i << "]"); @@ -1875,6 +1875,14 @@ static void qDumpQSet(QDumper &d) ); d.endHash(); ++i; + if (i > 10000) { + d.beginHash(); + P(d, "name", "Warning:"); + P(d, "value", "<incomplete>"); + P(d, "type", ""); + d.endHash(); + break; + } } } d << "]"; diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 3d99a84ad34..1792e4705d6 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -320,6 +320,51 @@ static WatchData take(const QString &iname, QList<WatchData> *list) } +static QList<WatchData> initialSet() +{ + QList<WatchData> result; + + WatchData root; + root.state = 0; + root.level = 0; + root.row = 0; + root.name = "Root"; + root.parentIndex = -1; + root.childIndex.append(1); + root.childIndex.append(2); + root.childIndex.append(3); + result.append(root); + + WatchData local; + local.iname = "local"; + local.name = "Locals"; + local.state = 0; + local.level = 1; + local.row = 0; + local.parentIndex = 0; + result.append(local); + + WatchData tooltip; + tooltip.iname = "tooltip"; + tooltip.name = "Tooltip"; + tooltip.state = 0; + tooltip.level = 1; + tooltip.row = 1; + tooltip.parentIndex = 0; + result.append(tooltip); + + WatchData watch; + watch.iname = "watch"; + watch.name = "Watchers"; + watch.state = 0; + watch.level = 1; + watch.row = 2; + watch.parentIndex = 0; + result.append(watch); + + return result; +} + /////////////////////////////////////////////////////////////////////// // // WatchHandler @@ -332,7 +377,8 @@ WatchHandler::WatchHandler() m_inFetchMore = false; m_inChange = false; - cleanModel(); + m_completeSet = initialSet(); + m_incompleteSet.clear(); m_displaySet = m_completeSet; } @@ -380,6 +426,7 @@ QVariant WatchHandler::data(const QModelIndex &idx, int role) const int node = idx.internalId(); if (node < 0) return QVariant(); + QWB_ASSERT(node < m_displaySet.size(), return QVariant()); const WatchData &data = m_displaySet.at(node); @@ -558,10 +605,13 @@ void WatchHandler::rebuildModel() MODEL_DEBUG("RECREATE MODEL, CURRENT SET:\n" << toString()); #endif + QHash<QString, int> oldTopINames; QHash<QString, QString> oldValues; for (int i = 0, n = m_oldSet.size(); i != n; ++i) { WatchData &data = m_oldSet[i]; oldValues[data.iname] = data.value; + if (data.level == 2) + ++oldTopINames[data.iname]; } #ifdef DEBUG_PENDING MODEL_DEBUG("OLD VALUES: " << oldValues); @@ -575,6 +625,9 @@ void WatchHandler::rebuildModel() qSort(m_completeSet.begin(), m_completeSet.end(), &iNameSorter); + // This helps to decide whether the view has completely changed or not. + QHash<QString, int> topINames; + QHash<QString, int> iname2idx; for (int i = m_completeSet.size(); --i > 0; ) { @@ -582,7 +635,10 @@ void WatchHandler::rebuildModel() data.parentIndex = 0; data.childIndex.clear(); iname2idx[data.iname] = i; + if (data.level == 2) + ++topINames[data.iname]; } + //qDebug() << "TOPINAMES: " << topINames << "\nOLD: " << oldTopINames; for (int i = 1; i < m_completeSet.size(); ++i) { WatchData &data = m_completeSet[i]; @@ -603,7 +659,13 @@ void WatchHandler::rebuildModel() && data.value != strNotInScope; } - //emit layoutAboutToBeChanged(); + emit layoutAboutToBeChanged(); + + if (oldTopINames != topINames) { + m_displaySet = initialSet(); + m_expandedINames.clear(); + emit reset(); + } m_displaySet = m_completeSet; @@ -668,11 +730,6 @@ void WatchHandler::rebuildModel() emit reset(); //qDebug() << "WATCHHANDLER: RESET EMITTED"; m_inChange = false; - //emit layoutChanged(); - //QSet<QString> einames = m_expandedINames; - //einames.insert("local"); - //einames.insert("watch"); - //emit expandedItems(einames); #if DEBUG_MODEL #if USE_MODEL_TEST @@ -691,8 +748,11 @@ void WatchHandler::cleanup() m_oldSet.clear(); m_expandedINames.clear(); m_displayedINames.clear(); - cleanModel(); + + m_incompleteSet.clear(); + m_completeSet = initialSet(); m_displaySet = m_completeSet; + #if 0 for (EditWindows::ConstIterator it = m_editWindows.begin(); it != m_editWindows.end(); ++it) { @@ -707,7 +767,7 @@ void WatchHandler::cleanup() void WatchHandler::collapseChildren(const QModelIndex &idx) { if (m_inChange || m_completeSet.isEmpty()) { - //qDebug() << "WATCHHANDLER: COLLAPSE IGNORED" << idx; + qDebug() << "WATCHHANDLER: COLLAPSE IGNORED" << idx; return; } QWB_ASSERT(checkIndex(idx.internalId()), return); @@ -879,56 +939,10 @@ void WatchHandler::removeWatchExpression(const QString &iname) emit watchModelUpdateRequested(); } -void WatchHandler::cleanModel() -{ - // This uses data stored in m_oldSet to re-create a new set - // one-by-one - m_completeSet.clear(); - m_incompleteSet.clear(); - - WatchData root; - root.state = 0; - root.level = 0; - root.row = 0; - root.name = "Root"; - root.parentIndex = -1; - root.childIndex.append(1); - root.childIndex.append(2); - root.childIndex.append(3); - m_completeSet.append(root); - - WatchData local; - local.iname = "local"; - local.name = "Locals"; - local.state = 0; - local.level = 1; - local.row = 0; - local.parentIndex = 0; - m_completeSet.append(local); - - WatchData tooltip; - tooltip.iname = "tooltip"; - tooltip.name = "Tooltip"; - tooltip.state = 0; - tooltip.level = 1; - tooltip.row = 1; - tooltip.parentIndex = 0; - m_completeSet.append(tooltip); - - WatchData watch; - watch.iname = "watch"; - watch.name = "Watchers"; - watch.state = 0; - watch.level = 1; - watch.row = 2; - watch.parentIndex = 0; - m_completeSet.append(watch); -} - - void WatchHandler::reinitializeWatchers() { - cleanModel(); + m_completeSet = initialSet(); + m_incompleteSet.clear(); // copy over all watchers and mark all watchers as incomplete for (int i = 0, n = m_oldSet.size(); i < n; ++i) { diff --git a/src/plugins/debugger/watchhandler.h b/src/plugins/debugger/watchhandler.h index 3841d55d300..989b99b3d22 100644 --- a/src/plugins/debugger/watchhandler.h +++ b/src/plugins/debugger/watchhandler.h @@ -192,7 +192,6 @@ signals: private: WatchData takeData(const QString &iname); QString toString() const; - void cleanModel(); bool m_expandPointers; bool m_inChange; diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index 78366198955..d528bf09242 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -57,7 +57,6 @@ enum { INameRole = Qt::UserRole, VisualRole }; WatchWindow::WatchWindow(Type type, QWidget *parent) : QTreeView(parent), m_type(type) { - m_blocked = false; setWindowTitle(tr("Locals and Watchers")); setAlternatingRowColors(true); setIndentation(indentation() * 9/10); @@ -76,12 +75,8 @@ void WatchWindow::expandNode(const QModelIndex &idx) //QModelIndex mi0 = idx.sibling(idx.row(), 0); //QString iname = model()->data(mi0, INameRole).toString(); //QString name = model()->data(mi0, Qt::DisplayRole).toString(); - //qDebug() << "\n\nEXPAND NODE " // << iname << name - // << idx << (m_blocked ? "blocked" : "passed"); //if (isExpanded(idx)) // return; - //if (m_blocked) - // return; emit requestExpandChildren(idx); } @@ -91,8 +86,6 @@ void WatchWindow::collapseNode(const QModelIndex &idx) //QString iname = model()->data(mi0, INameRole).toString(); //QString name = model()->data(mi0, Qt::DisplayRole).toString(); //qDebug() << "COLLAPSE NODE " << idx; - if (m_blocked) - return; emit requestCollapseChildren(idx); } @@ -201,7 +194,6 @@ void WatchWindow::setModel(QAbstractItemModel *model) void WatchWindow::modelAboutToBeReset() { - m_blocked = true; //qDebug() << "Model about to be reset"; m_expandedItems.clear(); m_expandedItems.insert("local"); @@ -225,10 +217,9 @@ void WatchWindow::modelAboutToBeResetHelper(const QModelIndex &idx) void WatchWindow::modelReset() { - //qDebug() << "Model reset"; + collapseAll(); expand(model()->index(0, 0)); modelResetHelper(model()->index(0, 0)); - m_blocked = false; } void WatchWindow::modelResetHelper(const QModelIndex &idx) @@ -242,6 +233,9 @@ void WatchWindow::modelResetHelper(const QModelIndex &idx) QModelIndex idx1 = model()->index(i, 0, idx); modelResetHelper(idx1); } + } else { + // if (!iname.isEmpty()) + // collapse(idx); } } diff --git a/src/plugins/debugger/watchwindow.h b/src/plugins/debugger/watchwindow.h index 9781f79fdb7..8b9b5d13ae4 100644 --- a/src/plugins/debugger/watchwindow.h +++ b/src/plugins/debugger/watchwindow.h @@ -85,7 +85,6 @@ private: bool m_alwaysResizeColumnsToContents; Type m_type; - bool m_blocked; QSet<QString> m_expandedItems; }; From d74ddb76b6229746f8c4538b3a35c760d51d2fd3 Mon Sep 17 00:00:00 2001 From: Roberto Raggi <qtc-committer@nokia.com> Date: Mon, 8 Dec 2008 10:44:56 +0100 Subject: [PATCH 22/77] Protected m_dirty and m_projects with a mutex. --- .../cmakeprojectmanager/cmakeproject.cpp | 7 ++- src/plugins/cpptools/cppmodelmanager.cpp | 61 ++++++++++++++++--- src/plugins/cpptools/cppmodelmanager.h | 25 ++++---- .../cpptools/cppmodelmanagerinterface.h | 32 ++++++++-- src/plugins/qt4projectmanager/qt4project.cpp | 26 ++++---- 5 files changed, 111 insertions(+), 40 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 1268c57b967..9c6c3947fa3 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -62,11 +62,12 @@ CMakeProject::CMakeProject(CMakeManager *manager, const QString &fileName) CppTools::CppModelManagerInterface *modelmanager = ExtensionSystem::PluginManager::instance()->getObject<CppTools::CppModelManagerInterface>(); if (modelmanager) { - CppTools::CppModelManagerInterface::ProjectInfo *pinfo = modelmanager->projectInfo(this); - pinfo->includePaths = cbpparser.includeFiles(); + CppTools::CppModelManagerInterface::ProjectInfo pinfo = modelmanager->projectInfo(this); + pinfo.includePaths = cbpparser.includeFiles(); // TODO we only want C++ files, not all other stuff that might be in the project - pinfo->sourceFiles = m_files; + pinfo.sourceFiles = m_files; // TODO defines + modelmanager->updateProjectInfo(pinfo); } } else { // TODO report error diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index 042b93cc74d..dbc324013c6 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -66,6 +66,7 @@ #include <Token.h> #include <QPlainTextEdit> +#include <QMutexLocker> #include <QTime> #include <QDebug> @@ -450,12 +451,25 @@ CppModelManager::CppModelManager(QObject *parent) : CppModelManager::~CppModelManager() { } -Document::Ptr CppModelManager::document(const QString &fileName) +Document::Ptr CppModelManager::document(const QString &fileName) const { return m_documents.value(fileName); } -CppModelManager::DocumentTable CppModelManager::documents() +CppModelManager::DocumentTable CppModelManager::documents() const { return m_documents; } +void CppModelManager::ensureUpdated() +{ + QMutexLocker locker(&mutex); + if (! m_dirty) + return; + + m_projectFiles = updateProjectFiles(); + m_includePaths = updateIncludePaths(); + m_frameworkPaths = updateFrameworkPaths(); + m_definedMacros = updateDefinedMacros(); + m_dirty = false; +} + QStringList CppModelManager::updateProjectFiles() const { QStringList files; @@ -527,8 +541,29 @@ QMap<QString, QByteArray> CppModelManager::buildWorkingCopyList() void CppModelManager::updateSourceFiles(const QStringList &sourceFiles) { (void) refreshSourceFiles(sourceFiles); } -CppModelManager::ProjectInfo *CppModelManager::projectInfo(ProjectExplorer::Project *project) -{ return &m_projects[project]; } +QList<CppModelManager::ProjectInfo> CppModelManager::projectInfos() const +{ + QMutexLocker locker(&mutex); + + return m_projects.values(); +} + +CppModelManager::ProjectInfo CppModelManager::projectInfo(ProjectExplorer::Project *project) const +{ + QMutexLocker locker(&mutex); + + return m_projects.value(project, ProjectInfo(project)); +} + +void CppModelManager::updateProjectInfo(const ProjectInfo &pinfo) +{ + QMutexLocker locker(&mutex); + + if (! pinfo.isValid()) + return; + + m_projects.insert(pinfo.project, pinfo); +} QFuture<void> CppModelManager::refreshSourceFiles(const QStringList &sourceFiles) { @@ -691,13 +726,18 @@ void CppModelManager::onDocumentUpdated(Document::Ptr doc) void CppModelManager::onProjectAdded(ProjectExplorer::Project *) { + QMutexLocker locker(&mutex); m_dirty = true; } void CppModelManager::onAboutToRemoveProject(ProjectExplorer::Project *project) { - m_dirty = true; - m_projects.remove(project); + do { + QMutexLocker locker(&mutex); + m_dirty = true; + m_projects.remove(project); + } while (0); + GC(); } @@ -705,8 +745,15 @@ void CppModelManager::onSessionUnloaded() { if (m_core->progressManager()) { m_core->progressManager()->cancelTasks(CppTools::Constants::TASK_INDEX); - m_dirty = true; } + + do { + QMutexLocker locker(&mutex); + m_projects.clear(); + m_dirty = true; + } while (0); + + GC(); } void CppModelManager::parse(QFutureInterface<void> &future, diff --git a/src/plugins/cpptools/cppmodelmanager.h b/src/plugins/cpptools/cppmodelmanager.h index a91a414e480..6bc7d0c1c55 100644 --- a/src/plugins/cpptools/cppmodelmanager.h +++ b/src/plugins/cpptools/cppmodelmanager.h @@ -40,6 +40,7 @@ #include <QMap> #include <QFutureInterface> +#include <QMutex> namespace Core { class ICore; @@ -70,9 +71,13 @@ public: virtual ~CppModelManager(); virtual void updateSourceFiles(const QStringList &sourceFiles); - virtual ProjectInfo *projectInfo(ProjectExplorer::Project *project); - virtual CPlusPlus::Document::Ptr document(const QString &fileName); - virtual DocumentTable documents(); + + virtual QList<ProjectInfo> projectInfos() const; + virtual ProjectInfo projectInfo(ProjectExplorer::Project *project) const; + virtual void updateProjectInfo(const ProjectInfo &pinfo); + + virtual CPlusPlus::Document::Ptr document(const QString &fileName) const; + virtual DocumentTable documents() const; virtual void GC(); QFuture<void> refreshSourceFiles(const QStringList &sourceFiles); @@ -127,22 +132,12 @@ private: return m_definedMacros; } + void ensureUpdated(); QStringList updateProjectFiles() const; QStringList updateIncludePaths() const; QStringList updateFrameworkPaths() const; QByteArray updateDefinedMacros() const; - void ensureUpdated() { - if (! m_dirty) - return; - - m_projectFiles = updateProjectFiles(); - m_includePaths = updateIncludePaths(); - m_frameworkPaths = updateFrameworkPaths(); - m_definedMacros = updateDefinedMacros(); - m_dirty = false; - } - static void parse(QFutureInterface<void> &future, CppPreprocessor *preproc, QStringList files); @@ -166,6 +161,8 @@ private: // project integration QMap<ProjectExplorer::Project *, ProjectInfo> m_projects; + mutable QMutex mutex; + enum { MAX_SELECTION_COUNT = 5 }; diff --git a/src/plugins/cpptools/cppmodelmanagerinterface.h b/src/plugins/cpptools/cppmodelmanagerinterface.h index 11be08a4b0e..e3ad4fe961b 100644 --- a/src/plugins/cpptools/cppmodelmanagerinterface.h +++ b/src/plugins/cpptools/cppmodelmanagerinterface.h @@ -38,6 +38,7 @@ #include <cplusplus/CppDocument.h> #include <QtCore/QObject> #include <QtCore/QMap> +#include <QtCore/QPointer> namespace ProjectExplorer { class Project; @@ -51,10 +52,29 @@ class CPPTOOLS_EXPORT CppModelManagerInterface Q_OBJECT public: - typedef QMap<QString, CPlusPlus::Document::Ptr> DocumentTable; + typedef QMap<QString, CPlusPlus::Document::Ptr> DocumentTable; // ### remove me - struct ProjectInfo + class ProjectInfo { + public: + ProjectInfo() + { } + + ProjectInfo(QPointer<ProjectExplorer::Project> project) + : project(project) + { } + + operator bool() const + { return ! project.isNull(); } + + bool isValid() const + { return ! project.isNull(); } + + bool isNull() const + { return project.isNull(); } + + public: // attributes + QPointer<ProjectExplorer::Project> project; QString projectPath; QByteArray defines; QStringList sourceFiles; @@ -69,10 +89,12 @@ public: virtual void GC() = 0; virtual void updateSourceFiles(const QStringList &sourceFiles) = 0; - virtual CPlusPlus::Document::Ptr document(const QString &fileName) = 0; - virtual DocumentTable documents() = 0; + virtual CPlusPlus::Document::Ptr document(const QString &fileName) const = 0; + virtual DocumentTable documents() const = 0; - virtual ProjectInfo *projectInfo(ProjectExplorer::Project *project) = 0; + virtual QList<ProjectInfo> projectInfos() const = 0; + virtual ProjectInfo projectInfo(ProjectExplorer::Project *project) const = 0; + virtual void updateProjectInfo(const ProjectInfo &pinfo) = 0; }; } // namespace CppTools diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp index 501068af004..b67535212e7 100644 --- a/src/plugins/qt4projectmanager/qt4project.cpp +++ b/src/plugins/qt4projectmanager/qt4project.cpp @@ -480,23 +480,27 @@ void Qt4Project::updateCodeModel() files += m_projectFiles->files[SourceType]; files += m_projectFiles->generatedFiles[SourceType]; - CppTools::CppModelManagerInterface::ProjectInfo *pinfo = modelmanager->projectInfo(this); + CppTools::CppModelManagerInterface::ProjectInfo pinfo = modelmanager->projectInfo(this); - if (pinfo->defines == predefinedMacros && - pinfo->includePaths == allIncludePaths && - pinfo->frameworkPaths == allFrameworkPaths && - pinfo->sourceFiles == files) { - // Nothing to update... + if (pinfo.defines == predefinedMacros && + pinfo.includePaths == allIncludePaths && + pinfo.frameworkPaths == allFrameworkPaths && + pinfo.sourceFiles == files) { + modelmanager->updateProjectInfo(pinfo); } else { - pinfo->defines = predefinedMacros; + pinfo.defines = predefinedMacros; // pinfo->defines += definedMacros; // ### FIXME: me - pinfo->includePaths = allIncludePaths; - pinfo->frameworkPaths = allFrameworkPaths; - pinfo->sourceFiles = files; + pinfo.includePaths = allIncludePaths; + pinfo.frameworkPaths = allFrameworkPaths; + pinfo.sourceFiles = files; + + modelmanager->updateProjectInfo(pinfo); modelmanager->GC(); - modelmanager->updateSourceFiles(pinfo->sourceFiles); + modelmanager->updateSourceFiles(pinfo.sourceFiles); } + + // update info } From 045e6dd1b4e97e5e79ec60db85e81616275fb770 Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Mon, 8 Dec 2008 11:00:46 +0100 Subject: [PATCH 23/77] simplify WatchWindow expansion handling a bit --- src/plugins/debugger/watchhandler.cpp | 7 ++++ src/plugins/debugger/watchhandler.h | 2 +- src/plugins/debugger/watchwindow.cpp | 52 +++------------------------ src/plugins/debugger/watchwindow.h | 4 --- 4 files changed, 13 insertions(+), 52 deletions(-) diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 1792e4705d6..1041c2edcc6 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -488,6 +488,13 @@ QVariant WatchHandler::data(const QModelIndex &idx, int role) const case VisualRole: return m_displayedINames.contains(data.iname); + case ExpandedRole: + //qDebug() << " FETCHING: " << data.iname + // << m_expandedINames.contains(data.iname) + // << m_expandedINames; + // Level 0 and 1 are always expanded + return node < 4 || m_expandedINames.contains(data.iname); + default: break; } diff --git a/src/plugins/debugger/watchhandler.h b/src/plugins/debugger/watchhandler.h index 989b99b3d22..f27e167dc1b 100644 --- a/src/plugins/debugger/watchhandler.h +++ b/src/plugins/debugger/watchhandler.h @@ -135,7 +135,7 @@ public: bool changed; }; -enum { INameRole = Qt::UserRole, VisualRole }; +enum { INameRole = Qt::UserRole, VisualRole, ExpandedRole }; class WatchHandler : public QAbstractItemModel diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index d528bf09242..f49b7073aef 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -46,7 +46,7 @@ using namespace Debugger::Internal; -enum { INameRole = Qt::UserRole, VisualRole }; +enum { INameRole = Qt::UserRole, VisualRole, ExpandedRole }; ///////////////////////////////////////////////////////////////////// // @@ -75,8 +75,6 @@ void WatchWindow::expandNode(const QModelIndex &idx) //QModelIndex mi0 = idx.sibling(idx.row(), 0); //QString iname = model()->data(mi0, INameRole).toString(); //QString name = model()->data(mi0, Qt::DisplayRole).toString(); - //if (isExpanded(idx)) - // return; emit requestExpandChildren(idx); } @@ -174,6 +172,7 @@ void WatchWindow::reset() QTreeView::reset(); setRootIndex(model()->index(row, 0, model()->index(0, 0))); //setRootIndex(model()->index(0, 0)); + resetHelper(model()->index(0, 0)); } void WatchWindow::setModel(QAbstractItemModel *model) @@ -185,57 +184,16 @@ void WatchWindow::setModel(QAbstractItemModel *model) header()->setResizeMode(QHeaderView::ResizeToContents); if (m_type != LocalsType) header()->hide(); - - connect(model, SIGNAL(modelAboutToBeReset()), - this, SLOT(modelAboutToBeReset())); - connect(model, SIGNAL(modelReset()), - this, SLOT(modelReset())); } -void WatchWindow::modelAboutToBeReset() +void WatchWindow::resetHelper(const QModelIndex &idx) { - //qDebug() << "Model about to be reset"; - m_expandedItems.clear(); - m_expandedItems.insert("local"); - m_expandedItems.insert("watch"); - modelAboutToBeResetHelper(model()->index(0, 0)); - //qDebug() << " expanded: " << m_expandedItems; -} - -void WatchWindow::modelAboutToBeResetHelper(const QModelIndex &idx) -{ - QString iname = model()->data(idx, INameRole).toString(); - //qDebug() << "Model about to be reset helper" << iname << idx - // << isExpanded(idx); - if (isExpanded(idx)) - m_expandedItems.insert(iname); - for (int i = 0, n = model()->rowCount(idx); i != n; ++i) { - QModelIndex idx1 = model()->index(i, 0, idx); - modelAboutToBeResetHelper(idx1); - } -} - -void WatchWindow::modelReset() -{ - collapseAll(); - expand(model()->index(0, 0)); - modelResetHelper(model()->index(0, 0)); -} - -void WatchWindow::modelResetHelper(const QModelIndex &idx) -{ - QString name = model()->data(idx, Qt::DisplayRole).toString(); - QString iname = model()->data(idx, INameRole).toString(); - //qDebug() << "Model reset helper" << iname << name; - if (m_expandedItems.contains(iname)) { + if (model()->data(idx, ExpandedRole).toBool()) { expand(idx); for (int i = 0, n = model()->rowCount(idx); i != n; ++i) { QModelIndex idx1 = model()->index(i, 0, idx); - modelResetHelper(idx1); + resetHelper(idx1); } - } else { - // if (!iname.isEmpty()) - // collapse(idx); } } diff --git a/src/plugins/debugger/watchwindow.h b/src/plugins/debugger/watchwindow.h index 8b9b5d13ae4..33aafe1d59b 100644 --- a/src/plugins/debugger/watchwindow.h +++ b/src/plugins/debugger/watchwindow.h @@ -72,20 +72,16 @@ private slots: void handleChangedItem(QWidget *); void expandNode(const QModelIndex &index); void collapseNode(const QModelIndex &index); - void modelAboutToBeReset(); - void modelReset(); private: void contextMenuEvent(QContextMenuEvent *ev); void editItem(const QModelIndex &idx); void reset(); /* reimpl */ - void modelAboutToBeResetHelper(const QModelIndex &idx); void modelResetHelper(const QModelIndex &idx); bool m_alwaysResizeColumnsToContents; Type m_type; - QSet<QString> m_expandedItems; }; From 1f8ce02d06b63c58b7e1a91bb13f9e778d60a5b1 Mon Sep 17 00:00:00 2001 From: Roberto Raggi <qtc-committer@nokia.com> Date: Mon, 8 Dec 2008 11:08:48 +0100 Subject: [PATCH 24/77] Some cleanup in CppPreprocessor. --- src/plugins/cpptools/cppmodelmanager.cpp | 565 ++++++++++++----------- 1 file changed, 296 insertions(+), 269 deletions(-) diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index dbc324013c6..6be28d36252 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -31,7 +31,6 @@ ** ***************************************************************************/ -#define _SCL_SECURE_NO_WARNINGS 1 #include "pp.h" #include "cppmodelmanager.h" @@ -70,11 +69,10 @@ #include <QTime> #include <QDebug> +using namespace CppTools; +using namespace CppTools::Internal; using namespace CPlusPlus; -namespace CppTools { -namespace Internal { - static const char pp_configuration_file[] = "<configuration>"; static const char pp_configuration[] = @@ -106,278 +104,40 @@ static const char pp_configuration[] = "#define __declspec(a)\n" "#define STDMETHOD(method) virtual HRESULT STDMETHODCALLTYPE method\n"; +namespace CppTools { +namespace Internal { + class CppPreprocessor: public rpp::Client { public: - CppPreprocessor(QPointer<CppModelManager> modelManager) - : m_modelManager(modelManager), - m_documents(modelManager->documents()), - m_proc(this, env) - { } + CppPreprocessor(QPointer<CppModelManager> modelManager); - void setWorkingCopy(const QMap<QString, QByteArray> &workingCopy) - { m_workingCopy = workingCopy; } - - void setIncludePaths(const QStringList &includePaths) - { m_includePaths = includePaths; } - - void setFrameworkPaths(const QStringList &frameworkPaths) - { m_frameworkPaths = frameworkPaths; } - - void addIncludePath(const QString &path) - { m_includePaths.append(path); } - - void setProjectFiles(const QStringList &files) - { m_projectFiles = files; } - - void run(QString &fileName) - { sourceNeeded(fileName, IncludeGlobal); } - - void operator()(QString &fileName) - { run(fileName); } + void setWorkingCopy(const QMap<QString, QByteArray> &workingCopy); + void setIncludePaths(const QStringList &includePaths); + void setFrameworkPaths(const QStringList &frameworkPaths); + void addIncludePath(const QString &path); + void setProjectFiles(const QStringList &files); + void run(QString &fileName); + void operator()(QString &fileName); protected: - bool includeFile(const QString &absoluteFilePath, QByteArray *result) - { - if (absoluteFilePath.isEmpty() || m_included.contains(absoluteFilePath)) { - return true; - } + CPlusPlus::Document::Ptr switchDocument(CPlusPlus::Document::Ptr doc); - if (m_workingCopy.contains(absoluteFilePath)) { - m_included.insert(absoluteFilePath); - *result = m_workingCopy.value(absoluteFilePath); - return true; - } + bool includeFile(const QString &absoluteFilePath, QByteArray *result); + QByteArray tryIncludeFile(QString &fileName, IncludeType type); - QFileInfo fileInfo(absoluteFilePath); - if (! fileInfo.isFile()) - return false; - - QFile file(absoluteFilePath); - if (file.open(QFile::ReadOnly)) { - m_included.insert(absoluteFilePath); - QTextStream stream(&file); - const QString contents = stream.readAll(); - *result = contents.toUtf8(); - file.close(); - return true; - } - - return false; - } - - QByteArray tryIncludeFile(QString &fileName, IncludeType type) - { - QFileInfo fileInfo(fileName); - if (fileName == QLatin1String(pp_configuration_file) || fileInfo.isAbsolute()) { - QByteArray contents; - includeFile(fileName, &contents); - return contents; - } - - if (type == IncludeLocal && m_currentDoc) { - QFileInfo currentFileInfo(m_currentDoc->fileName()); - QString path = currentFileInfo.absolutePath(); - path += QLatin1Char('/'); - path += fileName; - path = QDir::cleanPath(path); - QByteArray contents; - if (includeFile(path, &contents)) { - fileName = path; - return contents; - } - } - - foreach (const QString &includePath, m_includePaths) { - QString path = includePath; - path += QLatin1Char('/'); - path += fileName; - path = QDir::cleanPath(path); - QByteArray contents; - if (includeFile(path, &contents)) { - fileName = path; - return contents; - } - } - - // look in the system include paths - foreach (const QString &includePath, m_systemIncludePaths) { - QString path = includePath; - path += QLatin1Char('/'); - path += fileName; - path = QDir::cleanPath(path); - QByteArray contents; - if (includeFile(path, &contents)) { - fileName = path; - return contents; - } - } - - int index = fileName.indexOf(QLatin1Char('/')); - if (index != -1) { - QString frameworkName = fileName.left(index); - QString name = fileName.mid(index + 1); - - foreach (const QString &frameworkPath, m_frameworkPaths) { - QString path = frameworkPath; - path += QLatin1Char('/'); - path += frameworkName; - path += QLatin1String(".framework/Headers/"); - path += name; - QByteArray contents; - if (includeFile(path, &contents)) { - fileName = path; - return contents; - } - } - } - - QString path = fileName; - if (path.at(0) != QLatin1Char('/')) - path.prepend(QLatin1Char('/')); - - foreach (const QString &projectFile, m_projectFiles) { - if (projectFile.endsWith(path)) { - fileName = projectFile; - QByteArray contents; - includeFile(fileName, &contents); - return contents; - } - } - - //qDebug() << "**** file" << fileName << "not found!"; - return QByteArray(); - } - - virtual void macroAdded(const QByteArray ¯oName, const QByteArray ¯oText) - { - if (! m_currentDoc) - return; - - m_currentDoc->appendMacro(macroName, macroText); - } + void mergeEnvironment(CPlusPlus::Document::Ptr doc); + void mergeEnvironment(CPlusPlus::Document::Ptr doc, QSet<QString> *processed); + virtual void macroAdded(const QByteArray ¯oName, + const QByteArray ¯oText); virtual void startExpandingMacro(unsigned offset, - const rpp::Macro &, - const QByteArray &originalText) - { - if (! m_currentDoc) - return; - - //qDebug() << "start expanding:" << macro.name << "text:" << originalText; - m_currentDoc->addMacroUse(offset, originalText.length()); - } - - virtual void stopExpandingMacro(unsigned, const rpp::Macro &) - { - if (! m_currentDoc) - return; - - //qDebug() << "stop expanding:" << macro.name; - } - - void mergeEnvironment(Document::Ptr doc) - { - QSet<QString> processed; - mergeEnvironment(doc, &processed); - } - - void mergeEnvironment(Document::Ptr doc, QSet<QString> *processed) - { - if (! doc) - return; - - const QString fn = doc->fileName(); - - if (processed->contains(fn)) - return; - - processed->insert(fn); - - foreach (QString includedFile, doc->includedFiles()) - mergeEnvironment(m_documents.value(includedFile), processed); - - const QByteArray macros = doc->definedMacros(); - QByteArray localFileName = doc->fileName().toUtf8(); - - QByteArray dummy; - m_proc(localFileName, macros, &dummy); - } - - virtual void startSkippingBlocks(unsigned offset) - { - //qDebug() << "start skipping blocks:" << offset; - if (m_currentDoc) - m_currentDoc->startSkippingBlocks(offset); - } - - virtual void stopSkippingBlocks(unsigned offset) - { - //qDebug() << "stop skipping blocks:" << offset; - if (m_currentDoc) - m_currentDoc->stopSkippingBlocks(offset); - } - - virtual void sourceNeeded(QString &fileName, IncludeType type) - { - if (fileName.isEmpty()) - return; - - QByteArray contents = tryIncludeFile(fileName, type); - - if (m_currentDoc) { - m_currentDoc->addIncludeFile(fileName); - if (contents.isEmpty() && ! QFileInfo(fileName).isAbsolute()) { - QString msg; - msg += fileName; - msg += QLatin1String(": No such file or directory"); - Document::DiagnosticMessage d(Document::DiagnosticMessage::Warning, - m_currentDoc->fileName(), - env.currentLine, /*column = */ 0, - msg); - m_currentDoc->addDiagnosticMessage(d); - //qWarning() << "file not found:" << fileName << m_currentDoc->fileName() << env.current_line; - } - } - - if (! contents.isEmpty()) { - Document::Ptr cachedDoc = m_documents.value(fileName); - if (cachedDoc && m_currentDoc) { - mergeEnvironment(cachedDoc); - } else { - Document::Ptr previousDoc = switchDocument(Document::create(fileName)); - - const QByteArray previousFile = env.current_file; - const unsigned previousLine = env.currentLine; - - env.current_file = QByteArray(m_currentDoc->translationUnit()->fileName(), - m_currentDoc->translationUnit()->fileNameLength()); - - QByteArray preprocessedCode; - m_proc(contents, &preprocessedCode); - //qDebug() << preprocessedCode; - - env.current_file = previousFile; - env.currentLine = previousLine; - - m_currentDoc->setSource(preprocessedCode); - m_currentDoc->parse(); - m_currentDoc->check(); - m_currentDoc->releaseTranslationUnit(); // release the AST and the token stream. - - if (m_modelManager) - m_modelManager->emitDocumentUpdated(m_currentDoc); - (void) switchDocument(previousDoc); - } - } - } - - Document::Ptr switchDocument(Document::Ptr doc) - { - Document::Ptr previousDoc = m_currentDoc; - m_currentDoc = doc; - return previousDoc; - } + const rpp::Macro ¯o, + const QByteArray &originalText); + virtual void stopExpandingMacro(unsigned offset, const rpp::Macro ¯o); + virtual void startSkippingBlocks(unsigned offset); + virtual void stopSkippingBlocks(unsigned offset); + virtual void sourceNeeded(QString &fileName, IncludeType type); private: QPointer<CppModelManager> m_modelManager; @@ -390,15 +150,282 @@ private: QStringList m_projectFiles; QStringList m_frameworkPaths; QSet<QString> m_included; - Document::Ptr m_currentDoc; + CPlusPlus::Document::Ptr m_currentDoc; }; } // namespace Internal } // namespace CppTools +CppPreprocessor::CppPreprocessor(QPointer<CppModelManager> modelManager) + : m_modelManager(modelManager), + m_documents(modelManager->documents()), + m_proc(this, env) +{ } + +void CppPreprocessor::setWorkingCopy(const QMap<QString, QByteArray> &workingCopy) +{ m_workingCopy = workingCopy; } + +void CppPreprocessor::setIncludePaths(const QStringList &includePaths) +{ m_includePaths = includePaths; } + +void CppPreprocessor::setFrameworkPaths(const QStringList &frameworkPaths) +{ m_frameworkPaths = frameworkPaths; } + +void CppPreprocessor::addIncludePath(const QString &path) +{ m_includePaths.append(path); } + +void CppPreprocessor::setProjectFiles(const QStringList &files) +{ m_projectFiles = files; } + +void CppPreprocessor::run(QString &fileName) +{ sourceNeeded(fileName, IncludeGlobal); } + +void CppPreprocessor::operator()(QString &fileName) +{ run(fileName); } + +bool CppPreprocessor::includeFile(const QString &absoluteFilePath, QByteArray *result) +{ + if (absoluteFilePath.isEmpty() || m_included.contains(absoluteFilePath)) { + return true; + } + + if (m_workingCopy.contains(absoluteFilePath)) { + m_included.insert(absoluteFilePath); + *result = m_workingCopy.value(absoluteFilePath); + return true; + } + + QFileInfo fileInfo(absoluteFilePath); + if (! fileInfo.isFile()) + return false; + + QFile file(absoluteFilePath); + if (file.open(QFile::ReadOnly)) { + m_included.insert(absoluteFilePath); + QTextStream stream(&file); + const QString contents = stream.readAll(); + *result = contents.toUtf8(); + file.close(); + return true; + } + + return false; +} + +QByteArray CppPreprocessor::tryIncludeFile(QString &fileName, IncludeType type) +{ + QFileInfo fileInfo(fileName); + if (fileName == QLatin1String(pp_configuration_file) || fileInfo.isAbsolute()) { + QByteArray contents; + includeFile(fileName, &contents); + return contents; + } + + if (type == IncludeLocal && m_currentDoc) { + QFileInfo currentFileInfo(m_currentDoc->fileName()); + QString path = currentFileInfo.absolutePath(); + path += QLatin1Char('/'); + path += fileName; + path = QDir::cleanPath(path); + QByteArray contents; + if (includeFile(path, &contents)) { + fileName = path; + return contents; + } + } + + foreach (const QString &includePath, m_includePaths) { + QString path = includePath; + path += QLatin1Char('/'); + path += fileName; + path = QDir::cleanPath(path); + QByteArray contents; + if (includeFile(path, &contents)) { + fileName = path; + return contents; + } + } + + // look in the system include paths + foreach (const QString &includePath, m_systemIncludePaths) { + QString path = includePath; + path += QLatin1Char('/'); + path += fileName; + path = QDir::cleanPath(path); + QByteArray contents; + if (includeFile(path, &contents)) { + fileName = path; + return contents; + } + } + + int index = fileName.indexOf(QLatin1Char('/')); + if (index != -1) { + QString frameworkName = fileName.left(index); + QString name = fileName.mid(index + 1); + + foreach (const QString &frameworkPath, m_frameworkPaths) { + QString path = frameworkPath; + path += QLatin1Char('/'); + path += frameworkName; + path += QLatin1String(".framework/Headers/"); + path += name; + QByteArray contents; + if (includeFile(path, &contents)) { + fileName = path; + return contents; + } + } + } + + QString path = fileName; + if (path.at(0) != QLatin1Char('/')) + path.prepend(QLatin1Char('/')); + + foreach (const QString &projectFile, m_projectFiles) { + if (projectFile.endsWith(path)) { + fileName = projectFile; + QByteArray contents; + includeFile(fileName, &contents); + return contents; + } + } + + //qDebug() << "**** file" << fileName << "not found!"; + return QByteArray(); +} + +void CppPreprocessor::macroAdded(const QByteArray ¯oName, const QByteArray ¯oText) +{ + if (! m_currentDoc) + return; + + m_currentDoc->appendMacro(macroName, macroText); +} + +void CppPreprocessor::startExpandingMacro(unsigned offset, + const rpp::Macro &, + const QByteArray &originalText) +{ + if (! m_currentDoc) + return; + + //qDebug() << "start expanding:" << macro.name << "text:" << originalText; + m_currentDoc->addMacroUse(offset, originalText.length()); +} + +void CppPreprocessor::stopExpandingMacro(unsigned, const rpp::Macro &) +{ + if (! m_currentDoc) + return; + + //qDebug() << "stop expanding:" << macro.name; +} + +void CppPreprocessor::mergeEnvironment(Document::Ptr doc) +{ + QSet<QString> processed; + mergeEnvironment(doc, &processed); +} + +void CppPreprocessor::mergeEnvironment(Document::Ptr doc, QSet<QString> *processed) +{ + if (! doc) + return; + + const QString fn = doc->fileName(); + + if (processed->contains(fn)) + return; + + processed->insert(fn); + + foreach (QString includedFile, doc->includedFiles()) + mergeEnvironment(m_documents.value(includedFile), processed); + + const QByteArray macros = doc->definedMacros(); + QByteArray localFileName = doc->fileName().toUtf8(); + + QByteArray dummy; + m_proc(localFileName, macros, &dummy); +} + +void CppPreprocessor::startSkippingBlocks(unsigned offset) +{ + //qDebug() << "start skipping blocks:" << offset; + if (m_currentDoc) + m_currentDoc->startSkippingBlocks(offset); +} + +void CppPreprocessor::stopSkippingBlocks(unsigned offset) +{ + //qDebug() << "stop skipping blocks:" << offset; + if (m_currentDoc) + m_currentDoc->stopSkippingBlocks(offset); +} + +void CppPreprocessor::sourceNeeded(QString &fileName, IncludeType type) +{ + if (fileName.isEmpty()) + return; + + QByteArray contents = tryIncludeFile(fileName, type); + + if (m_currentDoc) { + m_currentDoc->addIncludeFile(fileName); + if (contents.isEmpty() && ! QFileInfo(fileName).isAbsolute()) { + QString msg; + msg += fileName; + msg += QLatin1String(": No such file or directory"); + Document::DiagnosticMessage d(Document::DiagnosticMessage::Warning, + m_currentDoc->fileName(), + env.currentLine, /*column = */ 0, + msg); + m_currentDoc->addDiagnosticMessage(d); + //qWarning() << "file not found:" << fileName << m_currentDoc->fileName() << env.current_line; + } + } + + if (! contents.isEmpty()) { + Document::Ptr cachedDoc = m_documents.value(fileName); + if (cachedDoc && m_currentDoc) { + mergeEnvironment(cachedDoc); + } else { + Document::Ptr previousDoc = switchDocument(Document::create(fileName)); + + const QByteArray previousFile = env.current_file; + const unsigned previousLine = env.currentLine; + + env.current_file = QByteArray(m_currentDoc->translationUnit()->fileName(), + m_currentDoc->translationUnit()->fileNameLength()); + + QByteArray preprocessedCode; + m_proc(contents, &preprocessedCode); + //qDebug() << preprocessedCode; + + env.current_file = previousFile; + env.currentLine = previousLine; + + m_currentDoc->setSource(preprocessedCode); + m_currentDoc->parse(); + m_currentDoc->check(); + m_currentDoc->releaseTranslationUnit(); // release the AST and the token stream. + + if (m_modelManager) + m_modelManager->emitDocumentUpdated(m_currentDoc); + (void) switchDocument(previousDoc); + } + } +} + +Document::Ptr CppPreprocessor::switchDocument(Document::Ptr doc) +{ + Document::Ptr previousDoc = m_currentDoc; + m_currentDoc = doc; + return previousDoc; +} + -using namespace CppTools; -using namespace CppTools::Internal; /*! \class CppTools::CppModelManager From e47967312e65e7620774ecc797a070dacc064afb Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Mon, 8 Dec 2008 11:58:36 +0100 Subject: [PATCH 25/77] compile fix --- src/plugins/debugger/gdbengine.cpp | 2 ++ src/plugins/debugger/watchwindow.h | 2 +- tests/manual/gdbdebugger/simple/app.cpp | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp index 1802c018001..9336981b128 100644 --- a/src/plugins/debugger/gdbengine.cpp +++ b/src/plugins/debugger/gdbengine.cpp @@ -1271,6 +1271,7 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data) if (isStoppedReason(reason) || reason.isEmpty()) { // Need another round trip if (reason == "breakpoint-hit") { + q->showStatusMessage(tr("Stopped at breakpoint."), -1); GdbMi frame = data.findChild("frame"); //qDebug() << frame.toString(); m_currentFrame = frame.findChild("addr").data() + '%' + @@ -1282,6 +1283,7 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data) QVariant var = QVariant::fromValue<GdbMi>(data); sendCommand("p 0", GdbAsyncOutput2, var); // dummy } else { + q->showStatusMessage(tr("Stopped. %1").arg(reason), -1); handleAsyncOutput2(data); } return; diff --git a/src/plugins/debugger/watchwindow.h b/src/plugins/debugger/watchwindow.h index 33aafe1d59b..c292bebb5f6 100644 --- a/src/plugins/debugger/watchwindow.h +++ b/src/plugins/debugger/watchwindow.h @@ -78,7 +78,7 @@ private: void editItem(const QModelIndex &idx); void reset(); /* reimpl */ - void modelResetHelper(const QModelIndex &idx); + void resetHelper(const QModelIndex &idx); bool m_alwaysResizeColumnsToContents; Type m_type; diff --git a/tests/manual/gdbdebugger/simple/app.cpp b/tests/manual/gdbdebugger/simple/app.cpp index 4a1ec67e7ab..958c8985b05 100644 --- a/tests/manual/gdbdebugger/simple/app.cpp +++ b/tests/manual/gdbdebugger/simple/app.cpp @@ -785,8 +785,13 @@ int main(int argc, char *argv[]) testVariant3(); testVector(); testVectorOfList(); + + + *(int *)0 = 0; + testObject(argc, argv); + //QColor color(255,128,10); //QFont font; From 358eceacfd07393bd0e70c01200263516559f37f Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Mon, 8 Dec 2008 12:01:53 +0100 Subject: [PATCH 26/77] whitespace cosmetics --- src/plugins/coreplugin/viewmanager.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/coreplugin/viewmanager.cpp b/src/plugins/coreplugin/viewmanager.cpp index 71ee1132994..b7b59f048ae 100644 --- a/src/plugins/coreplugin/viewmanager.cpp +++ b/src/plugins/coreplugin/viewmanager.cpp @@ -63,7 +63,7 @@ ViewManager::ViewManager(MainWindow *mainWnd) : ViewManagerInterface(mainWnd), m_mainWnd(mainWnd) { - for(int i = 0; i< 3; ++i) { + for (int i = 0; i < 3; ++i) { QWidget *w = new QWidget(); m_mainWnd->statusBar()->insertPermanentWidget(i, w); w->setLayout(new QHBoxLayout); @@ -89,7 +89,7 @@ void ViewManager::init() void ViewManager::objectAdded(QObject *obj) { - IView * view = Aggregation::query<IView>(obj); + IView *view = Aggregation::query<IView>(obj); if (!view) return; @@ -104,8 +104,8 @@ void ViewManager::objectAdded(QObject *obj) void ViewManager::aboutToRemoveObject(QObject *obj) { - IView * view = Aggregation::query<IView>(obj); - if(!view) + IView *view = Aggregation::query<IView>(obj); + if (!view) return; m_mainWnd->removeContextObject(view); } @@ -121,10 +121,10 @@ void ViewManager::saveSettings(QSettings *settings) settings->setValue(QLatin1String("ViewGroup_Default"), m_mainWnd->saveState()); } -IView * ViewManager::view(const QString & id) +IView *ViewManager::view(const QString &id) { QList<IView *> list = m_mainWnd->pluginManager()->getObjects<IView>(); - foreach (IView * view, list) { + foreach (IView *view, list) { if (view->uniqueViewName() == id) return view; } From 520a5c9e65b677086dbf82a801d07fd784777054 Mon Sep 17 00:00:00 2001 From: Roberto Raggi <qtc-committer@nokia.com> Date: Mon, 8 Dec 2008 12:17:39 +0100 Subject: [PATCH 27/77] Put the preprocessor the CPlusPlus namespace --- src/plugins/cpptools/cppmodelmanager.cpp | 14 +++++++------- src/plugins/cpptools/rpp/pp-cctype.h | 4 ++-- src/plugins/cpptools/rpp/pp-client.h | 4 ++-- src/plugins/cpptools/rpp/pp-engine.cpp | 1 - src/plugins/cpptools/rpp/pp-engine.h | 6 +++--- src/plugins/cpptools/rpp/pp-environment.cpp | 2 +- src/plugins/cpptools/rpp/pp-environment.h | 4 ++-- src/plugins/cpptools/rpp/pp-internal.h | 4 ++-- src/plugins/cpptools/rpp/pp-macro-expander.cpp | 2 +- src/plugins/cpptools/rpp/pp-macro-expander.h | 4 ++-- src/plugins/cpptools/rpp/pp-macro.h | 4 ++-- src/plugins/cpptools/rpp/pp-scanner.h | 4 ++-- 12 files changed, 26 insertions(+), 27 deletions(-) diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index 6be28d36252..af885de622f 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -107,7 +107,7 @@ static const char pp_configuration[] = namespace CppTools { namespace Internal { -class CppPreprocessor: public rpp::Client +class CppPreprocessor: public CPlusPlus::Client { public: CppPreprocessor(QPointer<CppModelManager> modelManager); @@ -132,9 +132,9 @@ protected: virtual void macroAdded(const QByteArray ¯oName, const QByteArray ¯oText); virtual void startExpandingMacro(unsigned offset, - const rpp::Macro ¯o, + const Macro ¯o, const QByteArray &originalText); - virtual void stopExpandingMacro(unsigned offset, const rpp::Macro ¯o); + virtual void stopExpandingMacro(unsigned offset, const Macro ¯o); virtual void startSkippingBlocks(unsigned offset); virtual void stopSkippingBlocks(unsigned offset); virtual void sourceNeeded(QString &fileName, IncludeType type); @@ -142,8 +142,8 @@ protected: private: QPointer<CppModelManager> m_modelManager; CppModelManager::DocumentTable m_documents; - rpp::Environment env; - rpp::pp m_proc; + Environment env; + pp m_proc; QStringList m_includePaths; QStringList m_systemIncludePaths; QMap<QString, QByteArray> m_workingCopy; @@ -304,7 +304,7 @@ void CppPreprocessor::macroAdded(const QByteArray ¯oName, const QByteArray & } void CppPreprocessor::startExpandingMacro(unsigned offset, - const rpp::Macro &, + const Macro &, const QByteArray &originalText) { if (! m_currentDoc) @@ -314,7 +314,7 @@ void CppPreprocessor::startExpandingMacro(unsigned offset, m_currentDoc->addMacroUse(offset, originalText.length()); } -void CppPreprocessor::stopExpandingMacro(unsigned, const rpp::Macro &) +void CppPreprocessor::stopExpandingMacro(unsigned, const Macro &) { if (! m_currentDoc) return; diff --git a/src/plugins/cpptools/rpp/pp-cctype.h b/src/plugins/cpptools/rpp/pp-cctype.h index 62b44f0bf4c..bec9c25aef1 100644 --- a/src/plugins/cpptools/rpp/pp-cctype.h +++ b/src/plugins/cpptools/rpp/pp-cctype.h @@ -55,7 +55,7 @@ #include <cctype> -namespace rpp { +namespace CPlusPlus { inline bool pp_isalpha (int __ch) { return std::isalpha ((unsigned char) __ch) != 0; } @@ -69,6 +69,6 @@ inline bool pp_isdigit (int __ch) inline bool pp_isspace (int __ch) { return std::isspace ((unsigned char) __ch) != 0; } -} // namespace rpp +} // namespace CPlusPlus #endif // PP_CCTYPE_H diff --git a/src/plugins/cpptools/rpp/pp-client.h b/src/plugins/cpptools/rpp/pp-client.h index 974004a6ce5..35df6497331 100644 --- a/src/plugins/cpptools/rpp/pp-client.h +++ b/src/plugins/cpptools/rpp/pp-client.h @@ -38,7 +38,7 @@ #include <QString> #include <QFile> -namespace rpp { +namespace CPlusPlus { class Macro; @@ -74,6 +74,6 @@ public: virtual void stopSkippingBlocks(unsigned offset) = 0; }; -} // namespace rpp +} // namespace CPlusPlus #endif // PP_CLIENT_H diff --git a/src/plugins/cpptools/rpp/pp-engine.cpp b/src/plugins/cpptools/rpp/pp-engine.cpp index 66e8957f355..f2e1d4908eb 100644 --- a/src/plugins/cpptools/rpp/pp-engine.cpp +++ b/src/plugins/cpptools/rpp/pp-engine.cpp @@ -57,7 +57,6 @@ #include <QtDebug> #include <algorithm> -using namespace rpp; using namespace CPlusPlus; namespace { diff --git a/src/plugins/cpptools/rpp/pp-engine.h b/src/plugins/cpptools/rpp/pp-engine.h index 13135f6a310..d0729b3715b 100644 --- a/src/plugins/cpptools/rpp/pp-engine.h +++ b/src/plugins/cpptools/rpp/pp-engine.h @@ -62,7 +62,7 @@ namespace CPlusPlus { class Token; } -namespace rpp { +namespace CPlusPlus { struct Value { @@ -200,7 +200,7 @@ namespace rpp { Value evalExpression(TokenIterator firstToken, TokenIterator lastToken, - const QByteArray &source) const; + const QByteArray &source) const; QVector<CPlusPlus::Token> tokenize(const QByteArray &text) const; @@ -226,6 +226,6 @@ namespace rpp { bool isQtReservedWord(const QByteArray &name) const; }; -} // namespace rpp +} // namespace CPlusPlus #endif // PP_ENGINE_H diff --git a/src/plugins/cpptools/rpp/pp-environment.cpp b/src/plugins/cpptools/rpp/pp-environment.cpp index 85e432ae5b5..b06d41757dd 100644 --- a/src/plugins/cpptools/rpp/pp-environment.cpp +++ b/src/plugins/cpptools/rpp/pp-environment.cpp @@ -54,7 +54,7 @@ #include "pp.h" #include <cstring> -using namespace rpp; +using namespace CPlusPlus; Environment::Environment () : currentLine(0), diff --git a/src/plugins/cpptools/rpp/pp-environment.h b/src/plugins/cpptools/rpp/pp-environment.h index 5b97c492d79..e3d130871ba 100644 --- a/src/plugins/cpptools/rpp/pp-environment.h +++ b/src/plugins/cpptools/rpp/pp-environment.h @@ -56,7 +56,7 @@ #include <QVector> #include <QByteArray> -namespace rpp { +namespace CPlusPlus { struct Macro; @@ -104,6 +104,6 @@ private: int _hash_count; }; -} // namespace rpp +} // namespace CPlusPlus #endif // PP_ENVIRONMENT_H diff --git a/src/plugins/cpptools/rpp/pp-internal.h b/src/plugins/cpptools/rpp/pp-internal.h index 13bc7c17e84..c11de37453a 100644 --- a/src/plugins/cpptools/rpp/pp-internal.h +++ b/src/plugins/cpptools/rpp/pp-internal.h @@ -55,7 +55,7 @@ #include <QByteArray> -namespace rpp { +namespace CPlusPlus { namespace _PP_internal { inline bool comment_p (const char *__first, const char *__last) @@ -73,6 +73,6 @@ inline bool comment_p (const char *__first, const char *__last) } } // _PP_internal -} // namespace rpp +} // namespace CPlusPlus #endif // PP_INTERNAL_H diff --git a/src/plugins/cpptools/rpp/pp-macro-expander.cpp b/src/plugins/cpptools/rpp/pp-macro-expander.cpp index 6b569eb132f..9ae9702fe18 100644 --- a/src/plugins/cpptools/rpp/pp-macro-expander.cpp +++ b/src/plugins/cpptools/rpp/pp-macro-expander.cpp @@ -35,7 +35,7 @@ #include "pp-macro-expander.h" #include <QDateTime> -using namespace rpp; +using namespace CPlusPlus; MacroExpander::MacroExpander (Environment &env, pp_frame *frame) : env(env), frame(frame), diff --git a/src/plugins/cpptools/rpp/pp-macro-expander.h b/src/plugins/cpptools/rpp/pp-macro-expander.h index dd11540c336..c2f636c1385 100644 --- a/src/plugins/cpptools/rpp/pp-macro-expander.h +++ b/src/plugins/cpptools/rpp/pp-macro-expander.h @@ -53,7 +53,7 @@ #ifndef PP_MACRO_EXPANDER_H #define PP_MACRO_EXPANDER_H -namespace rpp { +namespace CPlusPlus { struct pp_frame { @@ -97,7 +97,7 @@ namespace rpp { int generated_lines; }; -} // namespace rpp +} // namespace CPlusPlus #endif // PP_MACRO_EXPANDER_H diff --git a/src/plugins/cpptools/rpp/pp-macro.h b/src/plugins/cpptools/rpp/pp-macro.h index a7bbe35e1d5..b091abd6184 100644 --- a/src/plugins/cpptools/rpp/pp-macro.h +++ b/src/plugins/cpptools/rpp/pp-macro.h @@ -56,7 +56,7 @@ #include <QByteArray> #include <QVector> -namespace rpp { +namespace CPlusPlus { struct Macro { @@ -90,6 +90,6 @@ namespace rpp { { } }; -} // namespace rpp +} // namespace CPlusPlus #endif // PP_MACRO_H diff --git a/src/plugins/cpptools/rpp/pp-scanner.h b/src/plugins/cpptools/rpp/pp-scanner.h index 53fea70b52f..85b65403b0b 100644 --- a/src/plugins/cpptools/rpp/pp-scanner.h +++ b/src/plugins/cpptools/rpp/pp-scanner.h @@ -53,7 +53,7 @@ #ifndef PP_SCANNER_H #define PP_SCANNER_H -namespace rpp { +namespace CPlusPlus { struct pp_skip_blanks { @@ -373,7 +373,7 @@ struct pp_skip_argument } }; -} // namespace rpp +} // namespace CPlusPlus #endif // PP_SCANNER_H From f6fbb274ae715c05fcdee61cba5395b4fd4814b9 Mon Sep 17 00:00:00 2001 From: Roberto Raggi <qtc-committer@nokia.com> Date: Mon, 8 Dec 2008 12:24:40 +0100 Subject: [PATCH 28/77] Moved the preprocessor. --- src/libs/cplusplus/cplusplus.pro | 16 ++++++++++++++-- .../rpp => libs/cplusplus}/pp-cctype.h | 0 .../rpp => libs/cplusplus}/pp-client.h | 0 .../rpp => libs/cplusplus}/pp-engine.cpp | 0 .../rpp => libs/cplusplus}/pp-engine.h | 0 .../rpp => libs/cplusplus}/pp-environment.cpp | 0 .../rpp => libs/cplusplus}/pp-environment.h | 0 .../cpptools/rpp => libs/cplusplus}/pp-fwd.h | 0 .../rpp => libs/cplusplus}/pp-internal.h | 0 .../cplusplus}/pp-macro-expander.cpp | 0 .../rpp => libs/cplusplus}/pp-macro-expander.h | 0 .../cpptools/rpp => libs/cplusplus}/pp-macro.h | 0 .../rpp => libs/cplusplus}/pp-scanner.h | 0 .../cpptools/rpp => libs/cplusplus}/pp.h | 0 src/plugins/cpptools/cpptools.pro | 2 +- src/plugins/cpptools/rpp/rpp.pri | 18 ------------------ 16 files changed, 15 insertions(+), 21 deletions(-) rename src/{plugins/cpptools/rpp => libs/cplusplus}/pp-cctype.h (100%) rename src/{plugins/cpptools/rpp => libs/cplusplus}/pp-client.h (100%) rename src/{plugins/cpptools/rpp => libs/cplusplus}/pp-engine.cpp (100%) rename src/{plugins/cpptools/rpp => libs/cplusplus}/pp-engine.h (100%) rename src/{plugins/cpptools/rpp => libs/cplusplus}/pp-environment.cpp (100%) rename src/{plugins/cpptools/rpp => libs/cplusplus}/pp-environment.h (100%) rename src/{plugins/cpptools/rpp => libs/cplusplus}/pp-fwd.h (100%) rename src/{plugins/cpptools/rpp => libs/cplusplus}/pp-internal.h (100%) rename src/{plugins/cpptools/rpp => libs/cplusplus}/pp-macro-expander.cpp (100%) rename src/{plugins/cpptools/rpp => libs/cplusplus}/pp-macro-expander.h (100%) rename src/{plugins/cpptools/rpp => libs/cplusplus}/pp-macro.h (100%) rename src/{plugins/cpptools/rpp => libs/cplusplus}/pp-scanner.h (100%) rename src/{plugins/cpptools/rpp => libs/cplusplus}/pp.h (100%) delete mode 100644 src/plugins/cpptools/rpp/rpp.pri diff --git a/src/libs/cplusplus/cplusplus.pro b/src/libs/cplusplus/cplusplus.pro index 1a2b5326623..49d78fda8b3 100644 --- a/src/libs/cplusplus/cplusplus.pro +++ b/src/libs/cplusplus/cplusplus.pro @@ -21,7 +21,16 @@ HEADERS += \ TypeOfExpression.h \ TypePrettyPrinter.h \ ResolveExpression.h \ - LookupContext.h + LookupContext.h \ + pp-cctype.h \ + pp-engine.h \ + pp-fwd.h \ + pp-macro-expander.h \ + pp-scanner.h \ + pp-client.h \ + pp-environment.h \ + pp-internal.h \ + pp-macro.h SOURCES += \ SimpleLexer.cpp \ @@ -35,6 +44,9 @@ SOURCES += \ TypeOfExpression.cpp \ TypePrettyPrinter.cpp \ ResolveExpression.cpp \ - LookupContext.cpp + LookupContext.cpp \ + pp-engine.cpp \ + pp-environment.cpp \ + pp-macro-expander.cpp RESOURCES += cplusplus.qrc diff --git a/src/plugins/cpptools/rpp/pp-cctype.h b/src/libs/cplusplus/pp-cctype.h similarity index 100% rename from src/plugins/cpptools/rpp/pp-cctype.h rename to src/libs/cplusplus/pp-cctype.h diff --git a/src/plugins/cpptools/rpp/pp-client.h b/src/libs/cplusplus/pp-client.h similarity index 100% rename from src/plugins/cpptools/rpp/pp-client.h rename to src/libs/cplusplus/pp-client.h diff --git a/src/plugins/cpptools/rpp/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp similarity index 100% rename from src/plugins/cpptools/rpp/pp-engine.cpp rename to src/libs/cplusplus/pp-engine.cpp diff --git a/src/plugins/cpptools/rpp/pp-engine.h b/src/libs/cplusplus/pp-engine.h similarity index 100% rename from src/plugins/cpptools/rpp/pp-engine.h rename to src/libs/cplusplus/pp-engine.h diff --git a/src/plugins/cpptools/rpp/pp-environment.cpp b/src/libs/cplusplus/pp-environment.cpp similarity index 100% rename from src/plugins/cpptools/rpp/pp-environment.cpp rename to src/libs/cplusplus/pp-environment.cpp diff --git a/src/plugins/cpptools/rpp/pp-environment.h b/src/libs/cplusplus/pp-environment.h similarity index 100% rename from src/plugins/cpptools/rpp/pp-environment.h rename to src/libs/cplusplus/pp-environment.h diff --git a/src/plugins/cpptools/rpp/pp-fwd.h b/src/libs/cplusplus/pp-fwd.h similarity index 100% rename from src/plugins/cpptools/rpp/pp-fwd.h rename to src/libs/cplusplus/pp-fwd.h diff --git a/src/plugins/cpptools/rpp/pp-internal.h b/src/libs/cplusplus/pp-internal.h similarity index 100% rename from src/plugins/cpptools/rpp/pp-internal.h rename to src/libs/cplusplus/pp-internal.h diff --git a/src/plugins/cpptools/rpp/pp-macro-expander.cpp b/src/libs/cplusplus/pp-macro-expander.cpp similarity index 100% rename from src/plugins/cpptools/rpp/pp-macro-expander.cpp rename to src/libs/cplusplus/pp-macro-expander.cpp diff --git a/src/plugins/cpptools/rpp/pp-macro-expander.h b/src/libs/cplusplus/pp-macro-expander.h similarity index 100% rename from src/plugins/cpptools/rpp/pp-macro-expander.h rename to src/libs/cplusplus/pp-macro-expander.h diff --git a/src/plugins/cpptools/rpp/pp-macro.h b/src/libs/cplusplus/pp-macro.h similarity index 100% rename from src/plugins/cpptools/rpp/pp-macro.h rename to src/libs/cplusplus/pp-macro.h diff --git a/src/plugins/cpptools/rpp/pp-scanner.h b/src/libs/cplusplus/pp-scanner.h similarity index 100% rename from src/plugins/cpptools/rpp/pp-scanner.h rename to src/libs/cplusplus/pp-scanner.h diff --git a/src/plugins/cpptools/rpp/pp.h b/src/libs/cplusplus/pp.h similarity index 100% rename from src/plugins/cpptools/rpp/pp.h rename to src/libs/cplusplus/pp.h diff --git a/src/plugins/cpptools/cpptools.pro b/src/plugins/cpptools/cpptools.pro index 8a096900ebf..92905e42ef9 100644 --- a/src/plugins/cpptools/cpptools.pro +++ b/src/plugins/cpptools/cpptools.pro @@ -10,7 +10,7 @@ unix:QMAKE_CXXFLAGS_DEBUG += -O3 INCLUDEPATH += . DEFINES += CPPTOOLS_LIBRARY CONFIG += help -include(rpp/rpp.pri)|error("Can't find RPP") + HEADERS += cpptools_global.h \ cppquickopenfilter.h \ cppclassesfilter.h \ diff --git a/src/plugins/cpptools/rpp/rpp.pri b/src/plugins/cpptools/rpp/rpp.pri deleted file mode 100644 index a79b0028a05..00000000000 --- a/src/plugins/cpptools/rpp/rpp.pri +++ /dev/null @@ -1,18 +0,0 @@ -DEPENDPATH += $$PWD -INCLUDEPATH += $$PWD - -HEADERS += $$PWD/pp-cctype.h \ - $$PWD/pp-engine.h \ - $$PWD/pp-environment.h \ - $$PWD/pp-internal.h \ - $$PWD/pp-macro-expander.h \ - $$PWD/pp-macro.h \ - $$PWD/pp-scanner.h \ - $$PWD/pp.h \ - $$PWD/pp-client.h - -SOURCES += $$PWD/pp-engine.cpp \ - $$PWD/pp-environment.cpp \ - $$PWD/pp-macro-expander.cpp - - From e503e1e4e9e4b4482373f1f17eec0655b9562b3e Mon Sep 17 00:00:00 2001 From: dt <qtc-commiter@nokia.com> Date: Mon, 8 Dec 2008 12:24:31 +0100 Subject: [PATCH 29/77] Fixes: Parse all the targets. Task: - RevBy: - AutoTest: - Details: (Only outputs them via qDebug().) --- .../cmakeprojectmanager/cmakeproject.cpp | 28 +++++++++++++++++-- .../cmakeprojectmanager/cmakeproject.h | 5 ++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index fe591fa0041..4eb31302e65 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -393,12 +393,36 @@ void CMakeCbpParser::parseBuild() void CMakeCbpParser::parseTarget() { + m_targetOutput.clear(); + m_targetType = false; + while(!atEnd()) { + readNext(); + if (isEndElement()) { + if (m_targetType && !m_targetOutput.isEmpty()) { + qDebug()<<"found target "<<m_targetOutput; + m_targets.insert(m_targetOutput); + } + return; + } else if (name() == "Compiler") { + parseCompiler(); + } else if (name() == "Option") { + parseTargetOption(); + } else if (isStartElement()) { + parseUnknownElement(); + } + } +} + +void CMakeCbpParser::parseTargetOption() +{ + if (attributes().hasAttribute("output")) + m_targetOutput = attributes().value("output").toString(); + else if (attributes().hasAttribute("type") && attributes().value("type") == "1") + m_targetType = true; while(!atEnd()) { readNext(); if (isEndElement()) { return; - } else if (name() == "Compiler") { - parseCompiler(); } else if (isStartElement()) { parseUnknownElement(); } diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.h b/src/plugins/cmakeprojectmanager/cmakeproject.h index c765c0d3838..a0c821ada5e 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.h +++ b/src/plugins/cmakeprojectmanager/cmakeproject.h @@ -123,13 +123,18 @@ private: void parseProject(); void parseBuild(); void parseTarget(); + void parseTargetOption(); void parseCompiler(); void parseAdd(); void parseUnit(); void parseUnknownElement(); + QSet<QString> m_targets; QList<ProjectExplorer::FileNode *> m_fileList; QStringList m_includeFiles; + + QString m_targetOutput; + bool m_targetType; }; class CMakeFile : public Core::IFile From 83d5461c7f083277ee5948b6b4bbbd93b63415dc Mon Sep 17 00:00:00 2001 From: dt <qtc-commiter@nokia.com> Date: Mon, 8 Dec 2008 12:44:28 +0100 Subject: [PATCH 30/77] Fixes: Find the qplatformdefs.h file Task: - RevBy: - AutoTest: - Details: Add the include path for qplatformdefs.h to the fot. --- .../cmakeprojectmanager/cmakeproject.cpp | 2 +- src/plugins/qt4projectmanager/qt4project.cpp | 3 ++ .../qt4projectmanager/qtversionmanager.cpp | 47 +++++++++++-------- .../qt4projectmanager/qtversionmanager.h | 2 + 4 files changed, 33 insertions(+), 21 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 4eb31302e65..52c28cbc3d5 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -226,7 +226,7 @@ QStringList CMakeProject::files(FilesMode fileMode) const void CMakeProject::saveSettingsImpl(ProjectExplorer::PersistentSettingsWriter &writer) { // TODO - Q_UNUSED(writer) + Q_UNUSED(writer); } void CMakeProject::restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader &reader) diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp index 501068af004..2e06e1ae4e5 100644 --- a/src/plugins/qt4projectmanager/qt4project.cpp +++ b/src/plugins/qt4projectmanager/qt4project.cpp @@ -474,6 +474,9 @@ void Qt4Project::updateCodeModel() } } + // Add mkspec directory + allIncludePaths.append(qtVersion(activeBuildConfiguration())->mkspecPath()); + QStringList files; files += m_projectFiles->files[HeaderType]; files += m_projectFiles->generatedFiles[HeaderType]; diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp index 0c68fcd98eb..1262f901785 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.cpp +++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp @@ -728,6 +728,12 @@ QString QtVersion::mkspec() const return m_mkspec; } +QString QtVersion::mkspecPath() const +{ + updateMkSpec(); + return m_mkspecFullPath; +} + QHash<QString,QString> QtVersion::versionInfo() const { updateVersionInfo(); @@ -1023,24 +1029,24 @@ void QtVersion::updateMkSpec() const //qDebug()<<"Finding mkspec for"<<path(); QString mkspec; - QFile f(path() + "/.qmake.cache"); - if (f.exists() && f.open(QIODevice::ReadOnly)) { - while(!f.atEnd()) { - QByteArray line = f.readLine(); - if(line.startsWith("QMAKESPEC")) { - const QList<QByteArray> &temp = line.split('='); - if(temp.size() == 2) { - mkspec = temp.at(1).trimmed(); - if (mkspec.startsWith("$$QT_BUILD_TREE/mkspecs/")) - mkspec = mkspec.mid(QString("$$QT_BUILD_TREE/mkspecs/").length()); - else if (mkspec.startsWith("$$QT_BUILD_TREE\\mkspecs\\")) - mkspec = mkspec.mid(QString("$$QT_BUILD_TREE\\mkspecs\\").length()); - } - break; - } - } - f.close(); - } else { +// QFile f(path() + "/.qmake.cache"); +// if (f.exists() && f.open(QIODevice::ReadOnly)) { +// while(!f.atEnd()) { +// QByteArray line = f.readLine(); +// if(line.startsWith("QMAKESPEC")) { +// const QList<QByteArray> &temp = line.split('='); +// if(temp.size() == 2) { +// mkspec = temp.at(1).trimmed(); +// if (mkspec.startsWith("$$QT_BUILD_TREE/mkspecs/")) +// mkspec = mkspec.mid(QString("$$QT_BUILD_TREE/mkspecs/").length()); +// else if (mkspec.startsWith("$$QT_BUILD_TREE\\mkspecs\\")) +// mkspec = mkspec.mid(QString("$$QT_BUILD_TREE\\mkspecs\\").length()); +// } +// break; +// } +// } +// f.close(); +// } else { // no .qmake.cache so look at the default mkspec QString mkspecPath = versionInfo().value("QMAKE_MKSPECS"); if (mkspecPath.isEmpty()) @@ -1095,9 +1101,10 @@ void QtVersion::updateMkSpec() const mkspec = f2.symLinkTarget(); } #endif - } +// } - int index =mkspec.lastIndexOf('/'); + m_mkspecFullPath = mkspec; + int index = mkspec.lastIndexOf('/'); if(index == -1) index = mkspec.lastIndexOf('\\'); if (index >= 0 && QDir(mkspec.left(index)).canonicalPath() == QDir(m_path + "/mkspecs/").canonicalPath()) diff --git a/src/plugins/qt4projectmanager/qtversionmanager.h b/src/plugins/qt4projectmanager/qtversionmanager.h index 5810cfa1c2d..a8ca9570895 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.h +++ b/src/plugins/qt4projectmanager/qtversionmanager.h @@ -67,6 +67,7 @@ public: QString path() const; QString sourcePath() const; QString mkspec() const; + QString mkspecPath() const; QString makeCommand() const; QString qmakeCommand() const; // Returns the PREFIX, BINPREFIX, DOCPREFIX and similar information @@ -107,6 +108,7 @@ private: QString m_path; QString m_sourcePath; mutable QString m_mkspec; // updated lazily + mutable QString m_mkspecFullPath; QString m_mingwDirectory; QString m_prependPath; QString m_msvcVersion; From 310d50fd0760eed3558d56709b49dca9ffc74530 Mon Sep 17 00:00:00 2001 From: Roberto Raggi <qtc-committer@nokia.com> Date: Mon, 8 Dec 2008 12:59:33 +0100 Subject: [PATCH 31/77] Use Macros. --- src/libs/cplusplus/CppDocument.cpp | 19 +-------- src/libs/cplusplus/CppDocument.h | 15 +++++--- src/libs/cplusplus/pp-cctype.h | 10 +++-- src/libs/cplusplus/pp-client.h | 6 ++- src/libs/cplusplus/pp-engine.cpp | 21 +++------- src/libs/cplusplus/pp-engine.h | 2 +- src/libs/cplusplus/pp-environment.cpp | 4 +- src/libs/cplusplus/pp-environment.h | 8 ++-- src/libs/cplusplus/pp-macro.h | 45 +++++++++++----------- src/plugins/cpptools/cppcodecompletion.cpp | 4 +- src/plugins/cpptools/cppmodelmanager.cpp | 20 +++++----- 11 files changed, 69 insertions(+), 85 deletions(-) diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index 3a280416d9b..45ad1f569a5 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -138,19 +138,9 @@ void Document::addIncludeFile(const QString &fileName) _includedFiles.append(fileName); } -QByteArray Document::definedMacros() const +void Document::appendMacro(const Macro ¯o) { - return _definedMacros; -} - -void Document::appendMacro(const QByteArray ¯oName, const QByteArray &text) -{ - int index = macroName.indexOf('('); - if (index == -1) - _macroNames.insert(macroName); - else - _macroNames.insert(macroName.left(index)); - _definedMacros += text; + _definedMacros.append(macro); } void Document::addMacroUse(unsigned offset, unsigned length) @@ -251,11 +241,6 @@ void Document::stopSkippingBlocks(unsigned stop) _skippedBlocks.back() = Block(start, stop); } -QSet<QByteArray> Document::macroNames() const -{ - return _macroNames; -} - bool Document::parse(ParseMode mode) { TranslationUnit::ParseMode m = TranslationUnit::ParseTranlationUnit; diff --git a/src/libs/cplusplus/CppDocument.h b/src/libs/cplusplus/CppDocument.h index e952913a07b..d289c579e9c 100644 --- a/src/libs/cplusplus/CppDocument.h +++ b/src/libs/cplusplus/CppDocument.h @@ -36,6 +36,8 @@ #include <CPlusPlusForwardDeclarations.h> +#include "pp-macro.h" + #include <QByteArray> #include <QList> #include <QSet> @@ -45,6 +47,8 @@ namespace CPlusPlus { +class Macro; + class CPLUSPLUS_EXPORT Document { Document(const Document &other); @@ -63,10 +67,7 @@ public: QStringList includedFiles() const; void addIncludeFile(const QString &fileName); - QByteArray definedMacros() const; - QSet<QByteArray> macroNames() const; - - void appendMacro(const QByteArray ¯oName, const QByteArray &text); + void appendMacro(const Macro ¯o); void addMacroUse(unsigned offset, unsigned length); @@ -81,6 +82,9 @@ public: Scope *globalSymbols() const; // ### deprecate? Namespace *globalNamespace() const; + QList<Macro> definedMacros() const + { return _definedMacros; } + Symbol *findSymbolAt(unsigned line, unsigned column) const; void setSource(const QByteArray &source); @@ -191,8 +195,7 @@ private: TranslationUnit *_translationUnit; Namespace *_globalNamespace; QList<DiagnosticMessage> _diagnosticMessages; - QByteArray _definedMacros; - QSet<QByteArray> _macroNames; + QList<Macro> _definedMacros; QList<Block> _skippedBlocks; QList<Block> _macroUses; }; diff --git a/src/libs/cplusplus/pp-cctype.h b/src/libs/cplusplus/pp-cctype.h index bec9c25aef1..b7558ae5050 100644 --- a/src/libs/cplusplus/pp-cctype.h +++ b/src/libs/cplusplus/pp-cctype.h @@ -53,20 +53,22 @@ #ifndef PP_CCTYPE_H #define PP_CCTYPE_H +#include <CPlusPlusForwardDeclarations.h> + #include <cctype> namespace CPlusPlus { -inline bool pp_isalpha (int __ch) +inline bool CPLUSPLUS_EXPORT pp_isalpha (int __ch) { return std::isalpha ((unsigned char) __ch) != 0; } -inline bool pp_isalnum (int __ch) +inline bool CPLUSPLUS_EXPORT pp_isalnum (int __ch) { return std::isalnum ((unsigned char) __ch) != 0; } -inline bool pp_isdigit (int __ch) +inline bool CPLUSPLUS_EXPORT pp_isdigit (int __ch) { return std::isdigit ((unsigned char) __ch) != 0; } -inline bool pp_isspace (int __ch) +inline bool CPLUSPLUS_EXPORT pp_isspace (int __ch) { return std::isspace ((unsigned char) __ch) != 0; } } // namespace CPlusPlus diff --git a/src/libs/cplusplus/pp-client.h b/src/libs/cplusplus/pp-client.h index 35df6497331..2fc781f22f5 100644 --- a/src/libs/cplusplus/pp-client.h +++ b/src/libs/cplusplus/pp-client.h @@ -34,6 +34,8 @@ #ifndef PP_CLIENT_H #define PP_CLIENT_H +#include <CPlusPlusForwardDeclarations.h> + #include <QByteArray> #include <QString> #include <QFile> @@ -42,7 +44,7 @@ namespace CPlusPlus { class Macro; -class Client +class CPLUSPLUS_EXPORT Client { Client(const Client &other); void operator=(const Client &other); @@ -60,7 +62,7 @@ public: virtual ~Client() { } - virtual void macroAdded(const QByteArray ¯oId, const QByteArray &text) = 0; + virtual void macroAdded(const Macro ¯o) = 0; virtual void sourceNeeded(QString &fileName, IncludeType mode) = 0; // ### FIX the signature. virtual void startExpandingMacro(unsigned offset, diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp index f2e1d4908eb..7bdc9b95d69 100644 --- a/src/libs/cplusplus/pp-engine.cpp +++ b/src/libs/cplusplus/pp-engine.cpp @@ -906,16 +906,8 @@ void pp::processDefine(TokenIterator firstToken, TokenIterator lastToken) env.bind(macro); - QByteArray macroText; - macroText.reserve(64); - macroText += "#define "; - - macroText += macroId; - macroText += ' '; - macroText += macro.definition; - macroText += '\n'; - - client->macroAdded(macroId, macroText); + if (client) + client->macroAdded(macro); } void pp::processIf(TokenIterator firstToken, TokenIterator lastToken) @@ -1019,13 +1011,10 @@ void pp::processUndef(TokenIterator firstToken, TokenIterator lastToken) if (tk->is(T_IDENTIFIER)) { const QByteArray macroName = tokenText(*tk); - env.remove(macroName); + const Macro *macro = env.remove(macroName); - QByteArray macroText; - macroText += "#undef "; - macroText += macroName; - macroText += '\n'; - client->macroAdded(macroName, macroText); + if (client && macro) + client->macroAdded(*macro); } } diff --git a/src/libs/cplusplus/pp-engine.h b/src/libs/cplusplus/pp-engine.h index d0729b3715b..c909ffab3a7 100644 --- a/src/libs/cplusplus/pp-engine.h +++ b/src/libs/cplusplus/pp-engine.h @@ -134,7 +134,7 @@ namespace CPlusPlus { #undef PP_DEFINE_BIN_OP }; - class pp + class CPLUSPLUS_EXPORT pp { Client *client; Environment &env; diff --git a/src/libs/cplusplus/pp-environment.cpp b/src/libs/cplusplus/pp-environment.cpp index b06d41757dd..a1ade3b189a 100644 --- a/src/libs/cplusplus/pp-environment.cpp +++ b/src/libs/cplusplus/pp-environment.cpp @@ -115,12 +115,12 @@ Macro *Environment::bind(const Macro &__macro) return m; } -void Environment::remove (const QByteArray &name) +Macro *Environment::remove (const QByteArray &name) { Macro macro; macro.name = name; macro.hidden = true; - bind(macro); + return bind(macro); } bool Environment::isBuiltinMacro(const QByteArray &s) const diff --git a/src/libs/cplusplus/pp-environment.h b/src/libs/cplusplus/pp-environment.h index e3d130871ba..e2a75d29b81 100644 --- a/src/libs/cplusplus/pp-environment.h +++ b/src/libs/cplusplus/pp-environment.h @@ -53,14 +53,16 @@ #ifndef PP_ENVIRONMENT_H #define PP_ENVIRONMENT_H +#include "CPlusPlusForwardDeclarations.h" + #include <QVector> #include <QByteArray> namespace CPlusPlus { -struct Macro; +class Macro; -class Environment +class CPLUSPLUS_EXPORT Environment { public: Environment(); @@ -70,7 +72,7 @@ public: Macro *macroAt(unsigned index) const; Macro *bind(const Macro ¯o); - void remove(const QByteArray &name); + Macro *remove(const QByteArray &name); Macro *resolve(const QByteArray &name) const; bool isBuiltinMacro(const QByteArray &name) const; diff --git a/src/libs/cplusplus/pp-macro.h b/src/libs/cplusplus/pp-macro.h index b091abd6184..494b7a4de7f 100644 --- a/src/libs/cplusplus/pp-macro.h +++ b/src/libs/cplusplus/pp-macro.h @@ -53,42 +53,43 @@ #ifndef PP_MACRO_H #define PP_MACRO_H +#include <CPlusPlusForwardDeclarations.h> + #include <QByteArray> #include <QVector> namespace CPlusPlus { - struct Macro +class CPLUSPLUS_EXPORT Macro +{ +public: + QByteArray name; + QByteArray definition; + QVector<QByteArray> formals; + QByteArray fileName; + int line; + Macro *next; + unsigned hashcode; + + union { - QByteArray name; - QByteArray definition; - QVector<QByteArray> formals; - QByteArray fileName; - int line; - int lines; - Macro *next; - unsigned hashcode; + unsigned state; - union + struct { - unsigned state; - - struct - { - unsigned hidden: 1; - unsigned function_like: 1; - unsigned variadics: 1; - }; + unsigned hidden: 1; + unsigned function_like: 1; + unsigned variadics: 1; }; + }; - inline Macro(): + inline Macro(): line(0), - lines(0), next(0), hashcode(0), state(0) - { } - }; + { } +}; } // namespace CPlusPlus diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp index 7568d2c8877..47ac5c57678 100644 --- a/src/plugins/cpptools/cppcodecompletion.cpp +++ b/src/plugins/cpptools/cppcodecompletion.cpp @@ -699,7 +699,9 @@ void CppCodeCompletion::addMacros(const LookupContext &context) continue; processed.insert(fn); if (Document::Ptr doc = context.document(fn)) { - macroNames += doc->macroNames(); + foreach (const Macro macro, doc->definedMacros()) { + macroNames.insert(macro.name); + } todo += doc->includedFiles(); } } diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index af885de622f..e8359da2b5b 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -31,7 +31,7 @@ ** ***************************************************************************/ -#include "pp.h" +#include <cplusplus/pp.h> #include "cppmodelmanager.h" #include "cpphoverhandler.h" @@ -129,8 +129,7 @@ protected: void mergeEnvironment(CPlusPlus::Document::Ptr doc); void mergeEnvironment(CPlusPlus::Document::Ptr doc, QSet<QString> *processed); - virtual void macroAdded(const QByteArray ¯oName, - const QByteArray ¯oText); + virtual void macroAdded(const Macro ¯o); virtual void startExpandingMacro(unsigned offset, const Macro ¯o, const QByteArray &originalText); @@ -295,12 +294,12 @@ QByteArray CppPreprocessor::tryIncludeFile(QString &fileName, IncludeType type) return QByteArray(); } -void CppPreprocessor::macroAdded(const QByteArray ¯oName, const QByteArray ¯oText) +void CppPreprocessor::macroAdded(const Macro ¯o) { if (! m_currentDoc) return; - m_currentDoc->appendMacro(macroName, macroText); + m_currentDoc->appendMacro(macro); } void CppPreprocessor::startExpandingMacro(unsigned offset, @@ -340,14 +339,13 @@ void CppPreprocessor::mergeEnvironment(Document::Ptr doc, QSet<QString> *process processed->insert(fn); - foreach (QString includedFile, doc->includedFiles()) + foreach (QString includedFile, doc->includedFiles()) { mergeEnvironment(m_documents.value(includedFile), processed); + } - const QByteArray macros = doc->definedMacros(); - QByteArray localFileName = doc->fileName().toUtf8(); - - QByteArray dummy; - m_proc(localFileName, macros, &dummy); + foreach (const Macro macro, doc->definedMacros()) { + env.bind(macro); + } } void CppPreprocessor::startSkippingBlocks(unsigned offset) From c14896b7d29b701cd653625df09cd4be2597d638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com> Date: Fri, 5 Dec 2008 15:58:19 +0100 Subject: [PATCH 32/77] Slight optimization in Session::projectForFile Avoid creating a copy of the list of projects. --- src/plugins/cpptools/searchsymbols.cpp | 2 +- src/plugins/projectexplorer/session.cpp | 36 ++++++++++++------------- src/plugins/projectexplorer/session.h | 3 ++- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/plugins/cpptools/searchsymbols.cpp b/src/plugins/cpptools/searchsymbols.cpp index 670d0d6d471..308449ab581 100644 --- a/src/plugins/cpptools/searchsymbols.cpp +++ b/src/plugins/cpptools/searchsymbols.cpp @@ -194,7 +194,7 @@ QString SearchSymbols::symbolName(const Symbol *symbol) const void SearchSymbols::appendItem(const QString &name, const QString &info, ModelItemInfo::ItemType type, - const CPlusPlus::Symbol *symbol) + const Symbol *symbol) { const QIcon icon = icons.iconForSymbol(symbol); items.append(ModelItemInfo(name, info, type, diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index 876b8294a37..71057473046 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -709,7 +709,7 @@ void SessionManager::editDependencies() dlg.exec(); } -QList<Project *> SessionManager::projects() const +const QList<Project *> &SessionManager::projects() const { return m_file->m_projects; } @@ -839,26 +839,26 @@ Project *SessionManager::projectForFile(const QString &fileName) const if (debug) qDebug() << "SessionManager::projectForFile(" << fileName << ")"; - Project *project = 0; + const QList<Project *> &projectList = projects(); - QList<Project *> projectList = projects(); + // Check current project first + Project *currentProject = ProjectExplorerPlugin::instance()->currentProject(); + if (currentProject && projectContainsFile(currentProject, fileName)) + return currentProject; - // Always check current project first - if (Project *currentProject = ProjectExplorerPlugin::instance()->currentProject()) { - projectList.removeOne(currentProject); - projectList.insert(0, currentProject); - } + foreach (Project *p, projectList) + if (p != currentProject && projectContainsFile(p, fileName)) + return p; - foreach (Project *p, projectList) { - if (!m_projectFileCache.contains(p)) { - m_projectFileCache.insert(p, p->files(Project::AllFiles)); - } - if (m_projectFileCache.value(p).contains(fileName)) { - project = p; - break; - } - } - return project; + return 0; +} + +bool SessionManager::projectContainsFile(Project *p, const QString &fileName) const +{ + if (!m_projectFileCache.contains(p)) + m_projectFileCache.insert(p, p->files(Project::AllFiles)); + + return m_projectFileCache.value(p).contains(fileName); } void SessionManager::setEditorCodec(Core::IEditor *editor, const QString &fileName) diff --git a/src/plugins/projectexplorer/session.h b/src/plugins/projectexplorer/session.h index fcf98a23ded..d07316f07a4 100644 --- a/src/plugins/projectexplorer/session.h +++ b/src/plugins/projectexplorer/session.h @@ -137,7 +137,7 @@ public: Core::IFile *file() const; Project *startupProject() const; - QList<Project *> projects() const; + const QList<Project *> &projects() const; bool isDefaultVirgin() const; bool isDefaultSession(const QString &session) const; @@ -182,6 +182,7 @@ private: bool loadImpl(const QString &fileName); bool createImpl(const QString &fileName); QString sessionNameToFileName(const QString &session); + bool projectContainsFile(Project *p, const QString &fileName) const; bool recursiveDependencyCheck(const QString &newDep, const QString &checkDep) const; QStringList dependencies(const QString &proName) const; From d0a2f567c1967a17d6c136d3092b2d1a076604fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com> Date: Fri, 5 Dec 2008 16:06:09 +0100 Subject: [PATCH 33/77] Renamed slot to avoid confusement ProjectExplorer::sessionManager -> ProjectExplorer::showSessionManager --- src/plugins/projectexplorer/projectexplorer.cpp | 6 +++--- src/plugins/projectexplorer/projectexplorer.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index b95d5c19463..f67984f0da8 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -605,7 +605,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin } } - connect(m_sessionManagerAction, SIGNAL(triggered()), this, SLOT(sessionManager())); + connect(m_sessionManagerAction, SIGNAL(triggered()), this, SLOT(showSessionManager())); connect(m_newAction, SIGNAL(triggered()), this, SLOT(newProject())); #if 0 connect(m_loadAction, SIGNAL(triggered()), this, SLOT(loadAction())); @@ -765,10 +765,10 @@ void ProjectExplorerPlugin::newProject() updateActions(); } -void ProjectExplorerPlugin::sessionManager() +void ProjectExplorerPlugin::showSessionManager() { if (debug) - qDebug() << "ProjectExplorerPlugin::newSession"; + qDebug() << "ProjectExplorerPlugin::showSessionManager"; if (m_session->isDefaultVirgin()) { // do not save new virgin default sessions diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h index 6a7f4beb831..97eb684bb49 100644 --- a/src/plugins/projectexplorer/projectexplorer.h +++ b/src/plugins/projectexplorer/projectexplorer.h @@ -143,7 +143,7 @@ private slots: void unloadProject(); void clearSession(); void newProject(); - void sessionManager(); + void showSessionManager(); void populateBuildConfigurationMenu(); void buildConfigurationMenuTriggered(QAction *); void populateRunConfigurationMenu(); From bf7486c0118c32fe171cca7e50fd3fb89a5dbe72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com> Date: Mon, 8 Dec 2008 13:01:54 +0100 Subject: [PATCH 34/77] Don't keep around references to old documents The code completion was keeping around references to old documents after the completion finished. This caused documents to stay in memory when unloading projects, up until the next time you used the completion. --- src/libs/cplusplus/TypeOfExpression.cpp | 1 + src/libs/cplusplus/TypeOfExpression.h | 3 +++ src/plugins/cpptools/cppcodecompletion.cpp | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/src/libs/cplusplus/TypeOfExpression.cpp b/src/libs/cplusplus/TypeOfExpression.cpp index 7dd669365fc..487c9f8a469 100644 --- a/src/libs/cplusplus/TypeOfExpression.cpp +++ b/src/libs/cplusplus/TypeOfExpression.cpp @@ -48,6 +48,7 @@ TypeOfExpression::TypeOfExpression(): void TypeOfExpression::setDocuments(const QMap<QString, Document::Ptr> &documents) { m_documents = documents; + m_lookupContext = LookupContext(); } QList<TypeOfExpression::Result> TypeOfExpression::operator()(const QString &expression, diff --git a/src/libs/cplusplus/TypeOfExpression.h b/src/libs/cplusplus/TypeOfExpression.h index ecdfac7b290..cd7a23441fd 100644 --- a/src/libs/cplusplus/TypeOfExpression.h +++ b/src/libs/cplusplus/TypeOfExpression.h @@ -54,6 +54,9 @@ public: /** * Sets the documents used to evaluate expressions. Should be set before * calling this functor. + * + * Also clears the lookup context, so can be used to make sure references + * to the documents previously used are removed. */ void setDocuments(const QMap<QString, Document::Ptr> &documents); diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp index 47ac5c57678..d24f5a5f81d 100644 --- a/src/plugins/cpptools/cppcodecompletion.cpp +++ b/src/plugins/cpptools/cppcodecompletion.cpp @@ -1027,6 +1027,10 @@ bool CppCodeCompletion::partiallyComplete(const QList<TextEditor::CompletionItem void CppCodeCompletion::cleanup() { m_completions.clear(); + + // Set empty map in order to avoid referencing old versions of the documents + // until the next completion + typeOfExpression.setDocuments(QMap<QString, Document::Ptr>()); } int CppCodeCompletion::findStartOfName(const TextEditor::ITextEditor *editor) From 7411d9db55404f83a7a649f682e0cd987cdd2718 Mon Sep 17 00:00:00 2001 From: dt <qtc-commiter@nokia.com> Date: Mon, 8 Dec 2008 14:20:35 +0100 Subject: [PATCH 35/77] Fixes: Show the actual qt version in the Tools/Options dialog. Task: 237665 Details: We parse the qmake output anyway, so we can simply add the version from there. Seems to work nicely. Idea by hjk. --- .../qt4projectmanager/qtversionmanager.cpp | 28 ++++++++++++++----- .../qt4projectmanager/qtversionmanager.h | 6 +++- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp index 421aa3b77ae..ea0da4f989d 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.cpp +++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp @@ -314,7 +314,7 @@ QStringList QtVersionManager::possibleQMakeCommands() return result; } -bool QtVersionManager::checkQMakeVersion(const QString &qmakePath) +QString QtVersionManager::qtVersionForQMake(const QString &qmakePath) { QProcess qmake; qmake.start(qmakePath, QStringList()<<"--version"); @@ -323,9 +323,12 @@ bool QtVersionManager::checkQMakeVersion(const QString &qmakePath) QString output = qmake.readAllStandardOutput(); QRegExp regexp("(QMake version|Qmake version:)[\\s]*([\\d.]*)"); regexp.indexIn(output); - if (regexp.cap(2).startsWith("2.")) - return true; - return false; + if (regexp.cap(2).startsWith("2.")) { + QRegExp regexp2("Using Qt version[\\s]*([\\d\\.]*)"); + regexp2.indexIn(output); + return regexp2.cap(1); + } + return QString(); } QString QtVersionManager::findSystemQt() const @@ -336,7 +339,7 @@ QString QtVersionManager::findSystemQt() const foreach (const QString &possibleCommand, possibleQMakeCommands()) { QFileInfo qmake(path + "/" + possibleCommand); if (qmake.exists()) { - if (checkQMakeVersion(qmake.absoluteFilePath())) { + if (!qtVersionForQMake(qmake.absoluteFilePath()).isNull()) { QDir dir(qmake.absoluteDir()); dir.cdUp(); return dir.absolutePath(); @@ -517,7 +520,10 @@ void QtDirWidget::showEnvironmentPage(QTreeWidgetItem *item) m_ui.mingwLineEdit->setVisible(false); m_ui.mingwLabel->setVisible(false); m_ui.mingwBrowseButton->setVisible(false); - m_ui.errorLabel->setText("Found qt version: " + m_versions.at(index)->mkspec()); + m_ui.errorLabel->setText("Found Qt version " + + m_versions.at(index)->qtVersionString() + + " using mkspec " + + m_versions.at(index)->mkspec()); } } else { m_ui.msvcComboBox->setVisible(false); @@ -734,6 +740,12 @@ QString QtVersion::mkspecPath() const return m_mkspecFullPath; } +QString QtVersion::qtVersionString() const +{ + qmakeCommand(); + return m_qtVersionString; +} + QHash<QString,QString> QtVersion::versionInfo() const { updateVersionInfo(); @@ -1144,7 +1156,9 @@ QString QtVersion::qmakeCommand() const QString s = qtDir.absoluteFilePath(possibleCommand); QFileInfo qmake(s); if (qmake.exists() && qmake.isExecutable()) { - if (QtVersionManager::checkQMakeVersion(qmake.absoluteFilePath())) { + QString qtVersion = QtVersionManager::qtVersionForQMake(qmake.absoluteFilePath()); + if (!qtVersion.isNull()) { + m_qtVersionString = qtVersion; m_qmakeCommand = qmake.absoluteFilePath(); return qmake.absoluteFilePath(); } diff --git a/src/plugins/qt4projectmanager/qtversionmanager.h b/src/plugins/qt4projectmanager/qtversionmanager.h index a8ca9570895..d13ba7c3e00 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.h +++ b/src/plugins/qt4projectmanager/qtversionmanager.h @@ -70,6 +70,7 @@ public: QString mkspecPath() const; QString makeCommand() const; QString qmakeCommand() const; + QString qtVersionString() const; // Returns the PREFIX, BINPREFIX, DOCPREFIX and similar information QHash<QString,QString> versionInfo() const; @@ -119,6 +120,9 @@ private: mutable bool m_defaultConfigIsDebug; mutable bool m_defaultConfigIsDebugAndRelease; mutable QString m_qmakeCommand; + // This is updated on first call to qmakeCommand + // That function is called from updateVersionInfo() + mutable QString m_qtVersionString; Q_DISABLE_COPY(QtVersion); }; @@ -189,7 +193,7 @@ public: // returns something like qmake4, qmake, qmake-qt4 or whatever distributions have chosen (used by QtVersion) static QStringList possibleQMakeCommands(); // return true if the qmake at qmakePath is qt4 (used by QtVersion) - static bool checkQMakeVersion(const QString &qmakePath); + static QString qtVersionForQMake(const QString &qmakePath); signals: void defaultQtVersionChanged(); void qtVersionsChanged(); From 8d3a774fc2146bcad47e82e80a7c446b61e1ac69 Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Mon, 8 Dec 2008 14:26:11 +0100 Subject: [PATCH 36/77] new status widget for debugger output. needs a bit more polishing... --- src/plugins/debugger/debuggermanager.cpp | 31 +++++++------ src/plugins/debugger/debuggermanager.h | 14 ++++-- src/plugins/debugger/gdbengine.cpp | 58 ++++++++++++------------ src/plugins/debugger/mode.cpp | 2 + 4 files changed, 59 insertions(+), 46 deletions(-) diff --git a/src/plugins/debugger/debuggermanager.cpp b/src/plugins/debugger/debuggermanager.cpp index a94b1fb0931..11e7ef6c82d 100644 --- a/src/plugins/debugger/debuggermanager.cpp +++ b/src/plugins/debugger/debuggermanager.cpp @@ -62,6 +62,7 @@ #include <QtCore/QDir> #include <QtCore/QFileInfo> #include <QtCore/QTime> +#include <QtCore/QTimer> #include <QtGui/QAction> #include <QtGui/QComboBox> @@ -145,6 +146,7 @@ void DebuggerManager::init() m_modulesHandler = 0; m_registerHandler = 0; + m_statusLabel = new QLabel; m_breakWindow = new BreakWindow; m_disassemblerWindow = new DisassemblerWindow; m_modulesWindow = new ModulesWindow; @@ -157,6 +159,7 @@ void DebuggerManager::init() //m_tooltipWindow = new WatchWindow(WatchWindow::TooltipType); //m_watchersWindow = new QTreeView; m_tooltipWindow = new QTreeView; + m_statusTimer = new QTimer(this); m_mainWindow = new QMainWindow; m_mainWindow->setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::North); @@ -408,6 +411,8 @@ void DebuggerManager::init() this, SLOT(saveSessionData())); connect(m_dumpLogAction, SIGNAL(triggered()), this, SLOT(dumpLog())); + connect(m_statusTimer, SIGNAL(timeout()), + this, SLOT(clearStatusMessage())); connect(m_outputWindow, SIGNAL(commandExecutionRequested(QString)), this, SLOT(executeDebuggerCommand(QString))); @@ -553,24 +558,24 @@ QAbstractItemModel *DebuggerManager::threadsModel() return qobject_cast<ThreadsWindow*>(m_threadsWindow)->model(); } +void DebuggerManager::clearStatusMessage() +{ + m_statusLabel->setText(m_lastPermanentStatusMessage); +} + void DebuggerManager::showStatusMessage(const QString &msg, int timeout) { Q_UNUSED(timeout) //qDebug() << "STATUS: " << msg; showDebuggerOutput("status:", msg); - mainWindow()->statusBar()->showMessage(msg, timeout); -#if 0 - QString currentTime = QTime::currentTime().toString("hh:mm:ss.zzz"); - - ICore *core = m_pm->getObject<Core::ICore>(); - //qDebug() << qPrintable(currentTime) << "Setting status: " << msg; - if (msg.isEmpty()) - core->messageManager()->displayStatusBarMessage(msg); - else if (timeout == -1) - core->messageManager()->displayStatusBarMessage(tr("Debugger: ") + msg); - else - core->messageManager()->displayStatusBarMessage(tr("Debugger: ") + msg, timeout); -#endif + m_statusLabel->setText(" " + msg); + if (timeout > 0) { + m_statusTimer->setSingleShot(true); + m_statusTimer->start(timeout); + } else { + m_lastPermanentStatusMessage = msg; + m_statusTimer->stop(); + } } void DebuggerManager::notifyStartupFinished() diff --git a/src/plugins/debugger/debuggermanager.h b/src/plugins/debugger/debuggermanager.h index fd1e7cf5cba..63c225411fc 100644 --- a/src/plugins/debugger/debuggermanager.h +++ b/src/plugins/debugger/debuggermanager.h @@ -44,9 +44,11 @@ QT_BEGIN_NAMESPACE class QAction; class QAbstractItemModel; class QDockWidget; +class QLabel; class QMainWindow; class QModelIndex; class QSplitter; +class QTimer; class QWidget; QT_END_NAMESPACE @@ -190,7 +192,8 @@ public: private: friend class DebugMode; - virtual QWidget *threadsWindow() = 0; + virtual QWidget *threadsWindow() const = 0; + virtual QLabel *statusLabel() const = 0; virtual QList<QDockWidget*> dockWidgets() const = 0; virtual void createDockWidgets() = 0; }; @@ -213,6 +216,7 @@ public: IDebuggerManagerAccessForEngines *engineInterface(); IDebuggerManagerAccessForDebugMode *debugModeInterface(); QMainWindow *mainWindow() const { return m_mainWindow; } + QLabel *statusLabel() const { return m_statusLabel; } enum StartMode { startInternal, startExternal, attachExternal }; enum DebuggerType { GdbDebugger, ScriptDebugger, WinDebugger }; @@ -272,7 +276,7 @@ public slots: void assignValueInDebugger(const QString &expr, const QString &value); void executeDebuggerCommand(const QString &command); - void showStatusMessage(const QString &msg, int timeout); // -1 forever + void showStatusMessage(const QString &msg, int timeout = -1); // -1 forever private slots: void showDebuggerOutput(const QString &prefix, const QString &msg); @@ -290,6 +294,7 @@ private slots: void reloadRegisters(); void registerDockToggled(bool on); void setStatus(int status); + void clearStatusMessage(); private: // @@ -322,7 +327,7 @@ private: // // Implementation of IDebuggerManagerAccessForDebugMode // - QWidget *threadsWindow() { return m_threadsWindow; } + QWidget *threadsWindow() const { return m_threadsWindow; } QList<QDockWidget*> dockWidgets() const { return m_dockWidgets; } void createDockWidgets(); @@ -382,6 +387,7 @@ private: /// Views QMainWindow *m_mainWindow; + QLabel *m_statusLabel; QDockWidget *m_breakDock; QDockWidget *m_disassemblerDock; QDockWidget *m_modulesDock; @@ -440,6 +446,8 @@ private: int m_status; bool m_busy; + QTimer *m_statusTimer; + QString m_lastPermanentStatusMessage; IDebuggerEngine *engine(); IDebuggerEngine *m_engine; diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp index 9336981b128..5fce8a96555 100644 --- a/src/plugins/debugger/gdbengine.cpp +++ b/src/plugins/debugger/gdbengine.cpp @@ -347,7 +347,7 @@ void GdbEngine::gdbProcError(QProcess::ProcessError error) "This is the default return value of error()."); } - q->showStatusMessage(msg, 5000); + q->showStatusMessage(msg); QMessageBox::critical(q->mainWindow(), tr("Error"), msg); // act as if it was closed by the core q->exitDebugger(); @@ -710,7 +710,7 @@ void GdbEngine::sendCommand(const QString &command, int type, bool temporarilyStopped = false; if (needStop && q->status() == DebuggerInferiorRunning) { - q->showStatusMessage(tr("Temporarily stopped"), -1); + q->showStatusMessage(tr("Temporarily stopped")); interruptInferior(); temporarilyStopped = true; } @@ -1055,7 +1055,7 @@ void GdbEngine::handleExecJumpToLine(const GdbResultRecord &record) // ~"242\t x *= 2;" //109^done" qq->notifyInferiorStopped(); - q->showStatusMessage(tr("Jumped. Stopped."), -1); + q->showStatusMessage(tr("Jumped. Stopped.")); QString output = record.data.findChild("logstreamoutput").data(); if (!output.isEmpty()) return; @@ -1074,7 +1074,7 @@ void GdbEngine::handleExecRunToFunction(const GdbResultRecord &record) // func="foo",args=[{name="str",value="@0x7fff0f450460"}], // file="main.cpp",fullname="/tmp/g/main.cpp",line="37"} qq->notifyInferiorStopped(); - q->showStatusMessage(tr("Run to Function finished. Stopped."), -1); + q->showStatusMessage(tr("Run to Function finished. Stopped.")); GdbMi frame = record.data.findChild("frame"); QString file = frame.findChild("fullname").data(); int line = frame.findChild("line").data().toInt(); @@ -1212,7 +1212,7 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data) } } else { // slow start requested. - q->showStatusMessage("Loading " + data.toString(), -1); + q->showStatusMessage(tr("Loading %1...").arg(QString(data.toString()))); continueInferior(); } return; @@ -1231,7 +1231,7 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data) msg = "Program exited after receiving signal " + data.findChild("signal-name").toString(); } - q->showStatusMessage(msg, -1); + q->showStatusMessage(msg); q->exitDebugger(); return; } @@ -1271,7 +1271,7 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data) if (isStoppedReason(reason) || reason.isEmpty()) { // Need another round trip if (reason == "breakpoint-hit") { - q->showStatusMessage(tr("Stopped at breakpoint."), -1); + q->showStatusMessage(tr("Stopped at breakpoint")); GdbMi frame = data.findChild("frame"); //qDebug() << frame.toString(); m_currentFrame = frame.findChild("addr").data() + '%' + @@ -1283,7 +1283,7 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data) QVariant var = QVariant::fromValue<GdbMi>(data); sendCommand("p 0", GdbAsyncOutput2, var); // dummy } else { - q->showStatusMessage(tr("Stopped. %1").arg(reason), -1); + q->showStatusMessage(tr("Stopped. Reason: \"%1\"").arg(reason)); handleAsyncOutput2(data); } return; @@ -1305,7 +1305,7 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data) // system="0.00136",start="1218810678.805432",end="1218810678.812011"} q->resetLocation(); qq->notifyInferiorStopped(); - q->showStatusMessage(tr("Run to Function finished. Stopped."), -1); + q->showStatusMessage(tr("Run to Function finished. Stopped.")); GdbMi frame = data.findChild("frame"); QString file = frame.findChild("fullname").data(); int line = frame.findChild("line").data().toInt(); @@ -1378,8 +1378,9 @@ void GdbEngine::handleShowVersion(const GdbResultRecord &response) if (response.resultClass == GdbResultDone) { m_gdbVersion = 100; QString msg = response.data.findChild("consolestreamoutput").data(); - QRegExp supported("GNU gdb 6.[6789]"); - if (msg.indexOf(supported) == -1) { + QRegExp supported("GNU gdb(.*) (\\d+)\\.(\\d+)\\.(\\d+)"); + if (supported.indexIn(msg) == -1) { + qDebug() << "UNSUPPORTED GDB VERSION " << msg; QStringList list = msg.split("\n"); while (list.size() > 2) list.removeLast(); @@ -1396,11 +1397,11 @@ void GdbEngine::handleShowVersion(const GdbResultRecord &response) #else //QMessageBox::information(m_mainWindow, tr("Warning"), msg); #endif - } - int pos = msg.indexOf("GNU gdb 6."); - if (pos != -1) { - m_gdbVersion = 600 + (msg.at(pos + 10).unicode() - '0') * 10; - //qDebug() << "GDB VERSION " << m_gdbVersion << msg; + } else { + m_gdbVersion = 10000 * supported.cap(2).toInt() + + 100 * supported.cap(3).toInt() + + 1 * supported.cap(4).toInt(); + //qDebug() << "GDB VERSION " << m_gdbVersion; } } } @@ -1423,14 +1424,14 @@ void GdbEngine::handleExecRun(const GdbResultRecord &response) { if (response.resultClass == GdbResultRunning) { qq->notifyInferiorRunning(); - q->showStatusMessage(tr("Running..."), -1); + q->showStatusMessage(tr("Running...")); //reloadModules(); } else if (response.resultClass == GdbResultError) { QString msg = response.data.findChild("msg").data(); if (msg == "Cannot find bounds of current function") { qq->notifyInferiorStopped(); //q->showStatusMessage(tr("No debug information available. " - // "Leaving function..."), -1); + // "Leaving function...")); //stepOutExec(); } else { QMessageBox::critical(q->mainWindow(), tr("Error"), @@ -1558,7 +1559,7 @@ bool GdbEngine::startDebugger() qDebug() << "ExeFile: " << q->m_executable; #endif - q->showStatusMessage("Starting Debugger", -1); + q->showStatusMessage(tr("Starting Debugger")); emit gdbInputAvailable(QString(), theGdbSettings().m_gdbCmd + ' ' + gdbArgs.join(" ")); m_gdbProc.start(theGdbSettings().m_gdbCmd, gdbArgs); @@ -1567,7 +1568,7 @@ bool GdbEngine::startDebugger() if (m_gdbProc.state() != QProcess::Running) return false; - q->showStatusMessage(tr("Gdb Running"), -1); + q->showStatusMessage(tr("Gdb Running")); sendCommand("show version", GdbShowVersion); if (qq->useFastStart()) { @@ -2337,8 +2338,8 @@ void GdbEngine::handleModulesList(const GdbResultRecord &record) void GdbEngine::handleStackSelectThread(const GdbResultRecord &record, int) { Q_UNUSED(record); - qDebug("FIXME: StackHandler::handleOutput: SelectThread"); - q->showStatusMessage(tr("Retrieving data for stack view..."), -1); + //qDebug("FIXME: StackHandler::handleOutput: SelectThread"); + q->showStatusMessage(tr("Retrieving data for stack view..."), 3000); sendCommand("-stack-list-frames", StackListFrames); } @@ -2432,7 +2433,7 @@ void GdbEngine::selectThread(int index) QList<ThreadData> threads = threadsHandler->threads(); QWB_ASSERT(index < threads.size(), return); int id = threads.at(index).id; - q->showStatusMessage(tr("Retrieving data for stack view..."), -1); + q->showStatusMessage(tr("Retrieving data for stack view..."), 10000); sendCommand(QLatin1String("-thread-select ") + QString::number(id), StackSelectThread); } @@ -2545,7 +2546,7 @@ bool GdbEngine::supportsThreads() const { // 6.3 crashes happily on -thread-list-ids. So don't use it. // The test below is a semi-random pick, 6.8 works fine - return m_gdbVersion > 650; + return m_gdbVersion > 60500; } ////////////////////////////////////////////////////////////////////// @@ -3081,7 +3082,7 @@ void GdbEngine::runCustomDumper(const WatchData & data0, bool dumpChildren) q->showStatusMessage( tr("Retrieving data for watch view (%1 requests pending)...") - .arg(m_pendingRequests + 1), -1); + .arg(m_pendingRequests + 1), 10000); // create response slot for socket data QVariant var; var.setValue(data); @@ -3299,7 +3300,7 @@ void GdbEngine::updateWatchModel2() PENDING_DEBUG("REBUILDING MODEL") emit gdbInputAvailable(QString(), "[" + currentTime() + "] <Rebuild Watchmodel>"); - q->showStatusMessage(tr("Finished retrieving data."), -1); + q->showStatusMessage(tr("Finished retrieving data."), 400); qq->watchHandler()->rebuildModel(); if (!m_toolTipExpression.isEmpty()) { @@ -3313,9 +3314,6 @@ void GdbEngine::updateWatchModel2() "Cannot evaluate expression: " + m_toolTipExpression); } } - - //qDebug() << "INSERT DATA" << data0.toString(); - //q->showStatusMessage(tr("Stopped."), 5000); } void GdbEngine::handleQueryDataDumper1(const GdbResultRecord &record) @@ -3897,7 +3895,7 @@ void GdbEngine::handleToolTip(const GdbResultRecord &record, if (isCustomValueDumperAvailable(m_toolTip.type)) runCustomDumper(m_toolTip, false); else - q->showStatusMessage(tr("Retrieving data for tooltip..."), -1); + q->showStatusMessage(tr("Retrieving data for tooltip..."), 10000); sendCommand("-data-evaluate-expression " + m_toolTip.exp, WatchToolTip, "evaluate"); //sendToolTipCommand("-var-evaluate-expression tooltip") diff --git a/src/plugins/debugger/mode.cpp b/src/plugins/debugger/mode.cpp index 3eef7dc8329..2229cbfe6f5 100644 --- a/src/plugins/debugger/mode.cpp +++ b/src/plugins/debugger/mode.cpp @@ -169,6 +169,8 @@ QToolBar *DebugMode::createToolBar() managerAccess->threadsWindow(), SIGNAL(threadSelected(int))); debugToolBar->addWidget(threadBox); + debugToolBar->addWidget(managerAccess->statusLabel()); + QWidget *stretch = new QWidget; stretch->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); debugToolBar->addWidget(stretch); From 02488eebe43a840b90b6ee7d950c15c8a79ec853 Mon Sep 17 00:00:00 2001 From: Roberto Raggi <roberto.raggi@trolltech.com> Date: Mon, 8 Dec 2008 14:48:51 +0100 Subject: [PATCH 37/77] More cleanup in the CppPreprocessor. --- src/plugins/cpptools/cppmodelmanager.cpp | 24 ++++++++++++------------ src/plugins/cpptools/cppmodelmanager.h | 8 ++++---- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index e8359da2b5b..a165614a594 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -115,7 +115,6 @@ public: void setWorkingCopy(const QMap<QString, QByteArray> &workingCopy); void setIncludePaths(const QStringList &includePaths); void setFrameworkPaths(const QStringList &frameworkPaths); - void addIncludePath(const QString &path); void setProjectFiles(const QStringList &files); void run(QString &fileName); void operator()(QString &fileName); @@ -170,9 +169,6 @@ void CppPreprocessor::setIncludePaths(const QStringList &includePaths) void CppPreprocessor::setFrameworkPaths(const QStringList &frameworkPaths) { m_frameworkPaths = frameworkPaths; } -void CppPreprocessor::addIncludePath(const QString &path) -{ m_includePaths.append(path); } - void CppPreprocessor::setProjectFiles(const QStringList &files) { m_projectFiles = files; } @@ -488,14 +484,14 @@ void CppModelManager::ensureUpdated() if (! m_dirty) return; - m_projectFiles = updateProjectFiles(); - m_includePaths = updateIncludePaths(); - m_frameworkPaths = updateFrameworkPaths(); - m_definedMacros = updateDefinedMacros(); + m_projectFiles = internalProjectFiles(); + m_includePaths = internalIncludePaths(); + m_frameworkPaths = internalFrameworkPaths(); + m_definedMacros = internalDefinedMacros(); m_dirty = false; } -QStringList CppModelManager::updateProjectFiles() const +QStringList CppModelManager::internalProjectFiles() const { QStringList files; QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(m_projects); @@ -504,10 +500,11 @@ QStringList CppModelManager::updateProjectFiles() const ProjectInfo pinfo = it.value(); files += pinfo.sourceFiles; } + files.removeDuplicates(); return files; } -QStringList CppModelManager::updateIncludePaths() const +QStringList CppModelManager::internalIncludePaths() const { QStringList includePaths; QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(m_projects); @@ -516,10 +513,11 @@ QStringList CppModelManager::updateIncludePaths() const ProjectInfo pinfo = it.value(); includePaths += pinfo.includePaths; } + includePaths.removeDuplicates(); return includePaths; } -QStringList CppModelManager::updateFrameworkPaths() const +QStringList CppModelManager::internalFrameworkPaths() const { QStringList frameworkPaths; QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(m_projects); @@ -528,10 +526,11 @@ QStringList CppModelManager::updateFrameworkPaths() const ProjectInfo pinfo = it.value(); frameworkPaths += pinfo.frameworkPaths; } + frameworkPaths.removeDuplicates(); return frameworkPaths; } -QByteArray CppModelManager::updateDefinedMacros() const +QByteArray CppModelManager::internalDefinedMacros() const { QByteArray macros; QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(m_projects); @@ -588,6 +587,7 @@ void CppModelManager::updateProjectInfo(const ProjectInfo &pinfo) return; m_projects.insert(pinfo.project, pinfo); + m_dirty = true; } QFuture<void> CppModelManager::refreshSourceFiles(const QStringList &sourceFiles) diff --git a/src/plugins/cpptools/cppmodelmanager.h b/src/plugins/cpptools/cppmodelmanager.h index 6bc7d0c1c55..3b2f4e19993 100644 --- a/src/plugins/cpptools/cppmodelmanager.h +++ b/src/plugins/cpptools/cppmodelmanager.h @@ -133,10 +133,10 @@ private: } void ensureUpdated(); - QStringList updateProjectFiles() const; - QStringList updateIncludePaths() const; - QStringList updateFrameworkPaths() const; - QByteArray updateDefinedMacros() const; + QStringList internalProjectFiles() const; + QStringList internalIncludePaths() const; + QStringList internalFrameworkPaths() const; + QByteArray internalDefinedMacros() const; static void parse(QFutureInterface<void> &future, CppPreprocessor *preproc, From 764f9b3ac9ecde434ef37a9704b054a0249d2391 Mon Sep 17 00:00:00 2001 From: Kavindra Palaraja <qtc-committer@nokia.com> Date: Mon, 8 Dec 2008 15:14:36 +0100 Subject: [PATCH 38/77] Fixes: Documentation fixes RevBy: hjk --- doc/qtcreator.qdoc | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index 4dd7a5fb53c..0db515fe434 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -69,7 +69,7 @@ \image qtcreator-breakdown.png - \seection1 The Mode Selectors + \section1 The Mode Selectors When working in Qt Creator, you can be in one of five modes: \bold Project, \bold Edit, \bold Debug, \bold Help, and \bold Output. @@ -613,7 +613,7 @@ \page creator-debugging.html \nextpage creator-tips.html - \title Debugging With Qt Creator + \title Debugging with Qt Creator \table \row @@ -677,9 +677,9 @@ \list \o At a particular line you want the program to stop -- click on the - left margin or press \key F9 (\key F8 for Mac Os X). - \o At the name of a function that you want the program to stop -- enter - the function's name in \gui{Set Breakpoint at Function...} under the + left margin or press \key F9 (\key F8 for Mac OS X). + \o At a function that you want the program to stop -- enter the + function's name in \gui{Set Breakpoint at Function...} under the \gui Debug menu. \endlist @@ -744,7 +744,7 @@ When the program being debugged is stopped, Qt Creator displays the nested function calls leading to the current position as a \e call stack trace. - This stack trace is built up from \e call stack frames, each representing a + This stack trace is built up from \e{call stack frames}, each representing a particular function. For each function, Qt Creator will try to retrieve the file name and line number of the corresponding source files. This data is shown in the \gui Stack view. @@ -765,11 +765,10 @@ \section2 Threads - The \gui Thread view displays the state of the program being debugged one - thread at a time. If a multi-threaded program is stopped, the \gui Thread - view or the combobox named \gui Thread in the debugger's status bar can - be used to switch from one thread to another. The \gui Stack view will - adjust itself accordingly. + If a multi-threaded program is stopped, the \gui Thread view or the + combobox named \gui Thread in the debugger's status bar can be used to + switch from one thread to another. The \gui Stack view will adjust itself + accordingly. \section2 Locals and Watchers @@ -851,8 +850,8 @@ function, the latter the current state of the CPU registers. Both views are mainly useful in connection with the low-level \gui{Step single instruction} and \gui{Step over single instruction} - commands - + commands. + \section1 A Walkthrough for the Debugger Frontend @@ -947,8 +946,9 @@ \bold{Running Qt Creator from the Command Line} - You can start Qt Creator from a command prompt with an existing session or - \c{.pro} file by giving the name as argument on the command line. + You can start Qt Creator from a command prompt with the name of an existing + session or \c{.pro} file by giving the name as argument on the command + line. \bold{Show and Hide the Sidebar} From b220999bdd55c1fb8a7888b9d319353df6451653 Mon Sep 17 00:00:00 2001 From: Roberto Raggi <qtc-committer@nokia.com> Date: Mon, 8 Dec 2008 17:06:45 +0100 Subject: [PATCH 39/77] Fixes: release build with compiling with CONFIG+=debug_and_release --- src/qworkbench.pri | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/qworkbench.pri b/src/qworkbench.pri index e869ce452a8..1f842960842 100644 --- a/src/qworkbench.pri +++ b/src/qworkbench.pri @@ -1,16 +1,14 @@ IDE_SOURCE_TREE = $$PWD/../ -isEmpty(TEST) { - CONFIG(debug, debug|release) { +isEmpty(TEST):CONFIG(debug, debug|release) { + !debug_and_release|build_pass { TEST = 1 } } -!isEmpty(TEST) { - equals(TEST, 1) { - QT +=testlib - DEFINES+=WITH_TESTS - } +equals(TEST, 1) { + QT +=testlib + DEFINES += WITH_TESTS } isEmpty(IDE_BUILD_TREE) { From be9dfc8c913525e5b636d1693e8a14a45d021f17 Mon Sep 17 00:00:00 2001 From: con <qtc-committer@nokia.com> Date: Mon, 8 Dec 2008 17:47:54 +0100 Subject: [PATCH 40/77] Fixes: - Show <No Symbols> or <Select Symbol> in 'empty' method combo box Task: - 234321 RevBy: - Bjoern --- src/libs/cplusplus/OverviewModel.cpp | 46 ++++++++++++++++++++++------ src/plugins/cppeditor/cppeditor.cpp | 23 +++----------- src/plugins/cppeditor/cppeditor.h | 1 - 3 files changed, 41 insertions(+), 29 deletions(-) diff --git a/src/libs/cplusplus/OverviewModel.cpp b/src/libs/cplusplus/OverviewModel.cpp index 38456d8fa7d..20658778905 100644 --- a/src/libs/cplusplus/OverviewModel.cpp +++ b/src/libs/cplusplus/OverviewModel.cpp @@ -74,10 +74,10 @@ Symbol *OverviewModel::globalSymbolAt(unsigned index) const QModelIndex OverviewModel::index(int row, int column, const QModelIndex &parent) const { - if (! hasDocument()) { - return QModelIndex(); - } else if (! parent.isValid()) { - Symbol *symbol = globalSymbolAt(row); + if (!parent.isValid()) { + if (row == 0) // account for no symbol item + return createIndex(row, column); + Symbol *symbol = globalSymbolAt(row-1); // account for no symbol item return createIndex(row, column, symbol); } else { Symbol *parentSymbol = static_cast<Symbol *>(parent.internalPointer()); @@ -96,12 +96,20 @@ QModelIndex OverviewModel::index(int row, int column, const QModelIndex &parent) QModelIndex OverviewModel::parent(const QModelIndex &child) const { Symbol *symbol = static_cast<Symbol *>(child.internalPointer()); - Q_ASSERT(symbol != 0); + if (!symbol) // account for no symbol item + return QModelIndex(); if (Scope *scope = symbol->scope()) { Symbol *parentSymbol = scope->owner(); - if (parentSymbol && parentSymbol->scope()) - return createIndex(parentSymbol->index(), 0, parentSymbol); + if (parentSymbol && parentSymbol->scope()) { + QModelIndex index; + if (parentSymbol->scope() && parentSymbol->scope()->owner() + && parentSymbol->scope()->owner()->scope()) // the parent doesn't have a parent + index = createIndex(parentSymbol->index(), 0, parentSymbol); + else //+1 to account for no symbol item + index = createIndex(parentSymbol->index() + 1, 0, parentSymbol); + return index; + } } return QModelIndex(); @@ -110,22 +118,27 @@ QModelIndex OverviewModel::parent(const QModelIndex &child) const int OverviewModel::rowCount(const QModelIndex &parent) const { if (hasDocument()) { - if (! parent.isValid()) { - return globalSymbolCount(); + if (!parent.isValid()) { + return globalSymbolCount()+1; // account for no symbol item } else { + if (!parent.parent().isValid() && parent.row() == 0) // account for no symbol item + return 0; Symbol *parentSymbol = static_cast<Symbol *>(parent.internalPointer()); Q_ASSERT(parentSymbol != 0); if (ScopedSymbol *scopedSymbol = parentSymbol->asScopedSymbol()) { - if (! scopedSymbol->isFunction()) { + if (!scopedSymbol->isFunction()) { Scope *parentScope = scopedSymbol->members(); Q_ASSERT(parentScope != 0); return parentScope->symbolCount(); } } + return 0; } } + if (!parent.isValid()) + return 1; // account for no symbol item return 0; } @@ -136,6 +149,19 @@ int OverviewModel::columnCount(const QModelIndex &) const QVariant OverviewModel::data(const QModelIndex &index, int role) const { + // account for no symbol item + if (!index.parent().isValid() && index.row() == 0) { + switch (role) { + case Qt::DisplayRole: + if (rowCount() > 1) + return tr("<Select Symbol>"); + else + return tr("<No Symbols>"); + default: + return QVariant(); + } //switch + } + switch (role) { case Qt::DisplayRole: { Symbol *symbol = static_cast<Symbol *>(index.internalPointer()); diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 8567f81d751..ff68bd0bac2 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -203,9 +203,7 @@ void CPPEditor::createToolBar(CPPEditorEditable *editable) m_methodCombo->setMaxVisibleItems(20); m_overviewModel = new OverviewModel(this); - m_noSymbolsModel = new QStringListModel(this); - m_noSymbolsModel->setStringList(QStringList() << tr("<no symbols>")); - m_methodCombo->setModel(m_noSymbolsModel); + m_methodCombo->setModel(m_overviewModel); connect(m_methodCombo, SIGNAL(activated(int)), this, SLOT(jumpToMethod(int))); connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(updateMethodBoxIndex())); @@ -318,16 +316,9 @@ void CPPEditor::onDocumentUpdated(Document::Ptr doc) return; m_overviewModel->rebuild(doc); - if (m_overviewModel->rowCount() > 0) { - if (m_methodCombo->model() != m_overviewModel) - m_methodCombo->setModel(m_overviewModel); - OverviewTreeView *treeView = static_cast<OverviewTreeView *>(m_methodCombo->view()); - treeView->sync(); - updateMethodBoxIndex(); - } else { - if (m_methodCombo->model() != m_noSymbolsModel) - m_methodCombo->setModel(m_noSymbolsModel); - } + OverviewTreeView *treeView = static_cast<OverviewTreeView *>(m_methodCombo->view()); + treeView->sync(); + updateMethodBoxIndex(); } void CPPEditor::updateFileName() @@ -335,8 +326,6 @@ void CPPEditor::updateFileName() void CPPEditor::jumpToMethod(int) { - if (m_methodCombo->model() != m_overviewModel) - return; QModelIndex index = m_methodCombo->view()->currentIndex(); Symbol *symbol = m_overviewModel->symbolFromIndex(index); if (! symbol) @@ -351,8 +340,6 @@ void CPPEditor::jumpToMethod(int) void CPPEditor::updateMethodBoxIndex() { - if (m_methodCombo->model() != m_overviewModel) - return; int line = 0, column = 0; convertPosition(position(), &line, &column); @@ -362,7 +349,7 @@ void CPPEditor::updateMethodBoxIndex() for (int row = 0; row < rc; ++row) { const QModelIndex index = m_overviewModel->index(row, 0, QModelIndex()); Symbol *symbol = m_overviewModel->symbolFromIndex(index); - if (symbol->line() > unsigned(line)) + if (symbol && symbol->line() > unsigned(line)) break; lastIndex = index; } diff --git a/src/plugins/cppeditor/cppeditor.h b/src/plugins/cppeditor/cppeditor.h index 33745eddef2..05f2c5d9c74 100644 --- a/src/plugins/cppeditor/cppeditor.h +++ b/src/plugins/cppeditor/cppeditor.h @@ -139,7 +139,6 @@ private: QList<int> m_contexts; QComboBox *m_methodCombo; CPlusPlus::OverviewModel *m_overviewModel; - QStringListModel *m_noSymbolsModel; }; } // namespace Internal From e07976f6559109cd4b87f95068597aa3e54c1367 Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Mon, 8 Dec 2008 18:26:09 +0100 Subject: [PATCH 41/77] ignore async output starting with '=' --- doc/qtcreator.qch | Bin 1649664 -> 1657856 bytes src/plugins/debugger/gdbengine.cpp | 7 ++++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/qtcreator.qch b/doc/qtcreator.qch index 00473f3458d78cb11acb2bb75d02aee69b0869d7..c728e43245e3171093ce06f07e4e393d6fb157d4 100644 GIT binary patch delta 41730 zcmZp;k<u_Db%L~@Dg!DIny6zVz{327fq{W7nE5yJH|CGbZ#E0Elrysn@iQ<m@bYZ_ z#w;qp?8E$fv!K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{^-nqm6H z#%i`8B{s%JMI>zpEF`(6N6JXbu`2~BVw1aXBPlR_uZ$!gmtuheID8o)p0Y#rlp&HE z6&x897=jrx81fm47)lrv7~C0h7%~}h844JR8B!S(7!nyurYFitip%QDvoe}8nlffG z<T0c$q%u?>nIb=ZqP(OCo0lA#PrutrDsak0%Ywoy65<xLWND6MiY(X^35Xl=8HyQ- z84?+a7%Cb3WDp6pz)@0U`YA_A1$G$^X*R}2UPuTPI7;eqOE>aKf&Fa@vC9e7-$qDw zNx3oPGn6tEfqh@XkP7y%0z(NyK7#^-GeZ$WD#+&ysnfHKB@Nj;BoQ_lNJ{F7OM((R zJL4M$=5l5krXx%>OcqR%jBhqJUSpgdqa=BQElib-u~8G^HgIaxwU^Z4RE<;t1w|;t zd1ygliR3($>2=bQDqM|h%3%NKV%1=Rq(OQ5Ms-PlR&YTu-O*T5bn<;|Hb%Ya8yzJ@ zU2z8k149G@DItMmDnF{J#?z%#Bn_c9qRE*|U!*P>H~F46JEH;EMS`e$O&AiVe^Qe) z#je|Q`WF>RckFUz(;d_$jiGXAc^5fpF)*lsLq!rZaWOD3GB7YeLJG~@meaSXN?Jlq zN0YOdE}<rwBLzwaoD8xI%=OGROlO(+8TT-JV%X1+!5}+5R7292Qy`Rsogp%kkr8aY zAcpl|VHpfz21Z#!c6J6+Q>e!2PR5cVtc>!F?rhV)YDgYq77t{dzE4v!z(l3dnuU|0 z(YDc+k&&dRR3|0gSs0~qnWx)mN#=0zIx?{{xVkbjGJwnf=`q@pvieN*jGPROjE#(p ej10t<D9XetWMWj<rX#t7nNfNAPJKx?Mt%VP)k-V? diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp index 5fce8a96555..aea9635048f 100644 --- a/src/plugins/debugger/gdbengine.cpp +++ b/src/plugins/debugger/gdbengine.cpp @@ -442,7 +442,8 @@ void GdbEngine::handleResponse() break; } - if (token == -1 && *from != '&' && *from != '~' && *from != '*') { + if (token == -1 && *from != '&' && *from != '~' && *from != '*' + && *from != '=') { // FIXME: On Linux the application's std::out is merged in here. // High risk of falsely interpreting this as MI output. // We assume that we _always_ use tokens, so not finding a token @@ -470,7 +471,7 @@ void GdbEngine::handleResponse() for (; from != to; ++from) { const char c = *from; if (!isNameChar(c)) - break; + break; asyncClass += *from; } //qDebug() << "ASYNCCLASS" << asyncClass; @@ -1283,7 +1284,7 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data) QVariant var = QVariant::fromValue<GdbMi>(data); sendCommand("p 0", GdbAsyncOutput2, var); // dummy } else { - q->showStatusMessage(tr("Stopped. Reason: \"%1\"").arg(reason)); + q->showStatusMessage(tr("Stopped: \"%1\"").arg(reason)); handleAsyncOutput2(data); } return; From 6761ca0c1038be4982e2d80952a4f444ca7209c6 Mon Sep 17 00:00:00 2001 From: con <qtc-committer@nokia.com> Date: Mon, 8 Dec 2008 18:38:25 +0100 Subject: [PATCH 42/77] Fixes: - Custom Dumpers on Mac RevBy: - hjk --- src/plugins/debugger/gdbengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp index aea9635048f..f1042c4faf5 100644 --- a/src/plugins/debugger/gdbengine.cpp +++ b/src/plugins/debugger/gdbengine.cpp @@ -3971,7 +3971,7 @@ void GdbEngine::tryLoadCustomDumpers() if (qq->useFastStart()) sendCommand("set stop-on-solib-events 0"); QString flag = QString::number(RTLD_NOW); - sendCommand("call dlopen(\"" + lib + "\", " + flag + ")"); + sendCommand("call (void)dlopen(\"" + lib + "\", " + flag + ")"); sendCommand("sharedlibrary " + dotEscape(lib)); if (qq->useFastStart()) sendCommand("set stop-on-solib-events 1"); From d3a97147dd7a5898c88ea60572aa3cf42b9055ad Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Mon, 8 Dec 2008 19:26:00 +0100 Subject: [PATCH 43/77] make tooltip use while debugging configurable --- src/plugins/debugger/debuggermanager.cpp | 13 +++++++++ src/plugins/debugger/debuggermanager.h | 2 ++ src/plugins/debugger/debuggerplugin.cpp | 10 ++++++- src/plugins/debugger/gdbengine.cpp | 36 +++++++++--------------- 4 files changed, 38 insertions(+), 23 deletions(-) diff --git a/src/plugins/debugger/debuggermanager.cpp b/src/plugins/debugger/debuggermanager.cpp index 11e7ef6c82d..a01a3ddc57e 100644 --- a/src/plugins/debugger/debuggermanager.cpp +++ b/src/plugins/debugger/debuggermanager.cpp @@ -352,6 +352,15 @@ void DebuggerManager::init() m_useFastStartAction->setCheckable(true); m_useFastStartAction->setChecked(true); + m_useToolTipsAction = new QAction(this); + m_useToolTipsAction->setText(tr("Use Tooltips While Debugging")); + m_useToolTipsAction->setToolTip(tr("Checking this will make enable " + "tooltips for variable values during debugging. Since this can slow " + "down debugging and does not provide reliable information as it does " + "not use scope information, it is switched off by default.")); + m_useToolTipsAction->setCheckable(true); + m_useToolTipsAction->setChecked(false); + // FIXME m_useFastStartAction->setChecked(false); m_useFastStartAction->setEnabled(false); @@ -943,6 +952,8 @@ void DebuggerManager::loadSessionData() QVariant value; querySessionValue(QLatin1String("UseFastStart"), &value); m_useFastStartAction->setChecked(value.toBool()); + querySessionValue(QLatin1String("UseToolTips"), &value); + m_useToolTipsAction->setChecked(value.toBool()); querySessionValue(QLatin1String("UseCustomDumpers"), &value); m_useCustomDumpersAction->setChecked(!value.isValid() || value.toBool()); querySessionValue(QLatin1String("SkipKnownFrames"), &value); @@ -956,6 +967,8 @@ void DebuggerManager::saveSessionData() setSessionValue(QLatin1String("UseFastStart"), m_useFastStartAction->isChecked()); + setSessionValue(QLatin1String("UseToolTips"), + m_useToolTipsAction->isChecked()); setSessionValue(QLatin1String("UseCustomDumpers"), m_useCustomDumpersAction->isChecked()); setSessionValue(QLatin1String("SkipKnownFrames"), diff --git a/src/plugins/debugger/debuggermanager.h b/src/plugins/debugger/debuggermanager.h index 63c225411fc..64dee6957f7 100644 --- a/src/plugins/debugger/debuggermanager.h +++ b/src/plugins/debugger/debuggermanager.h @@ -308,6 +308,7 @@ private: ThreadsHandler *threadsHandler() { return m_threadsHandler; } WatchHandler *watchHandler() { return m_watchHandler; } QAction *useCustomDumpersAction() const { return m_useCustomDumpersAction; } + QAction *useToolTipsAction() const { return m_useToolTipsAction; } QAction *debugDumpersAction() const { return m_debugDumpersAction; } bool skipKnownFrames() const; bool debugDumpers() const; @@ -431,6 +432,7 @@ private: QAction *m_debugDumpersAction; QAction *m_useCustomDumpersAction; QAction *m_useFastStartAction; + QAction *m_useToolTipsAction; QAction *m_dumpLogAction; QWidget *m_breakWindow; diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index feb63fa0c30..db787482d10 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -91,6 +91,7 @@ const char * const DEBUG_DUMPERS = "Debugger.DebugDumpers"; const char * const ADD_TO_WATCH = "Debugger.AddToWatch"; const char * const USE_CUSTOM_DUMPERS = "Debugger.UseCustomDumpers"; const char * const USE_FAST_START = "Debugger.UseFastStart"; +const char * const USE_TOOL_TIPS = "Debugger.UseToolTips"; const char * const SKIP_KNOWN_FRAMES = "Debugger.SkipKnownFrames"; const char * const DUMP_LOG = "Debugger.DumpLog"; @@ -374,13 +375,17 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes Constants::USE_FAST_START, globalcontext); mdebug->addAction(cmd); + cmd = actionManager->registerAction(m_manager->m_useToolTipsAction, + Constants::USE_TOOL_TIPS, globalcontext); + mdebug->addAction(cmd); + +#ifdef QT_DEBUG cmd = actionManager->registerAction(m_manager->m_dumpLogAction, Constants::DUMP_LOG, globalcontext); //cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+D,Ctrl+L"))); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+F11"))); mdebug->addAction(cmd); -#ifdef QT_DEBUG cmd = actionManager->registerAction(m_manager->m_debugDumpersAction, Constants::DEBUG_DUMPERS, debuggercontext); mdebug->addAction(cmd); @@ -549,6 +554,9 @@ void DebuggerPlugin::requestMark(TextEditor::ITextEditor *editor, int lineNumber void DebuggerPlugin::showToolTip(TextEditor::ITextEditor *editor, const QPoint &point, int pos) { + if (!m_manager->useToolTipsAction()->isChecked()) + return; + QPlainTextEdit *plaintext = qobject_cast<QPlainTextEdit*>(editor->widget()); if (!plaintext) return; diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp index aea9635048f..adf49443654 100644 --- a/src/plugins/debugger/gdbengine.cpp +++ b/src/plugins/debugger/gdbengine.cpp @@ -278,25 +278,8 @@ void GdbEngine::init() connect(&m_gdbProc, SIGNAL(finished(int, QProcess::ExitStatus)), q, SLOT(exitDebugger())); - // Custom dumpers - //m_dumperServerConnection = 0; - //m_dumperServer = new DumperServer(this); - //QString name = "gdb-" + - // QDateTime::currentDateTime().toString("yyyy_MM_dd-hh_mm_ss_zzz"); - //m_dumperServer->listen(name); - //connect(m_dumperServer, SIGNAL(newConnection()), - // this, SLOT(acceptConnection())); - - //if (!m_dumperServer->isListening()) { - // QMessageBox::critical(q->mainWindow(), tr("Dumper Server Setup Failed"), - // tr("Unable to create server listening for data: %1.\n" - // "Server name: %2").arg(m_dumperServer->errorString(), name), - // QMessageBox::Retry | QMessageBox::Cancel); - // } - connect(qq->debugDumpersAction(), SIGNAL(toggled(bool)), this, SLOT(setDebugDumpers(bool))); - connect(qq->useCustomDumpersAction(), SIGNAL(toggled(bool)), this, SLOT(setCustomDumpersWanted(bool))); @@ -442,8 +425,7 @@ void GdbEngine::handleResponse() break; } - if (token == -1 && *from != '&' && *from != '~' && *from != '*' - && *from != '=') { + if (token == -1 && *from != '&' && *from != '~' && *from != '*') { // FIXME: On Linux the application's std::out is merged in here. // High risk of falsely interpreting this as MI output. // We assume that we _always_ use tokens, so not finding a token @@ -452,7 +434,7 @@ void GdbEngine::handleResponse() while (from != to && *from != '\n') s += *from++; //qDebug() << "UNREQUESTED DATA " << s << " TAKEN AS APPLICATION OUTPUT"; - s += '\n'; + //s += '\n'; m_inbuffer = QByteArray(from, to - from); emit applicationOutputAvailable("app-stdout: ", s); @@ -3660,10 +3642,20 @@ void GdbEngine::setLocals(const QList<GdbMi> &locals) QHash<QString, int> seen; foreach (const GdbMi &item, locals) { + // Local variables of inlined code are reported as + // 26^done,locals={varobj={exp="this",value="",name="var4",exp="this", + // numchild="1",type="const QtSharedPointer::Basic<CPlusPlus::..." + // We do not want these at all. Current hypotheses is that those + // "spurious" locals have _two_ "exp" field. Try to filter them: #ifdef Q_OS_MAC - QString name = item.findChild("exp").data(); + int numExps = 0; + foreach (const GdbMi &child, item.children()) + numExps += int(child.name() == "exp"); + if (numExps > 1) + continue; + QString name = item.findChild("exp").data(); #else - QString name = item.findChild("name").data(); + QString name = item.findChild("name").data(); #endif int n = seen.value(name); if (n) { From 88b7a14a7973058248874f9a4d3dbcb181bcd352 Mon Sep 17 00:00:00 2001 From: Roberto Raggi <qtc-committer@nokia.com> Date: Tue, 9 Dec 2008 09:42:17 +0100 Subject: [PATCH 44/77] Added the methods to get all the identifiers used in a translation unit. --- shared/cplusplus/Control.cpp | 6 ++++++ shared/cplusplus/Control.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/shared/cplusplus/Control.cpp b/shared/cplusplus/Control.cpp index c994dbab9a2..a486dfdb940 100644 --- a/shared/cplusplus/Control.cpp +++ b/shared/cplusplus/Control.cpp @@ -511,6 +511,12 @@ Identifier *Control::findOrInsertIdentifier(const char *chars) return findOrInsertIdentifier(chars, length); } +Control::IdentifierIterator Control::firstIdentifier() const +{ return d->identifiers.begin(); } + +Control::IdentifierIterator Control::lastIdentifier() const +{ return d->identifiers.end(); } + StringLiteral *Control::findOrInsertStringLiteral(const char *chars, unsigned size) { return d->stringLiterals.findOrInsertLiteral(chars, size); } diff --git a/shared/cplusplus/Control.h b/shared/cplusplus/Control.h index fa7b4faa502..bd4b204843f 100644 --- a/shared/cplusplus/Control.h +++ b/shared/cplusplus/Control.h @@ -151,6 +151,11 @@ public: Identifier *findOrInsertIdentifier(const char *chars, unsigned size); Identifier *findOrInsertIdentifier(const char *chars); + typedef const Identifier *const *IdentifierIterator; + + IdentifierIterator firstIdentifier() const; + IdentifierIterator lastIdentifier() const; + StringLiteral *findOrInsertStringLiteral(const char *chars, unsigned size); StringLiteral *findOrInsertStringLiteral(const char *chars); From 342caa2141d1f62cbd1a4280c3ccba972abda0fa Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Tue, 9 Dec 2008 11:07:24 +0100 Subject: [PATCH 45/77] some more whitespace changes --- shared/cpaster/cgi.cpp | 14 +-- shared/cpaster/splitter.cpp | 4 +- shared/cpaster/view.cpp | 4 +- shared/help/helpviewer.cpp | 2 +- shared/indenter/test/main.cpp | 2 +- shared/proparser/proeditor.cpp | 9 +- shared/proparser/proeditormodel.cpp | 21 ++-- shared/proparser/profileevaluator.cpp | 12 +- shared/proparser/proparserutils.h | 40 +++---- shared/proparser/prowriter.cpp | 6 +- shared/proparser/proxml.cpp | 2 +- shared/proparser/valueeditor.cpp | 2 +- shared/qrceditor/resourcefile.cpp | 20 ++-- shared/qrceditor/resourceview.cpp | 19 ++-- shared/qtsingleapplication/qtlocalpeer.cpp | 10 +- src/libs/extensionsystem/pluginmanager.cpp | 4 +- src/libs/utils/filewizardpage.cpp | 2 +- src/libs/utils/projectintropage.cpp | 2 +- src/libs/utils/submiteditorwidget.cpp | 5 +- src/plugins/bineditor/bineditor.cpp | 4 +- src/plugins/bookmarks/bookmarkmanager.cpp | 2 +- .../cmakeprojectmanager/cmakeproject.cpp | 32 +++--- src/plugins/coreplugin/basefilewizard.cpp | 4 +- .../coreplugin/dialogs/settingsdialog.cpp | 8 +- .../coreplugin/dialogs/shortcutsettings.cpp | 8 +- .../editormanager/editormanager.cpp | 2 +- .../editormanager/openeditorsview.cpp | 2 +- src/plugins/coreplugin/fileiconprovider.cpp | 4 +- src/plugins/coreplugin/mainwindow.cpp | 7 +- src/plugins/coreplugin/manhattanstyle.cpp | 2 +- src/plugins/coreplugin/mimedatabase.cpp | 2 +- src/plugins/coreplugin/navigationwidget.cpp | 4 +- src/plugins/coreplugin/outputpane.cpp | 4 +- .../progressmanager/progresspie.cpp | 4 +- src/plugins/coreplugin/rightpane.cpp | 6 +- src/plugins/coreplugin/styleanimator.cpp | 5 +- src/plugins/coreplugin/vcsmanager.cpp | 8 +- src/plugins/debugger/attachexternaldialog.cpp | 77 +++++++------ src/plugins/debugger/attachremotedialog.cpp | 28 ++--- src/plugins/debugger/gdbtypemacros.cpp | 6 +- src/plugins/debugger/startexternaldialog.cpp | 2 +- .../cpp/formclasswizardparameters.cpp | 2 +- src/plugins/designer/formeditorw.cpp | 2 +- src/plugins/find/basetextfind.cpp | 2 +- src/plugins/git/gitplugin.cpp | 2 +- src/plugins/help/contentstoolwindow.cpp | 13 +-- src/plugins/help/helpengine.cpp | 20 ++-- src/plugins/help/helpplugin.cpp | 2 +- src/plugins/perforce/perforceplugin.cpp | 7 +- .../projectexplorer/abstractprocessstep.cpp | 19 ++-- .../projectexplorer/buildconfiguration.cpp | 9 +- .../buildsettingspropertiespage.cpp | 24 ++-- src/plugins/projectexplorer/buildstep.cpp | 8 +- .../projectexplorer/buildstepspage.cpp | 30 ++--- src/plugins/projectexplorer/environment.cpp | 31 +++-- .../projectexplorer/environmenteditmodel.cpp | 106 +++++++++--------- src/plugins/projectexplorer/outputwindow.cpp | 4 +- .../projectexplorer/persistentsettings.cpp | 2 +- .../projectexplorer/pluginfilefactory.cpp | 2 +- src/plugins/projectexplorer/processstep.cpp | 8 +- src/plugins/projectexplorer/project.cpp | 88 +++++++-------- .../projectexplorer/projectexplorer.cpp | 6 +- src/plugins/projectexplorer/projectmodels.cpp | 28 +++-- src/plugins/projectexplorer/projectwindow.cpp | 9 +- .../projectexplorer/projectwizardpage.cpp | 5 +- .../projectexplorer/removefiledialog.cpp | 2 +- src/plugins/projectexplorer/session.cpp | 12 +- src/plugins/projectexplorer/sessiondialog.cpp | 2 +- src/plugins/projectexplorer/taskwindow.cpp | 4 +- .../qt4projectmanager/cesdkhandler.cpp | 22 ++-- .../qt4projectmanager/deployhelper.cpp | 4 +- .../qt4projectmanager/gdbmacrosbuildstep.cpp | 4 +- src/plugins/qt4projectmanager/makestep.cpp | 10 +- .../qt4projectmanager/msvcenvironment.cpp | 16 +-- .../qt4projectmanager/profilereader.cpp | 2 +- src/plugins/qt4projectmanager/qmakestep.cpp | 4 +- .../qt4buildconfigwidget.cpp | 20 ++-- .../qt4buildenvironmentwidget.cpp | 8 +- src/plugins/qt4projectmanager/qt4nodes.cpp | 4 +- src/plugins/qt4projectmanager/qt4project.cpp | 14 +-- .../qt4projectmanager/qt4projectmanager.cpp | 3 +- .../qt4projectmanager/qt4runconfiguration.cpp | 4 +- .../qt4projectmanager/qtversionmanager.cpp | 102 ++++++++--------- .../wizards/librarywizarddialog.cpp | 2 +- src/plugins/qtscripteditor/qtscripteditor.cpp | 4 +- src/plugins/snippets/snippetswindow.cpp | 2 +- src/plugins/subversion/subversionplugin.cpp | 7 +- src/plugins/texteditor/basetextmark.cpp | 6 +- src/plugins/texteditor/codecselector.cpp | 9 +- tests/auto/profilereader/sync | 2 +- 90 files changed, 528 insertions(+), 571 deletions(-) diff --git a/shared/cpaster/cgi.cpp b/shared/cpaster/cgi.cpp index 2e94dc96b02..6e8ecd1404c 100644 --- a/shared/cpaster/cgi.cpp +++ b/shared/cpaster/cgi.cpp @@ -45,7 +45,7 @@ QString CGI::encodeURL(const QString &rawText) enc.reserve(utf.length()); // Make sure we at least have space for a normal US-ASCII URL QByteArray::const_iterator it = utf.constBegin(); - while(it != utf.constEnd()) { + while (it != utf.constEnd()) { char ch = *it; if (('A' <= ch && ch <= 'Z') || ('a' <= ch && ch <= 'z') @@ -54,7 +54,7 @@ QString CGI::encodeURL(const QString &rawText) else if (ch == ' ') enc.append('+'); else { - switch(ch) { + switch (ch) { case '-': case '_': case '(': case ')': case '.': case '!': @@ -80,15 +80,15 @@ QString CGI::decodeURL(const QString &urlText) { QByteArray dec; QString::const_iterator it = urlText.constBegin(); - while(it != urlText.constEnd()) { + while (it != urlText.constEnd()) { ushort ch = (*it).unicode(); - switch(ch) { + switch (ch) { case '%': { char c1 = char(0x00ff & (*(++it)).unicode()); char c2 = char(0x00ff & (*(++it)).unicode()); ushort v = 0; - if('A' <= c1 && c1 <= 'Z') + if ('A' <= c1 && c1 <= 'Z') v = c1 - 'A' + 10; else if ('a' <= c1 && c1 <= 'z') v = c1 - 'a' + 10; @@ -97,7 +97,7 @@ QString CGI::decodeURL(const QString &urlText) else continue; // Malformed URL! v <<= 4; // c1 was MSB half - if('A' <= c2 && c2 <= 'Z') + if ('A' <= c2 && c2 <= 'Z') v |= c2 - 'A' + 10; else if ('a' <= c2 && c2 <= 'z') v |= c2 - 'a' + 10; @@ -123,7 +123,7 @@ QString CGI::decodeURL(const QString &urlText) // ------------------------------------------------------------------------------------------------- inline const char *unicodeToHTML(ushort unicode_char) { - switch(unicode_char) { + switch (unicode_char) { // Latin ------------------------------- case 0x0022: return "quot"; // (34 ) quotation mark = APL quote case 0x0026: return "amp"; // (38 ) ampersand diff --git a/shared/cpaster/splitter.cpp b/shared/cpaster/splitter.cpp index 08ec626f625..22ccf1d9901 100644 --- a/shared/cpaster/splitter.cpp +++ b/shared/cpaster/splitter.cpp @@ -66,10 +66,8 @@ FileDataList splitDiffToFiles(const QByteArray &data) // The algorithm works like this: // On the first match we only get the filename of the first patch part // On the second match (if any) we get the diff content, and the name of the next file patch - // - - while(-1 != (splitIndex = splitExpr.indexIn(strData,splitIndex))) { + while (-1 != (splitIndex = splitExpr.indexIn(strData,splitIndex))) { if (!filename.isEmpty()) { QString content = strData.mid(previousSplit, splitIndex - previousSplit); ret.append(FileData(filename, content.toLatin1())); diff --git a/shared/cpaster/view.cpp b/shared/cpaster/view.cpp index ca5bd270eb2..6c37defe36b 100644 --- a/shared/cpaster/view.cpp +++ b/shared/cpaster/view.cpp @@ -125,7 +125,7 @@ QString View::getComment() QByteArray View::getContent() { QByteArray newContent; - for(int i = 0; i < m_ui.uiPatchList->count(); ++i) { + for (int i = 0; i < m_ui.uiPatchList->count(); ++i) { QListWidgetItem *item = m_ui.uiPatchList->item(i); if (item->checkState() != Qt::Unchecked) newContent += m_parts.at(i).content; @@ -159,7 +159,7 @@ int View::show(const QString &user, const QString &description, const QString &c QByteArray content; m_parts = parts; m_ui.uiPatchList->clear(); - foreach(const FileData part, parts) { + foreach (const FileData part, parts) { QListWidgetItem *itm = new QListWidgetItem(part.filename, m_ui.uiPatchList); itm->setCheckState(Qt::Checked); itm->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled); diff --git a/shared/help/helpviewer.cpp b/shared/help/helpviewer.cpp index d542e4996f5..9b80e99cd84 100644 --- a/shared/help/helpviewer.cpp +++ b/shared/help/helpviewer.cpp @@ -409,7 +409,7 @@ QVariant HelpViewer::loadResource(int type, const QUrl &name) void HelpViewer::openLinkInNewTab() { - if(lastAnchor.isEmpty()) + if (lastAnchor.isEmpty()) return; parentWidget->setSourceInNewTab(QUrl(lastAnchor)); diff --git a/shared/indenter/test/main.cpp b/shared/indenter/test/main.cpp index 701f66987c0..e9c9396197a 100644 --- a/shared/indenter/test/main.cpp +++ b/shared/indenter/test/main.cpp @@ -174,7 +174,7 @@ int main(int argc, char **argv) return 1; } - foreach(QString fileName, fileNames) + foreach (const QString &fileName, fileNames) if (const int rc = format(fileName)) return rc; diff --git a/shared/proparser/proeditor.cpp b/shared/proparser/proeditor.cpp index 02287b06ab1..93adb12493e 100644 --- a/shared/proparser/proeditor.cpp +++ b/shared/proparser/proeditor.cpp @@ -139,7 +139,7 @@ bool ProEditor::eventFilter(QObject *, QEvent *event) if (event->type() == QEvent::ShortcutOverride) { QKeyEvent *k = static_cast<QKeyEvent*>(event); if (k->modifiers() == Qt::ControlModifier) { - switch(k->key()) { + switch (k->key()) { case Qt::Key_X: cut(); return true; case Qt::Key_C: @@ -168,11 +168,8 @@ void ProEditor::updatePasteAction() bool pasteEnabled = false; const QMimeData *data = QApplication::clipboard()->mimeData(); - if (data) { - if (data->hasFormat(QLatin1String("application/x-problock"))) { - pasteEnabled = true; - } - } + if (data && data->hasFormat(QLatin1String("application/x-problock"))) + pasteEnabled = true; m_pasteAction->setEnabled(pasteEnabled); } diff --git a/shared/proparser/proeditormodel.cpp b/shared/proparser/proeditormodel.cpp index d0f28f68688..a929c7ab88d 100644 --- a/shared/proparser/proeditormodel.cpp +++ b/shared/proparser/proeditormodel.cpp @@ -732,13 +732,10 @@ bool ProEditorModel::insertItem(ProItem *item, int row, const QModelIndex &paren void ProEditorModel::markProFileModified(QModelIndex index) { - while(index.isValid()) - { - if( proItem(index)->kind() == ProItem::BlockKind) - { + while (index.isValid()) { + if (proItem(index)->kind() == ProItem::BlockKind) { ProBlock * block = proBlock(index); - if(block->blockKind() == ProBlock::ProFileKind) - { + if (block->blockKind() == ProBlock::ProFileKind) { ProFile * file = static_cast<ProFile *>(block); file->setModified(true); return; @@ -791,9 +788,9 @@ QString ProEditorModel::expressionToString(ProBlock *block, bool display) const { QString result; QList<ProItem*> items = block->items(); - for(int i=0; i<items.count(); ++i) { + for (int i = 0; i < items.count(); ++i) { ProItem *item = items.at(i); - switch(item->kind()) { + switch (item->kind()) { case ProItem::FunctionKind: { ProFunction *v = static_cast<ProFunction*>(item); result += v->text(); @@ -808,14 +805,16 @@ QString ProEditorModel::expressionToString(ProBlock *block, bool display) const } else { result += v->text(); } - break; } + break; + } case ProItem::OperatorKind: { ProOperator *v = static_cast<ProOperator*>(item); if (v->operatorKind() == ProOperator::NotOperator) result += QLatin1Char('!'); else result += QLatin1Char('|'); - break; } + break; + } case ProItem::ValueKind: case ProItem::BlockKind: break; // ### unhandled @@ -847,7 +846,7 @@ QList<ProItem *> ProEditorModel::stringToExpression(const QString &exp) const bool c = false; QString tmpstr; - for (int i=0; i<exp.length(); ++i) { + for (int i = 0; i < exp.length(); ++i) { QChar tmpchar = exp.at(i); if (tmpchar == '(') ++p; else if (tmpchar == ')') --p; diff --git a/shared/proparser/profileevaluator.cpp b/shared/proparser/profileevaluator.cpp index c50de16feca..cdb02609c6e 100644 --- a/shared/proparser/profileevaluator.cpp +++ b/shared/proparser/profileevaluator.cpp @@ -332,7 +332,7 @@ void ProFileEvaluator::Private::insertOperator(const char op) updateItem(); ProOperator::OperatorKind opkind; - switch(op) { + switch (op) { case '!': opkind = ProOperator::NotOperator; break; @@ -532,21 +532,21 @@ bool ProFileEvaluator::Private::visitEndProFile(ProFile * pro) evaluateFile(mkspecDirectory + "/features/default_post.prf", &ok); QStringList processed; - while(1) { + while (1) { bool finished = true; QStringList configs = values("CONFIG"); - for(int i = configs.size()-1; i >= 0; --i) { + for (int i = configs.size()-1; i >= 0; --i) { const QString config = configs[i].toLower(); - if(!processed.contains(config)) { + if (!processed.contains(config)) { processed.append(config); evaluateFile(mkspecDirectory + "/features/" + config + ".prf", &ok); - if(ok) { + if (ok) { finished = false; break; } } } - if(finished) + if (finished) break; } } diff --git a/shared/proparser/proparserutils.h b/shared/proparser/proparserutils.h index 8c5cb3aaabc..82941e31c1b 100644 --- a/shared/proparser/proparserutils.h +++ b/shared/proparser/proparserutils.h @@ -173,41 +173,41 @@ static QStringList split_arg_list(QString params) const QChar *params_data = params.data(); const int params_len = params.length(); int last = 0; - while(last < params_len && ((params_data+last)->unicode() == SPACE + while (last < params_len && ((params_data+last)->unicode() == SPACE /*|| (params_data+last)->unicode() == TAB*/)) ++last; - for(int x = last, parens = 0; x <= params_len; x++) { + for (int x = last, parens = 0; x <= params_len; x++) { unicode = (params_data+x)->unicode(); - if(x == params_len) { - while(x && (params_data+(x-1))->unicode() == SPACE) + if (x == params_len) { + while (x && (params_data+(x-1))->unicode() == SPACE) --x; QString mid(params_data+last, x-last); - if(quote) { - if(mid[0] == quote && mid[(int)mid.length()-1] == quote) + if (quote) { + if (mid[0] == quote && mid[(int)mid.length()-1] == quote) mid = mid.mid(1, mid.length()-2); quote = 0; } args << mid; break; } - if(unicode == LPAREN) { + if (unicode == LPAREN) { --parens; - } else if(unicode == RPAREN) { + } else if (unicode == RPAREN) { ++parens; - } else if(quote && unicode == quote) { + } else if (quote && unicode == quote) { quote = 0; - } else if(!quote && (unicode == SINGLEQUOTE || unicode == DOUBLEQUOTE)) { + } else if (!quote && (unicode == SINGLEQUOTE || unicode == DOUBLEQUOTE)) { quote = unicode; - } else if(!parens && !quote && unicode == COMMA) { + } else if (!parens && !quote && unicode == COMMA) { QString mid = params.mid(last, x - last).trimmed(); args << mid; last = x+1; - while(last < params_len && ((params_data+last)->unicode() == SPACE + while (last < params_len && ((params_data+last)->unicode() == SPACE /*|| (params_data+last)->unicode() == TAB*/)) ++last; } } - for(int i = 0; i < args.count(); i++) + for (int i = 0; i < args.count(); i++) unquote(&args[i]); return args; } @@ -227,22 +227,22 @@ static QStringList split_value_list(const QString &vals, bool do_semicolon=false const QChar *vals_data = vals.data(); const int vals_len = vals.length(); - for(int x = 0, parens = 0; x < vals_len; x++) { + for (int x = 0, parens = 0; x < vals_len; x++) { QChar c = vals_data[x]; if (x != vals_len-1 && c == BACKSLASH && vals_data[x+1].unicode() == '\'' || vals_data[x+1] == DOUBLEQUOTE) { build += vals_data[x++]; // get that 'escape' } else if (!quote.isEmpty() && c == quote.top()) { quote.pop(); - } else if(c == SINGLEQUOTE || c == DOUBLEQUOTE) { + } else if (c == SINGLEQUOTE || c == DOUBLEQUOTE) { quote.push(c); - } else if(c == RPAREN) { + } else if (c == RPAREN) { --parens; - } else if(c == LPAREN) { + } else if (c == LPAREN) { ++parens; } - if(!parens && quote.isEmpty() && ((do_semicolon && c == SEMICOLON) || + if (!parens && quote.isEmpty() && ((do_semicolon && c == SEMICOLON) || vals_data[x] == Option::field_sep)) { ret << build; build.clear(); @@ -250,7 +250,7 @@ static QStringList split_value_list(const QString &vals, bool do_semicolon=false build += vals_data[x]; } } - if(!build.isEmpty()) + if (!build.isEmpty()) ret << build; return ret; } @@ -262,7 +262,7 @@ static QStringList qmake_mkspec_paths() QByteArray qmakepath = qgetenv("QMAKEPATH"); if (!qmakepath.isEmpty()) { const QStringList lst = splitPathList(QString::fromLocal8Bit(qmakepath)); - for(QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it) + for (QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it) ret << ((*it) + concat); } ret << QLibraryInfo::location(QLibraryInfo::DataPath) + concat; diff --git a/shared/proparser/prowriter.cpp b/shared/proparser/prowriter.cpp index 0f215fd79c4..98787294ce4 100644 --- a/shared/proparser/prowriter.cpp +++ b/shared/proparser/prowriter.cpp @@ -137,7 +137,7 @@ void ProWriter::writeBlock(ProBlock *block, const QString &indent) if (block->blockKind() & ProBlock::VariableKind) { ProVariable *v = static_cast<ProVariable*>(block); m_out << v->variable(); - switch(v->variableOperator()) { + switch (v->variableOperator()) { case ProVariable::AddOperator: m_out << QLatin1String(" += "); break; case ProVariable::RemoveOperator: @@ -165,12 +165,12 @@ void ProWriter::writeBlock(ProBlock *block, const QString &indent) } QList<ProItem*> items = block->items(); - for (int i=0; i<items.count(); ++i) { + for (int i = 0; i < items.count(); ++i) { m_writeState &= ~LastItem; m_writeState &= ~FirstItem; if (i == 0) m_writeState |= FirstItem; - if (i == (items.count()-1)) + if (i == items.count() - 1) m_writeState |= LastItem; writeItem(items.at(i), newindent); } diff --git a/shared/proparser/proxml.cpp b/shared/proparser/proxml.cpp index 4b63fc255d3..2416b3f6bc1 100644 --- a/shared/proparser/proxml.cpp +++ b/shared/proparser/proxml.cpp @@ -104,7 +104,7 @@ QDomNode ProXmlParser::createItemNode(QDomDocument doc, ProItem *item) const tag = doc.createElement(QLatin1String("block")); } - foreach(ProItem *child, block->items()) { + foreach (ProItem *child, block->items()) { QDomNode childNode = createItemNode(doc, child); if (!childNode.isNull()) tag.appendChild(childNode); diff --git a/shared/proparser/valueeditor.cpp b/shared/proparser/valueeditor.cpp index 2208b0492e9..638d7994a92 100644 --- a/shared/proparser/valueeditor.cpp +++ b/shared/proparser/valueeditor.cpp @@ -131,7 +131,7 @@ void ValueEditor::initialize() connect(m_itemListWidget, SIGNAL(itemChanged(QListWidgetItem *)), this, SLOT(updateItemChanges(QListWidgetItem *))); - foreach(ProVariableInfo *varinfo, m_infomanager->variables()) { + foreach (ProVariableInfo *varinfo, m_infomanager->variables()) { m_varComboBox->addItem(varinfo->name(), varinfo->id()); } diff --git a/shared/qrceditor/resourcefile.cpp b/shared/qrceditor/resourcefile.cpp index daf1946e53e..2867814c852 100644 --- a/shared/qrceditor/resourcefile.cpp +++ b/shared/qrceditor/resourcefile.cpp @@ -151,7 +151,7 @@ bool ResourceFile::save() const QStringList name_list = prefixList(); - foreach (QString name, name_list) { + foreach (const QString &name, name_list) { FileList file_list; QString lang; foreach (Prefix *pref, m_prefix_list) { @@ -164,7 +164,7 @@ bool ResourceFile::save() QDomElement relt = doc.createElement(QLatin1String("qresource")); root.appendChild(relt); relt.setAttribute(QLatin1String("prefix"), name); - if(!lang.isEmpty()) + if (!lang.isEmpty()) relt.setAttribute(QLatin1String("lang"), lang); foreach (const File *f, file_list) { @@ -622,14 +622,14 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const // Prefix node stringRes = prefix->name; const QString &lang = prefix->lang; - if(!lang.isEmpty()) + if (!lang.isEmpty()) appendParenthesized(lang, stringRes); } else { // File node Q_ASSERT(file != NULL); stringRes = QFileInfo(file->name).fileName(); const QString alias = file->alias; - if(!alias.isEmpty()) + if (!alias.isEmpty()) appendParenthesized(alias, stringRes); } result = stringRes; @@ -654,7 +654,7 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const QString conv_file = m_resource_file.relativePath(file->name); QString stringRes = conv_file.replace(QDir::separator(), QLatin1Char('/')); const QString &alias_file = file->alias; - if(!alias_file.isEmpty()) + if (!alias_file.isEmpty()) appendParenthesized(alias_file, stringRes); result = stringRes; @@ -696,7 +696,7 @@ void ResourceModel::getItem(const QModelIndex &index, QString &prefix, QString & QString ResourceModel::lang(const QModelIndex &index) const { - if(!index.isValid()) + if (!index.isValid()) return QString(); return m_resource_file.lang(index.row()); @@ -704,14 +704,14 @@ QString ResourceModel::lang(const QModelIndex &index) const QString ResourceModel::alias(const QModelIndex &index) const { - if(!index.isValid() || !index.parent().isValid()) + if (!index.isValid() || !index.parent().isValid()) return QString(); return m_resource_file.alias(index.parent().row(), index.row()); } QString ResourceModel::file(const QModelIndex &index) const { - if(!index.isValid() || !index.parent().isValid()) + if (!index.isValid() || !index.parent().isValid()) return QString(); return m_resource_file.file(index.parent().row(), index.row()); } @@ -852,7 +852,7 @@ void ResourceModel::changePrefix(const QModelIndex &model_idx, const QString &pr if (m_resource_file.prefix(prefix_idx) == ResourceFile::fixPrefix(prefix)) return; - if(m_resource_file.contains(prefix)) + if (m_resource_file.contains(prefix)) return; m_resource_file.replacePrefix(prefix_idx, prefix); @@ -880,7 +880,7 @@ void ResourceModel::changeAlias(const QModelIndex &index, const QString &alias) if (!index.parent().isValid()) return; - if(m_resource_file.alias(index.parent().row(), index.row()) == alias) + if (m_resource_file.alias(index.parent().row(), index.row()) == alias) return; m_resource_file.replaceAlias(index.parent().row(), index.row(), alias); emit dataChanged(index, index); diff --git a/shared/qrceditor/resourceview.cpp b/shared/qrceditor/resourceview.cpp index 27a0a5a4254..53b35b97e79 100644 --- a/shared/qrceditor/resourceview.cpp +++ b/shared/qrceditor/resourceview.cpp @@ -476,7 +476,7 @@ bool ResourceView::load(QString fileName) const QFileInfo fi(fileName); m_qrcModel->setFileName(fi.absoluteFilePath()); - if(!fi.exists()) + if (!fi.exists()) return false; const bool result = m_qrcModel->reload(); @@ -501,9 +501,8 @@ void ResourceView::changePrefix(const QModelIndex &index) QString const prefixAfter = QInputDialog::getText(this, tr("Change Prefix"), tr("Input Prefix:"), QLineEdit::Normal, prefixBefore, &ok); - if (ok) { + if (ok) addUndoCommand(preindex, PrefixProperty, prefixBefore, prefixAfter); - } } void ResourceView::changeLang(const QModelIndex &index) @@ -522,7 +521,7 @@ void ResourceView::changeLang(const QModelIndex &index) void ResourceView::changeAlias(const QModelIndex &index) { - if(!index.parent().isValid()) + if (!index.parent().isValid()) return; bool ok = false; @@ -531,9 +530,8 @@ void ResourceView::changeAlias(const QModelIndex &index) QString const aliasAfter = QInputDialog::getText(this, tr("Change File Alias"), tr("Alias:"), QLineEdit::Normal, aliasBefore, &ok); - if (ok) { + if (ok) addUndoCommand(index, AliasProperty, aliasBefore, aliasAfter); - } } QString ResourceView::currentAlias() const @@ -585,15 +583,16 @@ void ResourceView::changeValue(const QModelIndex &nodeIndex, NodeProperty proper } } -void ResourceView::advanceMergeId() { +void ResourceView::advanceMergeId() +{ m_mergeId++; - if (m_mergeId < 0) { + if (m_mergeId < 0) m_mergeId = 0; - } } void ResourceView::addUndoCommand(const QModelIndex &nodeIndex, NodeProperty property, - const QString &before, const QString &after) { + const QString &before, const QString &after) +{ QUndoCommand * const command = new ModifyPropertyCommand(this, nodeIndex, property, m_mergeId, before, after); m_history->push(command); diff --git a/shared/qtsingleapplication/qtlocalpeer.cpp b/shared/qtsingleapplication/qtlocalpeer.cpp index f488e72134b..1e324106ad0 100644 --- a/shared/qtsingleapplication/qtlocalpeer.cpp +++ b/shared/qtsingleapplication/qtlocalpeer.cpp @@ -50,9 +50,9 @@ static PProcessIdToSessionId pProcessIdToSessionId = 0; namespace SharedTools { -const char* QtLocalPeer::ack = "ack"; +const char *QtLocalPeer::ack = "ack"; -QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId) +QtLocalPeer::QtLocalPeer(QObject *parent, const QString &appId) : QObject(parent), id(appId) { if (id.isEmpty()) @@ -86,8 +86,6 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId) lockFile.open(QIODevice::ReadWrite); } - - bool QtLocalPeer::isClient() { if (lockFile.isLocked()) @@ -105,7 +103,6 @@ bool QtLocalPeer::isClient() return false; } - bool QtLocalPeer::sendMessage(const QString &message, int timeout) { if (!isClient()) @@ -113,7 +110,7 @@ bool QtLocalPeer::sendMessage(const QString &message, int timeout) QLocalSocket socket; bool connOk = false; - for(int i = 0; i < 2; i++) { + for (int i = 0; i < 2; i++) { // Try twice, in case the other instance is just starting up socket.connectToServer(socketName); connOk = socket.waitForConnected(timeout/2); @@ -139,7 +136,6 @@ bool QtLocalPeer::sendMessage(const QString &message, int timeout) return res; } - void QtLocalPeer::receiveConnection() { QLocalSocket* socket = server->nextPendingConnection(); diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index f6f623f6654..3f7ba386e4e 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -422,12 +422,12 @@ void PluginManager::formatPluginVersions(QTextStream &str) const void PluginManager::startTests() { #ifdef WITH_TESTS - foreach(PluginSpec *pluginSpec, d->testSpecs) { + foreach (PluginSpec *pluginSpec, d->testSpecs) { const QMetaObject *mo = pluginSpec->plugin()->metaObject(); QStringList methods; methods.append("arg0"); // We only want slots starting with "test" - for(int i = mo->methodOffset(); i < mo->methodCount(); ++i) { + for (int i = mo->methodOffset(); i < mo->methodCount(); ++i) { if (QByteArray(mo->method(i).signature()).startsWith("test")) { QString method = QString::fromLatin1(mo->method(i).signature()); methods.append(method.left(method.size()-2)); diff --git a/src/libs/utils/filewizardpage.cpp b/src/libs/utils/filewizardpage.cpp index 3e85b34d44b..da892faf03b 100644 --- a/src/libs/utils/filewizardpage.cpp +++ b/src/libs/utils/filewizardpage.cpp @@ -92,7 +92,7 @@ void FileWizardPage::setName(const QString &name) void FileWizardPage::changeEvent(QEvent *e) { - switch(e->type()) { + switch (e->type()) { case QEvent::LanguageChange: m_d->m_ui.retranslateUi(this); break; diff --git a/src/libs/utils/projectintropage.cpp b/src/libs/utils/projectintropage.cpp index 8d370571937..63123138730 100644 --- a/src/libs/utils/projectintropage.cpp +++ b/src/libs/utils/projectintropage.cpp @@ -117,7 +117,7 @@ void ProjectIntroPage::setDescription(const QString &description) void ProjectIntroPage::changeEvent(QEvent *e) { - switch(e->type()) { + switch (e->type()) { case QEvent::LanguageChange: m_d->m_ui.retranslateUi(this); break; diff --git a/src/libs/utils/submiteditorwidget.cpp b/src/libs/utils/submiteditorwidget.cpp index 85c11241490..4aa021e63ec 100644 --- a/src/libs/utils/submiteditorwidget.cpp +++ b/src/libs/utils/submiteditorwidget.cpp @@ -46,7 +46,8 @@ namespace Utils { // QActionPushButton: A push button tied to an action // (similar to a QToolButton) -class QActionPushButton : public QPushButton { +class QActionPushButton : public QPushButton +{ Q_OBJECT public: explicit QActionPushButton(QAction *a); @@ -319,7 +320,7 @@ void SubmitEditorWidget::fileSelectionChanged() void SubmitEditorWidget::changeEvent(QEvent *e) { - switch(e->type()) { + switch (e->type()) { case QEvent::LanguageChange: m_d->m_ui.retranslateUi(this); break; diff --git a/src/plugins/bineditor/bineditor.cpp b/src/plugins/bineditor/bineditor.cpp index 05e24a77b49..9ca1dbfb749 100644 --- a/src/plugins/bineditor/bineditor.cpp +++ b/src/plugins/bineditor/bineditor.cpp @@ -222,7 +222,7 @@ void BinEditor::scrollContentsBy(int dx, int dy) void BinEditor::changeEvent(QEvent *e) { QAbstractScrollArea::changeEvent(e); - if(e->type() == QEvent::ActivationChange) { + if (e->type() == QEvent::ActivationChange) { if (!isActiveWindow()) m_autoScrollTimer.stop(); } @@ -450,7 +450,7 @@ void BinEditor::paintEvent(QPaintEvent *e) for (int c = 0; c < 16; ++c) { int pos = line * 16 + c; if (pos >= m_data.size()) { - while(c < 16) { + while (c < 16) { itemStringData[c*3] = itemStringData[c*3+1] = ' '; ++c; } diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp index fd4541a01dd..fefe7562967 100644 --- a/src/plugins/bookmarks/bookmarkmanager.cpp +++ b/src/plugins/bookmarks/bookmarkmanager.cpp @@ -173,7 +173,7 @@ void BookmarkDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti // int idx; // forever { // idx = directory.lastIndexOf("/", pos-1); -// if(idx == -1) { +// if (idx == -1) { // // Can't happen, this means the string did fit after all? // break; // } diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 5569c900f2b..012b79ec831 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -58,7 +58,7 @@ CMakeProject::CMakeProject(CMakeManager *manager, const QString &fileName) CMakeCbpParser cbpparser; if (cbpparser.parseCbpFile(cbpFile)) { buildTree(m_rootNode, cbpparser.fileList()); - foreach(ProjectExplorer::FileNode *fn, cbpparser.fileList()) + foreach (ProjectExplorer::FileNode *fn, cbpparser.fileList()) m_files.append(fn->path()); m_files.sort(); @@ -87,11 +87,9 @@ QString CMakeProject::findCbpFile(const QDir &directory) // TODO the cbp file is named like the project() command in the CMakeList.txt file // so this method below could find the wrong cbp file, if the user changes the project() // name - foreach(const QString &cbpFile , directory.entryList()) - { - if (cbpFile.endsWith(".cbp")) { + foreach (const QString &cbpFile , directory.entryList()) { + if (cbpFile.endsWith(".cbp")) return directory.path() + "/" + cbpFile; - } } return QString::null; } @@ -113,7 +111,7 @@ void CMakeProject::buildTree(CMakeProjectNode *rootNode, QList<ProjectExplorer:: { //m_rootNode->addFileNodes(fileList, m_rootNode); qSort(list.begin(), list.end(), ProjectExplorer::ProjectNode::sortNodesByPath); - foreach( ProjectExplorer::FileNode *fn, list) { + foreach (ProjectExplorer::FileNode *fn, list) { // Get relative path to rootNode QString parentDir = QFileInfo(fn->path()).absolutePath(); ProjectExplorer::FolderNode *folder = findOrCreateFolder(rootNode, parentDir); @@ -127,10 +125,10 @@ ProjectExplorer::FolderNode *CMakeProject::findOrCreateFolder(CMakeProjectNode * QString relativePath = QDir(QFileInfo(rootNode->path()).path()).relativeFilePath(directory); QStringList parts = relativePath.split("/"); ProjectExplorer::FolderNode *parent = rootNode; - foreach(const QString &part, parts) { + foreach (const QString &part, parts) { // Find folder in subFolders bool found = false; - foreach(ProjectExplorer::FolderNode *folder, parent->subFolderNodes()) { + foreach (ProjectExplorer::FolderNode *folder, parent->subFolderNodes()) { if (QFileInfo(folder->path()).fileName() == part) { // yeah found something :) parent = folder; @@ -332,7 +330,7 @@ bool CMakeCbpParser::parseCbpFile(const QString &fileName) if (fi.exists() && fi.open(QFile::ReadOnly)) { setDevice(&fi); - while(!atEnd()) { + while (!atEnd()) { readNext(); if (name() == "CodeBlocks_project_file") { parseCodeBlocks_project_file(); @@ -350,7 +348,7 @@ bool CMakeCbpParser::parseCbpFile(const QString &fileName) void CMakeCbpParser::parseCodeBlocks_project_file() { - while(!atEnd()) { + while (!atEnd()) { readNext(); if (isEndElement()) { return; @@ -364,7 +362,7 @@ void CMakeCbpParser::parseCodeBlocks_project_file() void CMakeCbpParser::parseProject() { - while(!atEnd()) { + while (!atEnd()) { readNext(); if (isEndElement()) { return; @@ -380,7 +378,7 @@ void CMakeCbpParser::parseProject() void CMakeCbpParser::parseBuild() { - while(!atEnd()) { + while (!atEnd()) { readNext(); if (isEndElement()) { return; @@ -396,7 +394,7 @@ void CMakeCbpParser::parseTarget() { m_targetOutput.clear(); m_targetType = false; - while(!atEnd()) { + while (!atEnd()) { readNext(); if (isEndElement()) { if (m_targetType && !m_targetOutput.isEmpty()) { @@ -420,7 +418,7 @@ void CMakeCbpParser::parseTargetOption() m_targetOutput = attributes().value("output").toString(); else if (attributes().hasAttribute("type") && attributes().value("type") == "1") m_targetType = true; - while(!atEnd()) { + while (!atEnd()) { readNext(); if (isEndElement()) { return; @@ -432,7 +430,7 @@ void CMakeCbpParser::parseTargetOption() void CMakeCbpParser::parseCompiler() { - while(!atEnd()) { + while (!atEnd()) { readNext(); if (isEndElement()) { return; @@ -447,7 +445,7 @@ void CMakeCbpParser::parseCompiler() void CMakeCbpParser::parseAdd() { m_includeFiles.append(attributes().value("directory").toString()); - while(!atEnd()) { + while (!atEnd()) { readNext(); if (isEndElement()) { return; @@ -463,7 +461,7 @@ void CMakeCbpParser::parseUnit() QString fileName = attributes().value("filename").toString(); if (!fileName.endsWith(".rule")) m_fileList.append( new ProjectExplorer::FileNode(fileName, ProjectExplorer::SourceType, false)); - while(!atEnd()) { + while (!atEnd()) { readNext(); if (isEndElement()) { return; diff --git a/src/plugins/coreplugin/basefilewizard.cpp b/src/plugins/coreplugin/basefilewizard.cpp index 58030ba20c9..bb7adb99620 100644 --- a/src/plugins/coreplugin/basefilewizard.cpp +++ b/src/plugins/coreplugin/basefilewizard.cpp @@ -456,7 +456,7 @@ QStringList BaseFileWizard::runWizard(const QString &path, QWidget *parent) } } if (firstExtensionPageHit) - foreach(IFileWizardExtension *ex, extensions) + foreach (IFileWizardExtension *ex, extensions) ex->firstExtensionPageShown(files); if (accepted) break; @@ -486,7 +486,7 @@ QStringList BaseFileWizard::runWizard(const QString &path, QWidget *parent) } } // Run the extensions - foreach(IFileWizardExtension *ex, extensions) + foreach (IFileWizardExtension *ex, extensions) if (!ex->process(files, &errorMessage)) { QMessageBox::critical(parent, tr("File Generation Failure"), errorMessage); return QStringList(); diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index 696a7ddbdf9..2d8531f3ed7 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -58,7 +58,7 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &initialCategory, CoreImpl::instance()->pluginManager()->getObjects<IOptionsPage>(); int index = 0; - foreach(IOptionsPage *page, pages) { + foreach (IOptionsPage *page, pages) { QTreeWidgetItem *item = new QTreeWidgetItem(); item->setText(0, page->name()); item->setData(0, Qt::UserRole, index); @@ -77,7 +77,7 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &initialCategory, int catCount = 1; while (catCount < categoriesId.count()) { - if(!categories.contains(currentCategory + QLatin1Char('|') + categoriesId.at(catCount))) { + if (!categories.contains(currentCategory + QLatin1Char('|') + categoriesId.at(catCount))) { treeitem = new QTreeWidgetItem(categories.value(currentCategory)); currentCategory += QLatin1Char('|') + categoriesId.at(catCount); treeitem->setText(0, trCategories.at(catCount)); @@ -123,14 +123,14 @@ void SettingsDialog::pageSelected(QTreeWidgetItem *) void SettingsDialog::accept() { - foreach(IOptionsPage *page, m_pages) + foreach (IOptionsPage *page, m_pages) page->finished(true); done(QDialog::Accepted); } void SettingsDialog::reject() { - foreach(IOptionsPage *page, m_pages) + foreach (IOptionsPage *page, m_pages) page->finished(false); done(QDialog::Rejected); } diff --git a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp index c00e6cc6838..b5c98643b42 100644 --- a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp +++ b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp @@ -123,7 +123,7 @@ QWidget *ShortcutSettings::createPage(QWidget *parent) void ShortcutSettings::finished(bool accepted) { if (accepted) { - foreach(ShortcutItem *item, m_scitems) { + foreach (ShortcutItem *item, m_scitems) { item->m_cmd->setKeySequence(item->m_key); } } @@ -196,7 +196,7 @@ bool ShortcutSettings::filter(const QString &f, const QTreeWidgetItem *item) if (f.isEmpty()) return false; for (int i = 0; i < item->columnCount(); ++i) { - if(item->text(i).contains(f, Qt::CaseInsensitive)) + if (item->text(i).contains(f, Qt::CaseInsensitive)) return false; } return true; @@ -242,7 +242,7 @@ void ShortcutSettings::importAction() CommandsFile cf(fileName); QMap<QString, QKeySequence> mapping = cf.importCommands(); - foreach(ShortcutItem *item, m_scitems) { + foreach (ShortcutItem *item, m_scitems) { QString sid = uidm->stringForUniqueIdentifier(item->m_cmd->id()); if (mapping.contains(sid)) { item->m_key = mapping.value(sid); @@ -256,7 +256,7 @@ void ShortcutSettings::importAction() void ShortcutSettings::defaultAction() { - foreach(ShortcutItem *item, m_scitems) { + foreach (ShortcutItem *item, m_scitems) { item->m_key = item->m_cmd->defaultKeySequence(); item->m_item->setText(2, item->m_key); if (item->m_item == m_page->commandList->currentItem()) diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 29798b25c01..3f3b93af704 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1089,7 +1089,7 @@ bool EditorManager::saveFileAs(IEditor *editor) const bool success = editor->file()->save(absoluteFilePath); m_d->m_core->fileManager()->unblockFileChange(editor->file()); - if(success) + if (success) m_d->m_core->fileManager()->addToRecentFiles(editor->file()->fileName()); updateActions(); diff --git a/src/plugins/coreplugin/editormanager/openeditorsview.cpp b/src/plugins/coreplugin/editormanager/openeditorsview.cpp index 79e912e6e04..d321491e2f2 100644 --- a/src/plugins/coreplugin/editormanager/openeditorsview.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorsview.cpp @@ -70,7 +70,7 @@ OpenEditorsWidget::OpenEditorsWidget() m_ui.editorList->installEventFilter(this); m_ui.editorList->setFrameStyle(QFrame::NoFrame); EditorManager *em = EditorManager::instance(); - foreach(IEditor *editor, em->openedEditors()) { + foreach (IEditor *editor, em->openedEditors()) { registerEditor(editor); } connect(em, SIGNAL(editorOpened(Core::IEditor*)), diff --git a/src/plugins/coreplugin/fileiconprovider.cpp b/src/plugins/coreplugin/fileiconprovider.cpp index 243e5dd64de..571a49e8ed3 100644 --- a/src/plugins/coreplugin/fileiconprovider.cpp +++ b/src/plugins/coreplugin/fileiconprovider.cpp @@ -96,7 +96,7 @@ void FileIconProvider::registerIconForSuffix(const QIcon &icon, const QString &s { // delete old icon, if it exists QList<QPair<QString,QIcon> >::iterator iter = m_cache.begin(); - for(; iter != m_cache.end(); ++iter) { + for (; iter != m_cache.end(); ++iter) { if ((*iter).first == suffix) { iter = m_cache.erase(iter); break; @@ -118,7 +118,7 @@ QIcon FileIconProvider::iconForSuffix(const QString &suffix) const return icon; QList<QPair<QString,QIcon> >::const_iterator iter = m_cache.constBegin(); - for(; iter != m_cache.constEnd(); ++iter) { + for (; iter != m_cache.constEnd(); ++iter) { if ((*iter).first == suffix) { icon = (*iter).second; break; diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 1d905070549..4eab3fb5571 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -896,7 +896,7 @@ void MainWindow::removeContextObject(IContext *context) return; m_contextWidgets.remove(widget); - if(m_activeContext == context) + if (m_activeContext == context) updateContextObject(0); } @@ -957,10 +957,11 @@ void MainWindow::resetContext() updateContextObject(0); } -QMenu *MainWindow::createPopupMenu() { +QMenu *MainWindow::createPopupMenu() +{ QMenu *menu = new QMenu(this); QList<ActionContainer *> containers = m_actionManager->containers(); - foreach(ActionContainer *c, containers) { + foreach (ActionContainer *c, containers) { if (c->toolBar()) menu->addAction(c->toolBar()->toggleViewAction()); } diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index a39e68baad6..d796af3bdca 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -140,7 +140,7 @@ void drawCornerImage(const QImage &img, QPainter *painter, QRect rect, if (top > 0) { //top painter->drawImage(QRect(rect.left() + left, rect.top(), rect.width() -right - left, top), img, QRect(left, 0, size.width() -right - left, top)); - if(left > 0) //top-left + if (left > 0) //top-left painter->drawImage(QRect(rect.left(), rect.top(), left, top), img, QRect(0, 0, left, top)); if (right > 0) //top-right diff --git a/src/plugins/coreplugin/mimedatabase.cpp b/src/plugins/coreplugin/mimedatabase.cpp index 0c6d1d4cdde..37ff518a76a 100644 --- a/src/plugins/coreplugin/mimedatabase.cpp +++ b/src/plugins/coreplugin/mimedatabase.cpp @@ -299,7 +299,7 @@ void MimeTypeData::debug(QTextStream &str, int indent) const str << indentS << "SubClassesOf: " << subClassesOf.join(comma) << '\n'; if (!globPatterns.empty()) { str << indentS << "Glob: "; - foreach(const QRegExp &r, globPatterns) + foreach (const QRegExp &r, globPatterns) str << r.pattern() << ' '; str << '\n'; if (!suffixes.empty()) { diff --git a/src/plugins/coreplugin/navigationwidget.cpp b/src/plugins/coreplugin/navigationwidget.cpp index 5ce8e7498d0..82ed13a29e8 100644 --- a/src/plugins/coreplugin/navigationwidget.cpp +++ b/src/plugins/coreplugin/navigationwidget.cpp @@ -87,8 +87,8 @@ void NavigationWidgetPlaceHolder::applyStoredSize(int width) QList<int> sizes = splitter->sizes(); int index = splitter->indexOf(this); int diff = width - sizes.at(index); - int adjust = sizes.count() > 1? ( diff / (sizes.count() - 1)) : 0; - for(int i=0; i<sizes.count(); ++i) { + int adjust = sizes.count() > 1 ? (diff / (sizes.count() - 1)) : 0; + for (int i = 0; i < sizes.count(); ++i) { if (i != index) sizes[i] += adjust; } diff --git a/src/plugins/coreplugin/outputpane.cpp b/src/plugins/coreplugin/outputpane.cpp index ca60d674ff0..11c0a1c4a0c 100644 --- a/src/plugins/coreplugin/outputpane.cpp +++ b/src/plugins/coreplugin/outputpane.cpp @@ -277,7 +277,7 @@ void OutputPane::init(ICore *core, ExtensionSystem::PluginManager *pm) connect(cmd->action(), SIGNAL(triggered()), this, SLOT(shortcutTriggered())); connect(cmd->action(), SIGNAL(changed()), this, SLOT(updateToolTip())); - } while(it != begin); + } while (it != begin); changePage(); } @@ -293,7 +293,7 @@ void OutputPane::shortcutTriggered() // but the outputpane doesn't have focus // then just give it focus // else do the same as clicking on the button does - if(OutputPanePlaceHolder::m_current + if (OutputPanePlaceHolder::m_current && OutputPanePlaceHolder::m_current->isVisible() && m_widgetComboBox->itemData(m_widgetComboBox->currentIndex()).toInt() == idx) { if (!outputPane->hasFocus() && outputPane->canFocus()) diff --git a/src/plugins/coreplugin/progressmanager/progresspie.cpp b/src/plugins/coreplugin/progressmanager/progresspie.cpp index b6f34d36b41..f3aac399709 100644 --- a/src/plugins/coreplugin/progressmanager/progresspie.cpp +++ b/src/plugins/coreplugin/progressmanager/progresspie.cpp @@ -101,9 +101,9 @@ void ProgressBar::paintEvent(QPaintEvent *) double percent = 0.50; if (range != 0) percent = (value() - minimum()) / range; - if(percent > 1) + if (percent > 1) percent = 1; - else if(percent < 0) + else if (percent < 0) percent = 0; QPainter p(this); diff --git a/src/plugins/coreplugin/rightpane.cpp b/src/plugins/coreplugin/rightpane.cpp index 3c17b255833..1465164d187 100644 --- a/src/plugins/coreplugin/rightpane.cpp +++ b/src/plugins/coreplugin/rightpane.cpp @@ -76,8 +76,8 @@ void RightPanePlaceHolder::applyStoredSize(int width) QList<int> sizes = splitter->sizes(); int index = splitter->indexOf(this); int diff = width - sizes.at(index); - int adjust = sizes.count() > 1? ( diff / (sizes.count() - 1)) : 0; - for(int i=0; i<sizes.count(); ++i) { + int adjust = sizes.count() > 1 ? (diff / (sizes.count() - 1)) : 0; + for (int i = 0; i < sizes.count(); ++i) { if (i != index) sizes[i] -= adjust; } @@ -125,7 +125,7 @@ void RightPanePlaceHolder::currentModeChanged(Core::IMode *mode) RightPaneWidget *RightPaneWidget::m_instance = 0; RightPaneWidget::RightPaneWidget() - :m_shown(true), m_width(0) + : m_shown(true), m_width(0) { m_instance = this; diff --git a/src/plugins/coreplugin/styleanimator.cpp b/src/plugins/coreplugin/styleanimator.cpp index e69c48200d0..8ca453278b2 100644 --- a/src/plugins/coreplugin/styleanimator.cpp +++ b/src/plugins/coreplugin/styleanimator.cpp @@ -52,7 +52,8 @@ void Animation::paint(QPainter *painter, const QStyleOption *option) Q_UNUSED(painter); } -void Animation::drawBlendedImage(QPainter *painter, QRect rect, float alpha) { +void Animation::drawBlendedImage(QPainter *painter, QRect rect, float alpha) +{ if (_secondaryImage.isNull() || _primaryImage.isNull()) return; @@ -64,7 +65,7 @@ void Animation::drawBlendedImage(QPainter *painter, QRect rect, float alpha) { const int sw = _primaryImage.width(); const int sh = _primaryImage.height(); const int bpl = _primaryImage.bytesPerLine(); - switch(_primaryImage.depth()) { + switch (_primaryImage.depth()) { case 32: { uchar *mixed_data = _tempImage.bits(); diff --git a/src/plugins/coreplugin/vcsmanager.cpp b/src/plugins/coreplugin/vcsmanager.cpp index 02475a0d0e6..5980879ab1a 100644 --- a/src/plugins/coreplugin/vcsmanager.cpp +++ b/src/plugins/coreplugin/vcsmanager.cpp @@ -77,7 +77,7 @@ void VCSManager::setVCSEnabled(const QString &directory) qDebug() << Q_FUNC_INFO << directory; IVersionControl* managingVCS = findVersionControlForDirectory(directory); const VersionControlList versionControls = allVersionControls(); - foreach(IVersionControl *versionControl, versionControls) { + foreach (IVersionControl *versionControl, versionControls) { const bool newEnabled = versionControl == managingVCS; if (newEnabled != versionControl->isEnabled()) versionControl->setEnabled(newEnabled); @@ -89,7 +89,7 @@ void VCSManager::setAllVCSEnabled() if (debug) qDebug() << Q_FUNC_INFO; const VersionControlList versionControls = allVersionControls(); - foreach(IVersionControl *versionControl, versionControls) + foreach (IVersionControl *versionControl, versionControls) if (!versionControl->isEnabled()) versionControl->setEnabled(true); } @@ -106,7 +106,7 @@ IVersionControl* VCSManager::findVersionControlForDirectory(const QString &direc int pos = 0; const QChar slash = QLatin1Char('/'); - while(true) { + while (true) { int index = directory.indexOf(slash, pos); if (index == -1) break; @@ -119,7 +119,7 @@ IVersionControl* VCSManager::findVersionControlForDirectory(const QString &direc // ah nothing so ask the IVersionControls directly const VersionControlList versionControls = allVersionControls(); - foreach(IVersionControl * versionControl, versionControls) { + foreach (IVersionControl * versionControl, versionControls) { if (versionControl->managesDirectory(directory)) { m_d->m_cachedMatches.insert(versionControl->findTopLevelForDirectory(directory), versionControl); return versionControl; diff --git a/src/plugins/debugger/attachexternaldialog.cpp b/src/plugins/debugger/attachexternaldialog.cpp index 1a376b3373f..f5d2101cc95 100644 --- a/src/plugins/debugger/attachexternaldialog.cpp +++ b/src/plugins/debugger/attachexternaldialog.cpp @@ -152,13 +152,12 @@ void AttachExternalDialog::rebuildProcessList() #ifdef Q_OS_WINDOWS -// Forward declarations: -BOOL GetProcessList( ); -BOOL ListProcessModules( DWORD dwPID ); -BOOL ListProcessThreads( DWORD dwOwnerPID ); -void printError( TCHAR* msg ); +BOOL GetProcessList(); +BOOL ListProcessModules(DWORD dwPID); +BOOL ListProcessThreads(DWORD dwOwnerPID); +void printError(TCHAR *msg); -BOOL GetProcessList( ) +BOOL GetProcessList() { HANDLE hProcessSnap; HANDLE hProcess; @@ -167,7 +166,7 @@ BOOL GetProcessList( ) // Take a snapshot of all processes in the system. hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 ); - if( hProcessSnap == INVALID_HANDLE_VALUE ) + if (hProcessSnap == INVALID_HANDLE_VALUE) { printError( TEXT("CreateToolhelp32Snapshot (of processes)") ); return( FALSE ); @@ -178,7 +177,7 @@ BOOL GetProcessList( ) // Retrieve information about the first process, // and exit if unsuccessful - if( !Process32First( hProcessSnap, &pe32 ) ) + if (!Process32First( hProcessSnap, &pe32 )) { printError( TEXT("Process32First") ); // show cause of failure CloseHandle( hProcessSnap ); // clean the snapshot object @@ -196,12 +195,12 @@ BOOL GetProcessList( ) // Retrieve the priority class. dwPriorityClass = 0; hProcess = OpenProcess( PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID ); - if( hProcess == NULL ) + if (hProcess == NULL) printError( TEXT("OpenProcess") ); else { dwPriorityClass = GetPriorityClass( hProcess ); - if( !dwPriorityClass ) + if (!dwPriorityClass) printError( TEXT("GetPriorityClass") ); CloseHandle( hProcess ); } @@ -210,31 +209,30 @@ BOOL GetProcessList( ) printf( "\n Thread count = %d", pe32.cntThreads ); printf( "\n Parent process ID = 0x%08X", pe32.th32ParentProcessID ); printf( "\n Priority base = %d", pe32.pcPriClassBase ); - if( dwPriorityClass ) + if (dwPriorityClass) printf( "\n Priority class = %d", dwPriorityClass ); // List the modules and threads associated with this process ListProcessModules( pe32.th32ProcessID ); ListProcessThreads( pe32.th32ProcessID ); - } while( Process32Next( hProcessSnap, &pe32 ) ); + } while (Process32Next(hProcessSnap, &pe32)); - CloseHandle( hProcessSnap ); - return( TRUE ); + CloseHandle(hProcessSnap); + return TRUE; } -BOOL ListProcessModules( DWORD dwPID ) +BOOL ListProcessModules(DWORD dwPID) { HANDLE hModuleSnap = INVALID_HANDLE_VALUE; MODULEENTRY32 me32; // Take a snapshot of all modules in the specified process. hModuleSnap = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, dwPID ); - if( hModuleSnap == INVALID_HANDLE_VALUE ) - { - printError( TEXT("CreateToolhelp32Snapshot (of modules)") ); - return( FALSE ); + if (hModuleSnap == INVALID_HANDLE_VALUE) { + printError(TEXT("CreateToolhelp32Snapshot (of modules)")); + return FALSE; } // Set the size of the structure before using it. @@ -242,7 +240,7 @@ BOOL ListProcessModules( DWORD dwPID ) // Retrieve information about the first module, // and exit if unsuccessful - if( !Module32First( hModuleSnap, &me32 ) ) + if (!Module32First( hModuleSnap, &me32)) { printError( TEXT("Module32First") ); // show cause of failure CloseHandle( hModuleSnap ); // clean the snapshot object @@ -261,10 +259,10 @@ BOOL ListProcessModules( DWORD dwPID ) printf( "\n Base address = 0x%08X", (DWORD) me32.modBaseAddr ); printf( "\n Base size = %d", me32.modBaseSize ); - } while( Module32Next( hModuleSnap, &me32 ) ); + } while (Module32Next(hModuleSnap, &me32)); - CloseHandle( hModuleSnap ); - return( TRUE ); + CloseHandle(hModuleSnap); + return TRUE; } BOOL ListProcessThreads( DWORD dwOwnerPID ) @@ -274,7 +272,7 @@ BOOL ListProcessThreads( DWORD dwOwnerPID ) // Take a snapshot of all running threads hThreadSnap = CreateToolhelp32Snapshot( TH32CS_SNAPTHREAD, 0 ); - if( hThreadSnap == INVALID_HANDLE_VALUE ) + if (hThreadSnap == INVALID_HANDLE_VALUE) return( FALSE ); // Fill in the size of the structure before using it. @@ -282,7 +280,7 @@ BOOL ListProcessThreads( DWORD dwOwnerPID ) // Retrieve information about the first thread, // and exit if unsuccessful - if( !Thread32First( hThreadSnap, &te32 ) ) + if (!Thread32First( hThreadSnap, &te32 )) { printError( TEXT("Thread32First") ); // show cause of failure CloseHandle( hThreadSnap ); // clean the snapshot object @@ -294,13 +292,13 @@ BOOL ListProcessThreads( DWORD dwOwnerPID ) // associated with the specified process do { - if( te32.th32OwnerProcessID == dwOwnerPID ) + if (te32.th32OwnerProcessID == dwOwnerPID) { printf( "\n\n THREAD ID = 0x%08X", te32.th32ThreadID ); printf( "\n Base priority = %d", te32.tpBasePri ); printf( "\n Delta priority = %d", te32.tpDeltaPri ); } - } while( Thread32Next(hThreadSnap, &te32 ) ); + } while (Thread32Next(hThreadSnap, &te32)); CloseHandle( hThreadSnap ); return( TRUE ); @@ -308,22 +306,24 @@ BOOL ListProcessThreads( DWORD dwOwnerPID ) void printError( TCHAR* msg ) { - DWORD eNum; - TCHAR sysMsg[256]; - TCHAR* p; + DWORD eNum; + TCHAR sysMsg[256]; + TCHAR* p; - eNum = GetLastError( ); - FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + eNum = GetLastError( ); + FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, eNum, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language sysMsg, 256, NULL ); - // Trim the end of the line and terminate it with a null - p = sysMsg; - while( ( *p > 31 ) || ( *p == 9 ) ) - ++p; - do { *p-- = 0; } while( ( p >= sysMsg ) && - ( ( *p == '.' ) || ( *p < 33 ) ) ); + // Trim the end of the line and terminate it with a null + p = sysMsg; + while (*p > 31 || *p == 9 ) + ++p; + + do { + *p-- = 0; + } while( p >= sysMsg && (*p == '.' || *p < 33)); // Display the message _tprintf( TEXT("\n WARNING: %s failed with error %d (%s)"), msg, eNum, sysMsg ); @@ -331,7 +331,6 @@ void printError( TCHAR* msg ) #endif - void AttachExternalDialog::procSelected(const QModelIndex &index0) { QModelIndex index = index0.sibling(index0.row(), 0); diff --git a/src/plugins/debugger/attachremotedialog.cpp b/src/plugins/debugger/attachremotedialog.cpp index 65b02f37f10..a409ceba03a 100644 --- a/src/plugins/debugger/attachremotedialog.cpp +++ b/src/plugins/debugger/attachremotedialog.cpp @@ -150,10 +150,10 @@ void AttachRemoteDialog::rebuildProcessList() #include <stdio.h> // Forward declarations: -BOOL GetProcessList( ); -BOOL ListProcessModules( DWORD dwPID ); -BOOL ListProcessThreads( DWORD dwOwnerPID ); -void printError( TCHAR* msg ); +BOOL GetProcessList(); +BOOL ListProcessModules(DWORD dwPID); +BOOL ListProcessThreads(DWORD dwOwnerPID); +void printError(TCHAR* msg); BOOL GetProcessList( ) { @@ -164,7 +164,7 @@ BOOL GetProcessList( ) // Take a snapshot of all processes in the system. hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 ); - if( hProcessSnap == INVALID_HANDLE_VALUE ) + if (hProcessSnap == INVALID_HANDLE_VALUE) { printError( TEXT("CreateToolhelp32Snapshot (of processes)") ); return( FALSE ); @@ -175,7 +175,7 @@ BOOL GetProcessList( ) // Retrieve information about the first process, // and exit if unsuccessful - if( !Process32First( hProcessSnap, &pe32 ) ) + if (!Process32First( hProcessSnap, &pe32 )) { printError( TEXT("Process32First") ); // show cause of failure CloseHandle( hProcessSnap ); // clean the snapshot object @@ -193,12 +193,12 @@ BOOL GetProcessList( ) // Retrieve the priority class. dwPriorityClass = 0; hProcess = OpenProcess( PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID ); - if( hProcess == NULL ) + if (hProcess == NULL) printError( TEXT("OpenProcess") ); else { dwPriorityClass = GetPriorityClass( hProcess ); - if( !dwPriorityClass ) + if (!dwPriorityClass) printError( TEXT("GetPriorityClass") ); CloseHandle( hProcess ); } @@ -207,7 +207,7 @@ BOOL GetProcessList( ) printf( "\n Thread count = %d", pe32.cntThreads ); printf( "\n Parent process ID = 0x%08X", pe32.th32ParentProcessID ); printf( "\n Priority base = %d", pe32.pcPriClassBase ); - if( dwPriorityClass ) + if (dwPriorityClass) printf( "\n Priority class = %d", dwPriorityClass ); // List the modules and threads associated with this process @@ -228,7 +228,7 @@ BOOL ListProcessModules( DWORD dwPID ) // Take a snapshot of all modules in the specified process. hModuleSnap = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, dwPID ); - if( hModuleSnap == INVALID_HANDLE_VALUE ) + if (hModuleSnap == INVALID_HANDLE_VALUE) { printError( TEXT("CreateToolhelp32Snapshot (of modules)") ); return( FALSE ); @@ -239,7 +239,7 @@ BOOL ListProcessModules( DWORD dwPID ) // Retrieve information about the first module, // and exit if unsuccessful - if( !Module32First( hModuleSnap, &me32 ) ) + if (!Module32First( hModuleSnap, &me32 )) { printError( TEXT("Module32First") ); // show cause of failure CloseHandle( hModuleSnap ); // clean the snapshot object @@ -271,7 +271,7 @@ BOOL ListProcessThreads( DWORD dwOwnerPID ) // Take a snapshot of all running threads hThreadSnap = CreateToolhelp32Snapshot( TH32CS_SNAPTHREAD, 0 ); - if( hThreadSnap == INVALID_HANDLE_VALUE ) + if (hThreadSnap == INVALID_HANDLE_VALUE) return( FALSE ); // Fill in the size of the structure before using it. @@ -279,7 +279,7 @@ BOOL ListProcessThreads( DWORD dwOwnerPID ) // Retrieve information about the first thread, // and exit if unsuccessful - if( !Thread32First( hThreadSnap, &te32 ) ) + if (!Thread32First( hThreadSnap, &te32 )) { printError( TEXT("Thread32First") ); // show cause of failure CloseHandle( hThreadSnap ); // clean the snapshot object @@ -291,7 +291,7 @@ BOOL ListProcessThreads( DWORD dwOwnerPID ) // associated with the specified process do { - if( te32.th32OwnerProcessID == dwOwnerPID ) + if (te32.th32OwnerProcessID == dwOwnerPID) { printf( "\n\n THREAD ID = 0x%08X", te32.th32ThreadID ); printf( "\n Base priority = %d", te32.tpBasePri ); diff --git a/src/plugins/debugger/gdbtypemacros.cpp b/src/plugins/debugger/gdbtypemacros.cpp index a445a336324..8610d01e39d 100644 --- a/src/plugins/debugger/gdbtypemacros.cpp +++ b/src/plugins/debugger/gdbtypemacros.cpp @@ -59,10 +59,10 @@ TypeMacroPage::TypeMacroPage(GdbSettings *settings) //insert qt4 defaults m_settings->m_scriptFile = coreIFace->resourcePath() + QLatin1String("/gdb/qt4macros"); - for (int i=0; i<3; ++i) { + for (int i = 0; i < 3; ++i) { QByteArray data; QDataStream stream(&data, QIODevice::WriteOnly); - switch(i) { + switch (i) { case 0: stream << QString("printqstring") << (int)1; m_settings->m_typeMacros.insert(QLatin1String("QString"), data); @@ -154,7 +154,7 @@ void TypeMacroPage::finished(bool accepted) m_settings->m_typeMacros.clear(); m_settings->m_scriptFile = m_ui.scriptEdit->text(); - for (int i=0; i<m_ui.treeWidget->topLevelItemCount(); ++i) { + for (int i = 0; i < m_ui.treeWidget->topLevelItemCount(); ++i) { QTreeWidgetItem *item = m_ui.treeWidget->topLevelItem(i); QByteArray data; QDataStream stream(&data, QIODevice::WriteOnly); diff --git a/src/plugins/debugger/startexternaldialog.cpp b/src/plugins/debugger/startexternaldialog.cpp index 785757b7667..cca92ff3a3f 100644 --- a/src/plugins/debugger/startexternaldialog.cpp +++ b/src/plugins/debugger/startexternaldialog.cpp @@ -88,7 +88,7 @@ QString StartExternalDialog::executableArguments() const result << QLatin1String("--args"); result << execEdit->text(); - for(int i=0; i<args.length(); ++i) { + for (int i = 0; i < args.length(); ++i) { current = args.at(i); if (current == QLatin1Char('\"') && last != QLatin1Char('\\')) { diff --git a/src/plugins/designer/cpp/formclasswizardparameters.cpp b/src/plugins/designer/cpp/formclasswizardparameters.cpp index 7dd0056186a..10dda881db9 100644 --- a/src/plugins/designer/cpp/formclasswizardparameters.cpp +++ b/src/plugins/designer/cpp/formclasswizardparameters.cpp @@ -156,7 +156,7 @@ bool FormClassWizardParameters::generateCpp(QString *header, QString *source, in if (languageChange) { sourceStr << '\n' << namespaceIndent << "void " << unqualifiedClassName << "::" << "changeEvent(QEvent *e)\n" << namespaceIndent << "{\n" - << namespaceIndent << indent << "switch(e->type()) {\n" << namespaceIndent << indent << "case QEvent::LanguageChange:\n" + << namespaceIndent << indent << "switch (e->type()) {\n" << namespaceIndent << indent << "case QEvent::LanguageChange:\n" << namespaceIndent << indent << indent; if (embedding != InheritedUiClass) sourceStr << uiMemberC << (embedding == PointerAggregatedUiClass ? "->" : "."); diff --git a/src/plugins/designer/formeditorw.cpp b/src/plugins/designer/formeditorw.cpp index c156dec1b7f..a29759f0e38 100644 --- a/src/plugins/designer/formeditorw.cpp +++ b/src/plugins/designer/formeditorw.cpp @@ -472,7 +472,7 @@ Core::IActionContainer *FormEditorW::createPreviewStyleMenu(Core::ActionManagerI const QString deviceProfilePrefix = QLatin1String("DeviceProfile"); const QChar dot = QLatin1Char('.'); - foreach(QAction* a, actions) { + foreach (QAction* a, actions) { QString name = menuId; name += dot; const QVariant data = a->data(); diff --git a/src/plugins/find/basetextfind.cpp b/src/plugins/find/basetextfind.cpp index 6598a47e6f3..53578792d70 100644 --- a/src/plugins/find/basetextfind.cpp +++ b/src/plugins/find/basetextfind.cpp @@ -101,7 +101,7 @@ QString BaseTextFind::currentFindString() const cursor.movePosition(QTextCursor::StartOfWord); cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor); QString s = cursor.selectedText(); - foreach(QChar c, s) { + foreach (QChar c, s) { if (!c.isLetterOrNumber() && c != QLatin1Char('_')) { s.clear(); break; diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index ebce0f7c452..ec67478a259 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -161,7 +161,7 @@ GitPlugin::~GitPlugin() } if (!m_editorFactories.empty()) { - foreach(Core::IEditorFactory* pf, m_editorFactories) + foreach (Core::IEditorFactory* pf, m_editorFactories) removeObject(pf); qDeleteAll(m_editorFactories); } diff --git a/src/plugins/help/contentstoolwindow.cpp b/src/plugins/help/contentstoolwindow.cpp index ccd540bfef7..3c14d7f1b8e 100644 --- a/src/plugins/help/contentstoolwindow.cpp +++ b/src/plugins/help/contentstoolwindow.cpp @@ -126,7 +126,7 @@ void ContentsToolWindow::contentsDone() { m_widget->setCursor(QCursor(Qt::WaitCursor)); QList<QPair<QString, ContentList> > contentList = helpEngine->contents(); - for(QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) { + for (QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) { QTreeWidgetItem *newEntry; QTreeWidgetItem *contentEntry; QStack<QTreeWidgetItem*> stack; @@ -135,7 +135,7 @@ void ContentsToolWindow::contentsDone() bool root = false; QTreeWidgetItem *lastItem[64]; - for(int j = 0; j < 64; ++j) + for (int j = 0; j < 64; ++j) lastItem[j] = 0; ContentList lst = (*it).second; @@ -149,19 +149,18 @@ void ContentsToolWindow::contentsDone() stack.push(newEntry); depth = 1; root = true; - } - else{ - if((item.depth > depth) && root) { + } else { + if (item.depth > depth && root) { depth = item.depth; stack.push(contentEntry); } - if(item.depth == depth) { + if (item.depth == depth) { contentEntry = new QTreeWidgetItem(stack.top(), lastItem[ depth ]); lastItem[ depth ] = contentEntry; contentEntry->setText(0, item.title); contentEntry->setData(0, LinkRole, item.reference); } - else if(item.depth < depth) { + else if (item.depth < depth) { stack.pop(); depth--; item = *(--it); diff --git a/src/plugins/help/helpengine.cpp b/src/plugins/help/helpengine.cpp index db259f7aa03..44501d25abc 100644 --- a/src/plugins/help/helpengine.cpp +++ b/src/plugins/help/helpengine.cpp @@ -296,7 +296,7 @@ quint32 HelpEngine::getFileAges() QStringList::const_iterator i = addDocuFiles.begin(); quint32 fileAges = 0; - for(; i != addDocuFiles.end(); ++i) { + for (; i != addDocuFiles.end(); ++i) { QFileInfo fi(*i); if (fi.exists()) fileAges += fi.lastModified().toTime_t(); @@ -364,7 +364,7 @@ void TitleMapThread::run() bool needRebuild = false; if (Config::configuration()->profileName() == QLatin1String("default")) { const QStringList docuFiles = Config::configuration()->docFiles(); - for(QStringList::ConstIterator it = docuFiles.begin(); it != docuFiles.end(); it++) { + for (QStringList::ConstIterator it = docuFiles.begin(); it != docuFiles.end(); it++) { if (!QFile::exists(*it)) { Config::configuration()->saveProfile(Profile::createDefaultProfile()); Config::configuration()->loadDefaultProfile(); @@ -383,7 +383,7 @@ void TitleMapThread::run() getAllContents(); titleMap.clear(); - for(QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) { + for (QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) { ContentList lst = (*it).second; foreach (ContentItem item, lst) { titleMap[item.reference] = item.title.trimmed(); @@ -430,7 +430,7 @@ void TitleMapThread::buildContentDict() QStringList docuFiles = Config::configuration()->docFiles(); quint32 fileAges = 0; - for(QStringList::iterator it = docuFiles.begin(); it != docuFiles.end(); it++) { + for (QStringList::iterator it = docuFiles.begin(); it != docuFiles.end(); it++) { QFile file(*it); if (!file.exists()) { #ifdef _SHOW_ERRORS_ @@ -441,7 +441,7 @@ void TitleMapThread::buildContentDict() } fileAges += QFileInfo(file).lastModified().toTime_t(); DocuParser *handler = DocuParser::createParser(*it); - if(!handler) { + if (!handler) { #ifdef _SHOW_ERRORS_ emit errorOccured(tr("Documentation file %1 is not compatible!\n" "Skipping file.").arg(QFileInfo(file).absoluteFilePath())); @@ -450,7 +450,7 @@ void TitleMapThread::buildContentDict() } bool ok = handler->parse(&file); file.close(); - if(ok) { + if (ok) { contentList += qMakePair(*it, QList<ContentItem>(handler->getContentItems())); delete handler; } else { @@ -469,7 +469,7 @@ void TitleMapThread::buildContentDict() if (contentOut.open(QFile::WriteOnly)) { QDataStream s(&contentOut); s << fileAges; - for(QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) { + for (QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) { s << *it; } contentOut.close(); @@ -542,12 +542,12 @@ void IndexThread::buildKeywordDB() QStringList::iterator i = addDocuFiles.begin(); int steps = 0; - for(; i != addDocuFiles.end(); i++) + for (; i != addDocuFiles.end(); i++) steps += QFileInfo(*i).size(); QList<IndexKeyword> lst; quint32 fileAges = 0; - for(i = addDocuFiles.begin(); i != addDocuFiles.end(); i++){ + for (i = addDocuFiles.begin(); i != addDocuFiles.end(); i++) { QFile file(*i); if (!file.exists()) { #ifdef _SHOW_ERRORS_ @@ -560,7 +560,7 @@ void IndexThread::buildKeywordDB() DocuParser *handler = DocuParser::createParser(*i); bool ok = handler->parse(&file); file.close(); - if(!ok){ + if (!ok){ #ifdef _SHOW_ERRORS_ QString msg = QString::fromLatin1("In file %1:\n%2") .arg(QFileInfo(file).absoluteFilePath()) diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index c96fcf28472..972ab7d6a6b 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -512,7 +512,7 @@ void HelpPlugin::activateContext() // case 1 sidebar shown and has focus, we show whatever we have in the // sidebar in big RightPanePlaceHolder* placeHolder = RightPanePlaceHolder::current(); - if(placeHolder && Core::RightPaneWidget::instance()->hasFocus()) { + if (placeHolder && Core::RightPaneWidget::instance()->hasFocus()) { switchToHelpMode(); return; } diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index dc28901b705..b1f4494ce5e 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -561,10 +561,9 @@ void PerforcePlugin::submit() QStringList stdOutLines = result2.stdOut.split(QLatin1Char('\n')); QStringList depotFileNames; - foreach(const QString &line, stdOutLines) { - if (line.startsWith("... depotFile")) { + foreach (const QString &line, stdOutLines) { + if (line.startsWith("... depotFile")) depotFileNames.append(line.mid(14)); - } } if (depotFileNames.isEmpty()) { showOutput(tr("Project has no files")); @@ -1225,7 +1224,7 @@ PerforcePlugin::~PerforcePlugin() } if (!m_editorFactories.empty()) { - foreach(Core::IEditorFactory* pf, m_editorFactories) + foreach (Core::IEditorFactory *pf, m_editorFactories) removeObject(pf); qDeleteAll(m_editorFactories); m_editorFactories.clear(); diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index 06b40135c12..965a8b4c0c4 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -112,7 +112,7 @@ bool AbstractProcessStep::init(const QString &name) void AbstractProcessStep::run(QFutureInterface<bool> & fi) { m_futureInterface = &fi; - if(!m_enabled) { + if (!m_enabled) { fi.reportResult(true); return; } @@ -136,7 +136,7 @@ void AbstractProcessStep::run(QFutureInterface<bool> & fi) Qt::DirectConnection); m_process->start(m_command, m_arguments); - if(!m_process->waitForStarted()) { + if (!m_process->waitForStarted()) { processStartupFailed(); delete m_process; m_process = 0; @@ -188,8 +188,7 @@ void AbstractProcessStep::processStartupFailed() void AbstractProcessStep::processReadyReadStdOutput() { m_process->setReadChannel(QProcess::StandardOutput); - while(m_process->canReadLine()) - { + while (m_process->canReadLine()) { QString line = QString::fromLocal8Bit(m_process->readLine()).trimmed(); stdOut(line); } @@ -203,8 +202,7 @@ void AbstractProcessStep::stdOut(const QString &line) void AbstractProcessStep::processReadyReadStdError() { m_process->setReadChannel(QProcess::StandardError); - while (m_process->canReadLine()) - { + while (m_process->canReadLine()) { QString line = QString::fromLocal8Bit(m_process->readLine()).trimmed(); stdError(line); } @@ -217,7 +215,7 @@ void AbstractProcessStep::stdError(const QString &line) void AbstractProcessStep::checkForCancel() { - if(m_futureInterface->isCanceled() && m_timer->isActive()) { + if (m_futureInterface->isCanceled() && m_timer->isActive()) { m_timer->stop(); m_process->terminate(); m_process->waitForFinished(5000); @@ -228,13 +226,12 @@ void AbstractProcessStep::checkForCancel() void AbstractProcessStep::slotProcessFinished(int, QProcess::ExitStatus) { QString line = QString::fromLocal8Bit(m_process->readAllStandardError()).trimmed(); - if (!line.isEmpty()) { + if (!line.isEmpty()) stdOut(line); - } line = QString::fromLocal8Bit(m_process->readAllStandardOutput()).trimmed(); - if (!line.isEmpty()) { + if (!line.isEmpty()) stdError(line); - } + m_eventLoop->exit(0); } diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index c9090723a19..c960cb0e34c 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -42,9 +42,8 @@ BuildConfiguration::BuildConfiguration(const QString &name) } BuildConfiguration::BuildConfiguration(const QString &name, BuildConfiguration *source) - :m_values(source->m_values), m_name(name) + : m_values(source->m_values), m_name(name) { - } QString BuildConfiguration::name() const @@ -71,7 +70,7 @@ void BuildConfiguration::setDisplayName(const QString &name) QVariant BuildConfiguration::getValue(const QString & key) const { QHash<QString, QVariant>::const_iterator it = m_values.find(key); - if(it != m_values.constEnd()) + if (it != m_values.constEnd()) return *it; else return QVariant(); @@ -86,7 +85,7 @@ void BuildConfiguration::setValuesFromMap(QMap<QString, QVariant> map) { QMap<QString, QVariant>::const_iterator it, end; end = map.constEnd(); - for(it = map.constBegin(); it != end; ++it) + for (it = map.constBegin(); it != end; ++it) setValue(it.key(), it.value()); } @@ -95,7 +94,7 @@ QMap<QString, QVariant> BuildConfiguration::toMap() const QMap<QString, QVariant> result; QHash<QString, QVariant>::const_iterator it, end; end = m_values.constEnd(); - for(it = m_values.constBegin(); it != end; ++it) + for (it = m_values.constBegin(); it != end; ++it) result.insert(it.key(), it.value()); return result; } diff --git a/src/plugins/projectexplorer/buildsettingspropertiespage.cpp b/src/plugins/projectexplorer/buildsettingspropertiespage.cpp index a713fdc773e..2c1434534be 100644 --- a/src/plugins/projectexplorer/buildsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/buildsettingspropertiespage.cpp @@ -142,7 +142,7 @@ BuildSettingsWidget::BuildSettingsWidget(Project *project) void BuildSettingsWidget::buildConfigurationDisplayNameChanged(const QString &buildConfiguration) { QTreeWidgetItem *rootItem = m_ui.buildSettingsList->invisibleRootItem(); - for(int i = 0; i < rootItem->childCount(); ++i) { + for (int i = 0; i < rootItem->childCount(); ++i) { QTreeWidgetItem *child = rootItem->child(i); if (child->data(0, Qt::UserRole).toString() == buildConfiguration) { child->setText(0, m_project->displayNameFor(buildConfiguration)); @@ -334,7 +334,7 @@ void BuildSettingsWidget::createConfiguration() { bool ok; QString newBuildConfiguration = QInputDialog::getText(this, tr("New configuration"), tr("New Configuration Name:"), QLineEdit::Normal, QString(), &ok); - if(!ok || newBuildConfiguration.isEmpty()) + if (!ok || newBuildConfiguration.isEmpty()) return; QString newDisplayName = newBuildConfiguration; @@ -342,22 +342,20 @@ void BuildSettingsWidget::createConfiguration() const QStringList &buildConfigurations = m_project->buildConfigurations(); if (buildConfigurations.contains(newBuildConfiguration)) { int i = 2; - while(buildConfigurations.contains(newBuildConfiguration + QString::number(i))) { + while (buildConfigurations.contains(newBuildConfiguration + QString::number(i))) ++i; - } newBuildConfiguration += QString::number(i); } // Check that we don't have a configuration with the same displayName QStringList displayNames; - foreach(const QString &bc, buildConfigurations) + foreach (const QString &bc, buildConfigurations) displayNames << m_project->displayNameFor(bc); if (displayNames.contains(newDisplayName)) { int i = 2; - while(displayNames.contains(newDisplayName + QString::number(i))) { + while (displayNames.contains(newDisplayName + QString::number(i))) ++i; - } newDisplayName += QString::number(i); } @@ -407,11 +405,11 @@ void BuildSettingsWidget::setActiveConfiguration(const QString &configuration) void BuildSettingsWidget::cloneConfiguration(const QString &sourceConfiguration) { - if(sourceConfiguration.isEmpty()) + if (sourceConfiguration.isEmpty()) return; QString newBuildConfiguration = QInputDialog::getText(this, tr("Clone configuration"), tr("New Configuration Name:")); - if(newBuildConfiguration.isEmpty()) + if (newBuildConfiguration.isEmpty()) return; QString newDisplayName = newBuildConfiguration; @@ -419,22 +417,20 @@ void BuildSettingsWidget::cloneConfiguration(const QString &sourceConfiguration) const QStringList &buildConfigurations = m_project->buildConfigurations(); if (buildConfigurations.contains(newBuildConfiguration)) { int i = 2; - while(buildConfigurations.contains(newBuildConfiguration + QString::number(i))) { + while (buildConfigurations.contains(newBuildConfiguration + QString::number(i))) ++i; - } newBuildConfiguration += QString::number(i); } // Check that we don't have a configuration with the same displayName QStringList displayNames; - foreach(const QString &bc, buildConfigurations) + foreach (const QString &bc, buildConfigurations) displayNames << m_project->displayNameFor(bc); if (displayNames.contains(newDisplayName)) { int i = 2; - while(displayNames.contains(newDisplayName + QString::number(i))) { + while (displayNames.contains(newDisplayName + QString::number(i))) ++i; - } newDisplayName += QString::number(i); } diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index 474306dd57a..5367b50812d 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -60,8 +60,8 @@ void BuildStep::addBuildConfiguration(const QString &name) void BuildStep::removeBuildConfiguration(const QString &name) { - for(int i = 0; i != m_buildConfigurations.size(); ++i) - if(m_buildConfigurations.at(i)->name() == name) { + for (int i = 0; i != m_buildConfigurations.size(); ++i) + if (m_buildConfigurations.at(i)->name() == name) { delete m_buildConfigurations.at(i); m_buildConfigurations.removeAt(i); break; @@ -70,8 +70,8 @@ void BuildStep::removeBuildConfiguration(const QString &name) void BuildStep::copyBuildConfiguration(const QString &source, const QString &dest) { - for(int i = 0; i != m_buildConfigurations.size(); ++i) - if(m_buildConfigurations.at(i)->name() == source) + for (int i = 0; i != m_buildConfigurations.size(); ++i) + if (m_buildConfigurations.at(i)->name() == source) m_buildConfigurations.push_back(new BuildConfiguration(dest, m_buildConfigurations.at(i))); } diff --git a/src/plugins/projectexplorer/buildstepspage.cpp b/src/plugins/projectexplorer/buildstepspage.cpp index 6578d76e351..84f23c46bbf 100644 --- a/src/plugins/projectexplorer/buildstepspage.cpp +++ b/src/plugins/projectexplorer/buildstepspage.cpp @@ -119,17 +119,17 @@ void BuildStepsPage::init(const QString &buildConfiguration) /* switch from one tree item / build step to another */ void BuildStepsPage::updateBuildStepWidget(QTreeWidgetItem *newItem, QTreeWidgetItem *oldItem) { - if(oldItem == newItem) + if (oldItem == newItem) return; Q_ASSERT(m_pro); - if(newItem) { + if (newItem) { int row = m_ui->buildSettingsList->indexOfTopLevelItem(newItem); m_ui->buildSettingsWidget->setCurrentIndex(row); BuildStepConfigWidget *widget = qobject_cast<BuildStepConfigWidget *>(m_ui->buildSettingsWidget->currentWidget()); Q_ASSERT(widget); if (widget) - widget->init(m_configuration); + widget->init(m_configuration); } updateBuildStepButtonsState(); } @@ -151,11 +151,11 @@ void BuildStepsPage::updateAddBuildStepMenu() QMenu *menu = m_ui->buildStepAddButton->menu(); m_addBuildStepHash.clear(); menu->clear(); - if(!map.isEmpty()) { + if (!map.isEmpty()) { QStringList names; QMap<QString, QPair<QString, IBuildStepFactory *> >::const_iterator it, end; end = map.constEnd(); - for(it = map.constBegin(); it != end; ++it) { + for (it = map.constBegin(); it != end; ++it) { QAction *action = menu->addAction(it.key()); connect(action, SIGNAL(triggered()), this, SLOT(addBuildStep())); @@ -167,7 +167,7 @@ void BuildStepsPage::updateAddBuildStepMenu() void BuildStepsPage::addBuildStep() { - if(QAction *action = qobject_cast<QAction *>(sender())) { + if (QAction *action = qobject_cast<QAction *>(sender())) { QPair<QString, IBuildStepFactory *> pair = m_addBuildStepHash.value(action); BuildStep *newStep = pair.second->create(m_pro, pair.first); m_pro->insertBuildStep(0, newStep); @@ -182,7 +182,7 @@ void BuildStepsPage::addBuildStep() void BuildStepsPage::removeBuildStep() { int pos = m_ui->buildSettingsList->currentIndex().row(); - if(m_pro->buildSteps().at(pos)->immutable()) + if (m_pro->buildSteps().at(pos)->immutable()) return; bool blockSignals = m_ui->buildSettingsList->blockSignals(true); delete m_ui->buildSettingsList->invisibleRootItem()->takeChild(pos); @@ -190,7 +190,7 @@ void BuildStepsPage::removeBuildStep() QWidget *widget = m_ui->buildSettingsWidget->widget(pos); m_ui->buildSettingsWidget->removeWidget(widget); delete widget; - if(pos < m_ui->buildSettingsList->invisibleRootItem()->childCount()) + if (pos < m_ui->buildSettingsList->invisibleRootItem()->childCount()) m_ui->buildSettingsList->setCurrentItem(m_ui->buildSettingsList->invisibleRootItem()->child(pos)); else m_ui->buildSettingsList->setCurrentItem(m_ui->buildSettingsList->invisibleRootItem()->child(pos - 1)); @@ -201,11 +201,11 @@ void BuildStepsPage::removeBuildStep() void BuildStepsPage::upBuildStep() { int pos = m_ui->buildSettingsList->currentIndex().row(); - if(pos < 1) + if (pos < 1) return; - if(pos > m_ui->buildSettingsList->invisibleRootItem()->childCount()-1) + if (pos > m_ui->buildSettingsList->invisibleRootItem()->childCount()-1) return; - if(m_pro->buildSteps().at(pos)->immutable() && m_pro->buildSteps().at(pos-1)->immutable()) + if (m_pro->buildSteps().at(pos)->immutable() && m_pro->buildSteps().at(pos-1)->immutable()) return; bool blockSignals = m_ui->buildSettingsList->blockSignals(true); @@ -220,11 +220,11 @@ void BuildStepsPage::upBuildStep() void BuildStepsPage::downBuildStep() { int pos = m_ui->buildSettingsList->currentIndex().row() + 1; - if(pos < 1) + if (pos < 1) return; - if(pos > m_ui->buildSettingsList->invisibleRootItem()->childCount() - 1) + if (pos > m_ui->buildSettingsList->invisibleRootItem()->childCount() - 1) return; - if(m_pro->buildSteps().at(pos)->immutable() && m_pro->buildSteps().at(pos - 1)->immutable()) + if (m_pro->buildSteps().at(pos)->immutable() && m_pro->buildSteps().at(pos - 1)->immutable()) return; bool blockSignals = m_ui->buildSettingsList->blockSignals(true); @@ -238,7 +238,7 @@ void BuildStepsPage::downBuildStep() void BuildStepsPage::changeEvent(QEvent *e) { - switch(e->type()) { + switch (e->type()) { case QEvent::LanguageChange: m_ui->retranslateUi(this); break; diff --git a/src/plugins/projectexplorer/environment.cpp b/src/plugins/projectexplorer/environment.cpp index a8470d3df5d..b428ed3a92d 100644 --- a/src/plugins/projectexplorer/environment.cpp +++ b/src/plugins/projectexplorer/environment.cpp @@ -45,7 +45,7 @@ QList<EnvironmentItem> EnvironmentItem::fromStringList(QStringList list) QList<EnvironmentItem> result; foreach (const QString &string, list) { int pos = string.indexOf(QLatin1Char('=')); - if(pos == -1) { + if (pos == -1) { EnvironmentItem item(string, ""); item.unset = true; result.append(item); @@ -61,7 +61,7 @@ QStringList EnvironmentItem::toStringList(QList<EnvironmentItem> list) { QStringList result; foreach (const EnvironmentItem &item, list) { - if(item.unset) + if (item.unset) result << QString(item.name); else result << QString(item.name + '=' + item.value); @@ -71,14 +71,13 @@ QStringList EnvironmentItem::toStringList(QList<EnvironmentItem> list) Environment::Environment() { - } Environment::Environment(QStringList env) { - foreach(QString s, env) { + foreach (const QString &s, env) { int i = s.indexOf("="); - if (i >=0 ) { + if (i >= 0) { #ifdef Q_OS_WIN m_values.insert(s.left(i).toUpper(), s.mid(i+1)); #else @@ -196,13 +195,13 @@ QString Environment::searchInPath(QString executable) executable.append(QLatin1String(".exe")); #endif const QChar slash = QLatin1Char('/'); - foreach(const QString &p, path()) { + foreach (const QString &p, path()) { // qDebug()<<"trying"<<path + '/' + executable; QString fp = p; fp += slash; fp += executable; const QFileInfo fi(fp); - if(fi.exists()) { + if (fi.exists()) { // qDebug()<<"returning "<<fi.absoluteFilePath(); return fi.absoluteFilePath(); } @@ -248,7 +247,7 @@ Environment::const_iterator Environment::constEnd() const Environment::const_iterator Environment::find(const QString &name) { QMap<QString, QString>::const_iterator it = m_values.constFind(name); - if(it == m_values.constEnd()) + if (it == m_values.constEnd()) return constEnd(); else return it; @@ -263,24 +262,24 @@ void Environment::modify(const QList<EnvironmentItem> & list) { Environment resultEnvironment = *this; foreach (const EnvironmentItem &item, list) { - if(item.unset) { + if (item.unset) { resultEnvironment.unset(item.name); } else { // TODO use variable expansion QString value = item.value; - for(int i=0; i < value.size(); ++i) { - if(value.at(i) == QLatin1Char('$')) { - if((i + 1) < value.size()) { + for (int i=0; i < value.size(); ++i) { + if (value.at(i) == QLatin1Char('$')) { + if ((i + 1) < value.size()) { const QChar &c = value.at(i+1); int end = -1; if (c == '(') end = value.indexOf(')', i); - else if (c=='{') + else if (c == '{') end = value.indexOf('}', i); - if(end != -1) { + if (end != -1) { const QString &name = value.mid(i+2, end-i-2); Environment::const_iterator it = find(name); - if(it != constEnd()) + if (it != constEnd()) value.replace(i, end-i+1, it.value()); } } @@ -334,7 +333,7 @@ QStringList Environment::parseCombinedArgString(const QString &program) QString Environment::joinArgumentList(const QStringList &arguments) { QString result; - foreach(QString arg, arguments) { + foreach (QString arg, arguments) { if (!result.isEmpty()) result += QLatin1Char(' '); arg.replace(QLatin1String("\""), QLatin1String("\"\"\"")); diff --git a/src/plugins/projectexplorer/environmenteditmodel.cpp b/src/plugins/projectexplorer/environmenteditmodel.cpp index 2405d86998e..68bb6f5fdfb 100644 --- a/src/plugins/projectexplorer/environmenteditmodel.cpp +++ b/src/plugins/projectexplorer/environmenteditmodel.cpp @@ -38,11 +38,13 @@ using namespace ProjectExplorer; EnvironmentModel::EnvironmentModel() : m_mergedEnvironments(false) {} -EnvironmentModel::~EnvironmentModel() {} + +EnvironmentModel::~EnvironmentModel() +{} QString EnvironmentModel::indexToVariable(const QModelIndex &index) const { - if(m_mergedEnvironments) + if (m_mergedEnvironments) return m_resultEnvironment.key(m_resultEnvironment.constBegin() + index.row()); else return m_items.at(index.row()).name; @@ -53,7 +55,7 @@ void EnvironmentModel::updateResultEnvironment() m_resultEnvironment = m_baseEnvironment; m_resultEnvironment.modify(m_items); foreach (const EnvironmentItem &item, m_items) { - if(item.unset) { + if (item.unset) { m_resultEnvironment.set(item.name, "<UNSET>"); } } @@ -68,10 +70,10 @@ void EnvironmentModel::setBaseEnvironment(const ProjectExplorer::Environment &en void EnvironmentModel::setMergedEnvironments(bool b) { - if(m_mergedEnvironments == b) + if (m_mergedEnvironments == b) return; m_mergedEnvironments = b; - if(b) + if (b) updateResultEnvironment(); reset(); } @@ -96,48 +98,46 @@ int EnvironmentModel::columnCount(const QModelIndex &parent) const bool EnvironmentModel::changes(const QString &name) const { - foreach(const EnvironmentItem& item, m_items) { - if(item.name == name) { + foreach (const EnvironmentItem& item, m_items) + if (item.name == name) return true; - } - } return false; } QVariant EnvironmentModel::data(const QModelIndex &index, int role) const { - if((role == Qt::DisplayRole || role == Qt::EditRole) && index.isValid()) { - if((m_mergedEnvironments && index.row() >= m_resultEnvironment.size()) || + if ((role == Qt::DisplayRole || role == Qt::EditRole) && index.isValid()) { + if ((m_mergedEnvironments && index.row() >= m_resultEnvironment.size()) || (!m_mergedEnvironments && index.row() >= m_items.count())) { return QVariant(); } - if(index.column() == 0) { - if(m_mergedEnvironments) { + if (index.column() == 0) { + if (m_mergedEnvironments) { return m_resultEnvironment.key(m_resultEnvironment.constBegin() + index.row()); } else { return m_items.at(index.row()).name; } - } else if(index.column() == 1) { - if(m_mergedEnvironments) { - if(role == Qt::EditRole) { + } else if (index.column() == 1) { + if (m_mergedEnvironments) { + if (role == Qt::EditRole) { int pos = findInChanges(indexToVariable(index)); - if(pos != -1) + if (pos != -1) return m_items.at(pos).value; } return m_resultEnvironment.value(m_resultEnvironment.constBegin() + index.row()); } else { - if(m_items.at(index.row()).unset) + if (m_items.at(index.row()).unset) return "<UNSET>"; else return m_items.at(index.row()).value; } } } - if(role == Qt::FontRole) { - if(m_mergedEnvironments) { + if (role == Qt::FontRole) { + if (m_mergedEnvironments) { // check wheter this environment variable exists in m_items - if(changes(m_resultEnvironment.key(m_resultEnvironment.constBegin() + index.row()))) { + if (changes(m_resultEnvironment.key(m_resultEnvironment.constBegin() + index.row()))) { QFont f; f.setBold(true); return QVariant(f); @@ -157,7 +157,7 @@ Qt::ItemFlags EnvironmentModel::flags(const QModelIndex &index) const bool EnvironmentModel::hasChildren(const QModelIndex &index) const { - if(!index.isValid()) + if (!index.isValid()) return true; else return false; @@ -165,14 +165,14 @@ bool EnvironmentModel::hasChildren(const QModelIndex &index) const QVariant EnvironmentModel::headerData(int section, Qt::Orientation orientation, int role) const { - if(orientation == Qt::Vertical || role != Qt::DisplayRole) + if (orientation == Qt::Vertical || role != Qt::DisplayRole) return QVariant(); return section == 0 ? tr("Variable") : tr("Value"); } QModelIndex EnvironmentModel::index(int row, int column, const QModelIndex &parent) const { - if(!parent.isValid()) + if (!parent.isValid()) return createIndex(row, column, 0); return QModelIndex(); } @@ -188,16 +188,16 @@ QModelIndex EnvironmentModel::parent(const QModelIndex &index) const /// ***************** int EnvironmentModel::findInChanges(const QString &name) const { - for(int i=0; i<m_items.size(); ++i) - if(m_items.at(i).name == name) + for (int i=0; i<m_items.size(); ++i) + if (m_items.at(i).name == name) return i; return -1; } int EnvironmentModel::findInChangesInsertPosition(const QString &name) const { - for(int i=0; i<m_items.size(); ++i) - if(m_items.at(i).name > name) + for (int i=0; i<m_items.size(); ++i) + if (m_items.at(i).name > name) return i; return m_items.size(); } @@ -206,8 +206,8 @@ int EnvironmentModel::findInResult(const QString &name) const { Environment::const_iterator it; int i = 0; - for(it = m_resultEnvironment.constBegin(); it != m_resultEnvironment.constEnd(); ++it, ++i) - if(m_resultEnvironment.key(it) == name) + for (it = m_resultEnvironment.constBegin(); it != m_resultEnvironment.constEnd(); ++it, ++i) + if (m_resultEnvironment.key(it) == name) return i; return -1; } @@ -216,28 +216,28 @@ int EnvironmentModel::findInResultInsertPosition(const QString &name) const { Environment::const_iterator it; int i = 0; - for(it = m_resultEnvironment.constBegin(); it != m_resultEnvironment.constEnd(); ++it, ++i) - if(m_resultEnvironment.key(it) > name) + for (it = m_resultEnvironment.constBegin(); it != m_resultEnvironment.constEnd(); ++it, ++i) + if (m_resultEnvironment.key(it) > name) return i; return m_resultEnvironment.size(); } bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value, int role) { - if(role == Qt::EditRole && index.isValid()) { - if(index.column() == 0) { + if (role == Qt::EditRole && index.isValid()) { + if (index.column() == 0) { //fail if a variable with the same name already exists #ifdef Q_OS_WIN - if(findInChanges(value.toString().toUpper()) != -1) + if (findInChanges(value.toString().toUpper()) != -1) return false; #else - if(findInChanges(value.toString()) != -1) + if (findInChanges(value.toString()) != -1) return false; #endif EnvironmentItem old("", ""); - if(m_mergedEnvironments) { + if (m_mergedEnvironments) { int pos = findInChanges(indexToVariable(index)); - if(pos != -1) { + if (pos != -1) { old = m_items.at(pos); } else { old.name = m_resultEnvironment.key(m_resultEnvironment.constBegin() + index.row()); @@ -252,16 +252,16 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value, #else const QString &newName = value.toString(); #endif - if(changes(old.name)) + if (changes(old.name)) removeVariable(old.name); old.name = newName; addVariable(old); return true; - } else if(index.column() == 1) { - if(m_mergedEnvironments) { + } else if (index.column() == 1) { + if (m_mergedEnvironments) { const QString &name = indexToVariable(index); int pos = findInChanges(name); - if(pos != -1) { + if (pos != -1) { m_items[pos].value = value.toString(); m_items[pos].unset = false; updateResultEnvironment(); @@ -287,13 +287,13 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value, QModelIndex EnvironmentModel::addVariable() { const QString &name = "<VARIABLE>"; - if(m_mergedEnvironments) { + if (m_mergedEnvironments) { int i = findInResult(name); - if(i != -1) + if (i != -1) return index(i, 0, QModelIndex()); } else { int i = findInChanges(name); - if(i != -1) + if (i != -1) return index(i, 0, QModelIndex()); } // Don't exist, really add them @@ -302,10 +302,10 @@ QModelIndex EnvironmentModel::addVariable() QModelIndex EnvironmentModel::addVariable(const EnvironmentItem &item) { - if(m_mergedEnvironments) { + if (m_mergedEnvironments) { bool existsInBaseEnvironment = (m_baseEnvironment.find(item.name) != m_baseEnvironment.constEnd()); int rowInResult; - if(existsInBaseEnvironment) + if (existsInBaseEnvironment) rowInResult = findInResult(item.name); else rowInResult = findInResultInsertPosition(item.name); @@ -313,7 +313,7 @@ QModelIndex EnvironmentModel::addVariable(const EnvironmentItem &item) qDebug()<<"addVariable "<<item.name<<existsInBaseEnvironment<<rowInResult<<rowInChanges; - if(existsInBaseEnvironment) { + if (existsInBaseEnvironment) { m_items.insert(rowInChanges, item); updateResultEnvironment(); emit dataChanged(index(rowInResult, 0, QModelIndex()), index(rowInResult, 1, QModelIndex())); @@ -340,11 +340,11 @@ QModelIndex EnvironmentModel::addVariable(const EnvironmentItem &item) void EnvironmentModel::removeVariable(const QString &name) { - if(m_mergedEnvironments) { + if (m_mergedEnvironments) { int rowInResult = findInResult(name); int rowInChanges = findInChanges(name); bool existsInBaseEnvironment = m_baseEnvironment.find(name) != m_baseEnvironment.constEnd(); - if(existsInBaseEnvironment) { + if (existsInBaseEnvironment) { m_items.removeAt(rowInChanges); updateResultEnvironment(); emit dataChanged(index(rowInResult, 0, QModelIndex()), index(rowInResult, 1, QModelIndex())); @@ -368,11 +368,11 @@ void EnvironmentModel::removeVariable(const QString &name) void EnvironmentModel::unset(const QString &name) { - if(m_mergedEnvironments) { + if (m_mergedEnvironments) { int row = findInResult(name); // look in m_items for the variable int pos = findInChanges(name); - if(pos != -1) { + if (pos != -1) { m_items[pos].unset = true; updateResultEnvironment(); emit dataChanged(index(row, 0, QModelIndex()), index(row, 1, QModelIndex())); @@ -398,7 +398,7 @@ void EnvironmentModel::unset(const QString &name) bool EnvironmentModel::isUnset(const QString &name) { int pos = findInChanges(name); - if(pos != -1) + if (pos != -1) return m_items.at(pos).unset; else return false; diff --git a/src/plugins/projectexplorer/outputwindow.cpp b/src/plugins/projectexplorer/outputwindow.cpp index a2e0e206aee..81a9f292450 100644 --- a/src/plugins/projectexplorer/outputwindow.cpp +++ b/src/plugins/projectexplorer/outputwindow.cpp @@ -64,7 +64,7 @@ bool OutputPane::canFocus() void OutputPane::setFocus() { - if(m_tabWidget->currentWidget()) + if (m_tabWidget->currentWidget()) m_tabWidget->currentWidget()->setFocus(); } @@ -199,7 +199,7 @@ void OutputPane::createNewOutputWindow(RunControl *rc) // First look if we can reuse a tab bool found = false; - for(int i=0; i<m_tabWidget->count(); ++i) { + for (int i=0; i<m_tabWidget->count(); ++i) { RunControl *old = runControlForTab(i); if (old->runConfiguration() == rc->runConfiguration() && !old->isRunning()) { // Reuse this tab diff --git a/src/plugins/projectexplorer/persistentsettings.cpp b/src/plugins/projectexplorer/persistentsettings.cpp index 38253f3ae0d..0939dc17850 100644 --- a/src/plugins/projectexplorer/persistentsettings.cpp +++ b/src/plugins/projectexplorer/persistentsettings.cpp @@ -152,7 +152,7 @@ void PersistentSettingsWriter::writeValue(QDomElement &ps, const QVariant &varia QDomElement values = ps.ownerDocument().createElement("valuelist"); values.setAttribute("type", QVariant::typeToName(QVariant::List)); QList<QVariant> varList = variant.toList(); - foreach(QVariant var, varList) { + foreach (QVariant var, varList) { writeValue(values, var); } ps.appendChild(values); diff --git a/src/plugins/projectexplorer/pluginfilefactory.cpp b/src/plugins/projectexplorer/pluginfilefactory.cpp index a3d712ff5ee..723d5dbaf51 100644 --- a/src/plugins/projectexplorer/pluginfilefactory.cpp +++ b/src/plugins/projectexplorer/pluginfilefactory.cpp @@ -90,7 +90,7 @@ QList<ProjectFileFactory*> ProjectFileFactory::createFactories(const Core::ICore const QString filterSeparator = QLatin1String(";;"); filterString->clear(); - foreach(IProjectManager *manager, projectManagers) { + foreach (IProjectManager *manager, projectManagers) { rc.push_back(new ProjectFileFactory(core, manager)); if (!filterString->isEmpty()) *filterString += filterSeparator; diff --git a/src/plugins/projectexplorer/processstep.cpp b/src/plugins/projectexplorer/processstep.cpp index 4a24efa7069..f2e2a8ac543 100644 --- a/src/plugins/projectexplorer/processstep.cpp +++ b/src/plugins/projectexplorer/processstep.cpp @@ -54,7 +54,7 @@ bool ProcessStep::init(const QString &buildConfiguration) setEnvironment(buildConfiguration, project()->environment(buildConfiguration)); QVariant wd = value(buildConfiguration, "workingDirectory").toString(); QString workingDirectory; - if(!wd.isValid() || wd.toString().isEmpty()) + if (!wd.isValid() || wd.toString().isEmpty()) workingDirectory = "$BUILDDIR"; else workingDirectory = wd.toString(); @@ -161,7 +161,7 @@ QString ProcessStepConfigWidget::displayName() const void ProcessStepConfigWidget::workingDirBrowseButtonClicked() { QString workingDirectory = QFileDialog::getExistingDirectory(this, "Select the working directory", m_ui.workingDirectoryLineEdit->text()); - if(workingDirectory.isEmpty()) + if (workingDirectory.isEmpty()) return; m_ui.workingDirectoryLineEdit->setText(workingDirectory); workingDirectoryLineEditTextEdited(); @@ -170,7 +170,7 @@ void ProcessStepConfigWidget::workingDirBrowseButtonClicked() void ProcessStepConfigWidget::commandBrowseButtonClicked() { QString filename = QFileDialog::getOpenFileName(this, "Select the executable"); - if(filename.isEmpty()) + if (filename.isEmpty()) return; m_ui.commandLineEdit->setText(filename); commandLineEditTextEdited(); @@ -179,7 +179,7 @@ void ProcessStepConfigWidget::commandBrowseButtonClicked() void ProcessStepConfigWidget::init(const QString &buildConfiguration) { m_buildConfiguration = buildConfiguration; - if(buildConfiguration != QString::null) { + if (buildConfiguration != QString::null) { m_ui.commandLineEdit->setText(m_step->command(buildConfiguration)); QString workingDirectory = m_step->value(buildConfiguration, "workingDirectory").toString(); diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 8c74fe6e564..9cecd7b6841 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -57,11 +57,9 @@ void Project::insertBuildStep(int position, BuildStep *step) { m_buildSteps.insert(position, step); // check that the step has all the configurations - foreach(const QString & name, buildConfigurations()) - { + foreach (const QString &name, buildConfigurations()) if (!step->getBuildConfiguration(name)) step->addBuildConfiguration(name); - } } void Project::removeBuildStep(int position) @@ -80,11 +78,9 @@ void Project::insertCleanStep(int position, BuildStep *step) { m_cleanSteps.insert(position, step); // check that the step has all the configurations - foreach(const QString & name, buildConfigurations()) - { + foreach (const QString &name, buildConfigurations()) if (!step->getBuildConfiguration(name)) step->addBuildConfiguration(name); - } } void Project::removeCleanStep(int position) @@ -100,10 +96,10 @@ void Project::addBuildConfiguration(const QString &name) m_buildConfigurationValues.push_back(new BuildConfiguration(name)); - for (int i = 0; i!=m_buildSteps.size(); ++i) + for (int i = 0; i != m_buildSteps.size(); ++i) m_buildSteps.at(i)->addBuildConfiguration(name); - for (int i = 0; i!=m_cleanSteps.size(); ++i) + for (int i = 0; i != m_cleanSteps.size(); ++i) m_cleanSteps.at(i)->addBuildConfiguration(name); } @@ -113,15 +109,15 @@ void Project::removeBuildConfiguration(const QString &name) return; for (int i = 0; i != m_buildConfigurationValues.size(); ++i) - if(m_buildConfigurationValues.at(i)->name() == name) { + if (m_buildConfigurationValues.at(i)->name() == name) { delete m_buildConfigurationValues.at(i); m_buildConfigurationValues.removeAt(i); break; } - for (int i = 0; i!=m_buildSteps.size(); ++i) + for (int i = 0; i != m_buildSteps.size(); ++i) m_buildSteps.at(i)->removeBuildConfiguration(name); - for (int i = 0; i!=m_cleanSteps.size(); ++i) + for (int i = 0; i != m_cleanSteps.size(); ++i) m_cleanSteps.at(i)->removeBuildConfiguration(name); } @@ -132,22 +128,21 @@ void Project::copyBuildConfiguration(const QString &source, const QString &dest) return; for (int i = 0; i != m_buildConfigurationValues.size(); ++i) - if(m_buildConfigurationValues.at(i)->name() == source) + if (m_buildConfigurationValues.at(i)->name() == source) m_buildConfigurationValues.push_back(new BuildConfiguration(dest, m_buildConfigurationValues.at(i))); - for (int i = 0; i!= m_buildSteps.size(); ++i) + for (int i = 0; i != m_buildSteps.size(); ++i) m_buildSteps.at(i)->copyBuildConfiguration(source, dest); - for (int i = 0; i!= m_cleanSteps.size(); ++i) + for (int i = 0; i != m_cleanSteps.size(); ++i) m_cleanSteps.at(i)->copyBuildConfiguration(source, dest); } QStringList Project::buildConfigurations() const { QStringList result; - foreach (BuildConfiguration *bc, m_buildConfigurationValues) { + foreach (BuildConfiguration *bc, m_buildConfigurationValues) result << bc->name(); - } return result; } @@ -195,39 +190,36 @@ void Project::saveSettingsImpl(PersistentSettingsWriter &writer) writer.saveValue("project", m_values); //save buildsettings - foreach(const QString & buildConfigurationName, buildConfigurations()) { + foreach (const QString &buildConfigurationName, buildConfigurations()) { QMap<QString, QVariant> temp = getBuildConfiguration(buildConfigurationName)->toMap(); writer.saveValue("buildConfiguration-" + buildConfigurationName, temp); } QStringList buildStepNames; - foreach(BuildStep * buildStep, buildSteps()) { + foreach (BuildStep *buildStep, buildSteps()) buildStepNames << buildStep->name(); - } writer.saveValue("buildsteps", buildStepNames); QStringList cleanStepNames; - foreach(BuildStep * cleanStep, cleanSteps()) { + foreach (BuildStep *cleanStep, cleanSteps()) cleanStepNames << cleanStep->name(); - } writer.saveValue("cleansteps", cleanStepNames); QStringList buildConfigurationNames = buildConfigurations(); writer.saveValue("buildconfigurations", buildConfigurationNames ); //save buildstep configuration int buildstepnr = 0; - foreach(BuildStep * buildStep, buildSteps()) - { + foreach (BuildStep *buildStep, buildSteps()) { QMap<QString, QVariant> buildConfiguration = buildStep->valuesToMap(); writer.saveValue("buildstep" + QString().setNum(buildstepnr), buildConfiguration); ++buildstepnr; } // save each buildstep/buildConfiguration combination - foreach(const QString & buildConfigurationName, buildConfigurationNames) { + foreach (const QString &buildConfigurationName, buildConfigurationNames) { buildstepnr = 0; - foreach(BuildStep * buildStep, buildSteps()) { + foreach (BuildStep *buildStep, buildSteps()) { QMap<QString, QVariant> temp = buildStep->valuesToMap(buildConfigurationName); writer.saveValue("buildconfiguration-" + buildConfigurationName + "-buildstep" + QString().setNum(buildstepnr), temp); @@ -237,17 +229,16 @@ void Project::saveSettingsImpl(PersistentSettingsWriter &writer) //save cleansteps buildconfiguration int cleanstepnr = 0; - foreach(BuildStep * cleanStep, cleanSteps()) - { + foreach (BuildStep *cleanStep, cleanSteps()) { QMap<QString, QVariant> buildConfiguration = cleanStep->valuesToMap(); writer.saveValue("cleanstep" + QString().setNum(cleanstepnr), buildConfiguration); ++cleanstepnr; } // save each cleanstep/buildConfiguration combination - foreach(const QString & buildConfigurationName, buildConfigurationNames) { + foreach (const QString &buildConfigurationName, buildConfigurationNames) { cleanstepnr = 0; - foreach(BuildStep * cleanStep, cleanSteps()) { + foreach (BuildStep *cleanStep, cleanSteps()) { QMap<QString, QVariant> temp = cleanStep->valuesToMap(buildConfigurationName); writer.saveValue("buildconfiguration-" + buildConfigurationName + "-cleanstep" + QString().setNum(cleanstepnr), temp); ++cleanstepnr; @@ -279,7 +270,7 @@ void Project::restoreSettingsImpl(PersistentSettingsReader &reader) //Build Settings const QStringList buildConfigurationNames = reader.restoreValue("buildconfigurations").toStringList(); - foreach(const QString & buildConfigurationName, buildConfigurationNames) { + foreach (const QString &buildConfigurationName, buildConfigurationNames) { addBuildConfiguration(buildConfigurationName); QMap<QString, QVariant> temp = reader.restoreValue("buildConfiguration-" + buildConfigurationName).toMap(); @@ -287,16 +278,16 @@ void Project::restoreSettingsImpl(PersistentSettingsReader &reader) } QVariant buildStepsVariant = reader.restoreValue("buildsteps"); - if(buildStepsVariant.isValid()) { + if (buildStepsVariant.isValid()) { // restoring BuildSteps from settings int pos = 0; const QList<IBuildStepFactory *> buildStepFactories = ExtensionSystem::PluginManager::instance()->getObjects<IBuildStepFactory>(); QStringList buildStepNames = buildStepsVariant.toStringList(); - foreach(const QString & buildStepName, buildStepNames) { - foreach(IBuildStepFactory * factory, buildStepFactories) { - if(factory->canCreate(buildStepName)) { - BuildStep * buildStep = factory->create(this, buildStepName); + foreach (const QString &buildStepName, buildStepNames) { + foreach (IBuildStepFactory *factory, buildStepFactories) { + if (factory->canCreate(buildStepName)) { + BuildStep *buildStep = factory->create(this, buildStepName); insertBuildStep(pos, buildStep); ++pos; break; @@ -307,10 +298,10 @@ void Project::restoreSettingsImpl(PersistentSettingsReader &reader) QStringList cleanStepNames = reader.restoreValue("cleansteps").toStringList(); // restoring BuildSteps from settings pos = 0; - foreach(const QString & cleanStepName, cleanStepNames) { - foreach(IBuildStepFactory * factory, buildStepFactories) { - if(factory->canCreate(cleanStepName)) { - BuildStep * cleanStep = factory->create(this, cleanStepName); + foreach (const QString &cleanStepName, cleanStepNames) { + foreach (IBuildStepFactory *factory, buildStepFactories) { + if (factory->canCreate(cleanStepName)) { + BuildStep *cleanStep = factory->create(this, cleanStepName); insertCleanStep(pos, cleanStep); ++pos; break; @@ -324,15 +315,15 @@ void Project::restoreSettingsImpl(PersistentSettingsReader &reader) // restore BuildSteps configuration int buildstepnr = 0; - foreach(BuildStep * buildStep, buildSteps()) { + foreach (BuildStep *buildStep, buildSteps()) { QMap<QString, QVariant> buildConfiguration = reader.restoreValue("buildstep" + QString().setNum(buildstepnr)).toMap(); buildStep->setValuesFromMap(buildConfiguration); ++buildstepnr; } - foreach(const QString & buildConfigurationName, buildConfigurationNames) { + foreach (const QString &buildConfigurationName, buildConfigurationNames) { buildstepnr = 0; - foreach(BuildStep * buildStep, buildSteps()) { + foreach (BuildStep *buildStep, buildSteps()) { //get the buildconfiguration for this build step QMap<QString, QVariant> buildConfiguration = reader.restoreValue("buildconfiguration-" + buildConfigurationName + "-buildstep" + QString().setNum(buildstepnr)).toMap(); @@ -343,16 +334,15 @@ void Project::restoreSettingsImpl(PersistentSettingsReader &reader) // restore CleanSteps configuration int cleanstepnr = 0; - foreach(BuildStep * cleanStep, cleanSteps()) - { + foreach (BuildStep *cleanStep, cleanSteps()) { QMap<QString, QVariant> buildConfiguration = reader.restoreValue("cleanstep" + QString().setNum(cleanstepnr)).toMap(); cleanStep->setValuesFromMap(buildConfiguration); ++cleanstepnr; } - foreach(const QString & buildConfigurationName, buildConfigurationNames) { + foreach (const QString &buildConfigurationName, buildConfigurationNames) { cleanstepnr = 0; - foreach(BuildStep * cleanStep, cleanSteps()) { + foreach (BuildStep *cleanStep, cleanSteps()) { //get the buildconfiguration for this clean step QMap<QString, QVariant> buildConfiguration = reader.restoreValue("buildconfiguration-" + buildConfigurationName + "-cleanstep" + QString().setNum(cleanstepnr)).toMap(); @@ -373,7 +363,7 @@ void Project::restoreSettingsImpl(PersistentSettingsReader &reader) if (!typeVariant.isValid()) break; const QString &type = typeVariant.toString(); - foreach (IRunConfigurationFactory * factory, factories) { + foreach (IRunConfigurationFactory *factory, factories) { if (factory->canCreate(type)) { QSharedPointer<RunConfiguration> rc = factory->create(this, type); rc->restore(reader); @@ -403,7 +393,7 @@ QVariant Project::value(const QString &name) const { QMap<QString, QVariant>::const_iterator it = m_values.find(name); - if(it != m_values.constEnd()) + if (it != m_values.constEnd()) return it.value(); else return QVariant(); @@ -497,7 +487,7 @@ QString Project::displayNameFor(const QString &buildConfiguration) void Project::setDisplayNameFor(const QString &buildConfiguration, const QString &displayName) { QStringList displayNames; - foreach(const QString &bc, buildConfigurations()) { + foreach (const QString &bc, buildConfigurations()) { if (bc != buildConfiguration) displayNames << displayNameFor(bc); } diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index f67984f0da8..7b721b208ff 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -734,7 +734,7 @@ void ProjectExplorerPlugin::clearSession() void ProjectExplorerPlugin::extensionsInitialized() { m_fileFactories = ProjectFileFactory::createFactories(m_core, &m_projectFilterString); - foreach(ProjectFileFactory *pf, m_fileFactories) { + foreach (ProjectFileFactory *pf, m_fileFactories) { m_profileMimeTypes += pf->mimeTypes(); addAutoReleasedObject(pf); } @@ -1212,7 +1212,7 @@ QStringList ProjectExplorerPlugin::allFilesWithDependencies(Project *pro) qDebug() << "ProjectExplorerPlugin::allFilesWithDependencies(" << pro->file()->fileName() << ")"; QStringList filesToSave; - foreach(Project *p, m_session->projectOrder(pro)) { + foreach (Project *p, m_session->projectOrder(pro)) { FindAllFilesVisitor filesVisitor; p->rootProjectNode()->accept(&filesVisitor); filesToSave << filesVisitor.filePaths(); @@ -1783,7 +1783,7 @@ void ProjectExplorerPlugin::updateSessionMenu() { m_sessionMenu->clear(); const QString &activeSession = m_session->activeSession(); - foreach(const QString &session, m_session->sessions()) { + foreach (const QString &session, m_session->sessions()) { QAction *act = m_sessionMenu->addAction(session, this, SLOT(setSession())); act->setCheckable(true); if (session == activeSession) diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index 3e04069408c..a3d601364f4 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -988,10 +988,9 @@ void FlatModel::added(FolderNode* parentNode, const QList<Node*> &newNodeList) return; } - while(true) - { + while (true) { // Skip all that are the same - while(*oldIter == *newIter) { + while (*oldIter == *newIter) { ++oldIter; ++newIter; if (oldIter == oldNodeList.constEnd()) { @@ -1002,7 +1001,7 @@ void FlatModel::added(FolderNode* parentNode, const QList<Node*> &newNodeList) int count = newIter - startOfBlock; if (count > 0) { beginInsertRows(parentIndex, pos, pos+count-1); - while(startOfBlock != newIter) { + while (startOfBlock != newIter) { oldNodeList.insert(pos, *startOfBlock); ++pos; ++startOfBlock; @@ -1015,7 +1014,7 @@ void FlatModel::added(FolderNode* parentNode, const QList<Node*> &newNodeList) } QList<Node *>::const_iterator startOfBlock = newIter; - while(*oldIter != *newIter) + while (*oldIter != *newIter) ++newIter; // startOfBlock is the first that was diffrent // newIter points to the new position of oldIter @@ -1024,7 +1023,7 @@ void FlatModel::added(FolderNode* parentNode, const QList<Node*> &newNodeList) int pos = oldIter - oldNodeList.constBegin(); int count = newIter - startOfBlock; beginInsertRows(parentIndex, pos, pos + count - 1); - while(startOfBlock != newIter) { + while (startOfBlock != newIter) { oldNodeList.insert(pos, *startOfBlock); ++pos; ++startOfBlock; @@ -1059,10 +1058,9 @@ void FlatModel::removed(FolderNode* parentNode, const QList<Node*> &newNodeList) return; } - while(true) - { + while (true) { // Skip all that are the same - while(*oldIter == *newIter) { + while (*oldIter == *newIter) { ++oldIter; ++newIter; if (newIter == newNodeList.constEnd()) { @@ -1073,7 +1071,7 @@ void FlatModel::removed(FolderNode* parentNode, const QList<Node*> &newNodeList) int count = oldIter - startOfBlock; if (count > 0) { beginRemoveRows(parentIndex, pos, pos+count-1); - while(startOfBlock != oldIter) { + while (startOfBlock != oldIter) { ++startOfBlock; oldNodeList.removeAt(pos); } @@ -1086,7 +1084,7 @@ void FlatModel::removed(FolderNode* parentNode, const QList<Node*> &newNodeList) } QList<Node *>::const_iterator startOfBlock = oldIter; - while(*oldIter != *newIter) + while (*oldIter != *newIter) ++oldIter; // startOfBlock is the first that was diffrent // oldIter points to the new position of newIter @@ -1095,7 +1093,7 @@ void FlatModel::removed(FolderNode* parentNode, const QList<Node*> &newNodeList) int pos = startOfBlock - oldNodeList.constBegin(); int count = oldIter - startOfBlock; beginRemoveRows(parentIndex, pos, pos + count - 1); - while(startOfBlock != oldIter) { + while (startOfBlock != oldIter) { ++startOfBlock; oldNodeList.removeAt(pos); } @@ -1125,7 +1123,7 @@ void FlatModel::foldersAdded() void FlatModel::foldersAboutToBeRemoved(FolderNode *parentFolder, const QList<FolderNode*> &staleFolders) { QSet<Node *> blackList; - foreach(FolderNode * node, staleFolders) + foreach (FolderNode *node, staleFolders) blackList.insert(node); FolderNode *folderNode = visibleFolderNode(parentFolder); @@ -1137,7 +1135,7 @@ void FlatModel::foldersAboutToBeRemoved(FolderNode *parentFolder, const QList<Fo void FlatModel::removeFromCache(QList<FolderNode *> list) { - foreach(FolderNode * fn, list) { + foreach (FolderNode *fn, list) { removeFromCache(fn->subFolderNodes()); m_childNodes.remove(fn); } @@ -1170,7 +1168,7 @@ void FlatModel::filesAboutToBeRemoved(FolderNode *folder, const QList<FileNode*> FolderNode *folderNode = visibleFolderNode(folder); QSet<Node *> blackList; - foreach(Node* node, staleFiles) + foreach(Node *node, staleFiles) blackList.insert(node); // Now get the new List for that folder diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index 38aa7f958a1..c725c915c9e 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -230,13 +230,11 @@ void ProjectWindow::updateTreeWidget() Project *ProjectWindow::findProject(const QString &path) const { QList<Project*> projects = m_session->projects(); - foreach(Project* project, projects) { - if (project->file()->fileName() == path) { + foreach (Project* project, projects) + if (project->file()->fileName() == path) return project; - } - } return 0; - } +} void ProjectWindow::handleCurrentItemChanged(QTreeWidgetItem *current) @@ -244,7 +242,6 @@ void ProjectWindow::handleCurrentItemChanged(QTreeWidgetItem *current) if (current) { QString path = current->text(2); if (Project *project = findProject(path)) { - m_projectExplorer->setCurrentFile(project, path); showProperties(project, QModelIndex()); return; diff --git a/src/plugins/projectexplorer/projectwizardpage.cpp b/src/plugins/projectexplorer/projectwizardpage.cpp index 8912fbb9e94..f7022158bc8 100644 --- a/src/plugins/projectexplorer/projectwizardpage.cpp +++ b/src/plugins/projectexplorer/projectwizardpage.cpp @@ -99,7 +99,7 @@ void ProjectWizardPage::setAddToVersionControlEnabled(bool b) void ProjectWizardPage::changeEvent(QEvent *e) { - switch(e->type()) { + switch (e->type()) { case QEvent::LanguageChange: m_ui->retranslateUi(this); break; @@ -115,7 +115,8 @@ void ProjectWizardPage::setVCSDisplay(const QString &vcsName) void ProjectWizardPage::setFilesDisplay(const QStringList &files) { - QString fileMessage; { + QString fileMessage; + { QTextStream str(&fileMessage); str << "<html>Files to be added:<pre>"; const QStringList::const_iterator cend = files.constEnd(); diff --git a/src/plugins/projectexplorer/removefiledialog.cpp b/src/plugins/projectexplorer/removefiledialog.cpp index 3d8f11345a2..32f573b5f62 100644 --- a/src/plugins/projectexplorer/removefiledialog.cpp +++ b/src/plugins/projectexplorer/removefiledialog.cpp @@ -59,7 +59,7 @@ bool RemoveFileDialog::isDeleteFileChecked() const void RemoveFileDialog::changeEvent(QEvent *e) { - switch(e->type()) { + switch (e->type()) { case QEvent::LanguageChange: m_ui->retranslateUi(this); break; diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index 71057473046..6f17dd51a17 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -387,10 +387,10 @@ SessionManager::SessionManager(Core::ICore *core, QObject *parent) dir.mkpath(configDir + "/qtcreator"); // Move sessions to that directory - foreach(const QString &session, sessions()) { + foreach (const QString &session, sessions()) { QFile file(configDir + "/" + session + ".qws"); if (file.exists()) - if(file.copy(configDir + "/qtcreator/" + session + ".qws")) + if (file.copy(configDir + "/qtcreator/" + session + ".qws")) file.remove(); } } @@ -413,15 +413,15 @@ SessionManager::~SessionManager() bool SessionManager::isDefaultVirgin() const { - return (isDefaultSession(m_sessionName) + return isDefaultSession(m_sessionName) && projects().isEmpty() - && m_core->editorManager()->openedEditors().isEmpty()); + && m_core->editorManager()->openedEditors().isEmpty(); } bool SessionManager::isDefaultSession(const QString &session) const { - return (session == QLatin1String("default")); + return session == QLatin1String("default"); } @@ -1082,7 +1082,7 @@ bool SessionManager::loadSession(const QString &session) } } else { // Create a new session with that name - if(!createImpl(sessionNameToFileName(session))) + if (!createImpl(sessionNameToFileName(session))) return false; updateName(session); return true; diff --git a/src/plugins/projectexplorer/sessiondialog.cpp b/src/plugins/projectexplorer/sessiondialog.cpp index f00697597ed..b264ac11a9a 100644 --- a/src/plugins/projectexplorer/sessiondialog.cpp +++ b/src/plugins/projectexplorer/sessiondialog.cpp @@ -128,7 +128,7 @@ SessionDialog::SessionDialog(SessionManager *sessionManager, const QString &last this, SLOT(updateActions())); QStringList sessions = sessionManager->sessions(); - foreach(const QString &session, sessions) { + foreach (const QString &session, sessions) { m_ui.sessionList->addItem(session); if (session == lastSession) m_ui.sessionList->setCurrentRow(m_ui.sessionList->count() - 1); diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index 309e8ab9836..236b2069ae0 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -441,7 +441,7 @@ QSize TaskDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelInd int height = 0; QTextLayout tl(description); tl.beginLayout(); - while(true) { + while (true) { QTextLine line = tl.createLine(); if (!line.isValid()) break; @@ -528,7 +528,7 @@ void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, int height = 0; QTextLayout tl(description); tl.beginLayout(); - while(true) { + while (true) { QTextLine line = tl.createLine(); if (!line.isValid()) break; diff --git a/src/plugins/qt4projectmanager/cesdkhandler.cpp b/src/plugins/qt4projectmanager/cesdkhandler.cpp index cb10cba5011..25200c3ab27 100644 --- a/src/plugins/qt4projectmanager/cesdkhandler.cpp +++ b/src/plugins/qt4projectmanager/cesdkhandler.cpp @@ -41,13 +41,13 @@ using namespace Qt4ProjectManager::Internal; using ProjectExplorer::Environment; CeSdkInfo::CeSdkInfo() - : m_major(0) , m_minor(0) + : m_major(0), m_minor(0) { } Environment CeSdkInfo::addToEnvironment(const Environment &env) { - qDebug()<<"adding "<<name()<< "to Environment"; + qDebug() << "adding " << name() << "to Environment"; Environment e(env); e.set("INCLUDE", m_include); e.set("LIB", m_lib); @@ -66,21 +66,21 @@ QString CeSdkHandler::platformName(const QString &qtpath) QString CE_SDK; QString CE_ARCH; QFile f(qtpath); - if(f.exists() && f.open(QIODevice::ReadOnly)) { - while(!f.atEnd()) { + if (f.exists() && f.open(QIODevice::ReadOnly)) { + while (!f.atEnd()) { QByteArray line = f.readLine(); - if(line.startsWith("CE_SDK")) { + if (line.startsWith("CE_SDK")) { int index = line.indexOf('='); - if(index >= 0) { + if (index >= 0) { CE_SDK = line.mid(index + 1).trimmed(); } - } else if(line.startsWith("CE_ARCH")) { + } else if (line.startsWith("CE_ARCH")) { int index = line.indexOf('='); - if(index >= 0) { + if (index >= 0) { CE_ARCH = line.mid(index + 1).trimmed(); } } - if(!CE_SDK.isEmpty() && !CE_ARCH.isEmpty()) { + if (!CE_SDK.isEmpty() && !CE_ARCH.isEmpty()) { platformName = CE_SDK + " (" + CE_ARCH + ")"; break; } @@ -146,9 +146,9 @@ bool CeSdkHandler::parse(const QString &vsdir) CeSdkInfo CeSdkHandler::find(const QString &name) { - qDebug()<<"looking for platform "<<name; + qDebug() << "looking for platform " << name; for (QList<CeSdkInfo>::iterator it = m_list.begin(); it != m_list.end(); ++it) { - qDebug()<<"...."<<it->name(); + qDebug() << "...." << it->name(); if (it->name() == name) return *it; } diff --git a/src/plugins/qt4projectmanager/deployhelper.cpp b/src/plugins/qt4projectmanager/deployhelper.cpp index 57386afd2ef..cf48604ad20 100644 --- a/src/plugins/qt4projectmanager/deployhelper.cpp +++ b/src/plugins/qt4projectmanager/deployhelper.cpp @@ -60,9 +60,9 @@ bool DeployHelperRunStep::init(const QString &configuration) //find target m_exec = ""; QStringList targets = QStringList(); //TODO fix m_pro->qmakeTarget(); - foreach(const QString& target, targets) { + foreach (const QString &target, targets) { QFileInfo fi(m_appdir + QLatin1Char('/') + target); - if(fi.exists()) + if (fi.exists()) m_exec = target; break; } diff --git a/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp b/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp index 0046a9e4acf..bd2c367f696 100644 --- a/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp +++ b/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp @@ -74,7 +74,7 @@ void GdbMacrosBuildStep::run(QFutureInterface<bool> & fi) QString destDir = m_buildDirectory + "/qtc-gdbmacros/"; QDir dir; dir.mkpath(destDir); - foreach(const QString &file, files) { + foreach (const QString &file, files) { QFile destination(destDir + file); if (destination.exists()) destination.remove(); @@ -116,7 +116,7 @@ void GdbMacrosBuildStep::run(QFutureInterface<bool> & fi) QStringList makeargs = ms->value(m_buildConfiguration, "makeargs").toStringList(); if (makeargs.contains("debug")) { makeArguments << "debug"; - } else if(makeargs.contains("release")) { + } else if (makeargs.contains("release")) { makeArguments << "release"; } } diff --git a/src/plugins/qt4projectmanager/makestep.cpp b/src/plugins/qt4projectmanager/makestep.cpp index d88281ce596..59acdb1b5e0 100644 --- a/src/plugins/qt4projectmanager/makestep.cpp +++ b/src/plugins/qt4projectmanager/makestep.cpp @@ -69,7 +69,7 @@ ProjectExplorer::BuildParserInterface *MakeStep::buildParser(const QtVersion * c { QString buildParser; QtVersion::ToolchainType type = version->toolchainType(); - if( type == QtVersion::MSVC || type == QtVersion::WINCE) + if ( type == QtVersion::MSVC || type == QtVersion::WINCE) buildParser = Constants::BUILD_PARSER_MSVC; else buildParser = Constants::BUILD_PARSER_GCC; @@ -92,18 +92,18 @@ bool MakeStep::init(const QString &name) QString workingDirectory; if (project()->value(name, "useShadowBuild").toBool()) workingDirectory = project()->value(name, "buildDirectory").toString(); - if(workingDirectory.isEmpty()) + if (workingDirectory.isEmpty()) workingDirectory = QFileInfo(project()->file()->fileName()).absolutePath(); setWorkingDirectory(name, workingDirectory); //NBS only dependency on Qt4Project, we probably simply need a MakeProject from which Qt4Project derives QString makeCmd = qobject_cast<Qt4Project *>(project())->qtVersion(name)->makeCommand(); - if(!value(name, "makeCmd").toString().isEmpty()) + if (!value(name, "makeCmd").toString().isEmpty()) makeCmd = value(name, "makeCmd").toString(); if (!QFileInfo(makeCmd).isAbsolute()) { // Try to detect command in environment QString tmp = environment.searchInPath(makeCmd); - if(tmp == QString::null) { + if (tmp == QString::null) { emit addToOutputWindow(tr("<font color=\"#ff0000\">Could not find make command: %1 "\ "in the build environment</font>").arg(makeCmd)); return false; @@ -291,7 +291,7 @@ void MakeStepConfigWidget::init(const QString &buildConfiguration) bool showPage0 = buildConfiguration.isNull(); m_ui.stackedWidget->setCurrentIndex(showPage0? 0 : 1); - if(!showPage0) { + if (!showPage0) { Qt4Project *pro = qobject_cast<Qt4Project *>(m_makeStep->project()); m_ui.makeLabel->setText(tr("Override %1:").arg(pro->qtVersion(buildConfiguration)->makeCommand())); diff --git a/src/plugins/qt4projectmanager/msvcenvironment.cpp b/src/plugins/qt4projectmanager/msvcenvironment.cpp index 1c3a158d72f..48d751f0f25 100644 --- a/src/plugins/qt4projectmanager/msvcenvironment.cpp +++ b/src/plugins/qt4projectmanager/msvcenvironment.cpp @@ -66,7 +66,7 @@ QList<MSVCEnvironment> MSVCEnvironment::availableVersions() QSettings registry("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7", QSettings::NativeFormat); QStringList versions = registry.allKeys(); - foreach(const QString &version, versions) { + foreach (const QString &version, versions) { QString dir = registry.value(version).toString(); result << MSVCEnvironment(version, dir); } @@ -92,7 +92,7 @@ Environment MSVCEnvironment::addToEnvironment(const Environment &env) const QString varsbat = m_path + "Common7\\Tools\\vsvars32.bat"; if (QFileInfo(varsbat).exists()) { QTemporaryFile tf(QDir::tempPath() + "\\XXXXXX.bat"); - if(!tf.open()) + if (!tf.open()) return e; QString filename = tf.fileName(); tf.write("call \"" + varsbat.toLocal8Bit()+"\"\r\n"); @@ -107,13 +107,13 @@ Environment MSVCEnvironment::addToEnvironment(const Environment &env) const tf.close(); QFile vars(QDir::tempPath() + "\\qtcreator-msvc-environment.txt"); - if(vars.exists() && vars.open(QIODevice::ReadOnly)) { - while(!vars.atEnd()) { + if (vars.exists() && vars.open(QIODevice::ReadOnly)) { + while (!vars.atEnd()) { QByteArray line = vars.readLine(); QString line2 = QString::fromLocal8Bit(line); line2 = line2.trimmed(); QRegExp regexp("(\\w*)=(.*)"); - if(regexp.exactMatch(line2)) { + if (regexp.exactMatch(line2)) { QString variable = regexp.cap(1); QString value = regexp.cap(2); value.replace('%' + variable + '%', e.value(variable)); @@ -137,13 +137,13 @@ Environment MSVCEnvironment::addToEnvironment(const Environment &env) const // QFile varsbat(m_path + "Common7\\Tools\\vsvars32.bat"); -// if(varsbat.exists() && varsbat.open(QIODevice::ReadOnly)) { -// while(!varsbat.atEnd()) { +// if (varsbat.exists() && varsbat.open(QIODevice::ReadOnly)) { +// while (!varsbat.atEnd()) { // QByteArray line = varsbat.readLine(); // QString line2 = QString::fromLocal8Bit(line); // line2 = line2.trimmed(); // QRegExp regexp("\\s*@?(S|s)(E|e)(T|t)\\s*(\\w*)=(.*)"); -// if(regexp.exactMatch(line2)) { +// if (regexp.exactMatch(line2)) { // QString variable = regexp.cap(4); // QString value = regexp.cap(5); // value.replace('%' + variable + '%', e.value(variable)); diff --git a/src/plugins/qt4projectmanager/profilereader.cpp b/src/plugins/qt4projectmanager/profilereader.cpp index 9f65cc890d0..2b4c817928f 100644 --- a/src/plugins/qt4projectmanager/profilereader.cpp +++ b/src/plugins/qt4projectmanager/profilereader.cpp @@ -45,7 +45,7 @@ ProFileReader::ProFileReader() ProFileReader::~ProFileReader() { - foreach(ProFile *pf, m_proFiles) + foreach (ProFile *pf, m_proFiles) delete pf; } diff --git a/src/plugins/qt4projectmanager/qmakestep.cpp b/src/plugins/qt4projectmanager/qmakestep.cpp index 44780a7dcc5..786675e84b3 100644 --- a/src/plugins/qt4projectmanager/qmakestep.cpp +++ b/src/plugins/qt4projectmanager/qmakestep.cpp @@ -65,7 +65,7 @@ QStringList QMakeStep::arguments(const QString &buildConfiguration) QStringList arguments; arguments << project()->file()->fileName(); if (!additonalArguments.contains("-spec")) { - if(m_pro->value("useVBOX").toBool()) { //NBS TODO don't special case VBOX like this + if (m_pro->value("useVBOX").toBool()) { //NBS TODO don't special case VBOX like this arguments << "-spec" << "linux-i686fb-g++"; arguments << "-unix"; } else { @@ -116,7 +116,7 @@ bool QMakeStep::init(const QString &name) QString workingDirectory = m_pro->buildDirectory(name); Environment environment = m_pro->environment(name); - if(!environment.value("QMAKESPEC").isEmpty() && environment.value("QMAKESPEC") != qtVersion->mkspec()) + if (!environment.value("QMAKESPEC").isEmpty() && environment.value("QMAKESPEC") != qtVersion->mkspec()) emit addToOutputWindow(tr("QMAKESPEC set to ") + environment.value("QMAKESPEC") + tr(" overrides mkspec of selected qt ")+qtVersion->mkspec()); diff --git a/src/plugins/qt4projectmanager/qt4buildconfigwidget.cpp b/src/plugins/qt4projectmanager/qt4buildconfigwidget.cpp index a9d7753cfbb..75ea55097c1 100644 --- a/src/plugins/qt4projectmanager/qt4buildconfigwidget.cpp +++ b/src/plugins/qt4projectmanager/qt4buildconfigwidget.cpp @@ -118,31 +118,31 @@ void Qt4BuildConfigWidget::setupQtVersionsComboBox() if (m_buildConfiguration.isEmpty()) // not yet initialized return; - disconnect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(const QString &)), - this, SLOT(qtVersionComboBoxCurrentIndexChanged(const QString &))); + disconnect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(QString)), + this, SLOT(qtVersionComboBoxCurrentIndexChanged(QString))); m_ui->qtVersionComboBox->clear(); m_ui->qtVersionComboBox->addItem(tr("Default Qt Version"), 0); - if(m_pro->qtVersionId(m_buildConfiguration) == 0) { + if (m_pro->qtVersionId(m_buildConfiguration) == 0) { m_ui->qtVersionComboBox->setCurrentIndex(0); m_ui->invalidQtWarningLabel->setVisible(false); } // Add Qt Versions to the combo box QtVersionManager *vm = m_pro->qt4ProjectManager()->versionManager(); const QList<QtVersion *> &versions = vm->versions(); - for(int i=0; i<versions.size(); ++i) { + for (int i = 0; i < versions.size(); ++i) { m_ui->qtVersionComboBox->addItem(versions.at(i)->name(), versions.at(i)->uniqueId()); - if(versions.at(i)->uniqueId() == m_pro->qtVersionId(m_buildConfiguration)) { - m_ui->qtVersionComboBox->setCurrentIndex(i+1); + if (versions.at(i)->uniqueId() == m_pro->qtVersionId(m_buildConfiguration)) { + m_ui->qtVersionComboBox->setCurrentIndex(i + 1); m_ui->invalidQtWarningLabel->setVisible(!versions.at(i)->isValid()); } } // And connect again - connect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(const QString &)), - this, SLOT(qtVersionComboBoxCurrentIndexChanged(const QString &))); + connect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(QString)), + this, SLOT(qtVersionComboBoxCurrentIndexChanged(QString))); } void Qt4BuildConfigWidget::shadowBuildButtonClicked() @@ -180,7 +180,7 @@ void Qt4BuildConfigWidget::shadowBuildLineEditTextChanged() m_ui->importLabel->setVisible(false); if (m_ui->shadowBuildCheckBox->isChecked()) { QString qtPath = m_pro->qt4ProjectManager()->versionManager()->findQtVersionFromMakefile(m_ui->shadowBuildLineEdit->text()); - if(!qtPath.isEmpty()) { + if (!qtPath.isEmpty()) { m_ui->importLabel->setVisible(true); } } @@ -252,7 +252,7 @@ void Qt4BuildConfigWidget::qtVersionComboBoxCurrentIndexChanged(const QString &) } bool isValid = m_pro->qt4ProjectManager()->versionManager()->version(newQtVersion)->isValid(); m_ui->invalidQtWarningLabel->setVisible(!isValid); - if(newQtVersion != m_pro->qtVersionId(m_buildConfiguration)) { + if (newQtVersion != m_pro->qtVersionId(m_buildConfiguration)) { m_pro->setQtVersion(m_buildConfiguration, newQtVersion); m_pro->update(); } diff --git a/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.cpp b/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.cpp index 98dbd196a1d..84ae6744a45 100644 --- a/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.cpp +++ b/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.cpp @@ -127,7 +127,7 @@ void Qt4BuildEnvironmentWidget::removeEnvironmentButtonClicked() void Qt4BuildEnvironmentWidget::unsetEnvironmentButtonClicked() { const QString &name = m_environmentModel->indexToVariable(m_ui->environmentTreeView->currentIndex()); - if(!m_environmentModel->isInBaseEnvironment(name) && m_environmentModel->mergedEnvironments()) + if (!m_environmentModel->isInBaseEnvironment(name) && m_environmentModel->mergedEnvironments()) m_environmentModel->removeVariable(name); else m_environmentModel->unset(name); @@ -138,7 +138,7 @@ void Qt4BuildEnvironmentWidget::switchEnvironmentTab(int newTab) { bool mergedEnvironments = (newTab == 0); m_environmentModel->setMergedEnvironments(mergedEnvironments); - if(mergedEnvironments) { + if (mergedEnvironments) { m_ui->removeButton->setText(tr("Reset")); } else { m_ui->removeButton->setText(tr("Remove")); @@ -153,8 +153,8 @@ void Qt4BuildEnvironmentWidget::updateButtonsEnabled() void Qt4BuildEnvironmentWidget::environmentCurrentIndexChanged(const QModelIndex ¤t, const QModelIndex &previous) { Q_UNUSED(previous) - if(current.isValid()) { - if(m_environmentModel->mergedEnvironments()) { + if (current.isValid()) { + if (m_environmentModel->mergedEnvironments()) { const QString &name = m_environmentModel->indexToVariable(current); bool modified = m_environmentModel->isInBaseEnvironment(name) && m_environmentModel->changes(name); bool unset = m_environmentModel->isUnset(name); diff --git a/src/plugins/qt4projectmanager/qt4nodes.cpp b/src/plugins/qt4projectmanager/qt4nodes.cpp index 73e3620f9bc..556e7798f9f 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.cpp +++ b/src/plugins/qt4projectmanager/qt4nodes.cpp @@ -321,7 +321,7 @@ void Qt4PriFileNode::changeFiles(const FileType fileType, } ProFile *includeFile = reader->proFileFor(m_projectFilePath); - if(!includeFile) { + if (!includeFile) { m_project->proFileParseError(tr("Error while changing pro file %1.").arg(m_projectFilePath)); } @@ -418,7 +418,7 @@ void Qt4PriFileNode::save(ProFile *includeFile) Core::FileManager *fileManager = core->fileManager(); QList<Core::IFile *> allFileHandles = fileManager->managedFiles(includeFile->fileName()); Core::IFile *modifiedFileHandle = 0; - foreach(Core::IFile *file, allFileHandles) + foreach (Core::IFile *file, allFileHandles) if (file->fileName() == includeFile->fileName()) modifiedFileHandle = file; diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp index b3950ab63b7..edaabdf154e 100644 --- a/src/plugins/qt4projectmanager/qt4project.cpp +++ b/src/plugins/qt4projectmanager/qt4project.cpp @@ -273,7 +273,7 @@ void Qt4Project::qtVersionsChanged() foreach (QString bc, buildConfigurations()) { if (!qt4ProjectManager()->versionManager()->version(qtVersionId(bc))->isValid()) { setQtVersion(bc, 0); - if(bc == activeBuildConfiguration()) + if (bc == activeBuildConfiguration()) update(); } } @@ -663,7 +663,7 @@ QString Qt4Project::buildDirectory(const QString &buildConfiguration) const QString workingDirectory; if (value(buildConfiguration, "useShadowBuild").toBool()) workingDirectory = value(buildConfiguration, "buildDirectory").toString(); - if(workingDirectory.isEmpty()) + if (workingDirectory.isEmpty()) workingDirectory = QFileInfo(file()->fileName()).absolutePath(); return workingDirectory; } @@ -698,7 +698,7 @@ int Qt4Project::qtVersionId(const QString &buildConfiguration) const qDebug()<<"Looking for qtVersion ID of "<<buildConfiguration; int id = 0; QVariant vid = value(buildConfiguration, "QtVersionId"); - if(vid.isValid()) { + if (vid.isValid()) { id = vid.toInt(); if (m_manager->versionManager()->version(id)->isValid()) { return id; @@ -711,10 +711,10 @@ int Qt4Project::qtVersionId(const QString &buildConfiguration) const QString vname = value(buildConfiguration, "QtVersion").toString(); if (debug) qDebug()<<" Backward compatibility reading QtVersion"<<vname; - if(!vname.isEmpty()) { + if (!vname.isEmpty()) { const QList<QtVersion *> &versions = m_manager->versionManager()->versions(); foreach (const QtVersion * const version, versions) { - if(version->name() == vname) { + if (version->name() == vname) { if (debug) qDebug()<<"found name in versions"; const_cast<Qt4Project *>(this)->setValue(buildConfiguration, "QtVersionId", version->uniqueId()); @@ -828,7 +828,7 @@ void Qt4Project::checkForDeletedApplicationProjects() bool resetActiveRunConfiguration = false; QSharedPointer<RunConfiguration> rc(new ProjectExplorer::CustomExecutableRunConfiguration(this)); - foreach(QSharedPointer<Qt4RunConfiguration> qt4rc, removeList) { + foreach (QSharedPointer<Qt4RunConfiguration> qt4rc, removeList) { removeRunConfiguration(qt4rc); if (activeRunConfiguration() == qt4rc) resetActiveRunConfiguration = true; @@ -905,7 +905,7 @@ bool Qt4Project::hasSubNode(Qt4PriFileNode *root, const QString &path) foreach (FolderNode *fn, root->subFolderNodes()) { if (qobject_cast<Qt4ProFileNode *>(fn)) { // we aren't interested in pro file nodes - } else if(Qt4PriFileNode *qt4prifilenode = qobject_cast<Qt4PriFileNode *>(fn)) { + } else if (Qt4PriFileNode *qt4prifilenode = qobject_cast<Qt4PriFileNode *>(fn)) { if (hasSubNode(qt4prifilenode, path)) return true; } diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.cpp b/src/plugins/qt4projectmanager/qt4projectmanager.cpp index 8ff73970d53..2e1281682ef 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanager.cpp @@ -102,9 +102,8 @@ void Qt4Manager::unregisterProject(Qt4Project *project) void Qt4Manager::notifyChanged(const QString &name) { - foreach(Qt4Project *pro, m_projects) { + foreach (Qt4Project *pro, m_projects) pro->notifyChanged(name); - } } void Qt4Manager::init() diff --git a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp index 28f7ca2a8c8..b3aaa817ab0 100644 --- a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp @@ -297,7 +297,7 @@ QString Qt4RunConfiguration::qmakeBuildConfigFromBuildConfiguration(const QStrin QStringList makeargs = ms->value(buildConfigurationName, "makeargs").toStringList(); if (makeargs.contains("debug")) return "debug"; - else if(makeargs.contains("release")) + else if (makeargs.contains("release")) return "release"; // Oh we don't have an explicit make argument @@ -428,7 +428,7 @@ QStringList Qt4RunConfigurationFactoryUser::canCreate(ProjectExplorer::Project * if (qt4project) { QStringList applicationProFiles; QList<Qt4ProFileNode *> list = qt4project->applicationProFiles(); - foreach(Qt4ProFileNode * node, list) { + foreach (Qt4ProFileNode * node, list) { applicationProFiles.append("Qt4RunConfiguration." + node->path()); } return applicationProFiles; diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp index 421aa3b77ae..5ff19da38b9 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.cpp +++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp @@ -158,7 +158,7 @@ QWidget *QtVersionManager::createPage(QWidget *parent) void QtVersionManager::updateUniqueIdToIndexMap() { m_uniqueIdToIndex.clear(); - for(int i=0; i<m_versions.size(); ++i) + for (int i = 0; i < m_versions.size(); ++i) m_uniqueIdToIndex.insert(m_versions.at(i)->uniqueId(), i); } @@ -225,7 +225,7 @@ QtVersion *QtVersionManager::version(int id) const if (pos != -1) return m_versions.at(pos); - if(m_defaultVersion < m_versions.count()) + if (m_defaultVersion < m_versions.count()) return m_versions.at(m_defaultVersion); else return m_emptyVersion; @@ -248,17 +248,17 @@ void QtVersionManager::addNewVersionsFromInstaller() bool defaultVersionWasReset = false; foreach (QString newVersion, newVersionsList) { QStringList newVersionData = newVersion.split('='); - if(newVersionData.count()>=2) { + if (newVersionData.count()>=2) { if (QDir(newVersionData[1]).exists()) { QtVersion *version = new QtVersion(newVersionData[0], newVersionData[1], m_idcount++ ); - if(newVersionData.count() >= 3) + if (newVersionData.count() >= 3) version->setMingwDirectory(newVersionData[2]); - if(newVersionData.count() >= 4) + if (newVersionData.count() >= 4) version->setPrependPath(newVersionData[3]); bool versionWasAlreadyInList = false; foreach(const QtVersion * const it, m_versions) { - if(QDir(version->path()).canonicalPath() == QDir(it->path()).canonicalPath()) { + if (QDir(version->path()).canonicalPath() == QDir(it->path()).canonicalPath()) { versionWasAlreadyInList = true; break; } @@ -349,7 +349,7 @@ QString QtVersionManager::findSystemQt() const QtVersion *QtVersionManager::currentQtVersion() const { - if(m_defaultVersion < m_versions.count()) + if (m_defaultVersion < m_versions.count()) return m_versions.at(m_defaultVersion); else return m_emptyVersion; @@ -465,27 +465,27 @@ void QtDirWidget::updateState() void QtDirWidget::showEnvironmentPage(QTreeWidgetItem *item) { m_ui.msvcComboBox->setVisible(false); - if(item) { + if (item) { int index = m_ui.qtdirList->indexOfTopLevelItem(item); m_ui.errorLabel->setText(""); QtVersion::ToolchainType t = m_versions.at(index)->toolchainType(); - if(t == QtVersion::MinGW) { + if (t == QtVersion::MinGW) { m_ui.msvcComboBox->setVisible(false); m_ui.msvcLabel->setVisible(false); m_ui.mingwLineEdit->setVisible(true); m_ui.mingwLabel->setVisible(true); m_ui.mingwBrowseButton->setVisible(true); m_ui.mingwLineEdit->setText(m_versions.at(index)->mingwDirectory()); - } else if(t == QtVersion::MSVC || t == QtVersion::WINCE){ + } else if (t == QtVersion::MSVC || t == QtVersion::WINCE){ m_ui.msvcComboBox->setVisible(false); m_ui.msvcLabel->setVisible(true); m_ui.mingwLineEdit->setVisible(false); m_ui.mingwLabel->setVisible(false); m_ui.mingwBrowseButton->setVisible(false); QList<MSVCEnvironment> msvcenvironments = MSVCEnvironment::availableVersions(); - if(msvcenvironments.count() == 0) { + if (msvcenvironments.count() == 0) { m_ui.msvcLabel->setText(tr("No Visual Studio Installation found")); - } else if(msvcenvironments.count() == 1) { + } else if (msvcenvironments.count() == 1) { m_ui.msvcLabel->setText( msvcenvironments.at(0).description()); } else { m_ui.msvcComboBox->setVisible(true); @@ -500,7 +500,7 @@ void QtDirWidget::showEnvironmentPage(QTreeWidgetItem *item) } m_ui.msvcComboBox->blockSignals(block); } - } else if(t == QtVersion::INVALID) { + } else if (t == QtVersion::INVALID) { m_ui.msvcComboBox->setVisible(false); m_ui.msvcLabel->setVisible(false); m_ui.mingwLineEdit->setVisible(false); @@ -530,7 +530,7 @@ void QtDirWidget::showEnvironmentPage(QTreeWidgetItem *item) void QtDirWidget::versionChanged(QTreeWidgetItem *item, QTreeWidgetItem *old) { - if(old) { + if (old) { fixQtVersionName(m_ui.qtdirList->indexOfTopLevelItem(old)); } if (item) { @@ -601,7 +601,7 @@ void QtDirWidget::updateCurrentQtName() void QtDirWidget::finish() { - if(QTreeWidgetItem *item = m_ui.qtdirList->currentItem()) + if (QTreeWidgetItem *item = m_ui.qtdirList->currentItem()) fixQtVersionName(m_ui.qtdirList->indexOfTopLevelItem(item)); } @@ -612,9 +612,9 @@ void QtDirWidget::finish() void QtDirWidget::fixQtVersionName(int index) { int count = m_versions.count(); - for(int i=0; i<count; ++i) { - if(i != index) { - if(m_versions.at(i)->name() == m_versions.at(index)->name()) { + for (int i = 0; i < count; ++i) { + if (i != index) { + if (m_versions.at(i)->name() == m_versions.at(index)->name()) { // Same name, find new name QString name = m_versions.at(index)->name(); QRegExp regexp("^(.*)\\((\\d)\\)$"); @@ -666,7 +666,7 @@ void QtDirWidget::msvcVersionChanged() //get descriptionx QList<MSVCEnvironment> msvcEnvironments = MSVCEnvironment::availableVersions(); foreach(const MSVCEnvironment &msvcEnv, msvcEnvironments) { - if(msvcEnv.name() == msvcVersion) { + if (msvcEnv.name() == msvcVersion) { m_ui.msvcLabel->setText(msvcEnv.description()); break; } @@ -691,7 +691,7 @@ QtVersion::QtVersion(const QString &name, const QString &path, int id, bool isSy : m_name(name), m_isSystemVersion(isSystemVersion), m_notInstalled(false), m_defaultConfigIsDebug(true), m_defaultConfigIsDebugAndRelease(true) { setPath(path); - if(id == -1) + if (id == -1) m_id = getUniqueId(); else m_id = id; @@ -860,7 +860,7 @@ QtVersion::QmakeBuildConfig QtVersionManager::scanMakefileForQmakeConfig(const Q //Now chop into parts that are intresting QStringList parts; int lastpos = 0; - for(int i=1; i<line.size(); ++i) { + for (int i = 1; i < line.size(); ++i) { if (line.at(i) == QLatin1Char(' ') && line.at(i-1) != QLatin1Char('\\')) { // found a part parts.append(line.mid(lastpos, i-lastpos)); @@ -874,7 +874,7 @@ QtVersion::QmakeBuildConfig QtVersionManager::scanMakefileForQmakeConfig(const Q qDebug()<<"part appended:"<<line.mid(lastpos); foreach(const QString &part, parts) { - if(debugScan) + if (debugScan) qDebug()<<"now interpreting part"<<part; bool setFlags; // Now try to understand each part for that we do a rather stupid approach, optimize it if you care @@ -893,7 +893,7 @@ QtVersion::QmakeBuildConfig QtVersionManager::scanMakefileForQmakeConfig(const Q qDebug()<<"part has setFlags:"<<setFlags; // now loop forward, looking for something that looks like debug, release or debug_and_release - for(int i=0; i<part.size(); ++i) { + for (int i = 0; i < part.size(); ++i) { int left = part.size() - i; if (left >= 17 && QStringRef(&part, i, 17) == "debug_and_release") { if (setFlags) @@ -910,7 +910,7 @@ QtVersion::QmakeBuildConfig QtVersionManager::scanMakefileForQmakeConfig(const Q result = QtVersion::QmakeBuildConfig(result | QtVersion::DebugBuild); if (debugScan) qDebug()<<"found release new value"<<result; - i +=7; + i += 7; } else if (left >= 5 && QStringRef(&part, i, 5) == "debug") { if (setFlags) result = QtVersion::QmakeBuildConfig(result | QtVersion::DebugBuild); @@ -918,7 +918,7 @@ QtVersion::QmakeBuildConfig QtVersionManager::scanMakefileForQmakeConfig(const Q result = QtVersion::QmakeBuildConfig(result & ~QtVersion::DebugBuild); if (debugScan) qDebug()<<"found debug new value"<<result; - i+=5; + i += 5; } } } @@ -1004,9 +1004,9 @@ void QtVersion::updateVersionInfo() const foreach(const QString &value, values) { if (value == "debug") m_defaultConfigIsDebug = true; - else if(value == "release") + else if (value == "release") m_defaultConfigIsDebug = false; - else if(value == "build_all") + else if (value == "build_all") m_defaultConfigIsDebugAndRelease = true; } } @@ -1031,11 +1031,11 @@ void QtVersion::updateMkSpec() const QString mkspec; // QFile f(path() + "/.qmake.cache"); // if (f.exists() && f.open(QIODevice::ReadOnly)) { -// while(!f.atEnd()) { +// while (!f.atEnd()) { // QByteArray line = f.readLine(); -// if(line.startsWith("QMAKESPEC")) { +// if (line.startsWith("QMAKESPEC")) { // const QList<QByteArray> &temp = line.split('='); -// if(temp.size() == 2) { +// if (temp.size() == 2) { // mkspec = temp.at(1).trimmed(); // if (mkspec.startsWith("$$QT_BUILD_TREE/mkspecs/")) // mkspec = mkspec.mid(QString("$$QT_BUILD_TREE/mkspecs/").length()); @@ -1058,9 +1058,9 @@ void QtVersion::updateMkSpec() const #ifdef Q_OS_WIN QFile f2(mkspecPath + "/qmake.conf"); if (f2.exists() && f2.open(QIODevice::ReadOnly)) { - while(!f2.atEnd()) { + while (!f2.atEnd()) { QByteArray line = f2.readLine(); - if(line.startsWith("QMAKESPEC_ORIGINAL")) { + if (line.startsWith("QMAKESPEC_ORIGINAL")) { const QList<QByteArray> &temp = line.split('='); if (temp.size() == 2) { mkspec = temp.at(1); @@ -1073,9 +1073,9 @@ void QtVersion::updateMkSpec() const #elif defined(Q_OS_MAC) QFile f2(mkspecPath + "/qmake.conf"); if (f2.exists() && f2.open(QIODevice::ReadOnly)) { - while(!f2.atEnd()) { + while (!f2.atEnd()) { QByteArray line = f2.readLine(); - if(line.startsWith("MAKEFILE_GENERATOR")) { + if (line.startsWith("MAKEFILE_GENERATOR")) { const QList<QByteArray> &temp = line.split('='); if (temp.size() == 2) { const QByteArray &value = temp.at(1); @@ -1106,7 +1106,7 @@ void QtVersion::updateMkSpec() const m_mkspecFullPath = mkspec; int index = mkspec.lastIndexOf('/'); - if(index == -1) + if (index == -1) index = mkspec.lastIndexOf('\\'); QString mkspecDir = QDir(m_path + "/mkspecs/").canonicalPath(); if (index >= 0 && QDir(mkspec.left(index)).canonicalPath() == mkspecDir) @@ -1123,7 +1123,7 @@ QString QtVersion::makeCommand() const const QString &spec = mkspec(); if (spec.contains("win32-msvc") || spec.contains(QLatin1String("win32-icc"))) return "nmake.exe"; - else if(spec.startsWith("wince")) + else if (spec.startsWith("wince")) return "nmake.exe"; else return "mingw32-make.exe"; @@ -1140,7 +1140,7 @@ QString QtVersion::qmakeCommand() const return m_qmakeCommand; QDir qtDir = path() + "/bin/"; - foreach(const QString &possibleCommand, QtVersionManager::possibleQMakeCommands()) { + foreach (const QString &possibleCommand, QtVersionManager::possibleQMakeCommands()) { QString s = qtDir.absoluteFilePath(possibleCommand); QFileInfo qmake(s); if (qmake.exists() && qmake.isExecutable()) { @@ -1158,13 +1158,13 @@ QtVersion::ToolchainType QtVersion::toolchainType() const if (!isValid()) return INVALID; const QString &spec = mkspec(); - if(spec.contains("win32-msvc") || spec.contains(QLatin1String("win32-icc"))) + if (spec.contains("win32-msvc") || spec.contains(QLatin1String("win32-icc"))) return MSVC; - else if(spec == "win32-g++") + else if (spec == "win32-g++") return MinGW; - else if(spec == QString::null) + else if (spec == QString::null) return INVALID; - else if(spec.startsWith("wince")) + else if (spec.startsWith("wince")) return WINCE; else return OTHER; @@ -1210,32 +1210,32 @@ Environment QtVersion::addToEnvironment(const Environment &env) // or add Mingw dirs // or do nothing on other QtVersion::ToolchainType t = toolchainType(); - if(t == QtVersion::MinGW) { + if (t == QtVersion::MinGW) { QFileInfo mingwFileInfo(m_mingwDirectory + "/bin"); - if(mingwFileInfo.exists()) + if (mingwFileInfo.exists()) e.prependOrSetPath(m_mingwDirectory + "/bin"); - } else if(t == QtVersion::MSVC) { + } else if (t == QtVersion::MSVC) { QList<MSVCEnvironment> list = MSVCEnvironment::availableVersions(); - if(list.count() == 1) { + if (list.count() == 1) { e = list.at(0).addToEnvironment(e); } else { foreach(const MSVCEnvironment &m, list) { - if(m.name() == m_msvcVersion) { + if (m.name() == m_msvcVersion) { e = m.addToEnvironment(e); break; } } } - } else if(t == QtVersion::WINCE) { + } else if (t == QtVersion::WINCE) { QString msvcPath; // Find MSVC path QList<MSVCEnvironment> list = MSVCEnvironment::availableVersions(); - if(list.count() == 1) { + if (list.count() == 1) { msvcPath = list.at(0).path(); e = list.at(0).addToEnvironment(e); } else { foreach(const MSVCEnvironment &m, list) { - if(m.name() == m_msvcVersion) { + if (m.name() == m_msvcVersion) { e = m.addToEnvironment(e); msvcPath = m.path(); break; @@ -1254,8 +1254,8 @@ Environment QtVersion::addToEnvironment(const Environment &env) CeSdkHandler cesdkhandler; cesdkhandler.parse(msvcPath); e = cesdkhandler.find(platformName).addToEnvironment(e); - } else if(t == QtVersion::OTHER) { - if(!m_prependPath.isEmpty()) + } else if (t == QtVersion::OTHER) { + if (!m_prependPath.isEmpty()) e.prependOrSetPath(m_prependPath); } return e; diff --git a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp index 53972631c68..bf77fde7a3f 100644 --- a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp +++ b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp @@ -93,7 +93,7 @@ static QString pluginDependencies(const PluginBaseClasses *plb) QString(QLatin1String(plb->dependentModules)).split(blank) : QStringList(); pluginModules.push_back(QLatin1String(plb->module)); - foreach(const QString &module, pluginModules) { + foreach (const QString &module, pluginModules) { if (!dependencies.isEmpty()) dependencies += blank; dependencies += ModulesPage::idOfModule(module); diff --git a/src/plugins/qtscripteditor/qtscripteditor.cpp b/src/plugins/qtscripteditor/qtscripteditor.cpp index fa10cdd5102..673c7a02fd8 100644 --- a/src/plugins/qtscripteditor/qtscripteditor.cpp +++ b/src/plugins/qtscripteditor/qtscripteditor.cpp @@ -159,14 +159,12 @@ void ScriptEditor::contextMenuEvent(QContextMenuEvent *e) if (Core::IActionContainer *mcontext = m_core->actionManager()->actionContainer(QtScriptEditor::Constants::M_CONTEXT)) { QMenu *contextMenu = mcontext->menu(); - foreach(QAction *action, contextMenu->actions()) { + foreach (QAction *action, contextMenu->actions()) menu->addAction(action); - } } menu->exec(e->globalPos()); delete menu; - } } // namespace Internal diff --git a/src/plugins/snippets/snippetswindow.cpp b/src/plugins/snippets/snippetswindow.cpp index d549a06cf7f..866e7535935 100644 --- a/src/plugins/snippets/snippetswindow.cpp +++ b/src/plugins/snippets/snippetswindow.cpp @@ -243,7 +243,7 @@ void SnippetsWindow::showInputWidget(bool canceled, const QString &value) } else { QString desc = m_currentSnippet->argumentDescription(m_requiredArgs.first()); QString def = m_currentSnippet->argumentDefault(m_requiredArgs.first()); - foreach(QString arg, m_args) { + foreach (const QString &arg, m_args) { desc = desc.arg(arg); def = def.arg(arg); } diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index a24bb7d3d06..aad871187f5 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -194,7 +194,7 @@ SubversionPlugin::~SubversionPlugin() } if (!m_editorFactories.empty()) { - foreach(Core::IEditorFactory* pf, m_editorFactories) + foreach (Core::IEditorFactory* pf, m_editorFactories) removeObject(pf); qDeleteAll(m_editorFactories); m_editorFactories.clear(); @@ -579,9 +579,8 @@ void SubversionPlugin::revertCurrentFile() Core::FileManager *fm = m_coreInstance->fileManager(); QList<Core::IFile *> files = fm->managedFiles(file); - foreach (Core::IFile *file, files) { + foreach (Core::IFile *file, files) fm->blockFileChange(file); - } // revert args.clear(); @@ -726,7 +725,7 @@ QStringList SubversionPlugin::parseStatusOutput(const QString &output) const QStringList changeSet; const QString newLine = QString(QLatin1Char('\n')); const QStringList list = output.split(newLine, QString::SkipEmptyParts); - foreach (const QString& l, list) { + foreach (const QString &l, list) { QString line(l.trimmed()); if (line.startsWith(QLatin1Char('A')) || line.startsWith(QLatin1Char('D')) || line.startsWith(QLatin1Char('M'))) diff --git a/src/plugins/texteditor/basetextmark.cpp b/src/plugins/texteditor/basetextmark.cpp index 07af3577187..d3ec41eb293 100644 --- a/src/plugins/texteditor/basetextmark.cpp +++ b/src/plugins/texteditor/basetextmark.cpp @@ -60,9 +60,8 @@ void BaseTextMark::init() Core::EditorManager *em = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>()->editorManager(); connect(em, SIGNAL(editorOpened(Core::IEditor *)), this, SLOT(editorOpened(Core::IEditor *))); - foreach(Core::IEditor *editor, em->openedEditors()) { + foreach (Core::IEditor *editor, em->openedEditors()) editorOpened(editor); - } } void BaseTextMark::editorOpened(Core::IEditor *editor) @@ -132,7 +131,6 @@ void BaseTextMark::moveMark(const QString & /* filename */, int /* line */) delete m_internalMark; m_internalMark = 0; - foreach(Core::IEditor *editor, em->openedEditors()) { + foreach (Core::IEditor *editor, em->openedEditors()) editorOpened(editor); - } } diff --git a/src/plugins/texteditor/codecselector.cpp b/src/plugins/texteditor/codecselector.cpp index a8ff2e68bc3..3dcdf9f3735 100644 --- a/src/plugins/texteditor/codecselector.cpp +++ b/src/plugins/texteditor/codecselector.cpp @@ -87,15 +87,15 @@ CodecSelector::CodecSelector(QWidget *parent, BaseTextDocument *doc) QList<int> mibs = QTextCodec::availableMibs(); qSort(mibs); QList<int> sortedMibs; - foreach(int mib, mibs) + foreach (int mib, mibs) if (mib >= 0) sortedMibs += mib; - foreach(int mib, mibs) + foreach (int mib, mibs) if (mib < 0) sortedMibs += mib; int currentIndex = -1; - foreach(int mib, sortedMibs) { + foreach (int mib, sortedMibs) { QTextCodec *c = QTextCodec::codecForMib(mib); if (!buf.isEmpty()) { @@ -109,9 +109,8 @@ CodecSelector::CodecSelector(QWidget *parent, BaseTextDocument *doc) continue; } QString names = QString::fromLatin1(c->name()); - foreach(QByteArray alias, c->aliases()) { + foreach (QByteArray alias, c->aliases()) names += QLatin1String(" / ") + QString::fromLatin1(alias); - } if (doc->codec() == c) currentIndex = encodings.count(); encodings << names; diff --git a/tests/auto/profilereader/sync b/tests/auto/profilereader/sync index f0950addcc8..9dcbc91dcae 100755 --- a/tests/auto/profilereader/sync +++ b/tests/auto/profilereader/sync @@ -53,7 +53,7 @@ while ( @ARGV ) { if ("$arg" eq "-h" || "$arg" eq "-help" || "$arg" eq "--help" || "$arg" eq "?" || "$arg" eq "/?" || "$arg" eq "-?") { showUsage(); exit(0); - } elsif("$arg" eq "-qtdir") { + } elsif ("$arg" eq "-qtdir") { $qtSrcTree = shift @ARGV; } else { print "Unknown option: $arg\n"; From 3b315ed4d4e62e4be852f10fe45adeb7af673a94 Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Tue, 9 Dec 2008 11:27:17 +0100 Subject: [PATCH 46/77] fix file name validation bug --- src/libs/utils/pathchooser.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index 68ebe9cbbfd..8565b13edd6 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -55,7 +55,8 @@ namespace Utils { #endif // ------------------ PathValidatingLineEdit -class PathValidatingLineEdit : public BaseValidatingLineEdit { +class PathValidatingLineEdit : public BaseValidatingLineEdit +{ public: explicit PathValidatingLineEdit(PathChooser *chooser, QWidget *parent = 0); @@ -79,7 +80,8 @@ bool PathValidatingLineEdit::validate(const QString &value, QString *errorMessag } // ------------------ PathChooserPrivate -struct PathChooserPrivate { +struct PathChooserPrivate +{ PathChooserPrivate(PathChooser *chooser); PathValidatingLineEdit *m_lineEdit; @@ -160,9 +162,9 @@ void PathChooser::slotBrowse() // TODO make cross-platform // Delete trailing slashes unless it is "/", only - if (!newPath .isEmpty()) { - if (newPath .size() > 1 && newPath .endsWith(QDir::separator())) - newPath .truncate(newPath .size() - 1); + if (!newPath.isEmpty()) { + if (newPath.size() > 1 && newPath.endsWith(QDir::separator())) + newPath.truncate(newPath.size() - 1); setPath(newPath); } } @@ -174,7 +176,7 @@ bool PathChooser::isValid() const QString PathChooser::errorMessage() const { - return m_d->m_lineEdit->errorMessage(); + return m_d->m_lineEdit->errorMessage(); } bool PathChooser::validatePath(const QString &path, QString *errorMessage) @@ -207,17 +209,19 @@ bool PathChooser::validatePath(const QString &path, QString *errorMessage) // Check expected kind switch (m_d->m_acceptingKind) { case PathChooser::Directory: - if (!isDir) + if (!isDir) { if (errorMessage) *errorMessage = tr("The path '%1' is not a directory.").arg(path); return false; + } break; case PathChooser::File: - if (isDir) + if (isDir) { if (errorMessage) *errorMessage = tr("The path '%1' is not a file.").arg(path); return false; + } break; case PathChooser::Command: From 9cdbb1527bba77ed89a368dff32a99271446af61 Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Tue, 9 Dec 2008 12:08:56 +0100 Subject: [PATCH 47/77] rename QWB_ASSERT into QTC_ASSERT --- src/plugins/debugger/assert.h | 10 +++--- src/plugins/debugger/breakhandler.cpp | 4 +-- src/plugins/debugger/debuggerplugin.cpp | 12 +++---- src/plugins/debugger/debuggerrunner.cpp | 4 +-- src/plugins/debugger/gdbengine.cpp | 32 ++++++++--------- src/plugins/debugger/gdbmi.cpp | 4 +-- src/plugins/debugger/mode.cpp | 4 +-- src/plugins/debugger/scriptengine.cpp | 4 +-- src/plugins/debugger/stackhandler.cpp | 4 +-- src/plugins/debugger/watchhandler.cpp | 46 ++++++++++++------------- 10 files changed, 62 insertions(+), 62 deletions(-) diff --git a/src/plugins/debugger/assert.h b/src/plugins/debugger/assert.h index 014bb3b25d3..4989dba6c26 100644 --- a/src/plugins/debugger/assert.h +++ b/src/plugins/debugger/assert.h @@ -31,16 +31,16 @@ ** ***************************************************************************/ -#ifndef DEBUGGER_QWB_ASSERT_H -#define DEBUGGER_QWB_ASSERT_H +#ifndef DEBUGGER_QTC_ASSERT_H +#define DEBUGGER_QTC_ASSERT_H #ifdef Q_OS_UNIX -#define QWB_ASSERT(cond, action) \ +#define QTC_ASSERT(cond, action) \ if(cond){}else{qDebug()<<"ASSERTION"<<#cond<<"FAILED"<<__FILE__<<__LINE__;action;} #else -#define QWB_ASSERT(cond, action) \ +#define QTC_ASSERT(cond, action) \ if(cond){}else{qDebug()<<"ASSERTION"<<#cond<<"FAILED";action;} #endif -#endif // DEBUGGER_QWB_ASSERT_H +#endif // DEBUGGER_QTC_ASSERT_H diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index f4b528c50fa..b4e7239cc2e 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -371,7 +371,7 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const static const QIcon icon2(":/gdbdebugger/images/breakpoint_pending.svg"); static const QString empty = QString(QLatin1Char('-')); - QWB_ASSERT(mi.isValid(), return QVariant()); + QTC_ASSERT(mi.isValid(), return QVariant()); if (mi.row() >= size()) return QVariant(); @@ -550,7 +550,7 @@ void BreakHandler::breakByFunction(const QString &functionName) // One per function is enough for now for (int index = size(); --index >= 0;) { const BreakpointData *data = at(index); - QWB_ASSERT(data, break); + QTC_ASSERT(data, break); if (data->funcName == functionName && data->condition.isEmpty() && data->ignoreCount.isEmpty()) return; diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index db787482d10..68792675b89 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -189,7 +189,7 @@ void DebuggerPlugin::shutdown() { if (m_debugMode) m_debugMode->shutdown(); // saves state including manager information - QWB_ASSERT(m_manager, /**/); + QTC_ASSERT(m_manager, /**/); if (m_manager) m_manager->shutdown(); @@ -226,13 +226,13 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes m_pm = ExtensionSystem::PluginManager::instance(); ICore *core = m_pm->getObject<Core::ICore>(); - QWB_ASSERT(core, return false); + QTC_ASSERT(core, return false); Core::ActionManagerInterface *actionManager = core->actionManager(); - QWB_ASSERT(actionManager, return false); + QTC_ASSERT(actionManager, return false); Core::UniqueIDManager *uidm = core->uniqueIDManager(); - QWB_ASSERT(uidm, return false); + QTC_ASSERT(uidm, return false); QList<int> globalcontext; globalcontext << Core::Constants::C_GLOBAL_ID; @@ -598,13 +598,13 @@ void DebuggerPlugin::querySessionValue(const QString &name, QVariant *value) void DebuggerPlugin::setConfigValue(const QString &name, const QVariant &value) { - QWB_ASSERT(m_debugMode, return); + QTC_ASSERT(m_debugMode, return); m_debugMode->settings()->setValue(name, value); } void DebuggerPlugin::queryConfigValue(const QString &name, QVariant *value) { - QWB_ASSERT(m_debugMode, return); + QTC_ASSERT(m_debugMode, return); *value = m_debugMode->settings()->value(name); } diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index 90c8c4e9f7d..510bace05d4 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -118,9 +118,9 @@ void DebuggerRunControl::start() m_running = true; ApplicationRunConfigurationPtr rc = qSharedPointerCast<ApplicationRunConfiguration>(runConfiguration()); - QWB_ASSERT(rc, return); + QTC_ASSERT(rc, return); ProjectExplorer::Project *project = rc->project(); - QWB_ASSERT(project, return); + QTC_ASSERT(project, return); m_manager->m_executable = rc->executable(); m_manager->m_environment = rc->environment().toStringList(); diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp index 1874e625511..6eb2f4a4261 100644 --- a/src/plugins/debugger/gdbengine.cpp +++ b/src/plugins/debugger/gdbengine.cpp @@ -630,7 +630,7 @@ void GdbEngine::readGdbStandardOutput() #endif m_inbuffer.append(out); - //QWB_ASSERT(!m_inbuffer.isEmpty(), return); + //QTC_ASSERT(!m_inbuffer.isEmpty(), return); char c = m_inbuffer[m_inbuffer.size() - 1]; static const QByteArray termArray("(gdb) "); @@ -1398,7 +1398,7 @@ void GdbEngine::handleFileExecAndSymbols QString msg = response.data.findChild("msg").data(); QMessageBox::critical(q->mainWindow(), tr("Error"), tr("Starting executable failed:\n") + msg); - QWB_ASSERT(q->status() == DebuggerInferiorRunning, /**/); + QTC_ASSERT(q->status() == DebuggerInferiorRunning, /**/); interruptInferior(); } } @@ -1419,7 +1419,7 @@ void GdbEngine::handleExecRun(const GdbResultRecord &response) } else { QMessageBox::critical(q->mainWindow(), tr("Error"), tr("Starting executable failed:\n") + msg); - QWB_ASSERT(q->status() == DebuggerInferiorRunning, /**/); + QTC_ASSERT(q->status() == DebuggerInferiorRunning, /**/); interruptInferior(); } } @@ -2414,7 +2414,7 @@ void GdbEngine::selectThread(int index) threadsHandler->setCurrentThread(index); QList<ThreadData> threads = threadsHandler->threads(); - QWB_ASSERT(index < threads.size(), return); + QTC_ASSERT(index < threads.size(), return); int id = threads.at(index).id; q->showStatusMessage(tr("Retrieving data for stack view..."), 10000); sendCommand(QLatin1String("-thread-select ") + QString::number(id), @@ -2431,7 +2431,7 @@ void GdbEngine::activateFrame(int frameIndex) //qDebug() << "ACTIVATE FRAME: " << frameIndex << oldIndex // << stackHandler->currentIndex(); - QWB_ASSERT(frameIndex < stackHandler->stackSize(), return); + QTC_ASSERT(frameIndex < stackHandler->stackSize(), return); if (oldIndex != frameIndex) { // Assuming this always succeeds saves a roundtrip. @@ -2952,7 +2952,7 @@ bool GdbEngine::isCustomValueDumperAvailable(const QString &type) const void GdbEngine::runCustomDumper(const WatchData & data0, bool dumpChildren) { WatchData data = data0; - QWB_ASSERT(!data.exp.isEmpty(), return); + QTC_ASSERT(!data.exp.isEmpty(), return); QString tmplate; QString inner; bool isTemplate = extractTemplate(data.type, &tmplate, &inner); @@ -3093,7 +3093,7 @@ void GdbEngine::updateSubItem(const WatchData &data0) #if DEBUG_SUBITEM qDebug() << "UPDATE SUBITEM: " << data.toString(); #endif - QWB_ASSERT(data.isValid(), return); + QTC_ASSERT(data.isValid(), return); // in any case we need the type first if (data.isTypeNeeded()) { @@ -3121,7 +3121,7 @@ void GdbEngine::updateSubItem(const WatchData &data0) } // we should have a type now. this is relied upon further below - QWB_ASSERT(!data.type.isEmpty(), return); + QTC_ASSERT(!data.type.isEmpty(), return); // a common case that can be easily solved if (data.isChildrenNeeded() && isPointerType(data.type) @@ -3179,7 +3179,7 @@ void GdbEngine::updateSubItem(const WatchData &data0) } if (data.isValueNeeded()) { - QWB_ASSERT(!data.variable.isEmpty(), return); // tested above + QTC_ASSERT(!data.variable.isEmpty(), return); // tested above #if DEBUG_SUBITEM qDebug() << "UPDATE SUBITEM: VALUE"; #endif @@ -3208,7 +3208,7 @@ void GdbEngine::updateSubItem(const WatchData &data0) } if (data.isChildrenNeeded()) { - QWB_ASSERT(!data.variable.isEmpty(), return); // tested above + QTC_ASSERT(!data.variable.isEmpty(), return); // tested above QString cmd = "-var-list-children --all-values \"" + data.variable + "\""; sendSynchronizedCommand(cmd, WatchVarListChildren, QVariant::fromValue(data)); return; @@ -3233,14 +3233,14 @@ void GdbEngine::updateSubItem(const WatchData &data0) } if (data.isChildCountNeeded()) { - QWB_ASSERT(!data.variable.isEmpty(), return); // tested above + QTC_ASSERT(!data.variable.isEmpty(), return); // tested above QString cmd = "-var-list-children --all-values \"" + data.variable + "\""; sendCommand(cmd, WatchVarListChildren, QVariant::fromValue(data)); return; } qDebug() << "FIXME: UPDATE SUBITEM: " << data.toString(); - QWB_ASSERT(false, return); + QTC_ASSERT(false, return); } void GdbEngine::updateWatchModel() @@ -3254,7 +3254,7 @@ void GdbEngine::updateWatchModel2() { PENDING_DEBUG("UPDATE WATCH MODEL"); QList<WatchData> incomplete = qq->watchHandler()->takeCurrentIncompletes(); - //QWB_ASSERT(incomplete.isEmpty(), /**/); + //QTC_ASSERT(incomplete.isEmpty(), /**/); if (!incomplete.isEmpty()) { #if DEBUG_PENDING qDebug() << "##############################################"; @@ -3419,7 +3419,7 @@ void GdbEngine::handleEvaluateExpression(const GdbResultRecord &record, const WatchData &data0) { WatchData data = data0; - QWB_ASSERT(data.isValid(), qDebug() << "HUH?"); + QTC_ASSERT(data.isValid(), qDebug() << "HUH?"); if (record.resultClass == GdbResultDone) { //if (col == 0) // data.name = record.data.findChild("value").data(); @@ -3447,7 +3447,7 @@ void GdbEngine::handleDumpCustomValue1(const GdbResultRecord &record, const WatchData &data0) { WatchData data = data0; - QWB_ASSERT(data.isValid(), return); + QTC_ASSERT(data.isValid(), return); if (record.resultClass == GdbResultDone) { // ignore this case, data will follow } else if (record.resultClass == GdbResultError) { @@ -3481,7 +3481,7 @@ void GdbEngine::handleDumpCustomValue2(const GdbResultRecord &record, const WatchData &data0) { WatchData data = data0; - QWB_ASSERT(data.isValid(), return); + QTC_ASSERT(data.isValid(), return); //qDebug() << "CUSTOM VALUE RESULT: " << record.toString(); //qDebug() << "FOR DATA: " << data.toString() << record.resultClass; if (record.resultClass == GdbResultDone) { diff --git a/src/plugins/debugger/gdbmi.cpp b/src/plugins/debugger/gdbmi.cpp index ff976eff798..587e7c48315 100644 --- a/src/plugins/debugger/gdbmi.cpp +++ b/src/plugins/debugger/gdbmi.cpp @@ -138,7 +138,7 @@ void GdbMi::parseValue(const Char *&from, const Char *to) void GdbMi::parseTuple(const Char *&from, const Char *to) { //qDebug() << "parseTuple: " << QByteArray::fromUtf16(from, to - from); - QWB_ASSERT(*from == '{', /**/); + QTC_ASSERT(*from == '{', /**/); ++from; parseTuple_helper(from, to); } @@ -166,7 +166,7 @@ void GdbMi::parseTuple_helper(const Char *&from, const Char *to) void GdbMi::parseList(const Char *&from, const Char *to) { //qDebug() << "parseList: " << QByteArray::fromUtf16(from, to - from); - QWB_ASSERT(*from == '[', /**/); + QTC_ASSERT(*from == '[', /**/); ++from; m_type = List; while (from < to) { diff --git a/src/plugins/debugger/mode.cpp b/src/plugins/debugger/mode.cpp index 2229cbfe6f5..92bd6fb9b2b 100644 --- a/src/plugins/debugger/mode.cpp +++ b/src/plugins/debugger/mode.cpp @@ -213,8 +213,8 @@ void DebugMode::focusCurrentEditor(IMode *mode) void DebugMode::writeSettings() const { QSettings *s = settings(); - QWB_ASSERT(m_manager, return); - QWB_ASSERT(m_manager->mainWindow(), return); + QTC_ASSERT(m_manager, return); + QTC_ASSERT(m_manager->mainWindow(), return); s->beginGroup(QLatin1String("DebugMode")); s->setValue(QLatin1String("State"), m_manager->mainWindow()->saveState()); s->setValue(QLatin1String("Locked"), m_toggleLockedAction->isChecked()); diff --git a/src/plugins/debugger/scriptengine.cpp b/src/plugins/debugger/scriptengine.cpp index 28722b37dd2..00b37c8e368 100644 --- a/src/plugins/debugger/scriptengine.cpp +++ b/src/plugins/debugger/scriptengine.cpp @@ -574,7 +574,7 @@ void ScriptEngine::updateSubItem(const WatchData &data0) { WatchData data = data0; //qDebug() << "\nUPDATE SUBITEM: " << data.toString(); - QWB_ASSERT(data.isValid(), return); + QTC_ASSERT(data.isValid(), return); if (data.isTypeNeeded() || data.isValueNeeded()) { QScriptValue ob = data.scriptValue; @@ -667,7 +667,7 @@ void ScriptEngine::updateSubItem(const WatchData &data0) return; } - QWB_ASSERT(false, return); + QTC_ASSERT(false, return); } IDebuggerEngine *createScriptEngine(DebuggerManager *parent) diff --git a/src/plugins/debugger/stackhandler.cpp b/src/plugins/debugger/stackhandler.cpp index d2a468b07c6..870a24e2bd4 100644 --- a/src/plugins/debugger/stackhandler.cpp +++ b/src/plugins/debugger/stackhandler.cpp @@ -128,8 +128,8 @@ Qt::ItemFlags StackHandler::flags(const QModelIndex &index) const StackFrame StackHandler::currentFrame() const { - QWB_ASSERT(m_currentIndex >= 0, return StackFrame()); - QWB_ASSERT(m_currentIndex < m_stackFrames.size(), return StackFrame()); + QTC_ASSERT(m_currentIndex >= 0, return StackFrame()); + QTC_ASSERT(m_currentIndex < m_stackFrames.size(), return StackFrame()); return m_stackFrames.at(m_currentIndex); } diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 1041c2edcc6..ba239e170f2 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -426,7 +426,7 @@ QVariant WatchHandler::data(const QModelIndex &idx, int role) const int node = idx.internalId(); if (node < 0) return QVariant(); - QWB_ASSERT(node < m_displaySet.size(), return QVariant()); + QTC_ASSERT(node < m_displaySet.size(), return QVariant()); const WatchData &data = m_displaySet.at(node); @@ -702,10 +702,10 @@ void WatchHandler::rebuildModel() // Possibly append dummy items to prevent empty views bool ok = true; - QWB_ASSERT(m_displaySet.size() >= 2, ok = false); - QWB_ASSERT(m_displaySet.at(1).iname == "local", ok = false); - QWB_ASSERT(m_displaySet.at(2).iname == "tooltip", ok = false); - QWB_ASSERT(m_displaySet.at(3).iname == "watch", ok = false); + QTC_ASSERT(m_displaySet.size() >= 2, ok = false); + QTC_ASSERT(m_displaySet.at(1).iname == "local", ok = false); + QTC_ASSERT(m_displaySet.at(2).iname == "tooltip", ok = false); + QTC_ASSERT(m_displaySet.at(3).iname == "watch", ok = false); if (ok) { for (int i = 1; i <= 3; ++i) { WatchData &data = m_displaySet[i]; @@ -777,7 +777,7 @@ void WatchHandler::collapseChildren(const QModelIndex &idx) qDebug() << "WATCHHANDLER: COLLAPSE IGNORED" << idx; return; } - QWB_ASSERT(checkIndex(idx.internalId()), return); + QTC_ASSERT(checkIndex(idx.internalId()), return); #if 0 QString iname0 = m_displaySet.at(idx.internalId()).iname; MODEL_DEBUG("COLLAPSE NODE" << iname0); @@ -806,11 +806,11 @@ void WatchHandler::expandChildren(const QModelIndex &idx) int index = idx.internalId(); if (index == 0) return; - QWB_ASSERT(index >= 0, qDebug() << toString() << index; return); - QWB_ASSERT(index < m_completeSet.size(), qDebug() << toString() << index; return); + QTC_ASSERT(index >= 0, qDebug() << toString() << index; return); + QTC_ASSERT(index < m_completeSet.size(), qDebug() << toString() << index; return); const WatchData &display = m_displaySet.at(index); - QWB_ASSERT(index >= 0, qDebug() << toString() << index; return); - QWB_ASSERT(index < m_completeSet.size(), qDebug() << toString() << index; return); + QTC_ASSERT(index >= 0, qDebug() << toString() << index; return); + QTC_ASSERT(index < m_completeSet.size(), qDebug() << toString() << index; return); const WatchData &complete = m_completeSet.at(index); MODEL_DEBUG("\n\nEXPAND" << display.iname); if (display.iname.isEmpty()) { @@ -848,7 +848,7 @@ void WatchHandler::expandChildren(const QModelIndex &idx) void WatchHandler::insertData(const WatchData &data) { //MODEL_DEBUG("INSERTDATA: " << data.toString()); - QWB_ASSERT(data.isValid(), return); + QTC_ASSERT(data.isValid(), return); if (data.isSomethingNeeded()) insertDataHelper(m_incompleteSet, data); else @@ -977,7 +977,7 @@ bool WatchHandler::canFetchMore(const QModelIndex &parent) const // needs to be made synchronous to be useful. Busy loop is no good. if (!parent.isValid()) return false; - QWB_ASSERT(checkIndex(parent.internalId()), return false); + QTC_ASSERT(checkIndex(parent.internalId()), return false); const WatchData &data = m_displaySet.at(parent.internalId()); MODEL_DEBUG("CAN FETCH MORE: " << parent << " children: " << data.childCount << data.iname); @@ -990,7 +990,7 @@ void WatchHandler::fetchMore(const QModelIndex &parent) MODEL_DEBUG("FETCH MORE: " << parent); return; - QWB_ASSERT(checkIndex(parent.internalId()), return); + QTC_ASSERT(checkIndex(parent.internalId()), return); QString iname = m_displaySet.at(parent.internalId()).iname; if (m_inFetchMore) { @@ -1049,15 +1049,15 @@ QModelIndex WatchHandler::index(int row, int col, const QModelIndex &parent) con MODEL_DEBUG(" -> " << QModelIndex() << " (2) "); return QModelIndex(); } - QWB_ASSERT(checkIndex(parentIndex), return QModelIndex()); + QTC_ASSERT(checkIndex(parentIndex), return QModelIndex()); const WatchData &data = m_displaySet.at(parentIndex); - QWB_ASSERT(row >= 0, qDebug() << "ROW: " << row << "PARENT: " << parent + QTC_ASSERT(row >= 0, qDebug() << "ROW: " << row << "PARENT: " << parent << data.toString() << toString(); return QModelIndex()); - QWB_ASSERT(row < data.childIndex.size(), + QTC_ASSERT(row < data.childIndex.size(), MODEL_DEBUG("ROW: " << row << data.toString() << toString()); return QModelIndex()); QModelIndex idx = createIndex(row, col, data.childIndex.at(row)); - QWB_ASSERT(idx.row() == m_displaySet.at(idx.internalId()).row, + QTC_ASSERT(idx.row() == m_displaySet.at(idx.internalId()).row, return QModelIndex()); MODEL_DEBUG(" -> " << idx << " (A) "); return idx; @@ -1071,15 +1071,15 @@ QModelIndex WatchHandler::parent(const QModelIndex &idx) const } MODEL_DEBUG("PARENT " << idx); int currentIndex = idx.internalId(); - QWB_ASSERT(checkIndex(currentIndex), return QModelIndex()); - QWB_ASSERT(idx.row() == m_displaySet.at(currentIndex).row, + QTC_ASSERT(checkIndex(currentIndex), return QModelIndex()); + QTC_ASSERT(idx.row() == m_displaySet.at(currentIndex).row, MODEL_DEBUG("IDX: " << idx << toString(); return QModelIndex())); int parentIndex = m_displaySet.at(currentIndex).parentIndex; if (parentIndex < 0) { MODEL_DEBUG(" -> " << QModelIndex() << " (2) "); return QModelIndex(); } - QWB_ASSERT(checkIndex(parentIndex), return QModelIndex()); + QTC_ASSERT(checkIndex(parentIndex), return QModelIndex()); QModelIndex parent = createIndex(m_displaySet.at(parentIndex).row, 0, parentIndex); MODEL_DEBUG(" -> " << parent); @@ -1094,7 +1094,7 @@ int WatchHandler::rowCount(const QModelIndex &idx) const return 0; } int thisIndex = idx.internalId(); - QWB_ASSERT(checkIndex(thisIndex), return 0); + QTC_ASSERT(checkIndex(thisIndex), return 0); if (idx.row() == -1 && idx.column() == -1) { MODEL_DEBUG(" -> " << 3 << " (B) "); return 1; @@ -1129,7 +1129,7 @@ int WatchHandler::columnCount(const QModelIndex &idx) const return 0; } MODEL_DEBUG(" -> " << 3 << " (B) "); - QWB_ASSERT(checkIndex(idx.internalId()), return 3); + QTC_ASSERT(checkIndex(idx.internalId()), return 3); return 3; } @@ -1139,7 +1139,7 @@ bool WatchHandler::hasChildren(const QModelIndex &idx) const bool base = rowCount(idx) > 0 && columnCount(idx) > 0; MODEL_DEBUG("HAS CHILDREN: " << idx << base); return base; - QWB_ASSERT(checkIndex(idx.internalId()), return false); + QTC_ASSERT(checkIndex(idx.internalId()), return false); const WatchData &data = m_displaySet.at(idx.internalId()); MODEL_DEBUG("HAS CHILDREN: " << idx << data.toString()); return data.childCount > 0; // || data.childIndex.size() > 0; From 756de96d992014022fe3b3200d5b52b8fe1c0788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com> Date: Tue, 9 Dec 2008 12:10:26 +0100 Subject: [PATCH 48/77] Don't clip the right margin indication Doesn't look right, since it causes some background to show through between the indicator and the scrollbar. --- src/plugins/texteditor/basetexteditor.cpp | 29 +++++++++++------------ 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 82a4201b264..168e8431501 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -1635,6 +1635,20 @@ void BaseTextEditor::paintEvent(QPaintEvent *e) QRect er = e->rect(); QRect viewportRect = viewport()->rect(); + const QColor baseColor = palette().base().color(); + const int blendBase = (baseColor.value() > 128) ? 0 : 255; + // Darker backgrounds may need a bit more contrast + // (this calculation is temporary solution until we have a setting for this color) + const int blendFactor = (baseColor.value() > 128) ? 8 : 16; + const QColor blendColor( + (blendBase * blendFactor + baseColor.blue() * (256 - blendFactor)) / 256, + (blendBase * blendFactor + baseColor.green() * (256 - blendFactor)) / 256, + (blendBase * blendFactor + baseColor.blue() * (256 - blendFactor)) / 256); + if (d->m_visibleWrapColumn > 0) { + qreal lineX = fontMetrics().averageCharWidth() * d->m_visibleWrapColumn + offset.x() + 4; + painter.fillRect(QRectF(lineX, 0, viewportRect.width() - lineX, viewportRect.height()), blendColor); + } + // keep right margin clean from full-width selection int maxX = offset.x() + qMax((qreal)viewportRect.width(), documentLayout->documentSize().width()) - doc->documentMargin(); @@ -1647,7 +1661,6 @@ void BaseTextEditor::paintEvent(QPaintEvent *e) QAbstractTextDocumentLayout::PaintContext context = getPaintContext(); - if (!d->m_findScope.isNull()) { QAbstractTextDocumentLayout::Selection selection; selection.format.setBackground(d->m_searchScopeFormat.background()); @@ -1672,20 +1685,6 @@ void BaseTextEditor::paintEvent(QPaintEvent *e) blockSelection->lastColumn = qMax(columnA, columnB) + d->m_blockSelectionExtraX; } - const QColor baseColor = palette().base().color(); - const int blendBase = (baseColor.value() > 128) ? 0 : 255; - // Darker backgrounds may need a bit more contrast - // (this calculation is temporary solution until we have a setting for this color) - const int blendFactor = (baseColor.value() > 128) ? 8 : 16; - const QColor blendColor( - (blendBase * blendFactor + baseColor.blue() * (256 - blendFactor)) / 256, - (blendBase * blendFactor + baseColor.green() * (256 - blendFactor)) / 256, - (blendBase * blendFactor + baseColor.blue() * (256 - blendFactor)) / 256); - if (d->m_visibleWrapColumn > 0) { - qreal lineX = fontMetrics().averageCharWidth() * d->m_visibleWrapColumn + offset.x() + 4; - painter.fillRect(QRectF(lineX, 0, viewportRect.width() - lineX, viewportRect.height()), blendColor); - } - QTextBlock visibleCollapsedBlock; QPointF visibleCollapsedBlockOffset; From 56133d4f4f3d0910abca1d3fa586f7c74882f3d9 Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Tue, 9 Dec 2008 12:27:55 +0100 Subject: [PATCH 49/77] move plugins/debugger/assert.h -> /libs/utils/qtcassert.h --- src/{plugins/debugger/assert.h => libs/utils/qtcassert.h} | 6 +++--- src/plugins/debugger/breakhandler.cpp | 2 +- src/plugins/debugger/debugger.pro | 5 +++-- src/plugins/debugger/debuggerplugin.cpp | 2 +- src/plugins/debugger/debuggerrunner.cpp | 2 +- src/plugins/debugger/gdbengine.cpp | 2 +- src/plugins/debugger/gdbengine.h | 6 +++--- src/plugins/debugger/gdbmi.cpp | 2 +- src/plugins/debugger/idebuggerengine.h | 5 +++++ src/plugins/debugger/mode.cpp | 2 +- src/plugins/debugger/scriptengine.cpp | 2 +- src/plugins/debugger/stackhandler.cpp | 2 +- src/plugins/debugger/watchhandler.cpp | 2 +- 13 files changed, 23 insertions(+), 17 deletions(-) rename src/{plugins/debugger/assert.h => libs/utils/qtcassert.h} (94%) diff --git a/src/plugins/debugger/assert.h b/src/libs/utils/qtcassert.h similarity index 94% rename from src/plugins/debugger/assert.h rename to src/libs/utils/qtcassert.h index 4989dba6c26..538d906f827 100644 --- a/src/plugins/debugger/assert.h +++ b/src/libs/utils/qtcassert.h @@ -31,8 +31,8 @@ ** ***************************************************************************/ -#ifndef DEBUGGER_QTC_ASSERT_H -#define DEBUGGER_QTC_ASSERT_H +#ifndef QTC_ASSERT_H +#define QTC_ASSERT_H #ifdef Q_OS_UNIX #define QTC_ASSERT(cond, action) \ @@ -42,5 +42,5 @@ if(cond){}else{qDebug()<<"ASSERTION"<<#cond<<"FAILED";action;} #endif -#endif // DEBUGGER_QTC_ASSERT_H +#endif // QTC_ASSERT_H diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index b4e7239cc2e..926568517da 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -33,8 +33,8 @@ #include "breakhandler.h" -#include "assert.h" #include "imports.h" // TextEditor::BaseTextMark +#include "qtcassert.h" #include <QtCore/QDebug> #include <QtCore/QFileInfo> diff --git a/src/plugins/debugger/debugger.pro b/src/plugins/debugger/debugger.pro index d21eb7cdc01..6b8c2e74ca4 100644 --- a/src/plugins/debugger/debugger.pro +++ b/src/plugins/debugger/debugger.pro @@ -10,11 +10,12 @@ include(../../plugins/texteditor/texteditor.pri) include(../../plugins/cpptools/cpptools.pri) include(../../libs/cplusplus/cplusplus.pri) +INCLUDEPATH += ../../libs/utils + # DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII QT += gui network script -HEADERS += assert.h \ - attachexternaldialog.h \ +HEADERS += attachexternaldialog.h \ attachremotedialog.h \ breakhandler.h \ breakwindow.h \ diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 68792675b89..03f86bec249 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -33,13 +33,13 @@ #include "debuggerplugin.h" -#include "assert.h" #include "debuggerconstants.h" #include "debuggermanager.h" #include "debuggerrunner.h" #include "gdboptionpage.h" #include "gdbengine.h" #include "mode.h" +#include "qtcassert.h" #include <coreplugin/actionmanager/actionmanagerinterface.h> #include <coreplugin/coreconstants.h> diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index 510bace05d4..21da78fae9f 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -33,8 +33,8 @@ #include "debuggerrunner.h" -#include "assert.h" #include "debuggermanager.h" +#include "qtcassert.h" #include <projectexplorer/applicationrunconfiguration.h> #include <projectexplorer/environment.h> diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp index 6eb2f4a4261..13af8e3075b 100644 --- a/src/plugins/debugger/gdbengine.cpp +++ b/src/plugins/debugger/gdbengine.cpp @@ -33,11 +33,11 @@ #include "gdbengine.h" -#include "assert.h" #include "debuggerconstants.h" #include "debuggermanager.h" #include "gdbmi.h" #include "procinterrupt.h" +#include "qtcassert.h" #include "disassemblerhandler.h" #include "breakhandler.h" diff --git a/src/plugins/debugger/gdbengine.h b/src/plugins/debugger/gdbengine.h index b3e13233526..56106a75244 100644 --- a/src/plugins/debugger/gdbengine.h +++ b/src/plugins/debugger/gdbengine.h @@ -34,6 +34,9 @@ #ifndef DEBUGGER_GDBENGINE_H #define DEBUGGER_GDBENGINE_H +#include "idebuggerengine.h" +#include "gdbmi.h" + #include <QtCore/QByteArray> #include <QtCore/QHash> #include <QtCore/QMap> @@ -48,9 +51,6 @@ class QAbstractItemModel; class QWidget; QT_END_NAMESPACE -#include "idebuggerengine.h" -#include "gdbmi.h" - namespace Debugger { namespace Internal { diff --git a/src/plugins/debugger/gdbmi.cpp b/src/plugins/debugger/gdbmi.cpp index 587e7c48315..3beadc385fa 100644 --- a/src/plugins/debugger/gdbmi.cpp +++ b/src/plugins/debugger/gdbmi.cpp @@ -32,7 +32,7 @@ ***************************************************************************/ #include "gdbmi.h" -#include "assert.h" +#include "qtcassert.h" #include <QtCore/QByteArray> #include <QtCore/QDebug> diff --git a/src/plugins/debugger/idebuggerengine.h b/src/plugins/debugger/idebuggerengine.h index 22ed3ca1845..8c7f2d2b2e8 100644 --- a/src/plugins/debugger/idebuggerengine.h +++ b/src/plugins/debugger/idebuggerengine.h @@ -36,6 +36,11 @@ #include <QtCore/QObject> +QT_BEGIN_NAMESPACE +class QPoint; +class QString; +QT_END_NAMESPACE + namespace Debugger { namespace Internal { diff --git a/src/plugins/debugger/mode.cpp b/src/plugins/debugger/mode.cpp index 92bd6fb9b2b..c1bbdd550f1 100644 --- a/src/plugins/debugger/mode.cpp +++ b/src/plugins/debugger/mode.cpp @@ -33,9 +33,9 @@ #include "mode.h" -#include "assert.h" #include "debuggerconstants.h" #include "debuggermanager.h" +#include "qtcassert.h" #include <coreplugin/coreconstants.h> #include <coreplugin/icore.h> diff --git a/src/plugins/debugger/scriptengine.cpp b/src/plugins/debugger/scriptengine.cpp index 00b37c8e368..50f9dcdf4e2 100644 --- a/src/plugins/debugger/scriptengine.cpp +++ b/src/plugins/debugger/scriptengine.cpp @@ -33,7 +33,7 @@ #include "scriptengine.h" -#include "assert.h" +#include "qtcassert.h" #include "debuggerconstants.h" #include "debuggermanager.h" diff --git a/src/plugins/debugger/stackhandler.cpp b/src/plugins/debugger/stackhandler.cpp index 870a24e2bd4..818b6b61888 100644 --- a/src/plugins/debugger/stackhandler.cpp +++ b/src/plugins/debugger/stackhandler.cpp @@ -33,7 +33,7 @@ #include "stackhandler.h" -#include "assert.h" +#include "qtcassert.h" #include <QtCore/QAbstractTableModel> #include <QtCore/QDebug> diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index ba239e170f2..e03c91f7100 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -37,7 +37,7 @@ #include "modeltest.h" #endif -#include "assert.h" +#include "qtcassert.h" #include <QtCore/QDebug> #include <QtCore/QEvent> From 7d4dab15a5823c88a7e1911c6c4e7c90d995e12d Mon Sep 17 00:00:00 2001 From: dt <qtc-commiter@nokia.com> Date: Tue, 9 Dec 2008 14:13:29 +0100 Subject: [PATCH 50/77] Fixes: Some running support for cmake Task: - RevBy: - AutoTest: - Details: Note: I need to refactor the code significantly, i'm more or less convinced that one build configuration per target is wrong. We probably want one build configuration per build directory and instead build all targets that we are interested then in the makestep. This means we won't have any cmake support for the beta. --- .../cmakeprojectmanager/cmakeproject.cpp | 136 +++++++++++++++--- .../cmakeprojectmanager/cmakeproject.h | 19 ++- .../cmakeprojectconstants.h | 1 + .../cmakeprojectmanager.pro | 6 +- .../cmakeprojectplugin.cpp | 2 + src/plugins/cmakeprojectmanager/cmakestep.cpp | 5 + .../projectexplorer/runconfiguration.h | 2 +- 7 files changed, 144 insertions(+), 27 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 5569c900f2b..6e4cdfa59ec 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -36,10 +36,13 @@ #include "cmakeprojectnodes.h" #include "cmakestep.h" #include "makestep.h" +#include "cmakerunconfiguration.h" #include <extensionsystem/pluginmanager.h> #include <cpptools/cppmodelmanagerinterface.h> +#include <QProcess> +#include <QDir> #include <QtCore/QDebug> using namespace CMakeProjectManager; @@ -48,20 +51,31 @@ using namespace CMakeProjectManager::Internal; CMakeProject::CMakeProject(CMakeManager *manager, const QString &fileName) : m_manager(manager), m_fileName(fileName), m_rootNode(new CMakeProjectNode(m_fileName)) { - //TODO + m_file = new CMakeFile(this, fileName); QDir dir = QFileInfo(m_fileName).absoluteDir(); QString cbpFile = findCbpFile(dir); if (cbpFile.isEmpty()) cbpFile = createCbpFile(dir); + //TODO move this parsing to a seperate method, which is also called if the CMakeList.txt is updated CMakeCbpParser cbpparser; if (cbpparser.parseCbpFile(cbpFile)) { + // TODO do a intelligent updating of the tree buildTree(m_rootNode, cbpparser.fileList()); foreach(ProjectExplorer::FileNode *fn, cbpparser.fileList()) m_files.append(fn->path()); m_files.sort(); + m_targets = cbpparser.targets(); + qDebug()<<"Printing targets"; + foreach(CMakeTarget ct, m_targets) { + qDebug()<<ct.title<<" with executable:"<<ct.executable; + qDebug()<<"WD:"<<ct.workingDirectory; + qDebug()<<ct.makeCommand<<ct.makeCleanCommand; + qDebug()<<""; + } + CppTools::CppModelManagerInterface *modelmanager = ExtensionSystem::PluginManager::instance()->getObject<CppTools::CppModelManagerInterface>(); if (modelmanager) { CppTools::CppModelManagerInterface::ProjectInfo pinfo = modelmanager->projectInfo(this); @@ -69,6 +83,7 @@ CMakeProject::CMakeProject(CMakeManager *manager, const QString &fileName) // TODO we only want C++ files, not all other stuff that might be in the project pinfo.sourceFiles = m_files; // TODO defines + // TODO gcc preprocessor files modelmanager->updateProjectInfo(pinfo); } } else { @@ -96,16 +111,20 @@ QString CMakeProject::findCbpFile(const QDir &directory) return QString::null; } - -QString CMakeProject::createCbpFile(const QDir &) +QString CMakeProject::createCbpFile(const QDir &directory) { - // TODO create a cbp file. - // Issue: Where to create it? We want to do that in the build directory - // but at this stage we don't know the build directory yet - // So create it in a temp directory? - // Issue: We want to reuse whatever CMakeCache.txt that is alread there, which - // would indicate, creating it in the build directory - // Or we could use a temp directory and use -C builddirectory + // We create a cbp file, only if we didn't find a cbp file in the base directory + // Yet that can still override cbp files in subdirectories + // And we are creating tons of files in the source directories + // All of that is not really nice. + // The mid term plan is to move away from the CodeBlocks Generator and use our own + // QtCreator generator, which actually can be very similar to the CodeBlock Generator + + // TODO we need to pass on the same paremeters as the cmakestep + QProcess cmake; + cmake.setWorkingDirectory(directory.absolutePath()); + cmake.start("cmake", QStringList() << "-GCodeBlocks - Unix Makefiles"); + return QString::null; } @@ -227,27 +246,35 @@ QStringList CMakeProject::files(FilesMode fileMode) const void CMakeProject::saveSettingsImpl(ProjectExplorer::PersistentSettingsWriter &writer) { // TODO - Q_UNUSED(writer); + Project::saveSettingsImpl(writer); } void CMakeProject::restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader &reader) { // TODO - Q_UNUSED(reader); + Project::restoreSettingsImpl(reader); if (buildConfigurations().isEmpty()) { // No build configuration, adding those - - // TODO do we want to create one build configuration per target? - // or how do we want to handle that? - CMakeStep *cmakeStep = new CMakeStep(this); MakeStep *makeStep = new MakeStep(this); insertBuildStep(0, cmakeStep); insertBuildStep(1, makeStep); - addBuildConfiguration("all"); + // Create build configurations of m_targets + qDebug()<<"Create build configurations of m_targets"; + foreach(const CMakeTarget &ct, m_targets) { + addBuildConfiguration(ct.title); + makeStep->setValue(ct.title, "makeCommand", ct.makeCommand); + makeStep->setValue(ct.title, "makeCleanCommand", ct.makeCleanCommand); + + QSharedPointer<ProjectExplorer::RunConfiguration> rc(new CMakeRunConfiguration(this, ct.executable, ct.workingDirectory)); + // TODO set build configuration to build before it can be run + addRunConfiguration(rc); + setActiveRunConfiguration(rc); // TODO what exactly shall be the active run configuration? + } setActiveBuildConfiguration("all"); + } // Restoring is fine } @@ -394,14 +421,16 @@ void CMakeCbpParser::parseBuild() void CMakeCbpParser::parseTarget() { - m_targetOutput.clear(); m_targetType = false; + m_target.clear(); + + if (attributes().hasAttribute("title")) + m_target.title = attributes().value("title").toString(); while(!atEnd()) { readNext(); if (isEndElement()) { - if (m_targetType && !m_targetOutput.isEmpty()) { - qDebug()<<"found target "<<m_targetOutput; - m_targets.insert(m_targetOutput); + if (m_targetType || m_target.title == "all") { + m_targets.append(m_target); } return; } else if (name() == "Compiler") { @@ -417,9 +446,57 @@ void CMakeCbpParser::parseTarget() void CMakeCbpParser::parseTargetOption() { if (attributes().hasAttribute("output")) - m_targetOutput = attributes().value("output").toString(); + m_target.executable = attributes().value("output").toString(); else if (attributes().hasAttribute("type") && attributes().value("type") == "1") m_targetType = true; + else if (attributes().hasAttribute("working_dir")) + m_target.workingDirectory = attributes().value("working_dir").toString(); + while(!atEnd()) { + readNext(); + if (isEndElement()) { + return; + } else if (name() == "MakeCommand") { + parseMakeCommand(); + } else if (isStartElement()) { + parseUnknownElement(); + } + } +} + +void CMakeCbpParser::parseMakeCommand() +{ + while(!atEnd()) { + readNext(); + if (isEndElement()) { + return; + } else if (name() == "Build") { + parseTargetBuild(); + } else if (name() == "Clean") { + parseTargetClean(); + } else if (isStartElement()) { + parseUnknownElement(); + } + } +} + +void CMakeCbpParser::parseTargetBuild() +{ + if (attributes().hasAttribute("command")) + m_target.makeCommand = attributes().value("command").toString(); + while(!atEnd()) { + readNext(); + if (isEndElement()) { + return; + } else if (isStartElement()) { + parseUnknownElement(); + } + } +} + +void CMakeCbpParser::parseTargetClean() +{ + if (attributes().hasAttribute("command")) + m_target.makeCleanCommand = attributes().value("command").toString(); while(!atEnd()) { readNext(); if (isEndElement()) { @@ -497,3 +574,18 @@ QStringList CMakeCbpParser::includeFiles() { return m_includeFiles; } + +QList<CMakeTarget> CMakeCbpParser::targets() +{ + return m_targets; +} + +void CMakeTarget::clear() +{ + executable = QString::null; + makeCommand = QString::null; + makeCleanCommand = QString::null; + workingDirectory = QString::null; + title = QString::null; +} + diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.h b/src/plugins/cmakeprojectmanager/cmakeproject.h index a0c821ada5e..2a0314fda1a 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.h +++ b/src/plugins/cmakeprojectmanager/cmakeproject.h @@ -49,6 +49,16 @@ namespace Internal{ class CMakeFile; +struct CMakeTarget +{ + QString title; + QString executable; + QString workingDirectory; + QString makeCommand; + QString makeCleanCommand; + void clear(); +}; + class CMakeProject : public ProjectExplorer::Project { Q_OBJECT @@ -105,6 +115,7 @@ private: // TODO probably need a CMake specific node structure CMakeProjectNode* m_rootNode; QStringList m_files; + QList<CMakeTarget> m_targets; protected: virtual void saveSettingsImpl(ProjectExplorer::PersistentSettingsWriter &writer); @@ -118,23 +129,27 @@ public: bool parseCbpFile(const QString &fileName); QList<ProjectExplorer::FileNode *> fileList(); QStringList includeFiles(); + QList<CMakeTarget> targets(); private: void parseCodeBlocks_project_file(); void parseProject(); void parseBuild(); void parseTarget(); void parseTargetOption(); + void parseMakeCommand(); + void parseTargetBuild(); + void parseTargetClean(); void parseCompiler(); void parseAdd(); void parseUnit(); void parseUnknownElement(); - QSet<QString> m_targets; QList<ProjectExplorer::FileNode *> m_fileList; QStringList m_includeFiles; - QString m_targetOutput; + CMakeTarget m_target; bool m_targetType; + QList<CMakeTarget> m_targets; }; class CMakeFile : public Core::IFile diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h b/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h index 4832f17f263..71300589915 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h +++ b/src/plugins/cmakeprojectmanager/cmakeprojectconstants.h @@ -41,6 +41,7 @@ const char * const PROJECTCONTEXT = "CMakeProject.ProjectContext"; const char * const CMAKEMIMETYPE = "text/x-cmake"; // TOOD check that this is correct const char * const CMAKESTEP = "CMakeProjectManager.CMakeStep"; const char * const MAKESTEP = "CMakeProjectManager.MakeStep"; +const char * const CMAKERUNCONFIGURATION = "CMakeProjectManager.CMakeRunConfiguration"; } // namespace Constants diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.pro b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.pro index afca26b265b..74f69fea4ab 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.pro +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.pro @@ -8,11 +8,13 @@ HEADERS = cmakeproject.h \ cmakeprojectconstants.h \ cmakeprojectnodes.h \ cmakestep.h \ - makestep.h + makestep.h \ + cmakerunconfiguration.h SOURCES = cmakeproject.cpp \ cmakeprojectplugin.cpp \ cmakeprojectmanager.cpp \ cmakeprojectnodes.cpp \ cmakestep.cpp \ - makestep.cpp + makestep.cpp \ + cmakerunconfiguration.cpp RESOURCES += cmakeproject.qrc diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp index 2b59a47c8e2..932278a32c0 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp @@ -33,6 +33,7 @@ #include "cmakeprojectplugin.h" #include "cmakeprojectmanager.h" +#include "cmakerunconfiguration.h" #include <coreplugin/icore.h> #include <coreplugin/mimedatabase.h> @@ -57,6 +58,7 @@ bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString * if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":cmakeproject/CMakeProject.mimetypes.xml"), errorMessage)) return false; addAutoReleasedObject(new CMakeManager()); + addAutoReleasedObject(new CMakeRunConfigurationFactory()); return true; } diff --git a/src/plugins/cmakeprojectmanager/cmakestep.cpp b/src/plugins/cmakeprojectmanager/cmakestep.cpp index 0c267ca2c4c..adbfe59b6cc 100644 --- a/src/plugins/cmakeprojectmanager/cmakestep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakestep.cpp @@ -61,6 +61,11 @@ bool CMakeStep::init(const QString &buildConfiguration) void CMakeStep::run(QFutureInterface<bool> &fi) { + // TODO we want to only run cmake if the command line arguments or + // the CmakeLists.txt has actually changed + // And we want all of them to share the SAME command line arguments + // Shadow building ruins this, hmm, hmm + // AbstractProcessStep::run(fi); } diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 8d2e7b45d6a..def848765d0 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -80,6 +80,7 @@ public: void setName(const QString &name); // Returns the widget used to configure this run configuration. Ownership is transferred to the caller + // rename to createConfigurationWidget virtual QWidget *configurationWidget() = 0; virtual void save(PersistentSettingsWriter &writer) const; @@ -112,7 +113,6 @@ public: // used to translate the types to names to display to the user virtual QString nameForType(const QString &type) const = 0; virtual QSharedPointer<RunConfiguration> create(Project *project, const QString &type) = 0; - }; class PROJECTEXPLORER_EXPORT IRunConfigurationRunner : public QObject From f293f4d7efc4b973c9fdec8eb6910766fa8f5c4c Mon Sep 17 00:00:00 2001 From: dt <qtc-commiter@nokia.com> Date: Tue, 9 Dec 2008 14:33:09 +0100 Subject: [PATCH 51/77] Fixes: Whitespace to make hjk happy. --- src/plugins/cmakeprojectmanager/cmakeproject.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 9448b1b94df..581a92e9fbf 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -424,7 +424,7 @@ void CMakeCbpParser::parseTarget() if (attributes().hasAttribute("title")) m_target.title = attributes().value("title").toString(); - while(!atEnd()) { + while (!atEnd()) { readNext(); if (isEndElement()) { if (m_targetType || m_target.title == "all") { @@ -449,7 +449,7 @@ void CMakeCbpParser::parseTargetOption() m_targetType = true; else if (attributes().hasAttribute("working_dir")) m_target.workingDirectory = attributes().value("working_dir").toString(); - while(!atEnd()) { + while (!atEnd()) { readNext(); if (isEndElement()) { return; @@ -463,7 +463,7 @@ void CMakeCbpParser::parseTargetOption() void CMakeCbpParser::parseMakeCommand() { - while(!atEnd()) { + while (!atEnd()) { readNext(); if (isEndElement()) { return; @@ -481,7 +481,7 @@ void CMakeCbpParser::parseTargetBuild() { if (attributes().hasAttribute("command")) m_target.makeCommand = attributes().value("command").toString(); - while(!atEnd()) { + while (!atEnd()) { readNext(); if (isEndElement()) { return; @@ -495,7 +495,7 @@ void CMakeCbpParser::parseTargetClean() { if (attributes().hasAttribute("command")) m_target.makeCleanCommand = attributes().value("command").toString(); - while(!atEnd()) { + while (!atEnd()) { readNext(); if (isEndElement()) { return; From e99d8ce3fc67925437a9bef344b66db39ca232aa Mon Sep 17 00:00:00 2001 From: dt <qtc-commiter@nokia.com> Date: Tue, 9 Dec 2008 14:53:06 +0100 Subject: [PATCH 52/77] Fixes: Add those files. Task: - RevBy: - AutoTest: - Details: - --- .../cmakerunconfiguration.cpp | 155 ++++++++++++++++++ .../cmakerunconfiguration.h | 93 +++++++++++ 2 files changed, 248 insertions(+) create mode 100644 src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp create mode 100644 src/plugins/cmakeprojectmanager/cmakerunconfiguration.h diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp new file mode 100644 index 00000000000..eed15c3593e --- /dev/null +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp @@ -0,0 +1,155 @@ +/*************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** +** Non-Open Source Usage +** +** Licensees may use this file in accordance with the Qt Beta Version +** License Agreement, Agreement version 2.2 provided with the Software or, +** alternatively, in accordance with the terms contained in a written +** agreement between you and Nokia. +** +** GNU General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the packaging +** of this file. Please review the following information to ensure GNU +** General Public Licensing requirements will be met: +** +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt GPL Exception +** version 1.2, included in the file GPL_EXCEPTION.txt in this package. +** +***************************************************************************/ + +#include "cmakerunconfiguration.h" +#include "cmakeprojectconstants.h" +#include "cmakeproject.h" + +#include <projectexplorer/environment.h> + +using namespace CMakeProjectManager; +using namespace CMakeProjectManager::Internal; + +CMakeRunConfiguration::CMakeRunConfiguration(CMakeProject *pro, const QString &target, const QString &workingDirectory) + : ProjectExplorer::ApplicationRunConfiguration(pro), m_target(target), m_workingDirectory(workingDirectory) +{ + setName(target); +} +CMakeRunConfiguration::~CMakeRunConfiguration() +{ + +} + +QString CMakeRunConfiguration::type() const +{ + return Constants::CMAKERUNCONFIGURATION; +} + +QString CMakeRunConfiguration::executable() const +{ + return m_target; +} + +ProjectExplorer::ApplicationRunConfiguration::RunMode CMakeRunConfiguration::runMode() const +{ + return ProjectExplorer::ApplicationRunConfiguration::Gui; +} + +QString CMakeRunConfiguration::workingDirectory() const +{ + return m_workingDirectory; +} + +QStringList CMakeRunConfiguration::commandLineArguments() const +{ + // TODO + return QStringList(); +} + +ProjectExplorer::Environment CMakeRunConfiguration::environment() const +{ + // TODO + return ProjectExplorer::Environment::systemEnvironment(); +} + +void CMakeRunConfiguration::save(ProjectExplorer::PersistentSettingsWriter &writer) const +{ + ProjectExplorer::ApplicationRunConfiguration::save(writer); +} + +void CMakeRunConfiguration::restore(const ProjectExplorer::PersistentSettingsReader &reader) +{ + ProjectExplorer::ApplicationRunConfiguration::restore(reader); +} + +QWidget *CMakeRunConfiguration::configurationWidget() +{ + //TODO + return new QWidget(); +} + +// Factory +CMakeRunConfigurationFactory::CMakeRunConfigurationFactory() +{ + +} + +CMakeRunConfigurationFactory::~CMakeRunConfigurationFactory() +{ + +} + +// used to recreate the runConfigurations when restoring settings +bool CMakeRunConfigurationFactory::canCreate(const QString &type) const +{ + if (type.startsWith(Constants::CMAKERUNCONFIGURATION)) + return true; + return false; +} + +// used to show the list of possible additons to a project, returns a list of types +QStringList CMakeRunConfigurationFactory::canCreate(ProjectExplorer::Project *project) const +{ + CMakeProject *pro = qobject_cast<CMakeProject *>(project); + if (!pro) + return QStringList(); + // TODO gather all targets and return them here + return QStringList(); +} + +// used to translate the types to names to display to the user +QString CMakeRunConfigurationFactory::nameForType(const QString &type) const +{ + Q_ASSERT(type.startsWith(Constants::CMAKERUNCONFIGURATION)); + + if (type == Constants::CMAKERUNCONFIGURATION) + return "CMake"; // Doesn't happen + else + return type.mid(QString(Constants::CMAKERUNCONFIGURATION).length()); +} + +QSharedPointer<ProjectExplorer::RunConfiguration> CMakeRunConfigurationFactory::create(ProjectExplorer::Project *project, const QString &type) +{ + CMakeProject *pro = qobject_cast<CMakeProject *>(project); + Q_ASSERT(pro); + if (type == Constants::CMAKERUNCONFIGURATION) { + // Restoring, filename will be added by restoreSettings + QSharedPointer<ProjectExplorer::RunConfiguration> rc(new CMakeRunConfiguration(pro, QString::null, QString::null)); + return rc; + } else { + // Adding new + QString file = type.mid(QString(Constants::CMAKERUNCONFIGURATION).length()); + QSharedPointer<ProjectExplorer::RunConfiguration> rc(new CMakeRunConfiguration(pro, file, QString::null)); + return rc; + } +} diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h new file mode 100644 index 00000000000..082364e3042 --- /dev/null +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h @@ -0,0 +1,93 @@ +/*************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** +** Non-Open Source Usage +** +** Licensees may use this file in accordance with the Qt Beta Version +** License Agreement, Agreement version 2.2 provided with the Software or, +** alternatively, in accordance with the terms contained in a written +** agreement between you and Nokia. +** +** GNU General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the packaging +** of this file. Please review the following information to ensure GNU +** General Public Licensing requirements will be met: +** +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt GPL Exception +** version 1.2, included in the file GPL_EXCEPTION.txt in this package. +** +***************************************************************************/ + +#ifndef CMAKERUNCONFIGURATION_H +#define CMAKERUNCONFIGURATION_H + +#include <projectexplorer/applicationrunconfiguration.h> +#include <projectexplorer/environment.h> +#include <projectexplorer/persistentsettings.h> + +namespace CMakeProjectManager { +namespace Internal { + +class CMakeProject; + +class CMakeRunConfiguration : public ProjectExplorer::ApplicationRunConfiguration +{ +public: + CMakeRunConfiguration(CMakeProject *pro, const QString &target, const QString &workingDirectory); + virtual ~CMakeRunConfiguration(); + virtual QString type() const; + virtual QString executable() const; + virtual RunMode runMode() const; + virtual QString workingDirectory() const; + virtual QStringList commandLineArguments() const; + virtual ProjectExplorer::Environment environment() const; + virtual QWidget *configurationWidget(); + + virtual void save(ProjectExplorer::PersistentSettingsWriter &writer) const; + virtual void restore(const ProjectExplorer::PersistentSettingsReader &reader); +private: + QString m_target; + QString m_workingDirectory; +}; + +/* The run configuration factory is used for restoring run configurations from + * settings. And used to create new runconfigurations in the "Run Settings" Dialog. + * For the first case bool canCreate(const QString &type) and + * QSharedPointer<RunConfiguration> create(Project *project, QString type) are used. + * For the second type the functions QStringList canCreate(Project *pro) and + * QString nameForType(const QString&) are used to generate a list of creatable + * RunConfigurations, and create(..) is used to create it. + */ +class CMakeRunConfigurationFactory : public QObject +{ + Q_OBJECT; +public: + CMakeRunConfigurationFactory(); + virtual ~CMakeRunConfigurationFactory(); + // used to recreate the runConfigurations when restoring settings + virtual bool canCreate(const QString &type) const; + // used to show the list of possible additons to a project, returns a list of types + virtual QStringList canCreate(ProjectExplorer::Project *pro) const; + // used to translate the types to names to display to the user + virtual QString nameForType(const QString &type) const; + virtual QSharedPointer<ProjectExplorer::RunConfiguration> create(ProjectExplorer::Project *project, const QString &type); +}; + + +} +} + +#endif // CMAKERUNCONFIGURATION_H From 20e36cc364d5dce2bf5c5a91e2144d8ad289f6d2 Mon Sep 17 00:00:00 2001 From: Roberto Raggi <qtc-committer@nokia.com> Date: Tue, 9 Dec 2008 15:23:47 +0100 Subject: [PATCH 53/77] tooltip for macro definitions. --- src/libs/cplusplus/CppDocument.cpp | 4 ++-- src/libs/cplusplus/CppDocument.h | 25 +++++++++++++++++---- src/libs/cplusplus/pp-engine.cpp | 9 ++++---- src/libs/cplusplus/pp-macro.h | 28 ++++++++++++++++++++++++ src/plugins/cpptools/cpphoverhandler.cpp | 25 ++++++++++++--------- src/plugins/cpptools/cppmodelmanager.cpp | 4 ++-- 6 files changed, 73 insertions(+), 22 deletions(-) diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index aac0664f7e4..3e619548a23 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -146,9 +146,9 @@ void Document::appendMacro(const Macro ¯o) _definedMacros.append(macro); } -void Document::addMacroUse(unsigned offset, unsigned length) +void Document::addMacroUse(const Macro ¯o, unsigned offset, unsigned length) { - _macroUses.append(Block(offset, offset + length)); + _macroUses.append(MacroUse(macro, offset, offset + length)); } TranslationUnit *Document::translationUnit() const diff --git a/src/libs/cplusplus/CppDocument.h b/src/libs/cplusplus/CppDocument.h index d289c579e9c..aaca36c18ee 100644 --- a/src/libs/cplusplus/CppDocument.h +++ b/src/libs/cplusplus/CppDocument.h @@ -68,8 +68,7 @@ public: void addIncludeFile(const QString &fileName); void appendMacro(const Macro ¯o); - - void addMacroUse(unsigned offset, unsigned length); + void addMacroUse(const Macro ¯o, unsigned offset, unsigned length); Control *control() const; TranslationUnit *translationUnit() const; @@ -177,12 +176,30 @@ public: inline unsigned end() const { return _end; } + + bool contains(unsigned pos) const + { return pos >= _begin && pos < _end; } + }; + + class MacroUse: public Block { + Macro _macro; + + public: + inline MacroUse(const Macro ¯o, + unsigned begin = 0, + unsigned end = 0) + : Block(begin, end), + _macro(macro) + { } + + const Macro ¯o() const + { return _macro; } }; QList<Block> skippedBlocks() const { return _skippedBlocks; } - QList<Block> macroUses() const + QList<MacroUse> macroUses() const { return _macroUses; } private: @@ -197,7 +214,7 @@ private: QList<DiagnosticMessage> _diagnosticMessages; QList<Macro> _definedMacros; QList<Block> _skippedBlocks; - QList<Block> _macroUses; + QList<MacroUse> _macroUses; }; } // end of namespace CPlusPlus diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp index 7bdc9b95d69..fd618d27065 100644 --- a/src/libs/cplusplus/pp-engine.cpp +++ b/src/libs/cplusplus/pp-engine.cpp @@ -604,28 +604,29 @@ void pp::operator()(const QByteArray &source, QByteArray *result) m->definition.constEnd(), result); + m->hidden = false; + if (client) client->stopExpandingMacro(_dot->offset, *m); - m->hidden = false; continue; } else { QByteArray tmp; - m->hidden = true; if (client) client->startExpandingMacro(identifierToken->offset, *m, spell); + m->hidden = true; expand(m->definition.constBegin(), m->definition.constEnd(), &tmp); + m->hidden = false; + if (client) client->stopExpandingMacro(_dot->offset, *m); - m->hidden = false; - m = 0; // reset the active the macro pushState(createStateFromSource(tmp)); diff --git a/src/libs/cplusplus/pp-macro.h b/src/libs/cplusplus/pp-macro.h index 494b7a4de7f..73cdab7e3a0 100644 --- a/src/libs/cplusplus/pp-macro.h +++ b/src/libs/cplusplus/pp-macro.h @@ -57,6 +57,7 @@ #include <QByteArray> #include <QVector> +#include <QString> namespace CPlusPlus { @@ -89,6 +90,33 @@ public: hashcode(0), state(0) { } + + QString toString() const + { + QString text; + if (hidden) + text += QLatin1String("#undef "); + else + text += QLatin1String("#define "); + text += QString::fromUtf8(name.constData(), name.size()); + if (function_like) { + text += QLatin1Char('('); + bool first = true; + foreach (const QByteArray formal, formals) { + if (! first) + text += QLatin1String(", "); + else + first = false; + text += QString::fromUtf8(formal.constData(), formal.size()); + } + if (variadics) + text += QLatin1String("..."); + text += QLatin1Char(' '); + } + text += QLatin1Char(' '); + text += QString::fromUtf8(definition.constData(), definition.size()); + return text; + } }; } // namespace CPlusPlus diff --git a/src/plugins/cpptools/cpphoverhandler.cpp b/src/plugins/cpptools/cpphoverhandler.cpp index 16ed8a92150..1265ef9da7f 100644 --- a/src/plugins/cpptools/cpphoverhandler.cpp +++ b/src/plugins/cpptools/cpphoverhandler.cpp @@ -37,6 +37,7 @@ #include <coreplugin/icore.h> #include <coreplugin/uniqueidmanager.h> #include <texteditor/itexteditor.h> +#include <texteditor/basetexteditor.h> #include <debugger/debuggerconstants.h> #include <CoreTypes.h> @@ -51,13 +52,13 @@ #include <cplusplus/TypeOfExpression.h> #include <QtGui/QToolTip> -#include <QtGui/QPlainTextEdit> #include <QtGui/QTextCursor> #include <QtGui/QTextBlock> #include <QtHelp/QHelpEngineCore> #include <QtCore/QtCore> using namespace CppTools::Internal; +using namespace CPlusPlus; CppHoverHandler::CppHoverHandler(CppModelManager *manager, QObject *parent) : QObject(parent), m_manager(manager), m_helpEngineNeedsSetup(false) @@ -104,11 +105,9 @@ void CppHoverHandler::showToolTip(TextEditor::ITextEditor *editor, const QPoint } } -static QString buildHelpId(const CPlusPlus::FullySpecifiedType &type, - const CPlusPlus::Symbol *symbol) +static QString buildHelpId(const FullySpecifiedType &type, + const Symbol *symbol) { - using namespace CPlusPlus; - Name *name = 0; Scope *scope = 0; @@ -156,12 +155,10 @@ static QString buildHelpId(const CPlusPlus::FullySpecifiedType &type, void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, int pos) { - using namespace CPlusPlus; - m_helpId.clear(); m_toolTip.clear(); - QPlainTextEdit *edit = qobject_cast<QPlainTextEdit *>(editor->widget()); + TextEditor::BaseTextEditor *edit = qobject_cast<TextEditor::BaseTextEditor *>(editor->widget()); if (!edit) return; @@ -169,8 +166,7 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in tc.setPosition(pos); const int lineNumber = tc.block().blockNumber() + 1; - - QString fileName = editor->file()->fileName(); + const QString fileName = editor->file()->fileName(); Document::Ptr doc = m_manager->document(fileName); if (doc) { foreach (Document::DiagnosticMessage m, doc->diagnosticMessages()) { @@ -179,6 +175,15 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in break; } } + + if (m_toolTip.isEmpty()) { + foreach (const Document::MacroUse use, doc->macroUses()) { + if (use.contains(pos)) { + m_toolTip = use.macro().toString(); + break; + } + } + } } if (m_toolTip.isEmpty()) { diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index 71838142298..5111aa31996 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -302,14 +302,14 @@ void CppPreprocessor::macroAdded(const Macro ¯o) } void CppPreprocessor::startExpandingMacro(unsigned offset, - const Macro &, + const Macro ¯o, const QByteArray &originalText) { if (! m_currentDoc) return; //qDebug() << "start expanding:" << macro.name << "text:" << originalText; - m_currentDoc->addMacroUse(offset, originalText.length()); + m_currentDoc->addMacroUse(macro, offset, originalText.length()); } void CppPreprocessor::stopExpandingMacro(unsigned, const Macro &) From 4a552ead9ff84e77e9bbdb107b97432777a648d8 Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Tue, 9 Dec 2008 15:25:01 +0100 Subject: [PATCH 54/77] use QTC_ASSERT instead of Q_ASSERT --- installer/qinstaller.cpp | 2 +- shared/designerintegrationv2/formresizer.cpp | 9 +- shared/indenter/constants.cpp | 18 +-- shared/proparser/procommandmanager.cpp | 8 +- shared/proparser/profileevaluator.cpp | 4 +- shared/qrceditor/resourcefile.cpp | 107 ++++++++------- shared/qrceditor/resourcefile_p.h | 12 +- shared/qrceditor/resourceview.cpp | 30 ++-- shared/qrceditor/undocommands.cpp | 14 +- shared/scriptwrapper/wrap_helpers.h | 6 +- src/libs/cplusplus/CppDocument.cpp | 5 +- src/libs/cplusplus/OverviewModel.cpp | 12 +- src/libs/cplusplus/ResolveExpression.cpp | 28 ++-- src/libs/cplusplus/pp-environment.cpp | 21 ++- .../utils/classnamevalidatinglineedit.cpp | 6 +- src/libs/utils/filenamevalidatinglineedit.cpp | 5 +- src/libs/utils/pathchooser.cpp | 22 +-- src/libs/utils/qtcassert.h | 2 + src/plugins/bookmarks/bookmarkmanager.cpp | 11 +- .../cmakeprojectmanager/cmakeproject.cpp | 10 +- .../cmakerunconfiguration.cpp | 10 +- src/plugins/cmakeprojectmanager/cmakestep.cpp | 11 +- src/plugins/cmakeprojectmanager/makestep.cpp | 8 +- .../coreplugin/editormanager/editorgroup.cpp | 20 +-- .../editormanager/editormanager.cpp | 21 +-- .../editormanager/editorsplitter.cpp | 27 ++-- .../editormanager/openeditorsview.cpp | 3 +- .../editormanager/stackededitorgroup.cpp | 26 ++-- src/plugins/coreplugin/filemanager.cpp | 11 +- src/plugins/coreplugin/manhattanstyle.cpp | 55 ++++---- src/plugins/coreplugin/mimedatabase.cpp | 17 ++- src/plugins/coreplugin/modemanager.cpp | 7 +- .../progressmanager/progressmanager.cpp | 8 +- .../progressmanager/progressview.cpp | 4 +- .../scriptmanager/qworkbench_wrapper.cpp | 128 ++++++++++++++---- .../scriptmanager/scriptmanager.cpp | 8 +- src/plugins/coreplugin/versiondialog.cpp | 24 ++-- src/plugins/cppeditor/cppclasswizard.cpp | 10 +- src/plugins/cpptools/cppcodecompletion.cpp | 7 +- src/plugins/cpptools/cppmodelmanager.cpp | 21 +-- src/plugins/debugger/debuggerrunner.cpp | 9 +- src/plugins/designer/editorwidget.cpp | 7 +- src/plugins/designer/formeditorw.cpp | 17 +-- src/plugins/find/basetextfind.cpp | 10 +- src/plugins/find/currentdocumentfind.cpp | 58 ++++---- src/plugins/find/findplugin.cpp | 19 ++- src/plugins/git/gitclient.cpp | 37 ++--- src/plugins/git/giteditor.cpp | 27 ++-- src/plugins/git/gitplugin.cpp | 32 +++-- src/plugins/help/helpfindsupport.cpp | 10 +- src/plugins/perforce/perforceeditor.cpp | 26 ++-- src/plugins/perforce/perforceplugin.cpp | 76 +++++++---- src/plugins/perforce/perforceplugin.h | 6 +- src/plugins/perforce/perforcesubmiteditor.cpp | 4 +- .../projectexplorer/allprojectsfind.cpp | 13 +- .../applicationrunconfiguration.cpp | 15 +- src/plugins/projectexplorer/buildmanager.cpp | 16 ++- src/plugins/projectexplorer/buildstep.cpp | 4 +- .../projectexplorer/buildstepspage.cpp | 9 +- .../projectexplorer/currentprojectfind.cpp | 9 +- src/plugins/projectexplorer/project.cpp | 11 +- .../projectexplorer/projectexplorer.cpp | 37 ++--- src/plugins/projectexplorer/projectmodels.cpp | 49 +++---- src/plugins/projectexplorer/projectnodes.cpp | 12 +- .../projectexplorer/projecttreewidget.cpp | 7 +- .../runsettingspropertiespage.cpp | 30 ++-- src/plugins/projectexplorer/session.cpp | 35 +++-- .../qt4projectmanager/gdbmacrosbuildstep.cpp | 12 +- src/plugins/qt4projectmanager/makestep.cpp | 12 +- src/plugins/qt4projectmanager/qmakestep.cpp | 3 +- src/plugins/qt4projectmanager/qt4nodes.cpp | 13 +- .../qt4projectmanager/qt4runconfiguration.cpp | 16 ++- .../qt4projectmanager/qtversionmanager.cpp | 20 +-- .../wizards/librarywizarddialog.cpp | 6 +- .../qt4projectmanager/wizards/modulespage.cpp | 21 +-- .../qtscripteditor/qtscripteditorplugin.cpp | 8 +- .../qtscripteditor/qtscripthighlighter.cpp | 4 +- src/plugins/quickopen/quickopenmanager.cpp | 3 +- src/plugins/quickopen/quickopentoolwindow.cpp | 5 +- src/plugins/quickopen/settingspage.cpp | 17 ++- .../resourceeditor/resourceeditorplugin.cpp | 8 +- src/plugins/subversion/subversioneditor.cpp | 12 +- src/plugins/subversion/subversionplugin.cpp | 9 +- src/plugins/texteditor/basetextdocument.cpp | 10 +- src/plugins/texteditor/basetexteditor.cpp | 31 +++-- src/plugins/texteditor/completionsupport.cpp | 3 +- src/plugins/texteditor/completionwidget.cpp | 3 +- src/plugins/texteditor/fontsettings.cpp | 8 +- .../texteditor/texteditoractionhandler.cpp | 3 +- src/plugins/texteditor/texteditorplugin.cpp | 3 +- src/plugins/texteditor/texteditorsettings.cpp | 4 +- src/plugins/vcsbase/diffhighlighter.cpp | 4 +- src/tools/makespy/main.cpp | 1 - tests/manual/cplusplus/main.cpp | 14 +- 94 files changed, 923 insertions(+), 673 deletions(-) diff --git a/installer/qinstaller.cpp b/installer/qinstaller.cpp index b0b4cbff77e..9ccaa53850c 100644 --- a/installer/qinstaller.cpp +++ b/installer/qinstaller.cpp @@ -239,7 +239,7 @@ static void appendFileData(QIODevice *out, const QString &fileName) static void appendFileData(QIODevice *out, QIODevice *in) { - Q_ASSERT(!in->isSequential()); + QTC_ASSERT(!in->isSequential(), return); qint64 size = in->size(); QByteArray &b = theBuffer(size); rawRead(in, b.data(), size); diff --git a/shared/designerintegrationv2/formresizer.cpp b/shared/designerintegrationv2/formresizer.cpp index 3b44599d7ef..156b8e718ac 100644 --- a/shared/designerintegrationv2/formresizer.cpp +++ b/shared/designerintegrationv2/formresizer.cpp @@ -30,19 +30,22 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "formresizer.h" #include "sizehandlerect.h" #include "widgethostconstants.h" +#include <utils/qtcassert.h> + #include <QtDesigner/QDesignerFormWindowInterface> + #include <QtGui/QResizeEvent> #include <QtGui/QPalette> #include <QtGui/QLayout> #include <QtGui/QFrame> #include <QtGui/QResizeEvent> -#include <QtCore/QDebug> -enum { debugFormResizer=0 }; +enum { debugFormResizer = 0 }; using namespace SharedTools::Internal; @@ -140,7 +143,7 @@ void FormResizer::setFormWindow(QDesignerFormWindowInterface *fw) if (debugFormResizer) qDebug() << "FormResizer::setFormWindow " << fw; QVBoxLayout *layout = qobject_cast<QVBoxLayout *>(m_frame->layout()); - Q_ASSERT(layout); + QTC_ASSERT(layout, return); if (layout->count()) delete layout->takeAt(0); m_formWindow = fw; diff --git a/shared/indenter/constants.cpp b/shared/indenter/constants.cpp index 2339ceb6938..120ebdccb22 100644 --- a/shared/indenter/constants.cpp +++ b/shared/indenter/constants.cpp @@ -33,6 +33,8 @@ #include "indenter.h" +#include <utils/qtcassert.h> + using namespace SharedTools::IndenterInternal; // --- Constants @@ -55,12 +57,12 @@ Constants::Constants() : "|(?:public|protected|private|signals|Q_SIGNALS|default)(?:\\s+slots|\\s+Q_SLOTS)?\\s*" ")?:.*")) { - m_literal.setMinimal( true ); - m_inlineCComment.setMinimal( true ); - Q_ASSERT(m_literal.isValid()); - Q_ASSERT(m_label.isValid()); - Q_ASSERT(m_inlineCComment.isValid()); - Q_ASSERT(m_braceX.isValid()); - Q_ASSERT(m_iflikeKeyword.isValid()); - Q_ASSERT(m_caseLabel.isValid()); + m_literal.setMinimal(true); + m_inlineCComment.setMinimal(true); + QTC_ASSERT(m_literal.isValid(), return); + QTC_ASSERT(m_label.isValid(), return); + QTC_ASSERT(m_inlineCComment.isValid(), return); + QTC_ASSERT(m_braceX.isValid(), return); + QTC_ASSERT(m_iflikeKeyword.isValid(), return); + QTC_ASSERT(m_caseLabel.isValid(), return); } diff --git a/shared/proparser/procommandmanager.cpp b/shared/proparser/procommandmanager.cpp index a6b61f4a3fb..99fc3025637 100644 --- a/shared/proparser/procommandmanager.cpp +++ b/shared/proparser/procommandmanager.cpp @@ -33,6 +33,8 @@ #include "procommandmanager.h" +#include <utils/qtcassert.h> + using namespace Qt4ProjectManager::Internal; ProCommandGroup::ProCommandGroup(const QString &name) @@ -76,7 +78,7 @@ ProCommandManager::~ProCommandManager() void ProCommandManager::beginGroup(const QString &name) { - Q_ASSERT(!m_group); + QTC_ASSERT(!m_group, return); if (m_pos != m_groups.count()) { int removecount = m_groups.count() - m_pos; @@ -95,7 +97,7 @@ bool ProCommandManager::hasGroup() const void ProCommandManager::endGroup() { - Q_ASSERT(m_group); + QTC_ASSERT(m_group, return); m_groups.append(m_group); m_pos = m_groups.count(); @@ -106,7 +108,7 @@ void ProCommandManager::endGroup() bool ProCommandManager::command(ProCommand *cmd) { - Q_ASSERT(m_group); + QTC_ASSERT(m_group, return false); if (cmd->redo()) { m_group->appendCommand(cmd); diff --git a/shared/proparser/profileevaluator.cpp b/shared/proparser/profileevaluator.cpp index cdb02609c6e..1935efa2fdf 100644 --- a/shared/proparser/profileevaluator.cpp +++ b/shared/proparser/profileevaluator.cpp @@ -35,6 +35,8 @@ #include "proparserutils.h" #include "proitems.h" +#include <utils/qtcassert.h> + #include <QtCore/QByteArray> #include <QtCore/QDebug> #include <QtCore/QDir> @@ -683,7 +685,7 @@ bool ProFileEvaluator::Private::visitProFunction(ProFunction *func) QString text = func->text(); int lparen = text.indexOf(QLatin1Char('(')); int rparen = text.lastIndexOf(QLatin1Char(')')); - Q_ASSERT(lparen < rparen); + QTC_ASSERT(lparen < rparen, return false); QString arguments = text.mid(lparen + 1, rparen - lparen - 1); QString funcName = text.left(lparen); diff --git a/shared/qrceditor/resourcefile.cpp b/shared/qrceditor/resourcefile.cpp index 2867814c852..f394f43f41e 100644 --- a/shared/qrceditor/resourcefile.cpp +++ b/shared/qrceditor/resourcefile.cpp @@ -33,13 +33,16 @@ #include "resourcefile_p.h" -#include <QtCore/QtAlgorithms> -#include <QtCore/QFile> -#include <QtCore/QTextStream> +#include <utils/qtcassert.h> + #include <QtCore/QCoreApplication> -#include <QtCore/QDir> -#include <QtCore/QMimeData> #include <QtCore/QDebug> +#include <QtCore/QDir> +#include <QtCore/QFile> +#include <QtCore/QMimeData> +#include <QtCore/QtAlgorithms> +#include <QtCore/QTextStream> + #include <QtGui/QIcon> #include <QtGui/QImageReader> @@ -109,14 +112,14 @@ bool ResourceFile::load() const QString language = relt.attribute(QLatin1String("lang")); const int idx = indexOfPrefix(prefix); - Prefix * p = NULL; + Prefix * p = 0; if (idx == -1) { p = new Prefix(prefix, language); m_prefix_list.append(p); } else { p = m_prefix_list[idx]; } - Q_ASSERT(p != NULL); + QTC_ASSERT(p, return false); QDomElement felt = relt.firstChildElement(QLatin1String("file")); for (; !felt.isNull(); felt = felt.nextSiblingElement(QLatin1String("file"))) { @@ -247,9 +250,9 @@ bool ResourceFile::isEmpty() const QStringList ResourceFile::fileList(int pref_idx) const { - Q_ASSERT((pref_idx >= 0) && (pref_idx < m_prefix_list.count())); - const FileList &abs_file_list = m_prefix_list.at(pref_idx)->file_list; QStringList result; + QTC_ASSERT(pref_idx >= 0 && pref_idx < m_prefix_list.count(), return result); + const FileList &abs_file_list = m_prefix_list.at(pref_idx)->file_list; foreach (const File *abs_file, abs_file_list) result.append(relativePath(abs_file->name)); return result; @@ -258,9 +261,9 @@ QStringList ResourceFile::fileList(int pref_idx) const void ResourceFile::addFile(int prefix_idx, const QString &file, int file_idx) { Prefix * const p = m_prefix_list[prefix_idx]; - Q_ASSERT(p != NULL); + QTC_ASSERT(p, return); FileList &files = p->file_list; - Q_ASSERT((file_idx >= -1) && (file_idx <= files.size())); + QTC_ASSERT(file_idx >= -1 && file_idx <= files.size(), return); if (file_idx == -1) file_idx = files.size(); files.insert(file_idx, new File(p, absolutePath(file))); @@ -272,7 +275,7 @@ void ResourceFile::addPrefix(const QString &prefix, int prefix_idx) if (indexOfPrefix(fixed_prefix) != -1) return; - Q_ASSERT((prefix_idx >= -1) && (prefix_idx <= m_prefix_list.size())); + QTC_ASSERT(prefix_idx >= -1 && prefix_idx <= m_prefix_list.size(), return); if (prefix_idx == -1) prefix_idx = m_prefix_list.size(); m_prefix_list.insert(prefix_idx, new Prefix(fixed_prefix)); @@ -280,7 +283,7 @@ void ResourceFile::addPrefix(const QString &prefix, int prefix_idx) void ResourceFile::removePrefix(int prefix_idx) { - Q_ASSERT((prefix_idx >= 0) && (prefix_idx < m_prefix_list.count())); + QTC_ASSERT(prefix_idx >= 0 && prefix_idx < m_prefix_list.count(), return); Prefix * const p = m_prefix_list.at(prefix_idx); delete p; m_prefix_list.removeAt(prefix_idx); @@ -288,39 +291,39 @@ void ResourceFile::removePrefix(int prefix_idx) void ResourceFile::removeFile(int prefix_idx, int file_idx) { - Q_ASSERT((prefix_idx >= 0) && (prefix_idx < m_prefix_list.count())); + QTC_ASSERT(prefix_idx >= 0 && prefix_idx < m_prefix_list.count(), return); FileList &fileList = m_prefix_list[prefix_idx]->file_list; - Q_ASSERT((file_idx >= 0) && (file_idx < fileList.count())); + QTC_ASSERT(file_idx >= 0 && file_idx < fileList.count(), return); delete fileList.at(file_idx); fileList.removeAt(file_idx); } void ResourceFile::replacePrefix(int prefix_idx, const QString &prefix) { - Q_ASSERT((prefix_idx >= 0) && (prefix_idx < m_prefix_list.count())); + QTC_ASSERT(prefix_idx >= 0 && prefix_idx < m_prefix_list.count(), return); m_prefix_list[prefix_idx]->name = fixPrefix(prefix); } void ResourceFile::replaceLang(int prefix_idx, const QString &lang) { - Q_ASSERT((prefix_idx >= 0) && (prefix_idx < m_prefix_list.count())); + QTC_ASSERT(prefix_idx >= 0 && prefix_idx < m_prefix_list.count(), return); m_prefix_list[prefix_idx]->lang = lang; } void ResourceFile::replaceAlias(int prefix_idx, int file_idx, const QString &alias) { - Q_ASSERT((prefix_idx >= 0) && (prefix_idx < m_prefix_list.count())); + QTC_ASSERT(prefix_idx >= 0 && prefix_idx < m_prefix_list.count(), return); FileList &fileList = m_prefix_list.at(prefix_idx)->file_list; - Q_ASSERT((file_idx >= 0) && (file_idx < fileList.count())); + QTC_ASSERT(file_idx >= 0 && file_idx < fileList.count(), return); fileList[file_idx]->alias = alias; } void ResourceFile::replaceFile(int pref_idx, int file_idx, const QString &file) { - Q_ASSERT((pref_idx >= 0) && (pref_idx < m_prefix_list.count())); + QTC_ASSERT(pref_idx >= 0 && pref_idx < m_prefix_list.count(), return); FileList &fileList = m_prefix_list.at(pref_idx)->file_list; - Q_ASSERT((file_idx >= 0) && (file_idx < fileList.count())); + QTC_ASSERT(file_idx >= 0 && file_idx < fileList.count(), return); fileList[file_idx]->name = file; } @@ -336,7 +339,7 @@ int ResourceFile::indexOfPrefix(const QString &prefix) const int ResourceFile::indexOfFile(int pref_idx, const QString &file) const { - Q_ASSERT((pref_idx >= 0) && (pref_idx < m_prefix_list.count())); + QTC_ASSERT(pref_idx >= 0 && pref_idx < m_prefix_list.count(), return -1); Prefix * const p = m_prefix_list.at(pref_idx); File equalFile(p, absolutePath(file)); return p->file_list.indexOf(&equalFile); @@ -370,16 +373,16 @@ bool ResourceFile::contains(const QString &prefix, const QString &file) const return false; if (file.isEmpty()) return true; - Q_ASSERT((pref_idx >= 0) && (pref_idx < m_prefix_list.count())); + QTC_ASSERT(pref_idx >= 0 && pref_idx < m_prefix_list.count(), return false); Prefix * const p = m_prefix_list.at(pref_idx); - Q_ASSERT(p != NULL); + QTC_ASSERT(p, return false); File equalFile(p, absolutePath(file)); return p->file_list.contains(&equalFile); } bool ResourceFile::contains(int pref_idx, const QString &file) const { - Q_ASSERT((pref_idx >= 0) && (pref_idx < m_prefix_list.count())); + QTC_ASSERT(pref_idx >= 0 && pref_idx < m_prefix_list.count(), return false); Prefix * const p = m_prefix_list.at(pref_idx); File equalFile(p, absolutePath(file)); return p->file_list.contains(&equalFile); @@ -409,49 +412,49 @@ int ResourceFile::prefixCount() const QString ResourceFile::prefix(int idx) const { - Q_ASSERT((idx >= 0) && (idx < m_prefix_list.count())); + QTC_ASSERT((idx >= 0) && (idx < m_prefix_list.count()), return QString()); return m_prefix_list.at(idx)->name; } QString ResourceFile::lang(int idx) const { - Q_ASSERT((idx >= 0) && (idx < m_prefix_list.count())); + QTC_ASSERT(idx >= 0 && idx < m_prefix_list.count(), return QString()); return m_prefix_list.at(idx)->lang; } int ResourceFile::fileCount(int prefix_idx) const { - Q_ASSERT((prefix_idx >= 0) && (prefix_idx < m_prefix_list.count())); + QTC_ASSERT(prefix_idx >= 0 && prefix_idx < m_prefix_list.count(), return 0); return m_prefix_list.at(prefix_idx)->file_list.size(); } QString ResourceFile::file(int prefix_idx, int file_idx) const { - Q_ASSERT((prefix_idx >= 0) && (prefix_idx < m_prefix_list.count())); + QTC_ASSERT(prefix_idx >= 0 && prefix_idx < m_prefix_list.count(), return QString()); FileList &fileList = m_prefix_list.at(prefix_idx)->file_list; - Q_ASSERT((file_idx >= 0) && (file_idx < fileList.count())); + QTC_ASSERT(file_idx >= 0 && file_idx < fileList.count(), return QString()); return fileList.at(file_idx)->name; } QString ResourceFile::alias(int prefix_idx, int file_idx) const { - Q_ASSERT((prefix_idx >= 0) && (prefix_idx < m_prefix_list.count())); + QTC_ASSERT(prefix_idx >= 0 && prefix_idx < m_prefix_list.count(), return QString()); FileList &fileList = m_prefix_list.at(prefix_idx)->file_list; - Q_ASSERT((file_idx >= 0) && (file_idx < fileList.count())); + QTC_ASSERT(file_idx >= 0 && file_idx < fileList.count(), return QString()); return fileList.at(file_idx)->alias; } void * ResourceFile::prefixPointer(int prefixIndex) const { - Q_ASSERT((prefixIndex >= 0) && (prefixIndex < m_prefix_list.count())); + QTC_ASSERT(prefixIndex >= 0 && prefixIndex < m_prefix_list.count(), return 0); return m_prefix_list.at(prefixIndex); } void * ResourceFile::filePointer(int prefixIndex, int fileIndex) const { - Q_ASSERT((prefixIndex >= 0) && (prefixIndex < m_prefix_list.count())); + QTC_ASSERT(prefixIndex >= 0 && prefixIndex < m_prefix_list.count(), return 0); FileList &fileList = m_prefix_list.at(prefixIndex)->file_list; - Q_ASSERT((fileIndex >= 0) && (fileIndex < fileList.count())); + QTC_ASSERT(fileIndex >= 0 && fileIndex < fileList.count(), return 0); return fileList.at(fileIndex); } @@ -497,28 +500,28 @@ QModelIndex ResourceModel::index(int row, int column, const QModelIndex &parent) if (column != 0) return QModelIndex(); - void * internalPointer = NULL; + void * internalPointer = 0; if (parent.isValid()) { void * const pip = parent.internalPointer(); - if (pip == NULL) + if (pip == 0) return QModelIndex(); // File node Node * const node = reinterpret_cast<Node *>(pip); Prefix * const prefix = node->prefix(); - Q_ASSERT(prefix != NULL); - if ((row < 0) || (row >= prefix->file_list.count())) + QTC_ASSERT(prefix, return QModelIndex()); + if (row < 0 || row >= prefix->file_list.count()) return QModelIndex(); const int prefixIndex = m_resource_file.prefixPointerIndex(prefix); const int fileIndex = row; internalPointer = m_resource_file.filePointer(prefixIndex, fileIndex); } else { // Prefix node - if ((row < 0) || (row >= m_resource_file.prefixCount())) + if (row < 0 || row >= m_resource_file.prefixCount()) return QModelIndex(); internalPointer = m_resource_file.prefixPointer(row); } - Q_ASSERT(internalPointer != NULL); + QTC_ASSERT(internalPointer, return QModelIndex()); return createIndex(row, 0, internalPointer); } @@ -528,16 +531,16 @@ QModelIndex ResourceModel::parent(const QModelIndex &index) const return QModelIndex(); void * const internalPointer = index.internalPointer(); - if (internalPointer == NULL) + if (internalPointer == 0) return QModelIndex(); Node * const node = reinterpret_cast<Node *>(internalPointer); Prefix * const prefix = node->prefix(); - Q_ASSERT(prefix != NULL); + QTC_ASSERT(prefix, return QModelIndex()); bool const isFileNode = (prefix != node); if (isFileNode) { const int row = m_resource_file.prefixPointerIndex(prefix); - Q_ASSERT(row >= 0); + QTC_ASSERT(row >= 0, return QModelIndex()); return createIndex(row, 0, prefix); } else { return QModelIndex(); @@ -550,7 +553,7 @@ int ResourceModel::rowCount(const QModelIndex &parent) const void * const internalPointer = parent.internalPointer(); Node * const node = reinterpret_cast<Node *>(internalPointer); Prefix * const prefix = node->prefix(); - Q_ASSERT(prefix != NULL); + QTC_ASSERT(prefix, return 0); bool const isFileNode = (prefix != node); if (isFileNode) { @@ -609,7 +612,7 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const Node * const node = reinterpret_cast<Node *>(internalPointer); Prefix const * const prefix = node->prefix(); File const * const file = node->file(); - Q_ASSERT(prefix != NULL); + QTC_ASSERT(prefix, return QVariant()); bool const isFileNode = (prefix != node); QVariant result; @@ -626,7 +629,7 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const appendParenthesized(lang, stringRes); } else { // File node - Q_ASSERT(file != NULL); + QTC_ASSERT(file, return result); stringRes = QFileInfo(file->name).fileName(); const QString alias = file->alias; if (!alias.isEmpty()) @@ -638,7 +641,7 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const case Qt::DecorationRole: if (isFileNode) { // File node - Q_ASSERT(file != NULL); + QTC_ASSERT(file, return result); const QString path = m_resource_file.absolutePath(file->name); if (iconFileExtension(path)) { const QIcon icon(path); @@ -650,7 +653,7 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const case Qt::ToolTipRole: if (isFileNode) { // File node - Q_ASSERT(file != NULL); + QTC_ASSERT(file, return result); QString conv_file = m_resource_file.relativePath(file->name); QString stringRes = conv_file.replace(QDir::separator(), QLatin1Char('/')); const QString &alias_file = file->alias; @@ -679,12 +682,12 @@ void ResourceModel::getItem(const QModelIndex &index, QString &prefix, QString & void * const internalPointer = index.internalPointer(); Node * const node = reinterpret_cast<Node *>(internalPointer); Prefix * const p = node->prefix(); - Q_ASSERT(p != NULL); + QTC_ASSERT(p, return); bool const isFileNode = (p != node); if (isFileNode) { - File * const f = node->file(); - Q_ASSERT(f != NULL); + File *const f = node->file(); + QTC_ASSERT(f, return); if (!f->alias.isEmpty()) file = f->alias; else diff --git a/shared/qrceditor/resourcefile_p.h b/shared/qrceditor/resourcefile_p.h index 3276c2dec1e..6643be39aba 100644 --- a/shared/qrceditor/resourcefile_p.h +++ b/shared/qrceditor/resourcefile_p.h @@ -36,10 +36,12 @@ #include "namespace_global.h" +#include <utils/qtcassert.h> + +#include <QtCore/QAbstractItemModel> +#include <QtCore/QMap> #include <QtCore/QString> #include <QtCore/QStringList> -#include <QtCore/QMap> -#include <QtCore/QAbstractItemModel> #include "shared_global_p.h" @@ -66,11 +68,11 @@ class Node protected: Node(File *file, Prefix *prefix) : m_file(file), m_prefix(prefix) { - Q_ASSERT(m_prefix != NULL); + QTC_ASSERT(m_prefix, return); } public: - File * file() { return m_file; } - Prefix * prefix() { Q_ASSERT(m_prefix != NULL); return m_prefix; } + File *file() { return m_file; } + Prefix *prefix() { return m_prefix; } private: File *m_file; Prefix *m_prefix; diff --git a/shared/qrceditor/resourceview.cpp b/shared/qrceditor/resourceview.cpp index 53b35b97e79..d0d3a9d11c5 100644 --- a/shared/qrceditor/resourceview.cpp +++ b/shared/qrceditor/resourceview.cpp @@ -32,16 +32,20 @@ ***************************************************************************/ #include "resourceview.h" + #include "undocommands_p.h" -#include <QtGui/QHeaderView> -#include <QtGui/QMenu> +#include <utils/qtcassert.h> + +#include <QtCore/QDebug> + #include <QtGui/QAction> -#include <QtGui/QMouseEvent> #include <QtGui/QApplication> -#include <QtGui/QInputDialog> #include <QtGui/QFileDialog> -#include <QtCore/QtDebug> +#include <QtGui/QHeaderView> +#include <QtGui/QInputDialog> +#include <QtGui/QMenu> +#include <QtGui/QMouseEvent> #include <QtGui/QUndoStack> namespace SharedTools { @@ -308,14 +312,14 @@ void ResourceView::findSamePlacePostDeletionModelIndex(int &row, QModelIndex &pa EntryBackup * ResourceView::removeEntry(const QModelIndex &index) { - Q_ASSERT(m_qrcModel != NULL); + QTC_ASSERT(m_qrcModel, return 0); return m_qrcModel->removeEntry(index); } void ResourceView::addFiles(int prefixIndex, const QStringList &fileNames, int cursorFile, int &firstFile, int &lastFile) { - Q_ASSERT(m_qrcModel != NULL); + QTC_ASSERT(m_qrcModel, return); m_qrcModel->addFiles(prefixIndex, fileNames, cursorFile, firstFile, lastFile); // Expand prefix node @@ -327,11 +331,11 @@ void ResourceView::addFiles(int prefixIndex, const QStringList &fileNames, int c void ResourceView::removeFiles(int prefixIndex, int firstFileIndex, int lastFileIndex) { - Q_ASSERT((prefixIndex >= 0) && (prefixIndex < m_qrcModel->rowCount(QModelIndex()))); + QTC_ASSERT(prefixIndex >= 0 && prefixIndex < m_qrcModel->rowCount(QModelIndex()), return); const QModelIndex prefixModelIndex = m_qrcModel->index(prefixIndex, 0, QModelIndex()); - Q_ASSERT(prefixModelIndex != QModelIndex()); - Q_ASSERT((firstFileIndex >= 0) && (firstFileIndex < m_qrcModel->rowCount(prefixModelIndex))); - Q_ASSERT((lastFileIndex >= 0) && (lastFileIndex < m_qrcModel->rowCount(prefixModelIndex))); + QTC_ASSERT(prefixModelIndex != QModelIndex(), return); + QTC_ASSERT(firstFileIndex >= 0 && firstFileIndex < m_qrcModel->rowCount(prefixModelIndex), return); + QTC_ASSERT(lastFileIndex >= 0 && lastFileIndex < m_qrcModel->rowCount(prefixModelIndex), return); for (int i = lastFileIndex; i >= firstFileIndex; i--) { const QModelIndex index = m_qrcModel->index(i, 0, prefixModelIndex); @@ -568,7 +572,7 @@ QString ResourceView::getCurrentValue(NodeProperty property) const case AliasProperty: return currentAlias(); case PrefixProperty: return currentPrefix(); case LanguageProperty: return currentLanguage(); - default: Q_ASSERT(false); return QString(); // Kill warning + default: QTC_ASSERT(false, /**/); return QString(); // Kill warning } } @@ -579,7 +583,7 @@ void ResourceView::changeValue(const QModelIndex &nodeIndex, NodeProperty proper case AliasProperty: m_qrcModel->changeAlias(nodeIndex, value); return; case PrefixProperty: m_qrcModel->changePrefix(nodeIndex, value); return; case LanguageProperty: m_qrcModel->changeLang(nodeIndex, value); return; - default: Q_ASSERT(false); + default: QTC_ASSERT(false, /**/); } } diff --git a/shared/qrceditor/undocommands.cpp b/shared/qrceditor/undocommands.cpp index 6b549326d58..246b69c0d71 100644 --- a/shared/qrceditor/undocommands.cpp +++ b/shared/qrceditor/undocommands.cpp @@ -92,7 +92,7 @@ bool ModifyPropertyCommand::mergeWith(const QUndoCommand * command) { const ModifyPropertyCommand * const brother = dynamic_cast<const ModifyPropertyCommand *>(command); - if (command == NULL || m_property != brother->m_property) + if (command == 0 || m_property != brother->m_property) return false; // Choose older command (this) and forgot the other @@ -101,7 +101,7 @@ bool ModifyPropertyCommand::mergeWith(const QUndoCommand * command) void ModifyPropertyCommand::undo() { - Q_ASSERT(m_view != NULL); + QTC_ASSERT(m_view, return); // Save current text in m_after for redo() m_after = m_view->getCurrentValue(m_property); @@ -117,12 +117,12 @@ void ModifyPropertyCommand::redo() return; // Bring back text before undo - Q_ASSERT(m_view != NULL); + QTC_ASSERT(m_view, return); m_view->changeValue(makeIndex(), m_property, m_after); } RemoveEntryCommand::RemoveEntryCommand(ResourceView *view, const QModelIndex &index) - : ModelIndexViewCommand(view), m_entry(NULL), m_isExpanded(true) + : ModelIndexViewCommand(view), m_entry(0), m_isExpanded(true) { storeIndex(index); } @@ -142,9 +142,9 @@ void RemoveEntryCommand::redo() void RemoveEntryCommand::undo() { - if (m_entry != NULL) { + if (m_entry == 0) { m_entry->restore(); - Q_ASSERT(m_view != NULL); + QTC_ASSERT(m_view != 0, return); const QModelIndex index = makeIndex(); m_view->setExpanded(index, m_isExpanded); m_view->setCurrentIndex(index); @@ -155,7 +155,7 @@ void RemoveEntryCommand::undo() void RemoveEntryCommand::freeEntry() { delete m_entry; - m_entry = NULL; + m_entry = 0; } AddFilesCommand::AddFilesCommand(ResourceView *view, int prefixIndex, int cursorFileIndex, diff --git a/shared/scriptwrapper/wrap_helpers.h b/shared/scriptwrapper/wrap_helpers.h index 21ed625c161..02db144a3e5 100644 --- a/shared/scriptwrapper/wrap_helpers.h +++ b/shared/scriptwrapper/wrap_helpers.h @@ -34,6 +34,8 @@ #ifndef WRAP_HELPERS_H #define WRAP_HELPERS_H +#include <utils/qtcassert.h> + #include <QtScript/QScriptEngine> #include <QtScript/QScriptContext> #include <QtScript/QScriptValue> @@ -87,7 +89,7 @@ template <class Wrapper, class Wrapped> Wrapped * (Wrapper::*wrappedAccessor) () const) { Wrapped *wrapped = wrappedFromScriptValue(context->thisObject(), wrappedAccessor); - Q_ASSERT(wrapped); + QTC_ASSERT(wrapped, return 0); return wrapped; } @@ -314,7 +316,7 @@ static void scriptValueToQObject(const QScriptValue &sv, SomeQObject * &p) { QObject *qObject = sv.toQObject(); p = qobject_cast<SomeQObject*>(qObject); - Q_ASSERT(p); + QTC_ASSERT(p, return); } // Register a QObject-derived class which has Q_DECLARE_METATYPE(Ptr*) diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index 45ad1f569a5..aac0664f7e4 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -32,6 +32,9 @@ ***************************************************************************/ #include "CppDocument.h" + +#include <utils/qtcassert.h> + #include <Control.h> #include <TranslationUnit.h> #include <DiagnosticClient.h> @@ -270,7 +273,7 @@ bool Document::parse(ParseMode mode) void Document::check() { - Q_ASSERT(! _globalNamespace); + QTC_ASSERT(!_globalNamespace, return); Semantic semantic(_control); diff --git a/src/libs/cplusplus/OverviewModel.cpp b/src/libs/cplusplus/OverviewModel.cpp index 20658778905..7f38cb8ba1a 100644 --- a/src/libs/cplusplus/OverviewModel.cpp +++ b/src/libs/cplusplus/OverviewModel.cpp @@ -34,6 +34,8 @@ #include "OverviewModel.h" #include "Overview.h" +#include <utils/qtcassert.h> + #include <Scope.h> #include <Semantic.h> #include <Literals.h> @@ -81,13 +83,13 @@ QModelIndex OverviewModel::index(int row, int column, const QModelIndex &parent) return createIndex(row, column, symbol); } else { Symbol *parentSymbol = static_cast<Symbol *>(parent.internalPointer()); - Q_ASSERT(parentSymbol != 0); + QTC_ASSERT(parentSymbol, return QModelIndex()); ScopedSymbol *scopedSymbol = parentSymbol->asScopedSymbol(); - Q_ASSERT(scopedSymbol != 0); + QTC_ASSERT(scopedSymbol, return QModelIndex()); Scope *scope = scopedSymbol->members(); - Q_ASSERT(scope != 0); + QTC_ASSERT(scope, return QModelIndex()); return createIndex(row, 0, scope->symbolAt(row)); } @@ -124,12 +126,12 @@ int OverviewModel::rowCount(const QModelIndex &parent) const if (!parent.parent().isValid() && parent.row() == 0) // account for no symbol item return 0; Symbol *parentSymbol = static_cast<Symbol *>(parent.internalPointer()); - Q_ASSERT(parentSymbol != 0); + QTC_ASSERT(parentSymbol, return 0); if (ScopedSymbol *scopedSymbol = parentSymbol->asScopedSymbol()) { if (!scopedSymbol->isFunction()) { Scope *parentScope = scopedSymbol->members(); - Q_ASSERT(parentScope != 0); + QTC_ASSERT(parentScope, return 0); return parentScope->symbolCount(); } diff --git a/src/libs/cplusplus/ResolveExpression.cpp b/src/libs/cplusplus/ResolveExpression.cpp index cfcd06cacd7..6915e1169b0 100644 --- a/src/libs/cplusplus/ResolveExpression.cpp +++ b/src/libs/cplusplus/ResolveExpression.cpp @@ -45,12 +45,14 @@ #include <TypeVisitor.h> #include <NameVisitor.h> -#include <QList> -#include <QtDebug> +#include <utils/qtcassert.h> + +#include <QtCore/QList> +#include <QtCore/QtDebug> using namespace CPlusPlus; -namespace { +namespace { typedef QList< QPair<Name *, FullySpecifiedType> > Substitution; @@ -98,7 +100,7 @@ protected: // types virtual void visit(PointerToMemberType * /*ty*/) { - Q_ASSERT(0); + QTC_ASSERT(false, /**/); } virtual void visit(PointerType *ty) @@ -150,32 +152,32 @@ protected: { /* nothing to do*/ } virtual void visit(Namespace *) - { Q_ASSERT(0); } + { QTC_ASSERT(false, /**/); } virtual void visit(Class *) - { Q_ASSERT(0); } + { QTC_ASSERT(false, /**/); } virtual void visit(Enum *) - { Q_ASSERT(0); } + { QTC_ASSERT(false, /**/); } // names virtual void visit(NameId *) - { Q_ASSERT(0); } + { QTC_ASSERT(false, /**/); } virtual void visit(TemplateNameId *) - { Q_ASSERT(0); } + { QTC_ASSERT(false, /**/); } virtual void visit(DestructorNameId *) - { Q_ASSERT(0); } + { QTC_ASSERT(false, /**/); } virtual void visit(OperatorNameId *) - { Q_ASSERT(0); } + { QTC_ASSERT(false, /**/); } virtual void visit(ConversionNameId *) - { Q_ASSERT(0); } + { QTC_ASSERT(false, /**/); } virtual void visit(QualifiedNameId *) - { Q_ASSERT(0); } + { QTC_ASSERT(false, /**/); } }; } // end of anonymous namespace diff --git a/src/libs/cplusplus/pp-environment.cpp b/src/libs/cplusplus/pp-environment.cpp index a1ade3b189a..ff2ca77e4f2 100644 --- a/src/libs/cplusplus/pp-environment.cpp +++ b/src/libs/cplusplus/pp-environment.cpp @@ -52,11 +52,14 @@ #include "pp-environment.h" #include "pp.h" + +#include <utils/qtcassert.h> + #include <cstring> using namespace CPlusPlus; -Environment::Environment () +Environment::Environment() : currentLine(0), hide_next(false), _macros(0), @@ -67,7 +70,7 @@ Environment::Environment () { } -Environment::~Environment () +Environment::~Environment() { if (_macros) { qDeleteAll(firstMacro(), lastMacro()); @@ -78,15 +81,19 @@ Environment::~Environment () free(_hash); } -unsigned Environment::macroCount () const -{ return _macro_count + 1; } +unsigned Environment::macroCount() const +{ + return _macro_count + 1; +} -Macro *Environment::macroAt (unsigned index) const -{ return _macros[index]; } +Macro *Environment::macroAt(unsigned index) const +{ + return _macros[index]; +} Macro *Environment::bind(const Macro &__macro) { - Q_ASSERT(! __macro.name.isEmpty()); + QTC_ASSERT(! __macro.name.isEmpty(), return 0); Macro *m = new Macro (__macro); m->hashcode = hash_code(m->name); diff --git a/src/libs/utils/classnamevalidatinglineedit.cpp b/src/libs/utils/classnamevalidatinglineedit.cpp index 0210b96e702..aa6557574cf 100644 --- a/src/libs/utils/classnamevalidatinglineedit.cpp +++ b/src/libs/utils/classnamevalidatinglineedit.cpp @@ -33,6 +33,8 @@ #include "classnamevalidatinglineedit.h" +#include <utils/qtcassert.h> + #include <QtCore/QDebug> #include <QtCore/QRegExp> @@ -53,7 +55,7 @@ ClassNameValidatingLineEditPrivate:: ClassNameValidatingLineEditPrivate() : m_namespaceDelimiter(QLatin1String("::")), m_namespacesEnabled(false) { - Q_ASSERT(m_nameRegexp.isValid()); + QTC_ASSERT(m_nameRegexp.isValid(), return); } // --------------------- ClassNameValidatingLineEdit @@ -113,7 +115,7 @@ QString ClassNameValidatingLineEdit::createClassName(const QString &name) // Remove spaces and convert the adjacent characters to uppercase QString className = name; QRegExp spaceMatcher(QLatin1String(" +(\\w)"), Qt::CaseSensitive, QRegExp::RegExp2); - Q_ASSERT(spaceMatcher.isValid()); + QTC_ASSERT(spaceMatcher.isValid(), /**/); int pos; while ((pos = spaceMatcher.indexIn(className)) != -1) { className.replace(pos, spaceMatcher.matchedLength(), diff --git a/src/libs/utils/filenamevalidatinglineedit.cpp b/src/libs/utils/filenamevalidatinglineedit.cpp index 5b308f5ce47..a7e228903b5 100644 --- a/src/libs/utils/filenamevalidatinglineedit.cpp +++ b/src/libs/utils/filenamevalidatinglineedit.cpp @@ -32,6 +32,7 @@ ***************************************************************************/ #include "filenamevalidatinglineedit.h" +#include "qtcassert.h" #include <QtCore/QRegExp> #include <QtCore/QDebug> @@ -46,7 +47,7 @@ static const QRegExp &windowsDeviceNoSubDirPattern() { static const QRegExp rc(QLatin1String("CON|AUX|PRN|COM1|COM2|LPT1|LPT2|NUL"), Qt::CaseInsensitive); - Q_ASSERT(rc.isValid()); + QTC_ASSERT(rc.isValid(), return rc); return rc; } @@ -54,7 +55,7 @@ static const QRegExp &windowsDeviceSubDirPattern() { static const QRegExp rc(QLatin1String(".*[/\\\\]CON|.*[/\\\\]AUX|.*[/\\\\]PRN|.*[/\\\\]COM1|.*[/\\\\]COM2|.*[/\\\\]LPT1|.*[/\\\\]LPT2|.*[/\\\\]NUL"), Qt::CaseInsensitive); - Q_ASSERT(rc.isValid()); + QTC_ASSERT(rc.isValid(), return rc); return rc; } diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index 8565b13edd6..81a2228e669 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -32,18 +32,20 @@ ***************************************************************************/ #include "pathchooser.h" + #include "basevalidatinglineedit.h" +#include "qtcassert.h" -#include <QtGui/QLineEdit> -#include <QtGui/QHBoxLayout> -#include <QtGui/QToolButton> -#include <QtGui/QFileDialog> -#include <QtGui/QDesktopServices> - -#include <QtCore/QFileInfo> -#include <QtCore/QDir> -#include <QtCore/QSettings> #include <QtCore/QDebug> +#include <QtCore/QDir> +#include <QtCore/QFileInfo> +#include <QtCore/QSettings> + +#include <QtGui/QDesktopServices> +#include <QtGui/QFileDialog> +#include <QtGui/QHBoxLayout> +#include <QtGui/QLineEdit> +#include <QtGui/QToolButton> namespace Core { namespace Utils { @@ -71,7 +73,7 @@ PathValidatingLineEdit::PathValidatingLineEdit(PathChooser *chooser, QWidget *pa BaseValidatingLineEdit(parent), m_chooser(chooser) { - Q_ASSERT(chooser != NULL); + QTC_ASSERT(chooser, return); } bool PathValidatingLineEdit::validate(const QString &value, QString *errorMessage) const diff --git a/src/libs/utils/qtcassert.h b/src/libs/utils/qtcassert.h index 538d906f827..d05be20df81 100644 --- a/src/libs/utils/qtcassert.h +++ b/src/libs/utils/qtcassert.h @@ -34,6 +34,8 @@ #ifndef QTC_ASSERT_H #define QTC_ASSERT_H +#include <QtCore/QDebug> + #ifdef Q_OS_UNIX #define QTC_ASSERT(cond, action) \ if(cond){}else{qDebug()<<"ASSERTION"<<#cond<<"FAILED"<<__FILE__<<__LINE__;action;} diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp index fefe7562967..a9377730fd8 100644 --- a/src/plugins/bookmarks/bookmarkmanager.cpp +++ b/src/plugins/bookmarks/bookmarkmanager.cpp @@ -32,6 +32,7 @@ ***************************************************************************/ #include "bookmarkmanager.h" + #include "bookmark.h" #include "bookmarksplugin.h" #include "bookmarks_global.h" @@ -41,12 +42,14 @@ #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/uniqueidmanager.h> #include <texteditor/basetexteditor.h> +#include <utils/qtcassert.h> + +#include <QtCore/QDebug> +#include <QtCore/QFileInfo> #include <QtGui/QAction> -#include <QtCore/QFileInfo> -#include <QtCore/QDebug> -#include <QtGui/QPainter> #include <QtGui/QContextMenuEvent> +#include <QtGui/QPainter> Q_DECLARE_METATYPE(Bookmarks::Internal::Bookmark*) @@ -272,7 +275,7 @@ void BookmarkView::removeAll() void BookmarkView::setModel(QAbstractItemModel *model) { BookmarkManager *manager = qobject_cast<BookmarkManager *>(model); - Q_ASSERT(manager); + QTC_ASSERT(manager, return); QListView::setModel(model); setSelectionModel(manager->selectionModel()); setSelectionMode(QAbstractItemView::SingleSelection); diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 581a92e9fbf..423fa2dcb3f 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -32,18 +32,20 @@ ***************************************************************************/ #include "cmakeproject.h" + #include "cmakeprojectconstants.h" #include "cmakeprojectnodes.h" +#include "cmakerunconfiguration.h" #include "cmakestep.h" #include "makestep.h" -#include "cmakerunconfiguration.h" #include <extensionsystem/pluginmanager.h> #include <cpptools/cppmodelmanagerinterface.h> +#include <utils/qtcassert.h> -#include <QProcess> -#include <QDir> #include <QtCore/QDebug> +#include <QtCore/QDir> +#include <QtCore/QProcess> using namespace CMakeProjectManager; using namespace CMakeProjectManager::Internal; @@ -550,7 +552,7 @@ void CMakeCbpParser::parseUnit() void CMakeCbpParser::parseUnknownElement() { - Q_ASSERT(isStartElement()); + QTC_ASSERT(isStartElement(), /**/); while (!atEnd()) { readNext(); diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp index eed15c3593e..d8bc8e795ba 100644 --- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp @@ -32,10 +32,12 @@ ***************************************************************************/ #include "cmakerunconfiguration.h" -#include "cmakeprojectconstants.h" + #include "cmakeproject.h" +#include "cmakeprojectconstants.h" #include <projectexplorer/environment.h> +#include <utils/qtcassert.h> using namespace CMakeProjectManager; using namespace CMakeProjectManager::Internal; @@ -45,9 +47,9 @@ CMakeRunConfiguration::CMakeRunConfiguration(CMakeProject *pro, const QString &t { setName(target); } + CMakeRunConfiguration::~CMakeRunConfiguration() { - } QString CMakeRunConfiguration::type() const @@ -130,7 +132,7 @@ QStringList CMakeRunConfigurationFactory::canCreate(ProjectExplorer::Project *pr // used to translate the types to names to display to the user QString CMakeRunConfigurationFactory::nameForType(const QString &type) const { - Q_ASSERT(type.startsWith(Constants::CMAKERUNCONFIGURATION)); + QTC_ASSERT(type.startsWith(Constants::CMAKERUNCONFIGURATION), /**/); if (type == Constants::CMAKERUNCONFIGURATION) return "CMake"; // Doesn't happen @@ -141,7 +143,7 @@ QString CMakeRunConfigurationFactory::nameForType(const QString &type) const QSharedPointer<ProjectExplorer::RunConfiguration> CMakeRunConfigurationFactory::create(ProjectExplorer::Project *project, const QString &type) { CMakeProject *pro = qobject_cast<CMakeProject *>(project); - Q_ASSERT(pro); + QTC_ASSERT(pro, /**/); if (type == Constants::CMAKERUNCONFIGURATION) { // Restoring, filename will be added by restoreSettings QSharedPointer<ProjectExplorer::RunConfiguration> rc(new CMakeRunConfiguration(pro, QString::null, QString::null)); diff --git a/src/plugins/cmakeprojectmanager/cmakestep.cpp b/src/plugins/cmakeprojectmanager/cmakestep.cpp index adbfe59b6cc..045fa46a241 100644 --- a/src/plugins/cmakeprojectmanager/cmakestep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakestep.cpp @@ -32,8 +32,11 @@ ***************************************************************************/ #include "cmakestep.h" -#include "cmakeprojectconstants.h" + #include "cmakeproject.h" +#include "cmakeprojectconstants.h" + +#include <utils/qtcassert.h> using namespace CMakeProjectManager; using namespace CMakeProjectManager::Internal; @@ -41,12 +44,10 @@ using namespace CMakeProjectManager::Internal; CMakeStep::CMakeStep(CMakeProject *pro) : AbstractProcessStep(pro), m_pro(pro) { - } CMakeStep::~CMakeStep() { - } bool CMakeStep::init(const QString &buildConfiguration) @@ -114,9 +115,9 @@ bool CMakeBuildStepFactory::canCreate(const QString &name) const ProjectExplorer::BuildStep *CMakeBuildStepFactory::create(ProjectExplorer::Project *project, const QString &name) const { - Q_ASSERT(name == Constants::CMAKESTEP); + QTC_ASSERT(name == Constants::CMAKESTEP, /**/); CMakeProject *pro = qobject_cast<CMakeProject *>(project); - Q_ASSERT(pro); + QTC_ASSERT(pro, /**/); return new CMakeStep(pro); } diff --git a/src/plugins/cmakeprojectmanager/makestep.cpp b/src/plugins/cmakeprojectmanager/makestep.cpp index 6bb5b59cdf8..3cdc0726e8c 100644 --- a/src/plugins/cmakeprojectmanager/makestep.cpp +++ b/src/plugins/cmakeprojectmanager/makestep.cpp @@ -35,18 +35,18 @@ #include "cmakeprojectconstants.h" #include "cmakeproject.h" +#include <utils/qtcassert.h> + using namespace CMakeProjectManager; using namespace CMakeProjectManager::Internal; MakeStep::MakeStep(CMakeProject *pro) : AbstractProcessStep(pro), m_pro(pro) { - } MakeStep::~MakeStep() { - } bool MakeStep::init(const QString &buildConfiguration) @@ -109,9 +109,9 @@ bool MakeBuildStepFactory::canCreate(const QString &name) const ProjectExplorer::BuildStep *MakeBuildStepFactory::create(ProjectExplorer::Project *project, const QString &name) const { - Q_ASSERT(name == Constants::MAKESTEP); + QTC_ASSERT(name == Constants::MAKESTEP, return 0); CMakeProject *pro = qobject_cast<CMakeProject *>(project); - Q_ASSERT(pro); + QTC_ASSERT(pro, return 0); return new MakeStep(pro); } diff --git a/src/plugins/coreplugin/editormanager/editorgroup.cpp b/src/plugins/coreplugin/editormanager/editorgroup.cpp index 58c867b02c4..c146a09f256 100644 --- a/src/plugins/coreplugin/editormanager/editorgroup.cpp +++ b/src/plugins/coreplugin/editormanager/editorgroup.cpp @@ -32,15 +32,18 @@ ***************************************************************************/ #include "editorgroup.h" + #include "editormanager.h" #include <coreplugin/coreconstants.h> +#include <utils/qtcassert.h> #include <QtCore/QDir> +#include <QtCore/QDebug> + #include <QtGui/QPainter> #include <QtGui/QStyle> #include <QtGui/QStyleOption> -#include <QtCore/QtDebug> #ifdef Q_WS_MAC #include <QtGui/QMacStyle> #endif @@ -107,20 +110,20 @@ QVariant EditorModel::data(const QModelIndex &index, int role) const if (!index.isValid()) return QVariant(); IEditor *editor = m_editors.at(index.row()); - Q_ASSERT(editor); + QTC_ASSERT(editor, return QVariant()); switch (role) { case Qt::DisplayRole: return editor->file()->isModified() - ?editor->displayName()+QLatin1String("*") - :editor->displayName(); + ? editor->displayName() + QLatin1String("*") + : editor->displayName(); case Qt::DecorationRole: return editor->file()->isReadOnly() - ?QIcon(QLatin1String(":/qworkbench/images/locked.png")) - :QIcon(); + ? QIcon(QLatin1String(":/qworkbench/images/locked.png")) + : QIcon(); case Qt::ToolTipRole: return editor->file()->fileName().isEmpty() - ?editor->displayName() - :QDir::toNativeSeparators(editor->file()->fileName()); + ? editor->displayName() + : QDir::toNativeSeparators(editor->file()->fileName()); case Qt::UserRole: return qVariantFromValue(editor); default: @@ -145,6 +148,7 @@ EditorGroupContext::EditorGroupContext(EditorGroup *editorGroup) m_editorGroup(editorGroup) { } + QList<int> EditorGroupContext::context() const { return m_context; diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 3f3b93af704..1b4f04093fd 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -53,21 +53,23 @@ #include <coreplugin/baseview.h> #include <coreplugin/imode.h> -#include <QtCore/QFileInfo> -#include <QtCore/QSettings> -#include <QtCore/QMap> -#include <QtCore/QSet> -#include <QtCore/QProcess> +#include <utils/qtcassert.h> + #include <QtCore/QDebug> +#include <QtCore/QFileInfo> +#include <QtCore/QMap> +#include <QtCore/QProcess> +#include <QtCore/QSet> +#include <QtCore/QSettings> #include <QtGui/QAction> -#include <QtGui/QLayout> #include <QtGui/QApplication> -#include <QtGui/QSplitter> #include <QtGui/QFileDialog> +#include <QtGui/QLayout> #include <QtGui/QMenu> #include <QtGui/QMessageBox> #include <QtGui/QPushButton> +#include <QtGui/QSplitter> using namespace Core; using namespace Core::Internal; @@ -961,11 +963,10 @@ bool EditorManager::hasEditor(const QString &fileName) const void EditorManager::restoreEditorState(IEditor *editor) { - Q_ASSERT(editor); + QTC_ASSERT(editor, return); QString fileName = editor->file()->fileName(); - if (m_d->m_editorStates.contains(fileName)) { + if (m_d->m_editorStates.contains(fileName)) editor->restoreState(m_d->m_editorStates.value(fileName).toByteArray()); - } } bool EditorManager::saveEditor(IEditor *editor) diff --git a/src/plugins/coreplugin/editormanager/editorsplitter.cpp b/src/plugins/coreplugin/editormanager/editorsplitter.cpp index f0e7f82bf9a..48ec7e0e45a 100644 --- a/src/plugins/coreplugin/editormanager/editorsplitter.cpp +++ b/src/plugins/coreplugin/editormanager/editorsplitter.cpp @@ -32,16 +32,19 @@ ***************************************************************************/ #include "editorsplitter.h" + #include "editormanager.h" +#include "minisplitter.h" #include "openeditorswindow.h" #include "stackededitorgroup.h" -#include "minisplitter.h" #include <coreplugin/icore.h> #include <coreplugin/coreconstants.h> #include <coreplugin/uniqueidmanager.h> #include <coreplugin/actionmanager/actionmanagerinterface.h> +#include <utils/qtcassert.h> + #include <QtGui/QHBoxLayout> #include <QtGui/QMenu> #include <QtGui/QApplication> @@ -160,7 +163,7 @@ void EditorSplitter::registerActions() void EditorSplitter::updateActions() { const bool hasMultipleGroups = (qobject_cast<QSplitter*>(m_root) != 0); - Q_ASSERT(currentGroup()); + QTC_ASSERT(currentGroup(), return); const bool hasEditors = (currentGroup()->editorCount() != 0); m_unsplitAction->setEnabled(hasMultipleGroups); #if 0 @@ -245,7 +248,7 @@ void EditorSplitter::collectGroups(QWidget *widget, QList<EditorGroup*> &groups) return; } QSplitter *splitter = qobject_cast<QSplitter*>(widget); - Q_ASSERT(splitter); + QTC_ASSERT(splitter, return); collectGroups(splitter->widget(LEFT), groups); collectGroups(splitter->widget(RIGHT), groups); } @@ -330,7 +333,7 @@ void EditorSplitter::unsplit() if (!curGroup) return; QWidget *curGroupWidget = curGroup->widget(); - Q_ASSERT(curGroupWidget); + QTC_ASSERT(curGroupWidget, return); IEditor *selectedEditor = curGroup->currentEditor(); QSplitter *parentSplitter = qobject_cast<QSplitter*>(curGroupWidget->parentWidget()); @@ -454,25 +457,25 @@ EditorGroup *EditorSplitter::groupFarthestOnSide(QWidget *node, Side side) const void EditorSplitter::selectNextGroup() { EditorGroup *curGroup = currentGroup(); - Q_ASSERT(curGroup); + QTC_ASSERT(curGroup, return); setCurrentGroup(nextGroup(curGroup, RIGHT)); } void EditorSplitter::selectPreviousGroup() { EditorGroup *curGroup = currentGroup(); - Q_ASSERT(curGroup); + QTC_ASSERT(curGroup, return); setCurrentGroup(nextGroup(curGroup, LEFT)); } EditorGroup *EditorSplitter::nextGroup(EditorGroup *curGroup, Side side) const { - Q_ASSERT(curGroup); + QTC_ASSERT(curGroup, return 0); QWidget *curWidget = curGroup->widget(); QWidget *parent = curWidget->parentWidget(); while (curWidget != m_root) { QSplitter *splitter = qobject_cast<QSplitter *>(parent); - Q_ASSERT(splitter); + QTC_ASSERT(splitter, return 0); if (splitter->widget(side) != curWidget) { curWidget = splitter->widget(side); break; @@ -486,7 +489,7 @@ EditorGroup *EditorSplitter::nextGroup(EditorGroup *curGroup, Side side) const void EditorSplitter::moveDocToAdjacentGroup(Side side) { EditorGroup *curGroup = currentGroup(); - Q_ASSERT(curGroup); + QTC_ASSERT(curGroup, return); IEditor *editor = curGroup->currentEditor(); if (!editor) return; @@ -510,7 +513,7 @@ QWidget *EditorSplitter::recreateGroupTree(QWidget *node) QSplitter *splitter = qobject_cast<QSplitter *>(node); if (!splitter) { EditorGroup *group = qobject_cast<EditorGroup *>(node); - Q_ASSERT(group); + QTC_ASSERT(group, return 0); IEditor *currentEditor = group->currentEditor(); EditorGroup *newGroup = createGroup(); bool block = newGroup->widget()->blockSignals(true); @@ -588,7 +591,7 @@ void EditorSplitter::saveState(QWidget *current, QDataStream &stream) const saveState(splitter->widget(1), stream); } else { EditorGroup *group = qobject_cast<EditorGroup *>(current); - Q_ASSERT(group); + QTC_ASSERT(group, /**/); if (group != currentGroup()) type = 1; else @@ -639,7 +642,7 @@ void EditorSplitter::fillPathGroupMap(QWidget *current, QString currentPath, map.insert(currentPath, group); } else { QSplitter *splitter = qobject_cast<QSplitter *>(current); - Q_ASSERT(splitter); + QTC_ASSERT(splitter, return); fillPathGroupMap(splitter->widget(0), currentPath+"0", map); fillPathGroupMap(splitter->widget(1), currentPath+"1", map); } diff --git a/src/plugins/coreplugin/editormanager/openeditorsview.cpp b/src/plugins/coreplugin/editormanager/openeditorsview.cpp index d321491e2f2..8fadf753064 100644 --- a/src/plugins/coreplugin/editormanager/openeditorsview.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorsview.cpp @@ -39,6 +39,7 @@ #include <coreplugin/coreconstants.h> #include <coreplugin/filemanager.h> #include <coreplugin/uniqueidmanager.h> +#include <utils/qtcassert.h> #include <QtCore/QTimer> #include <QtGui/QMenu> @@ -197,7 +198,7 @@ void OpenEditorsWidget::selectEditor(QTreeWidgetItem *item) void OpenEditorsWidget::updateEditor() { IEditor *editor = qobject_cast<IEditor *>(sender()); - Q_ASSERT(editor); + QTC_ASSERT(editor, return); int num = m_ui.editorList->topLevelItemCount(); for (int i = 0; i < num; ++i) { QTreeWidgetItem *item = m_ui.editorList->topLevelItem(i); diff --git a/src/plugins/coreplugin/editormanager/stackededitorgroup.cpp b/src/plugins/coreplugin/editormanager/stackededitorgroup.cpp index 35c4abca29c..c4dcffe91d5 100644 --- a/src/plugins/coreplugin/editormanager/stackededitorgroup.cpp +++ b/src/plugins/coreplugin/editormanager/stackededitorgroup.cpp @@ -35,21 +35,24 @@ #include "editormanager.h" #include "coreimpl.h" -#include <QtCore/QFileInfo> +#include <utils/qtcassert.h> + +#include <QtCore/QDebug> #include <QtCore/QDir> +#include <QtCore/QFileInfo> #include <QtCore/QMimeData> + +#include <QtGui/QApplication> #include <QtGui/QComboBox> #include <QtGui/QHBoxLayout> +#include <QtGui/QLabel> +#include <QtGui/QMouseEvent> #include <QtGui/QPainter> +#include <QtGui/QStackedWidget> #include <QtGui/QStyle> #include <QtGui/QStyleOption> -#include <QtGui/QMouseEvent> -#include <QtGui/QApplication> #include <QtGui/QToolBar> #include <QtGui/QToolButton> -#include <QtGui/QLabel> -#include <QtGui/QStackedWidget> -#include <QtDebug> #ifdef Q_WS_MAC #include <qmacstyle_mac.h> #endif @@ -240,7 +243,7 @@ void StackedEditorGroup::sendCloseRequest() void StackedEditorGroup::removeEditor(IEditor *editor) { - Q_ASSERT(editor); + QTC_ASSERT(editor, return); EditorGroup::removeEditor(editor); const int index = m_container->indexOf(editor->widget()); if (index != -1) { @@ -280,7 +283,7 @@ void StackedEditorGroup::setCurrentEditor(IEditor *editor) return; m_toplevel->setVisible(true); const int idx = m_container->indexOf(editor->widget()); - Q_ASSERT(idx >= 0); + QTC_ASSERT(idx >= 0, return); if (m_container->currentIndex() != idx) { m_container->setCurrentIndex(idx); @@ -298,10 +301,11 @@ void StackedEditorGroup::setCurrentEditor(IEditor *editor) } } -void StackedEditorGroup::updateEditorStatus(IEditor *editor) { +void StackedEditorGroup::updateEditorStatus(IEditor *editor) +{ if (!editor) editor = qobject_cast<IEditor *>(sender()); - Q_ASSERT(editor); + QTC_ASSERT(editor, return); static const QIcon lockedIcon(QLatin1String(":/qworkbench/images/locked.png")); static const QIcon unlockedIcon(QLatin1String(":/qworkbench/images/unlocked.png")); @@ -371,6 +375,6 @@ int StackedEditorGroup::indexOf(IEditor *editor) if (editor == model->data(model->index(i, 0), Qt::UserRole).value<IEditor*>()) return i; } - Q_ASSERT(false); + QTC_ASSERT(false, /**/); return 0; } diff --git a/src/plugins/coreplugin/filemanager.cpp b/src/plugins/coreplugin/filemanager.cpp index 9e4e6704380..48ae15dd951 100644 --- a/src/plugins/coreplugin/filemanager.cpp +++ b/src/plugins/coreplugin/filemanager.cpp @@ -32,6 +32,7 @@ ***************************************************************************/ #include "filemanager.h" + #include "ifile.h" #include "mainwindow.h" #include "saveitemsdialog.h" @@ -40,6 +41,8 @@ #include "mimedatabase.h" #include "iversioncontrol.h" +#include <utils/qtcassert.h> + #include <QtCore/QDebug> #include <QtCore/QSettings> #include <QtCore/QFileInfo> @@ -177,22 +180,20 @@ bool FileManager::removeFile(IFile *file) void FileManager::addWatch(const QString &filename) { - if (!filename.isEmpty() && managedFiles(filename).isEmpty()) { + if (!filename.isEmpty() && managedFiles(filename).isEmpty()) m_fileWatcher->addPath(filename); - } } void FileManager::removeWatch(const QString &filename) { - if (!filename.isEmpty() && managedFiles(filename).isEmpty()) { + if (!filename.isEmpty() && managedFiles(filename).isEmpty()) m_fileWatcher->removePath(filename); - } } void FileManager::checkForNewFileName() { IFile *file = qobject_cast<IFile *>(sender()); - Q_ASSERT(file); + QTC_ASSERT(file, return); const QString newfilename = fixFileName(file->fileName()); const QString oldfilename = m_managedFiles.value(file).fileName; if (!newfilename.isEmpty() && newfilename != oldfilename) { diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index d796af3bdca..1b018c66d13 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -33,30 +33,34 @@ #include "manhattanstyle.h" -#include <QStyleOption> -#include <QPainter> -#include <QScrollArea> -#include <QMainWindow> -#include <QDockWidget> -#include <QPixmapCache> -#include <QDialogButtonBox> -#include <QPixmap> -#include <QToolBar> -#include <QDialog> -#include <QLineEdit> -#include <QComboBox> -#include <QLibrary> -#include <QStatusBar> -#include <QApplication> -#include <QStyleFactory> -#include <QToolButton> -#include <QLabel> -#include <QPushButton> -#include <QSplitter> -#include <QMenuBar> #include "stylehelper.h" #include "styleanimator.h" -#include <qdebug.h> + +#include <QtCore/QDebug> +#include <QtCore/QLibrary> + +#include <QtGui/QApplication> +#include <QtGui/QComboBox> +#include <QtGui/QDialog> +#include <QtGui/QDialogButtonBox> +#include <QtGui/QDockWidget> +#include <QtGui/QLabel> +#include <QtGui/QLineEdit> +#include <QtGui/QMainWindow> +#include <QtGui/QMenuBar> +#include <QtGui/QPainter> +#include <QtGui/QPixmap> +#include <QtGui/QPixmapCache> +#include <QtGui/QPushButton> +#include <QtGui/QScrollArea> +#include <QtGui/QSplitter> +#include <QtGui/QStatusBar> +#include <QtGui/QStyleFactory> +#include <QtGui/QStyleOption> +#include <QtGui/QToolBar> +#include <QtGui/QToolButton> + +#include <utils/qtcassert.h> // We define a currently unused state for indicating animations #define State_Animating 0x00000040 @@ -97,7 +101,7 @@ public: ManhattanStylePrivate(const QString &baseStyleName) { style = QStyleFactory::create(baseStyleName); - Q_ASSERT(style); + QTC_ASSERT(style, /**/); buttonImage_pressed = QImage(":/qworkbench/images/pushbutton_pressed.png"); buttonImage = QImage(":/qworkbench/images/pushbutton.png"); @@ -105,12 +109,15 @@ public: lineeditImage_disabled = QImage(":/qworkbench/images/inputfield_disabled.png"); } - ~ManhattanStylePrivate() { + ~ManhattanStylePrivate() + { delete style; style = 0; } void init(); + +public: QStyle *style; QImage buttonImage; QImage buttonImage_pressed; diff --git a/src/plugins/coreplugin/mimedatabase.cpp b/src/plugins/coreplugin/mimedatabase.cpp index 37ff518a76a..26e6858c983 100644 --- a/src/plugins/coreplugin/mimedatabase.cpp +++ b/src/plugins/coreplugin/mimedatabase.cpp @@ -33,19 +33,22 @@ #include "mimedatabase.h" -#include <QtCore/QStringList> +#include <utils/qtcassert.h> + +#include <QtCore/QByteArray> +#include <QtCore/QCoreApplication> +#include <QtCore/QDebug> #include <QtCore/QFile> +#include <QtCore/QFileInfo> +#include <QtCore/QLocale> #include <QtCore/QMap> #include <QtCore/QMultiHash> -#include <QtCore/QDebug> #include <QtCore/QRegExp> -#include <QtCore/QCoreApplication> -#include <QtCore/QFileInfo> -#include <QtCore/QByteArray> #include <QtCore/QSharedData> #include <QtCore/QSharedPointer> +#include <QtCore/QStringList> #include <QtCore/QTextStream> -#include <QtCore/QLocale> + #include <QtXml/QXmlStreamReader> enum { debugMimeDB = 0 }; @@ -574,7 +577,7 @@ BaseMimeTypeParser:: BaseMimeTypeParser() : // "*.log[1-9]" m_suffixPattern(QLatin1String("^\\*\\.[\\w]+$")) { - Q_ASSERT(m_suffixPattern.isValid()); + QTC_ASSERT(m_suffixPattern.isValid(), /**/); } void BaseMimeTypeParser::addGlobPattern(const QString &pattern, MimeTypeData *d) const diff --git a/src/plugins/coreplugin/modemanager.cpp b/src/plugins/coreplugin/modemanager.cpp index 3ea82b42433..31221a343c2 100644 --- a/src/plugins/coreplugin/modemanager.cpp +++ b/src/plugins/coreplugin/modemanager.cpp @@ -32,11 +32,13 @@ ***************************************************************************/ #include "modemanager.h" + #include "fancytabwidget.h" #include "fancyactionbar.h" #include "mainwindow.h" #include <aggregation/aggregate.h> + #include <coreplugin/actionmanager/actionmanagerinterface.h> #include <coreplugin/actionmanager/icommand.h> #include <coreplugin/coreconstants.h> @@ -44,9 +46,12 @@ #include <coreplugin/imode.h> #include <coreplugin/uniqueidmanager.h> +#include <utils/qtcassert.h> + #include <QtCore/QObject> #include <QtCore/QDebug> #include <QtCore/QSignalMapper> + #include <QtGui/QAction> #include <QtGui/QTabWidget> #include <QtGui/QVBoxLayout> @@ -225,7 +230,7 @@ void ModeManager::currentTabChanged(int index) void ModeManager::setFocusToCurrentMode() { IMode *mode = currentMode(); - Q_ASSERT(mode); + QTC_ASSERT(mode, return); QWidget *widget = mode->widget(); if (widget) { QWidget *focusWidget = widget->focusWidget(); diff --git a/src/plugins/coreplugin/progressmanager/progressmanager.cpp b/src/plugins/coreplugin/progressmanager/progressmanager.cpp index e74198d897a..be851f52677 100644 --- a/src/plugins/coreplugin/progressmanager/progressmanager.cpp +++ b/src/plugins/coreplugin/progressmanager/progressmanager.cpp @@ -40,11 +40,13 @@ #include "uniqueidmanager.h" #include "viewmanagerinterface.h" +#include <utils/qtcassert.h> + using namespace Core; using namespace Core::Internal; -ProgressManager::ProgressManager(QObject *parent) : - ProgressManagerInterface(parent) +ProgressManager::ProgressManager(QObject *parent) + : ProgressManagerInterface(parent) { m_progressView = new ProgressView; ICore *core = CoreImpl::instance(); @@ -103,7 +105,7 @@ QWidget *ProgressManager::progressView() void ProgressManager::taskFinished() { QObject *taskObject = sender(); - Q_ASSERT(taskObject); + QTC_ASSERT(taskObject, return); QFutureWatcher<void> *task = static_cast<QFutureWatcher<void> *>(taskObject); m_runningTasks.remove(task); delete task; diff --git a/src/plugins/coreplugin/progressmanager/progressview.cpp b/src/plugins/coreplugin/progressmanager/progressview.cpp index 274eae8bdb6..c589b4b689a 100644 --- a/src/plugins/coreplugin/progressmanager/progressview.cpp +++ b/src/plugins/coreplugin/progressmanager/progressview.cpp @@ -34,6 +34,8 @@ #include "progressview.h" #include "futureprogress.h" +#include <utils/qtcassert.h> + #include <QtGui/QHBoxLayout> using namespace Core; @@ -136,7 +138,7 @@ void ProgressView::removeTask(FutureProgress *task) void ProgressView::slotFinished() { FutureProgress *progress = qobject_cast<FutureProgress *>(sender()); - Q_ASSERT(progress); + QTC_ASSERT(progress, return); if (m_keep.contains(progress) && !m_keep.value(progress) && !progress->hasError()) removeTask(progress); removeOldTasks(m_type.value(progress), true); diff --git a/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp b/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp index 28c3c658e66..81e0f77b564 100644 --- a/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp +++ b/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp @@ -38,12 +38,15 @@ #include <coreplugin/messagemanager.h> #include <coreplugin/editormanager/editorgroup.h> +#include <utils/qtcassert.h> + #include <QtCore/QDebug> #include <QtCore/QSettings> #include <QtGui/QMainWindow> #include <QtGui/QStatusBar> #include <QtGui/QToolBar> + #include <QtScript/QScriptEngine> namespace { @@ -107,7 +110,7 @@ QString CorePrototype::toString() const CorePrototype::ICore *CorePrototype::callee() const { ICore *rc = qscriptvalue_cast<ICore *>(thisObject()); - Q_ASSERT(rc); + QTC_ASSERT(rc, return 0); return rc; } @@ -121,14 +124,14 @@ MessageManagerPrototype::MessageManagerPrototype(QObject *parent) : void MessageManagerPrototype::displayStatusBarMessage(const QString &text, int ms) { MessageManager *mm = qscriptvalue_cast<MessageManager *>(thisObject()); - Q_ASSERT(mm); + QTC_ASSERT(mm, return); mm->displayStatusBarMessage(text, ms); } void MessageManagerPrototype::printToOutputPane(const QString &text, bool bringToForeground) { MessageManager *mm = qscriptvalue_cast<MessageManager *>(thisObject()); - Q_ASSERT(mm); + QTC_ASSERT(mm, return); mm->printToOutputPane(text, bringToForeground); } @@ -147,28 +150,66 @@ FileManagerPrototype::FileManagerPrototype(QObject *parent) : FileManager *FileManagerPrototype::callee() const { FileManager *rc = qscriptvalue_cast<FileManager *>(thisObject()); - Q_ASSERT(rc); + QTC_ASSERT(rc, return 0); return rc; } -bool FileManagerPrototype::addFiles(const QList<Core::IFile *> &files) { return callee()->addFiles(files); } -bool FileManagerPrototype::addFile(Core::IFile *file) { return callee()->addFile(file); } -bool FileManagerPrototype::removeFile(Core::IFile *file) { return callee()->removeFile(file); } +bool FileManagerPrototype::addFiles(const QList<Core::IFile *> &files) +{ + return callee()->addFiles(files); +} + +bool FileManagerPrototype::addFile(Core::IFile *file) +{ + return callee()->addFile(file); +} + +bool FileManagerPrototype::removeFile(Core::IFile *file) +{ + return callee()->removeFile(file); +} QList<Core::IFile*> - FileManagerPrototype::saveModifiedFilesSilently(const QList<Core::IFile*> &files) { return callee()->saveModifiedFilesSilently(files); } +FileManagerPrototype::saveModifiedFilesSilently(const QList<Core::IFile*> &files) +{ + return callee()->saveModifiedFilesSilently(files); +} -QString FileManagerPrototype::getSaveAsFileName(Core::IFile *file) { return callee()->getSaveAsFileName(file); } +QString FileManagerPrototype::getSaveAsFileName(Core::IFile *file) +{ + return callee()->getSaveAsFileName(file); +} + +bool FileManagerPrototype::isFileManaged(const QString &fileName) const +{ + return callee()->isFileManaged(fileName); +} -bool FileManagerPrototype::isFileManaged(const QString &fileName) const { return callee()->isFileManaged(fileName); } QList<Core::IFile *> - FileManagerPrototype::managedFiles(const QString &fileName) const { return callee()->managedFiles(fileName); } +FileManagerPrototype::managedFiles(const QString &fileName) const +{ + return callee()->managedFiles(fileName); +} -void FileManagerPrototype::blockFileChange(Core::IFile *file) { callee()->blockFileChange(file); } -void FileManagerPrototype::unblockFileChange(Core::IFile *file) { return callee()->unblockFileChange(file); } +void FileManagerPrototype::blockFileChange(Core::IFile *file) +{ + callee()->blockFileChange(file); +} -void FileManagerPrototype::addToRecentFiles(const QString &fileName) { return callee()->addToRecentFiles(fileName); } -QStringList FileManagerPrototype::recentFiles() const { return callee()->recentFiles(); } +void FileManagerPrototype::unblockFileChange(Core::IFile *file) +{ + return callee()->unblockFileChange(file); +} + +void FileManagerPrototype::addToRecentFiles(const QString &fileName) +{ + return callee()->addToRecentFiles(fileName); +} + +QStringList FileManagerPrototype::recentFiles() const +{ + return callee()->recentFiles(); +} QString FileManagerPrototype::toString() const { @@ -185,7 +226,7 @@ FilePrototype::FilePrototype(QObject *parent) : IFile *FilePrototype::callee() const { IFile *rc = qscriptvalue_cast<IFile *>(thisObject()); - Q_ASSERT(rc); + QTC_ASSERT(rc, return 0); return rc; } @@ -270,39 +311,66 @@ QString EditorManagerPrototype::toString() const EditorManagerPrototype::EditorManager *EditorManagerPrototype::callee() const { EditorManager *rc = qscriptvalue_cast<EditorManager *>(thisObject()); - Q_ASSERT(rc); + QTC_ASSERT(rc, return 0); return rc; - } // ------------- EditorPrototype -EditorPrototype::EditorPrototype(QObject *parent) : - QObject(parent) +EditorPrototype::EditorPrototype(QObject *parent) + : QObject(parent) { } -QString EditorPrototype::displayName() const { return callee()->displayName(); } -void EditorPrototype::setDisplayName(const QString &title) { callee()->setDisplayName(title); } +QString EditorPrototype::displayName() const +{ + return callee()->displayName(); +} -QString EditorPrototype::kind() const { return QLatin1String(callee()->kind()); } -bool EditorPrototype::duplicateSupported() const { return callee()->duplicateSupported(); } +void EditorPrototype::setDisplayName(const QString &title) +{ + callee()->setDisplayName(title); +} -bool EditorPrototype::createNew(const QString &contents) { return callee()->createNew(contents); } -bool EditorPrototype::open(const QString &fileName) { return callee()->open(fileName); } +QString EditorPrototype::kind() const +{ + return QLatin1String(callee()->kind()); +} + +bool EditorPrototype::duplicateSupported() const +{ + return callee()->duplicateSupported(); +} + +bool EditorPrototype::createNew(const QString &contents) +{ + return callee()->createNew(contents); +} + +bool EditorPrototype::open(const QString &fileName) +{ + return callee()->open(fileName); +} Core::IEditor *EditorPrototype::duplicate(QWidget *parent) { return callee()->duplicate(parent); } -Core::IFile *EditorPrototype::file() const { return callee()->file(); } -QToolBar* EditorPrototype::toolBar() const { return callee()->toolBar();} +Core::IFile *EditorPrototype::file() const +{ + return callee()->file(); +} + +QToolBar* EditorPrototype::toolBar() const +{ + return callee()->toolBar(); +} Core::IEditor *EditorPrototype::callee() const { IEditor *rc = qscriptvalue_cast<IEditor *>(thisObject()); - Q_ASSERT(rc); + QTC_ASSERT(rc, return 0); return rc; } @@ -375,7 +443,7 @@ QString EditorGroupPrototype::toString() const Core::EditorGroup *EditorGroupPrototype::callee() const { EditorGroup *rc = qscriptvalue_cast<EditorGroup *>(thisObject()); - Q_ASSERT(rc); + QTC_ASSERT(rc, return 0); return rc; } diff --git a/src/plugins/coreplugin/scriptmanager/scriptmanager.cpp b/src/plugins/coreplugin/scriptmanager/scriptmanager.cpp index 5613bd6781a..a3761a17fe1 100644 --- a/src/plugins/coreplugin/scriptmanager/scriptmanager.cpp +++ b/src/plugins/coreplugin/scriptmanager/scriptmanager.cpp @@ -36,8 +36,10 @@ #include "metatypedeclarations.h" #include <extensionsystem/ExtensionSystemInterfaces> +#include <utils/qtcassert.h> #include <interface_wrap_helpers.h> #include <wrap_helpers.h> + #include <limits.h> #include <QtCore/QDebug> @@ -154,7 +156,7 @@ static QScriptValue inputDialogGetItem(QScriptContext *context, QScriptEngine *e // Script function template to pop up a file box // with a certain icon and buttons. template <int TAcceptMode, int TFileMode> - static QScriptValue fileBox(QScriptContext *context, QScriptEngine *engine) +static QScriptValue fileBox(QScriptContext *context, QScriptEngine *engine) { const int argumentCount = context->argumentCount(); if (argumentCount < 2) @@ -170,7 +172,7 @@ template <int TAcceptMode, int TFileMode> if (fileDialog.exec() == QDialog::Rejected) return QScriptValue(engine, QScriptValue::NullValue); const QStringList rc = fileDialog.selectedFiles(); - Q_ASSERT(!rc.empty()); + QTC_ASSERT(!rc.empty(), /**/); return TFileMode == QFileDialog::ExistingFiles ? engine->toScriptValue(rc) : engine->toScriptValue(rc.front()); } @@ -249,7 +251,7 @@ void ScriptManager::ensureEngineInitialized() { if (m_initialized) return; - Q_ASSERT(m_core); + QTC_ASSERT(m_core, return); // register QObjects that occur as properties SharedTools::registerQObject<QMainWindow>(m_engine); SharedTools::registerQObject<QStatusBar>(m_engine); diff --git a/src/plugins/coreplugin/versiondialog.cpp b/src/plugins/coreplugin/versiondialog.cpp index d2ad590ef69..0decae6cf18 100644 --- a/src/plugins/coreplugin/versiondialog.cpp +++ b/src/plugins/coreplugin/versiondialog.cpp @@ -32,21 +32,25 @@ ***************************************************************************/ #include "versiondialog.h" + #include "coreconstants.h" #include "coreimpl.h" +#include <utils/qtcassert.h> + +#include <QtCore/QDate> +#include <QtCore/QFile> + +#include <QtGui/QDialogButtonBox> +#include <QtGui/QGridLayout> +#include <QtGui/QLabel> +#include <QtGui/QPushButton> +#include <QtGui/QTextBrowser> + using namespace Core; using namespace Core::Internal; using namespace Core::Constants; -#include <QtCore/QDate> -#include <QtCore/QFile> -#include <QtGui/QGridLayout> -#include <QtGui/QLabel> -#include <QtGui/QPushButton> -#include <QtGui/QDialogButtonBox> -#include <QtGui/QTextBrowser> - VersionDialog::VersionDialog(QWidget *parent) : QDialog(parent) { @@ -90,7 +94,7 @@ VersionDialog::VersionDialog(QWidget *parent) QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close); - Q_ASSERT(closeButton); + QTC_ASSERT(closeButton, /**/); buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole)); connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject())); @@ -118,7 +122,7 @@ void VersionDialog::popupLicense() // Read file into string ICore * core = CoreImpl::instance(); - Q_ASSERT(core != NULL); + QTC_ASSERT(core, return); QString fileName = core->resourcePath() + "/license.txt"; QFile file(fileName); diff --git a/src/plugins/cppeditor/cppclasswizard.cpp b/src/plugins/cppeditor/cppclasswizard.cpp index 652eec535f1..7babfc45ad8 100644 --- a/src/plugins/cppeditor/cppclasswizard.cpp +++ b/src/plugins/cppeditor/cppclasswizard.cpp @@ -36,12 +36,14 @@ #include <utils/codegeneration.h> #include <utils/newclasswidget.h> +#include <utils/qtcassert.h> -#include <QtCore/QTextStream> -#include <QtCore/QDir> #include <QtCore/QDebug> -#include <QtGui/QComboBox> +#include <QtCore/QDir> +#include <QtCore/QTextStream> + #include <QtGui/QCheckBox> +#include <QtGui/QComboBox> #include <QtGui/QLabel> #include <QtGui/QVBoxLayout> #include <QtGui/QWizard> @@ -196,7 +198,7 @@ bool CppClassWizard::generateHeaderAndSource(const CppClassWizardParameters &par << "\n#define " << guard << '\n' << '\n'; const QRegExp qtClassExpr(QLatin1String("^Q[A-Z3].+")); - Q_ASSERT(qtClassExpr.isValid()); + QTC_ASSERT(qtClassExpr.isValid(), /**/); const bool superIsQtClass = qtClassExpr.exactMatch(params.baseClass); if (superIsQtClass) { Core::Utils::writeIncludeFileDirective(params.baseClass, true, headerStr); diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp index d24f5a5f81d..35206c2633b 100644 --- a/src/plugins/cpptools/cppcodecompletion.cpp +++ b/src/plugins/cpptools/cppcodecompletion.cpp @@ -32,6 +32,7 @@ ***************************************************************************/ #include "cppcodecompletion.h" + #include "cppmodelmanager.h" #include <Control.h> @@ -45,6 +46,7 @@ #include <SymbolVisitor.h> #include <Scope.h> #include <TranslationUnit.h> + #include <cplusplus/ResolveExpression.h> #include <cplusplus/LookupContext.h> #include <cplusplus/Overview.h> @@ -55,6 +57,7 @@ #include <coreplugin/editormanager/editormanager.h> #include <texteditor/itexteditor.h> #include <texteditor/itexteditable.h> +#include <utils/qtcassert.h> #include <texteditor/basetexteditor.h> #include <QtCore/QDebug> @@ -540,7 +543,7 @@ bool CppCodeCompletion::completeMember(FullySpecifiedType, const QList<TypeOfExpression::Result> &results, const LookupContext &context) { - Q_ASSERT(! results.isEmpty()); + QTC_ASSERT(!results.isEmpty(), return false); QList<Symbol *> classObjectCandidates; @@ -938,7 +941,7 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item) if (m_completionOperator == T_LPAREN) { if (symbol) { Function *function = symbol->type()->asFunction(); - Q_ASSERT(function != 0); + QTC_ASSERT(function, return); m_functionArgumentWidget = new FunctionArgumentWidget(m_core); m_functionArgumentWidget->showFunctionHint(function); diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index a165614a594..71838142298 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -52,6 +52,8 @@ #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/progressmanager/progressmanager.h> +#include <utils/qtcassert.h> + #include <TranslationUnit.h> #include <Semantic.h> #include <AST.h> @@ -64,10 +66,11 @@ #include <Lexer.h> #include <Token.h> -#include <QPlainTextEdit> -#include <QMutexLocker> -#include <QTime> -#include <QDebug> +#include <QtCore/QDebug> +#include <QtCore/QMutexLocker> +#include <QtCore/QTime> + +//#include <QtGui/QPlainTextEdit> using namespace CppTools; using namespace CppTools::Internal; @@ -439,10 +442,10 @@ CppModelManager::CppModelManager(QObject *parent) : m_projectExplorer = ExtensionSystem::PluginManager::instance() ->getObject<ProjectExplorer::ProjectExplorerPlugin>(); - Q_ASSERT(m_projectExplorer); + QTC_ASSERT(m_projectExplorer, return); ProjectExplorer::SessionManager *session = m_projectExplorer->session(); - Q_ASSERT(session != 0); + QTC_ASSERT(session, return); connect(session, SIGNAL(projectAdded(ProjectExplorer::Project*)), this, SLOT(onProjectAdded(ProjectExplorer::Project*))); @@ -626,7 +629,7 @@ void CppModelManager::editorOpened(Core::IEditor *editor) { if (isCppEditor(editor)) { TextEditor::ITextEditor *textEditor = qobject_cast<TextEditor::ITextEditor *>(editor); - Q_ASSERT(textEditor != 0); + QTC_ASSERT(textEditor, return); CppEditorSupport *editorSupport = new CppEditorSupport(this); editorSupport->setTextEditor(textEditor); @@ -646,7 +649,7 @@ void CppModelManager::editorAboutToClose(Core::IEditor *editor) { if (isCppEditor(editor)) { TextEditor::ITextEditor *textEditor = qobject_cast<TextEditor::ITextEditor *>(editor); - Q_ASSERT(textEditor != 0); + QTC_ASSERT(textEditor, return); CppEditorSupport *editorSupport = m_editorSupport.value(textEditor); m_editorSupport.remove(textEditor); @@ -785,7 +788,7 @@ void CppModelManager::parse(QFutureInterface<void> &future, CppPreprocessor *preproc, QStringList files) { - Q_ASSERT(! files.isEmpty()); + QTC_ASSERT(!files.isEmpty(), return); // Change the priority of the background parser thread to idle. QThread::currentThread()->setPriority(QThread::IdlePriority); diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index 21da78fae9f..ddf21ad652e 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -34,16 +34,18 @@ #include "debuggerrunner.h" #include "debuggermanager.h" -#include "qtcassert.h" #include <projectexplorer/applicationrunconfiguration.h> #include <projectexplorer/environment.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> +#include <utils/qtcassert.h> + #include <QtCore/QDebug> #include <QtCore/QDir> #include <QtCore/QFileInfo> + #include <QtGui/QTextDocument> using namespace Debugger::Internal; @@ -76,11 +78,10 @@ QString DebuggerRunner::displayName() const RunControl* DebuggerRunner::run(RunConfigurationPtr runConfiguration, const QString &mode) { - Q_UNUSED(mode); - Q_ASSERT(mode == ProjectExplorer::Constants::DEBUGMODE); + QTC_ASSERT(mode == ProjectExplorer::Constants::DEBUGMODE, return 0); ApplicationRunConfigurationPtr rc = qSharedPointerCast<ApplicationRunConfiguration>(runConfiguration); - Q_ASSERT(rc); + QTC_ASSERT(rc, return 0); //qDebug() << "***** Debugging" << rc->name() << rc->executable(); return new DebuggerRunControl(m_manager, rc); } diff --git a/src/plugins/designer/editorwidget.cpp b/src/plugins/designer/editorwidget.cpp index 1a60dbb1715..794db9e0cb7 100644 --- a/src/plugins/designer/editorwidget.cpp +++ b/src/plugins/designer/editorwidget.cpp @@ -35,6 +35,7 @@ #include "formeditorw.h" #include <coreplugin/minisplitter.h> +#include <utils/qtcassert.h> #include <QtCore/QEvent> #include <QtGui/QVBoxLayout> @@ -54,7 +55,7 @@ SharedSubWindow::SharedSubWindow(QWidget *shared, QWidget *parent) : m_shared(shared), m_layout(new QVBoxLayout) { - Q_ASSERT(m_shared); + QTC_ASSERT(m_shared, /**/); m_layout->setContentsMargins(0, 0, 0, 0); setLayout(m_layout); } @@ -62,14 +63,14 @@ SharedSubWindow::SharedSubWindow(QWidget *shared, QWidget *parent) : void SharedSubWindow::activate() { // Take the widget off the other parent - Q_ASSERT(m_shared); + QTC_ASSERT(m_shared, return); QWidget *currentParent = m_shared->parentWidget(); if (currentParent == this) return; if (currentParent) { QVBoxLayout *lt = qobject_cast<QVBoxLayout *>(currentParent->layout()); - Q_ASSERT(lt); + QTC_ASSERT(lt, return); m_shared->setParent(0); delete lt->takeAt(0); } diff --git a/src/plugins/designer/formeditorw.cpp b/src/plugins/designer/formeditorw.cpp index a29759f0e38..01f159f991e 100644 --- a/src/plugins/designer/formeditorw.cpp +++ b/src/plugins/designer/formeditorw.cpp @@ -43,6 +43,7 @@ #include <coreplugin/uniqueidmanager.h> #include <coreplugin/actionmanager/actionmanagerinterface.h> #include <coreplugin/editormanager/editormanager.h> +#include <utils/qtcassert.h> #include <QtDesigner/QDesignerFormEditorPluginInterface> #include <QtDesigner/private/pluginmanager_p.h> @@ -169,9 +170,9 @@ FormEditorW::FormEditorW() : { if (debugFormEditor) qDebug() << Q_FUNC_INFO; - Q_ASSERT(!m_self); + QTC_ASSERT(!m_self, return); m_self = this; - Q_ASSERT(m_core); + QTC_ASSERT(m_core, return); qFill(m_designerSubWindows, m_designerSubWindows + Designer::Constants::DesignerSubWindowCount, static_cast<QWidget *>(0)); @@ -180,7 +181,7 @@ FormEditorW::FormEditorW() : m_formeditor->setSettingsManager(new SettingsManager()); m_fwm = qobject_cast<qdesigner_internal::QDesignerFormWindowManager*>(m_formeditor->formWindowManager()); - Q_ASSERT(m_fwm); + QTC_ASSERT(m_fwm, return); const int uid = m_core->uniqueIDManager()->uniqueIdentifier(QLatin1String(C_FORMEDITOR)); m_context << uid; @@ -216,7 +217,7 @@ FormEditorW::~FormEditorW() void FormEditorW::fullInit() { - Q_ASSERT(m_initStage == RegisterPlugins); + QTC_ASSERT(m_initStage == RegisterPlugins, return); QTime *initTime = 0; if (debugFormEditor) { initTime = new QTime; @@ -410,7 +411,7 @@ void FormEditorW::setupActions() createSeparator(this, am, m_context, mformtools, QLatin1String("FormEditor.Menu.Tools.Separator2")); m_actionPreview = m_fwm->actionDefaultPreview(); - Q_ASSERT(m_actionPreview); + QTC_ASSERT(m_actionPreview, return); addToolAction(m_actionPreview, am, m_context, QLatin1String("FormEditor.Preview"), mformtools, tr("Ctrl+Alt+R")); @@ -445,8 +446,8 @@ QToolBar *FormEditorW::createEditorToolBar() const Core::ActionManagerInterface *am = m_core->actionManager(); const QStringList::const_iterator cend = m_toolActionIds.constEnd(); for (QStringList::const_iterator it = m_toolActionIds.constBegin(); it != cend; ++it) { - Core::ICommand *cmd = am->command(*it); - Q_ASSERT(cmd); + Core::ICommand *cmd = am->command(*it); + QTC_ASSERT(cmd, continue); QAction *action = cmd->action(); if (!action->icon().isNull()) // Simplify grid has no action yet rc->addAction(action); @@ -591,7 +592,7 @@ void FormEditorW::currentEditorChanged(Core::IEditor *editor) // Deactivate Designer if a non-form is being edited if (editor && !qstrcmp(editor->kind(), Constants::C_FORMWINDOW)) { FormWindowEditor *fw = qobject_cast<FormWindowEditor *>(editor); - Q_ASSERT(fw); + QTC_ASSERT(fw, return); fw->activate(); m_fwm->setActiveFormWindow(fw->formWindow()); } else { diff --git a/src/plugins/find/basetextfind.cpp b/src/plugins/find/basetextfind.cpp index 53578792d70..d6a2e9997e8 100644 --- a/src/plugins/find/basetextfind.cpp +++ b/src/plugins/find/basetextfind.cpp @@ -33,6 +33,8 @@ #include "basetextfind.h" +#include <utils/qtcassert.h> + #include <QtGui/QTextBlock> using namespace Find; @@ -49,26 +51,26 @@ BaseTextFind::BaseTextFind(QPlainTextEdit *editor) QTextCursor BaseTextFind::textCursor() const { - Q_ASSERT(m_editor || m_plaineditor); + QTC_ASSERT(m_editor || m_plaineditor, return QTextCursor()); return m_editor ? m_editor->textCursor() : m_plaineditor->textCursor(); } void BaseTextFind::setTextCursor(const QTextCursor& cursor) { - Q_ASSERT(m_editor || m_plaineditor); + QTC_ASSERT(m_editor || m_plaineditor, return); m_editor ? m_editor->setTextCursor(cursor) : m_plaineditor->setTextCursor(cursor); } QTextDocument *BaseTextFind::document() const { - Q_ASSERT(m_editor || m_plaineditor); + QTC_ASSERT(m_editor || m_plaineditor, return 0); return m_editor ? m_editor->document() : m_plaineditor->document(); } bool BaseTextFind::isReadOnly() const { - Q_ASSERT(m_editor || m_plaineditor); + QTC_ASSERT(m_editor || m_plaineditor, return true); return m_editor ? m_editor->isReadOnly() : m_plaineditor->isReadOnly(); } diff --git a/src/plugins/find/currentdocumentfind.cpp b/src/plugins/find/currentdocumentfind.cpp index 091c307d3d0..59d05919cf8 100644 --- a/src/plugins/find/currentdocumentfind.cpp +++ b/src/plugins/find/currentdocumentfind.cpp @@ -36,16 +36,17 @@ #include <aggregation/aggregate.h> #include <coreplugin/coreconstants.h> #include <coreplugin/modemanager.h> +#include <utils/qtcassert.h> +#include <QtCore/QDebug> #include <QtGui/QApplication> -#include <QtDebug> using namespace Core; using namespace Find; using namespace Find::Internal; CurrentDocumentFind::CurrentDocumentFind(ICore *core) - : m_core(core), m_currentFind(0) + : m_core(core), m_currentFind(0) { connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)), this, SLOT(updateCurrentFindFilter(QWidget*,QWidget*))); @@ -59,16 +60,14 @@ void CurrentDocumentFind::removeConnections() void CurrentDocumentFind::resetIncrementalSearch() { - Q_ASSERT(m_currentFind); - if (m_currentFind) - m_currentFind->resetIncrementalSearch(); + QTC_ASSERT(m_currentFind, return); + m_currentFind->resetIncrementalSearch(); } void CurrentDocumentFind::clearResults() { - Q_ASSERT(m_currentFind); - if (m_currentFind) - m_currentFind->clearResults(); + QTC_ASSERT(m_currentFind, return); + m_currentFind->clearResults(); } bool CurrentDocumentFind::isEnabled() const @@ -78,67 +77,64 @@ bool CurrentDocumentFind::isEnabled() const bool CurrentDocumentFind::supportsReplace() const { - Q_ASSERT(m_currentFind); - return m_currentFind ? m_currentFind->supportsReplace() : false; + QTC_ASSERT(m_currentFind, return false); + return m_currentFind->supportsReplace(); } QString CurrentDocumentFind::currentFindString() const { - Q_ASSERT(m_currentFind); - return m_currentFind ? m_currentFind->currentFindString() : QString(); + QTC_ASSERT(m_currentFind, return QString()); + return m_currentFind->currentFindString(); } QString CurrentDocumentFind::completedFindString() const { - Q_ASSERT(m_currentFind); - return m_currentFind ? m_currentFind->completedFindString() : QString(); + QTC_ASSERT(m_currentFind, return QString()); + return m_currentFind->completedFindString(); } void CurrentDocumentFind::highlightAll(const QString &txt, QTextDocument::FindFlags findFlags) { - Q_ASSERT(m_currentFind); - if (m_currentFind) - m_currentFind->highlightAll(txt, findFlags); + QTC_ASSERT(m_currentFind, return); + m_currentFind->highlightAll(txt, findFlags); } bool CurrentDocumentFind::findIncremental(const QString &txt, QTextDocument::FindFlags findFlags) { - Q_ASSERT(m_currentFind); - return (m_currentFind? m_currentFind->findIncremental(txt, findFlags) : false); + QTC_ASSERT(m_currentFind, return false); + return m_currentFind->findIncremental(txt, findFlags); } bool CurrentDocumentFind::findStep(const QString &txt, QTextDocument::FindFlags findFlags) { - Q_ASSERT(m_currentFind); - return (m_currentFind? m_currentFind->findStep(txt, findFlags) : false); + QTC_ASSERT(m_currentFind, return false); + return m_currentFind->findStep(txt, findFlags); } bool CurrentDocumentFind::replaceStep(const QString &before, const QString &after, QTextDocument::FindFlags findFlags) { - Q_ASSERT(m_currentFind); - return (m_currentFind? m_currentFind->replaceStep(before, after, findFlags) : false); + QTC_ASSERT(m_currentFind, return false); + return m_currentFind->replaceStep(before, after, findFlags); } int CurrentDocumentFind::replaceAll(const QString &before, const QString &after, QTextDocument::FindFlags findFlags) { - Q_ASSERT(m_currentFind); - return (m_currentFind? m_currentFind->replaceAll(before, after, findFlags) : 0); + QTC_ASSERT(m_currentFind, return 0); + return m_currentFind->replaceAll(before, after, findFlags); } void CurrentDocumentFind::defineFindScope() { - Q_ASSERT(m_currentFind); - if (m_currentFind) - m_currentFind->defineFindScope(); + QTC_ASSERT(m_currentFind, return); + m_currentFind->defineFindScope(); } void CurrentDocumentFind::clearFindScope() { - Q_ASSERT(m_currentFind); - if (m_currentFind) - m_currentFind->clearFindScope(); + QTC_ASSERT(m_currentFind, return); + m_currentFind->clearFindScope(); } void CurrentDocumentFind::updateCurrentFindFilter(QWidget *old, QWidget *now) diff --git a/src/plugins/find/findplugin.cpp b/src/plugins/find/findplugin.cpp index 344ee578e5b..766c435a503 100644 --- a/src/plugins/find/findplugin.cpp +++ b/src/plugins/find/findplugin.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "findplugin.h" #include "textfindconstants.h" @@ -42,6 +43,8 @@ #include <coreplugin/actionmanager/icommand.h> #include <coreplugin/coreconstants.h> +#include <utils/qtcassert.h> + #include <QtCore/qplugin.h> #include <QtCore/QSettings> @@ -102,24 +105,18 @@ void FindPlugin::filterChanged() { IFindFilter *changedFilter = qobject_cast<IFindFilter *>(sender()); QAction *action = m_filterActions.value(changedFilter); - Q_ASSERT(changedFilter); - Q_ASSERT(action); - if (!changedFilter || !action) - return; + QTC_ASSERT(changedFilter, return); + QTC_ASSERT(action, return); action->setEnabled(changedFilter->isEnabled()); } void FindPlugin::openFindFilter() { QAction *action = qobject_cast<QAction*>(sender()); - Q_ASSERT(action); - if (!action) - return; + QTC_ASSERT(action, return); IFindFilter *filter = action->data().value<IFindFilter *>(); - Q_ASSERT(filter); - Q_ASSERT(filter->isEnabled()); - if (!filter || !filter->isEnabled()) - return; + QTC_ASSERT(filter, return); + QTC_ASSERT(filter->isEnabled(), return); QString currentFindString = (m_currentDocumentFind->isEnabled() ? m_currentDocumentFind->currentFindString() : ""); if (!currentFindString.isEmpty()) m_findDialog->setFindText(currentFindString); diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index a1668e60ceb..ff0cdbde5e4 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -32,36 +32,38 @@ ***************************************************************************/ #include "gitclient.h" -#include "gitplugin.h" -#include "gitconstants.h" + #include "commitdata.h" +#include "gitconstants.h" +#include "gitplugin.h" #include "gitsubmiteditor.h" -#include <coreplugin/icore.h> -#include <coreplugin/coreconstants.h> -#include <coreplugin/messagemanager.h> -#include <coreplugin/uniqueidmanager.h> #include <coreplugin/actionmanager/actionmanagerinterface.h> +#include <coreplugin/coreconstants.h> #include <coreplugin/editormanager/editormanager.h> +#include <coreplugin/icore.h> +#include <coreplugin/messagemanager.h> #include <coreplugin/progressmanager/progressmanagerinterface.h> -#include <vcsbase/vcsbaseeditor.h> +#include <coreplugin/uniqueidmanager.h> #include <texteditor/itexteditor.h> +#include <utils/qtcassert.h> +#include <vcsbase/vcsbaseeditor.h> +#include <QtCore/QFuture> #include <QtCore/QRegExp> #include <QtCore/QTemporaryFile> -#include <QtCore/QFuture> #include <QtCore/QTime> -#include <QtGui/QMessageBox> #include <QtGui/QMainWindow> // for msg box parent +#include <QtGui/QMessageBox> #include <QtGui/QPushButton> using namespace Git; using namespace Git::Internal; -const char* const kGitCommand = "git"; -const char* const kGitDirectoryC = ".git"; -const char* const kBranchIndicatorC = "# On branch"; +const char *const kGitCommand = "git"; +const char *const kGitDirectoryC = ".git"; +const char *const kBranchIndicatorC = "# On branch"; enum { untrackedFilesInCommit = 0 }; @@ -169,14 +171,14 @@ VCSBase::VCSBaseEditor // Exists already outputEditor->createNew(m_msgWait); rc = VCSBase::VCSBaseEditor::getVcsBaseEditor(outputEditor); - Q_ASSERT(rc); + QTC_ASSERT(rc, return 0); m_core->editorManager()->setCurrentEditor(outputEditor); } else { // Create new, set wait message, set up with source and codec outputEditor = m_core->editorManager()->newFile(kind, &title, m_msgWait); outputEditor->setProperty(registerDynamicProperty, dynamicPropertyValue); rc = VCSBase::VCSBaseEditor::getVcsBaseEditor(outputEditor); - Q_ASSERT(rc); + QTC_ASSERT(rc, return 0); rc->setSource(source); if (setSourceCodec) rc->setCodec(VCSBase::VCSBaseEditor::getCodec(m_core, source)); @@ -394,11 +396,10 @@ void GitClient::executeGit(const QString &workingDirectory, const QStringList &a GitCommand* command = new GitCommand(); if (outputToWindow) { - Q_ASSERT(outputWindow); connect(command, SIGNAL(outputText(QString)), outputWindow, SLOT(append(QString))); connect(command, SIGNAL(outputData(QByteArray)), outputWindow, SLOT(appendData(QByteArray))); } else { - Q_ASSERT(editor); + QTC_ASSERT(editor, /**/); connect(command, SIGNAL(outputText(QString)), editor, SLOT(setPlainText(QString))); connect(command, SIGNAL(outputData(QByteArray)), editor, SLOT(setPlainTextData(QByteArray))); } @@ -515,7 +516,7 @@ static bool parseFiles(const QString &output, CommitData *d) State s = None; // Match added/changed-not-updated files: "#<tab>modified: foo.cpp" QRegExp filesPattern(QLatin1String("#\\t[^:]+:\\s+.+")); - Q_ASSERT(filesPattern.isValid()); + QTC_ASSERT(filesPattern.isValid(), return false); const QStringList::const_iterator cend = lines.constEnd(); for (QStringList::const_iterator it = lines.constBegin(); it != cend; ++it) { @@ -533,7 +534,7 @@ static bool parseFiles(const QString &output, CommitData *d) // Now match untracked: "#<tab>foo.cpp" s = UntrackedFiles; filesPattern = QRegExp(QLatin1String("#\\t.+")); - Q_ASSERT(filesPattern.isValid()); + QTC_ASSERT(filesPattern.isValid(), return false); } else { if (filesPattern.exactMatch(line)) { const QString fileSpec = line.mid(2).trimmed(); diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp index 733a6abc0d5..a92e14eea19 100644 --- a/src/plugins/git/giteditor.cpp +++ b/src/plugins/git/giteditor.cpp @@ -32,22 +32,25 @@ ***************************************************************************/ #include "giteditor.h" + #include "annotationhighlighter.h" +#include "gitclient.h" #include "gitconstants.h" #include "gitplugin.h" -#include "gitclient.h" -#include <vcsbase/diffhighlighter.h> #include <coreplugin/editormanager/editormanager.h> +#include <utils/qtcassert.h> +#include <vcsbase/diffhighlighter.h> -#include <QtCore/QFileInfo> -#include <QtCore/QTextStream> -#include <QtCore/QSet> -#include <QtCore/QRegExp> -#include <QtCore/QDir> #include <QtCore/QDebug> -#include <QtGui/QTextEdit> +#include <QtCore/QDir> +#include <QtCore/QFileInfo> +#include <QtCore/QRegExp> +#include <QtCore/QSet> +#include <QtCore/QTextStream> + #include <QtGui/QTextCursor> +#include <QtGui/QTextEdit> #define CHANGE_PATTERN_8C "[a-f0-9]{8,8}" #define CHANGE_PATTERN_40C "[a-f0-9]{40,40}" @@ -62,8 +65,8 @@ GitEditor::GitEditor(const VCSBase::VCSBaseEditorParameters *type, m_changeNumberPattern8(QLatin1String(CHANGE_PATTERN_8C)), m_changeNumberPattern40(QLatin1String(CHANGE_PATTERN_40C)) { - Q_ASSERT(m_changeNumberPattern8.isValid()); - Q_ASSERT(m_changeNumberPattern40.isValid()); + QTC_ASSERT(m_changeNumberPattern8.isValid(), return); + QTC_ASSERT(m_changeNumberPattern40.isValid(), return); if (Git::Constants::debug) qDebug() << "GitEditor::GitEditor" << type->type << type->kind; } @@ -76,11 +79,11 @@ QSet<QString> GitEditor::annotationChanges() const return changes; // Hunt for first change number in annotation: "<change>:" QRegExp r(QLatin1String("^("CHANGE_PATTERN_8C") ")); - Q_ASSERT(r.isValid()); + QTC_ASSERT(r.isValid(), return changes); if (r.indexIn(txt) != -1) { changes.insert(r.cap(1)); r.setPattern(QLatin1String("\n("CHANGE_PATTERN_8C") ")); - Q_ASSERT(r.isValid()); + QTC_ASSERT(r.isValid(), return changes); int pos = 0; while ((pos = r.indexIn(txt, pos)) != -1) { pos += r.matchedLength(); diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index ec67478a259..d9187f542a9 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -32,13 +32,14 @@ ***************************************************************************/ #include "gitplugin.h" -#include "gitclient.h" -#include "gitversioncontrol.h" -#include "giteditor.h" -#include "gitconstants.h" + #include "changeselectiondialog.h" -#include "gitsubmiteditor.h" #include "commitdata.h" +#include "gitclient.h" +#include "gitconstants.h" +#include "giteditor.h" +#include "gitsubmiteditor.h" +#include "gitversioncontrol.h" #include <coreplugin/icore.h> #include <coreplugin/coreconstants.h> @@ -47,20 +48,24 @@ #include <coreplugin/uniqueidmanager.h> #include <coreplugin/actionmanager/actionmanagerinterface.h> #include <coreplugin/editormanager/editormanager.h> + +#include <utils/qtcassert.h> + #include <vcsbase/basevcseditorfactory.h> #include <vcsbase/vcsbaseeditor.h> #include <vcsbase/basevcssubmiteditorfactory.h> #include <QtCore/qplugin.h> #include <QtCore/QDebug> +#include <QtCore/QDir> #include <QtCore/QFileInfo> #include <QtCore/QTemporaryFile> -#include <QtCore/QDir> + #include <QtGui/QAction> +#include <QtGui/QFileDialog> +#include <QtGui/QMainWindow> #include <QtGui/QMenu> #include <QtGui/QMessageBox> -#include <QtGui/QMainWindow> -#include <QtGui/QFileDialog> static const VCSBase::VCSBaseEditorParameters editorParameters[] = { { @@ -142,7 +147,6 @@ GitPlugin::GitPlugin() : m_versionControl(0), m_changeTmpFile(0) { - Q_ASSERT(m_instance == 0); m_instance = this; } @@ -212,10 +216,10 @@ static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = { Git::Constants::DIFF_SELECTED }; -static inline Core::ICommand *createSeparator(Core::ActionManagerInterface *am, - const QList<int> &context, - const QString &id, - QObject *parent) +static Core::ICommand *createSeparator(Core::ActionManagerInterface *am, + const QList<int> &context, + const QString &id, + QObject *parent) { QAction *a = new QAction(parent); a->setSeparator(true); @@ -627,7 +631,7 @@ Core::IEditor *GitPlugin::openSubmitEditor(const QString &fileName, const Commit qDebug() << Q_FUNC_INFO << fileName << editor; m_core->editorManager()->ensureEditorManagerVisible(); GitSubmitEditor *submitEditor = qobject_cast<GitSubmitEditor*>(editor); - Q_ASSERT(submitEditor); + QTC_ASSERT(submitEditor, return 0); // The actions are for some reason enabled by the context switching // mechanism. Disable them correctly. m_submitCurrentAction->setEnabled(!cd.stagedFiles.empty()); diff --git a/src/plugins/help/helpfindsupport.cpp b/src/plugins/help/helpfindsupport.cpp index 83ec2d1570d..a26032ec2f5 100644 --- a/src/plugins/help/helpfindsupport.cpp +++ b/src/plugins/help/helpfindsupport.cpp @@ -34,6 +34,8 @@ #include "helpfindsupport.h" #include "helpviewer.h" +#include <utils/qtcassert.h> + using namespace Help::Internal; HelpFindSupport::HelpFindSupport(CentralWidget *centralWidget) @@ -52,8 +54,8 @@ bool HelpFindSupport::isEnabled() const QString HelpFindSupport::currentFindString() const { - Q_ASSERT(m_centralWidget); - HelpViewer* viewer = m_centralWidget->currentHelpViewer(); + QTC_ASSERT(m_centralWidget, return QString()); + HelpViewer *viewer = m_centralWidget->currentHelpViewer(); if (!viewer) return QString(); #if !defined(QT_NO_WEBKIT) @@ -70,13 +72,13 @@ QString HelpFindSupport::completedFindString() const bool HelpFindSupport::findIncremental(const QString &txt, QTextDocument::FindFlags findFlags) { - Q_ASSERT(m_centralWidget); + QTC_ASSERT(m_centralWidget, return false); findFlags &= ~QTextDocument::FindBackward; return m_centralWidget->find(txt, findFlags, true); } bool HelpFindSupport::findStep(const QString &txt, QTextDocument::FindFlags findFlags) { - Q_ASSERT(m_centralWidget); + QTC_ASSERT(m_centralWidget, return false); return m_centralWidget->find(txt, findFlags, false); } diff --git a/src/plugins/perforce/perforceeditor.cpp b/src/plugins/perforce/perforceeditor.cpp index 8eda71843f4..845f8b0f74d 100644 --- a/src/plugins/perforce/perforceeditor.cpp +++ b/src/plugins/perforce/perforceeditor.cpp @@ -32,26 +32,28 @@ ***************************************************************************/ #include "perforceeditor.h" + #include "annotationhighlighter.h" -#include "perforceplugin.h" #include "perforceconstants.h" #include "perforceplugin.h" -#include <vcsbase/diffhighlighter.h> #include <coreplugin/editormanager/editormanager.h> +#include <utils/qtcassert.h> +#include <vcsbase/diffhighlighter.h> -#include <QtCore/QFileInfo> -#include <QtCore/QTextStream> -#include <QtCore/QSet> -#include <QtCore/QRegExp> #include <QtCore/QDebug> +#include <QtCore/QFileInfo> +#include <QtCore/QProcess> +#include <QtCore/QRegExp> +#include <QtCore/QSet> +#include <QtCore/QTextStream> + +#include <QtGui/QAction> #include <QtGui/QKeyEvent> #include <QtGui/QLayout> -#include <QtGui/QTextEdit> #include <QtGui/QMenu> -#include <QtGui/QAction> #include <QtGui/QTextCursor> -#include <QtCore/QProcess> +#include <QtGui/QTextEdit> namespace Perforce { namespace Internal { @@ -63,7 +65,7 @@ PerforceEditor::PerforceEditor(const VCSBase::VCSBaseEditorParameters *type, m_changeNumberPattern(QLatin1String("^\\d+$")), m_plugin(PerforcePlugin::perforcePluginInstance()) { - Q_ASSERT(m_changeNumberPattern.isValid()); + QTC_ASSERT(m_changeNumberPattern.isValid(), /**/); if (Perforce::Constants::debug) qDebug() << "PerforceEditor::PerforceEditor" << type->type << type->kind; } @@ -76,11 +78,11 @@ QSet<QString> PerforceEditor::annotationChanges() const return changes; // Hunt for first change number in annotation: "<change>:" QRegExp r(QLatin1String("^(\\d+):")); - Q_ASSERT(r.isValid()); + QTC_ASSERT(r.isValid(), return changes); if (r.indexIn(txt) != -1) { changes.insert(r.cap(1)); r.setPattern(QLatin1String("\n(\\d+):")); - Q_ASSERT(r.isValid()); + QTC_ASSERT(r.isValid(), return changes); int pos = 0; while ((pos = r.indexIn(txt, pos)) != -1) { pos += r.matchedLength(); diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index b1f4494ce5e..c609c35bf0e 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -31,25 +31,27 @@ ** ***************************************************************************/ -#include "p4.h" #include "perforceplugin.h" -#include "perforceoutputwindow.h" -#include "settingspage.h" -#include "perforcesubmiteditor.h" -#include "changenumberdialog.h" -#include "perforceconstants.h" -#include "perforceversioncontrol.h" -#include "perforceeditor.h" -#include "pendingchangesdialog.h" -#include <coreplugin/icore.h> -#include <coreplugin/coreconstants.h> -#include <coreplugin/mimedatabase.h> -#include <coreplugin/filemanager.h> -#include <coreplugin/messagemanager.h> -#include <coreplugin/uniqueidmanager.h> +#include "changenumberdialog.h" +#include "p4.h" +#include "pendingchangesdialog.h" +#include "perforceconstants.h" +#include "perforceeditor.h" +#include "perforceoutputwindow.h" +#include "perforcesubmiteditor.h" +#include "perforceversioncontrol.h" +#include "settingspage.h" + #include <coreplugin/actionmanager/actionmanagerinterface.h> +#include <coreplugin/coreconstants.h> #include <coreplugin/editormanager/editormanager.h> +#include <coreplugin/filemanager.h> +#include <coreplugin/icore.h> +#include <coreplugin/messagemanager.h> +#include <coreplugin/mimedatabase.h> +#include <coreplugin/uniqueidmanager.h> +#include <utils/qtcassert.h> #include <utils/synchronousprocess.h> #include <vcsbase/basevcseditorfactory.h> #include <vcsbase/basevcssubmiteditorfactory.h> @@ -57,16 +59,17 @@ #include <QtCore/qplugin.h> #include <QtCore/QDebug> -#include <QtCore/QFileInfo> -#include <QtCore/QTemporaryFile> #include <QtCore/QDir> +#include <QtCore/QFileInfo> #include <QtCore/QSettings> +#include <QtCore/QTemporaryFile> #include <QtCore/QTextCodec> + #include <QtGui/QAction> +#include <QtGui/QFileDialog> +#include <QtGui/QMainWindow> #include <QtGui/QMenu> #include <QtGui/QMessageBox> -#include <QtGui/QMainWindow> -#include <QtGui/QFileDialog> using namespace Perforce::Internal; @@ -420,7 +423,7 @@ void PerforcePlugin::deleteCurrentFile() void PerforcePlugin::revertCurrentFile() { - Q_ASSERT(m_coreInstance); + QTC_ASSERT(m_coreInstance, return); const QString fileName = currentFileName(); QTextCodec *codec = VCSBase::VCSBaseEditor::getCodec(m_coreInstance, fileName); @@ -460,7 +463,7 @@ void PerforcePlugin::diffCurrentFile() void PerforcePlugin::diffCurrentProject() { - Q_ASSERT(m_projectExplorer); + QTC_ASSERT(m_projectExplorer, return); QStringList files; QString name; ProjectExplorer::Project *currentProject = m_projectExplorer->currentProject(); @@ -502,7 +505,8 @@ void PerforcePlugin::resolve() void PerforcePlugin::submit() { - Q_ASSERT(m_coreInstance); + QTC_ASSERT(m_coreInstance, return); + if (!checkP4Command()) { showOutput(tr("No p4 executable specified!")); return; @@ -534,7 +538,7 @@ void PerforcePlugin::submit() m_changeTmpFile->seek(0); // Assemble file list of project - Q_ASSERT(m_projectExplorer); + QTC_ASSERT(m_projectExplorer, return); QStringList files; QString name; ProjectExplorer::Project *currentProject = m_projectExplorer->currentProject(); @@ -581,7 +585,7 @@ Core::IEditor *PerforcePlugin::openPerforceSubmitEditor(const QString &fileName, m_coreInstance->editorManager()->openEditor(fileName, Constants::PERFORCESUBMITEDITOR_KIND); m_coreInstance->editorManager()->ensureEditorManagerVisible(); PerforceSubmitEditor *submitEditor = dynamic_cast<PerforceSubmitEditor*>(editor); - Q_ASSERT(submitEditor); + QTC_ASSERT(submitEditor, return 0); submitEditor->restrictToProjectFiles(depotFileNames); connect(submitEditor, SIGNAL(diffSelectedFiles(QStringList)), this, SLOT(slotDiff(QStringList))); // The actions are for some reason enabled by the context switching @@ -735,7 +739,7 @@ QString PerforcePlugin::findTopLevelForDirectory(const QString & /* dir */) cons return QString::null; QRegExp regExp(QLatin1String("(\\n|\\r\\n|\\r)Root:\\s*(.*)(\\n|\\r\\n|\\r)")); - Q_ASSERT(regExp.isValid()); + QTC_ASSERT(regExp.isValid(), /**/); regExp.setMinimal(true); if (regExp.indexIn(result.stdOut) != -1) { QString file = regExp.cap(2).trimmed(); @@ -784,7 +788,7 @@ PerforceResponse PerforcePlugin::runP4Cmd(const QStringList &args, qDebug() << "PerforcePlugin::runP4Cmd" << args << extraArgs << debugCodec(outputCodec); PerforceResponse response; response.error = true; - Q_ASSERT(m_coreInstance); + QTC_ASSERT(m_coreInstance, return response); if (!checkP4Command()) { response.message = tr("No p4 executable specified!"); m_perforceOutputWindow->append(response.message, true); @@ -874,7 +878,7 @@ Core::IEditor * PerforcePlugin::showOutputInEditor(const QString& title, const Q int editorType, QTextCodec *codec) { const VCSBase::VCSBaseEditorParameters *params = findType(editorType); - Q_ASSERT(params); + QTC_ASSERT(params, return 0); const QString kind = QLatin1String(params->kind); if (Perforce::Constants::debug) qDebug() << "PerforcePlugin::showOutputInEditor" << title << kind << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec); @@ -1047,10 +1051,9 @@ void PerforcePlugin::openFiles(const QStringList &files) QString PerforcePlugin::clientFilePath(const QString &serverFilePath) { - QString path; - Q_ASSERT(m_coreInstance); + QTC_ASSERT(m_coreInstance, return QString()); if (!checkP4Command()) - return path; + return QString(); QApplication::setOverrideCursor(Qt::WaitCursor); QProcess proc; @@ -1058,6 +1061,7 @@ QString PerforcePlugin::clientFilePath(const QString &serverFilePath) proc.start(m_settings.p4Command, basicP4Args() << QLatin1String("fstat") << serverFilePath); + QString path; if (proc.waitForFinished(3000)) { QString output = QString::fromUtf8(proc.readAllStandardOutput()); if (!output.isEmpty()) { @@ -1284,5 +1288,17 @@ QString PerforcePlugin::fileNameFromPerforceName(const QString& perforceName, return rc; } +Core::ICore *PerforcePlugin::coreInstance() +{ + QTC_ASSERT(m_coreInstance, return 0); + return m_coreInstance; +} + +PerforcePlugin *PerforcePlugin::perforcePluginInstance() +{ + QTC_ASSERT(m_perforcePluginInstance, return 0); + return m_perforcePluginInstance; +} + Q_EXPORT_PLUGIN(PerforcePlugin) diff --git a/src/plugins/perforce/perforceplugin.h b/src/plugins/perforce/perforceplugin.h index 7a4e2307779..11301853b9d 100644 --- a/src/plugins/perforce/perforceplugin.h +++ b/src/plugins/perforce/perforceplugin.h @@ -100,7 +100,7 @@ public: ~PerforcePlugin(); QStringList basicP4Args() const; - inline SettingsPage *settingsPage() const { return m_settingsPage; } + SettingsPage *settingsPage() const { return m_settingsPage; } bool initialize(const QStringList &arguments, QString *error_message); void extensionsInitialized(); @@ -117,8 +117,8 @@ public: Core::IEditor *openPerforceSubmitEditor(const QString &fileName, const QStringList &depotFileNames); - static Core::ICore *coreInstance() {Q_ASSERT(m_coreInstance); return m_coreInstance;} - static PerforcePlugin *perforcePluginInstance() {Q_ASSERT(m_perforcePluginInstance); return m_perforcePluginInstance;} + static Core::ICore *coreInstance(); + static PerforcePlugin *perforcePluginInstance(); PerforceSettings settings() const; void setSettings(const PerforceSettings &s); diff --git a/src/plugins/perforce/perforcesubmiteditor.cpp b/src/plugins/perforce/perforcesubmiteditor.cpp index 4dc41e7fa5e..035ffe24621 100644 --- a/src/plugins/perforce/perforcesubmiteditor.cpp +++ b/src/plugins/perforce/perforcesubmiteditor.cpp @@ -36,6 +36,8 @@ #include "perforceplugin.h" #include "perforceconstants.h" +#include <utils/qtcassert.h> + #include <QtCore/QDebug> namespace Perforce { @@ -153,7 +155,7 @@ void PerforceSubmitEditor::updateFields() lines.removeLast(); // that is the empty line at the end const QRegExp leadingTabPattern = QRegExp(QLatin1String("^\\t")); - Q_ASSERT(leadingTabPattern.isValid()); + QTC_ASSERT(leadingTabPattern.isValid(), /**/); lines.replaceInStrings(leadingTabPattern, QString()); widget->setDescriptionText(lines.join(newLine)); diff --git a/src/plugins/projectexplorer/allprojectsfind.cpp b/src/plugins/projectexplorer/allprojectsfind.cpp index be7d9d96ee4..a7832ca6796 100644 --- a/src/plugins/projectexplorer/allprojectsfind.cpp +++ b/src/plugins/projectexplorer/allprojectsfind.cpp @@ -32,10 +32,13 @@ ***************************************************************************/ #include "allprojectsfind.h" -#include "projectexplorer.h" -#include "project.h" -#include <QtDebug> +#include "project.h" +#include "projectexplorer.h" + +#include <utils/qtcassert.h> + +#include <QtCore/QDebug> #include <QtCore/QRegExp> #include <QtGui/QGridLayout> @@ -71,9 +74,7 @@ QKeySequence AllProjectsFind::defaultShortcut() const QStringList AllProjectsFind::files() { - Q_ASSERT(m_plugin->session()); - if (!m_plugin->session()) - return QStringList(); + QTC_ASSERT(m_plugin->session(), return QStringList()); QList<QRegExp> filterRegs; QStringList nameFilters = fileNameFilters(); foreach (const QString &filter, nameFilters) { diff --git a/src/plugins/projectexplorer/applicationrunconfiguration.cpp b/src/plugins/projectexplorer/applicationrunconfiguration.cpp index 30b9a7f7caa..88bbd641164 100644 --- a/src/plugins/projectexplorer/applicationrunconfiguration.cpp +++ b/src/plugins/projectexplorer/applicationrunconfiguration.cpp @@ -36,6 +36,7 @@ #include "environment.h" #include <projectexplorer/projectexplorerconstants.h> +#include <utils/qtcassert.h> #include <QtGui/QLabel> #include <QtGui/QTextDocument> @@ -94,8 +95,8 @@ QString ApplicationRunConfigurationRunner::displayName() const RunControl* ApplicationRunConfigurationRunner::run(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode) { QSharedPointer<ApplicationRunConfiguration> rc = qSharedPointerCast<ApplicationRunConfiguration>(runConfiguration); - Q_ASSERT(rc); - Q_ASSERT(mode == ProjectExplorer::Constants::RUNMODE); + QTC_ASSERT(rc, return 0); + QTC_ASSERT(mode == ProjectExplorer::Constants::RUNMODE, return 0); ApplicationRunControl *runControl = new ApplicationRunControl(rc); return runControl; @@ -112,10 +113,10 @@ QWidget *ApplicationRunConfigurationRunner::configurationWidget(QSharedPointer<R ApplicationRunControl::ApplicationRunControl(QSharedPointer<ApplicationRunConfiguration> runConfiguration) : RunControl(runConfiguration), m_applicationLauncher() { - connect(&m_applicationLauncher, SIGNAL(applicationError(const QString &)), - this, SLOT(slotError(const QString &))); - connect(&m_applicationLauncher, SIGNAL(appendOutput(const QString &)), - this, SLOT(slotAddToOutputWindow(const QString &))); + connect(&m_applicationLauncher, SIGNAL(applicationError(QString)), + this, SLOT(slotError(QString))); + connect(&m_applicationLauncher, SIGNAL(appendOutput(QString)), + this, SLOT(slotAddToOutputWindow(QString))); connect(&m_applicationLauncher, SIGNAL(processExited(int)), this, SLOT(processExited(int))); connect(&m_applicationLauncher, SIGNAL(bringToForegroundRequested(qint64)), @@ -129,7 +130,7 @@ ApplicationRunControl::~ApplicationRunControl() void ApplicationRunControl::start() { QSharedPointer<ApplicationRunConfiguration> rc = qSharedPointerCast<ApplicationRunConfiguration>(runConfiguration()); - Q_ASSERT(rc); + QTC_ASSERT(rc, return); m_applicationLauncher.setEnvironment(rc->environment().toStringList()); m_applicationLauncher.setWorkingDirectory(rc->workingDirectory()); diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index 98002f88270..c6f386fa413 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -32,16 +32,18 @@ ***************************************************************************/ #include "buildmanager.h" + +#include "buildprogress.h" #include "buildstep.h" #include "compileoutputwindow.h" -#include "taskwindow.h" -#include "projectexplorer.h" #include "projectexplorerconstants.h" -#include "buildprogress.h" +#include "projectexplorer.h" +#include "taskwindow.h" -#include <extensionsystem/pluginmanager.h> #include <coreplugin/progressmanager/progressmanagerinterface.h> #include <coreplugin/progressmanager/futureprogress.h> +#include <extensionsystem/pluginmanager.h> +#include <utils/qtcassert.h> #include <QtCore/QDir> #include <QtCore/QTimer> @@ -300,7 +302,7 @@ void BuildManager::buildQueueAppend(BuildStep * bs, const QString &configuration void BuildManager::buildProjects(const QList<Project *> &projects, const QList<QString> &configurations) { - Q_ASSERT(projects.count() == configurations.count()); + QTC_ASSERT(projects.count() == configurations.count(), /**/); QList<QString>::const_iterator cit = configurations.constBegin(); QList<Project *>::const_iterator it, end; end = projects.constEnd(); @@ -316,7 +318,7 @@ void BuildManager::buildProjects(const QList<Project *> &projects, const QList<Q void BuildManager::cleanProjects(const QList<Project *> &projects, const QList<QString> &configurations) { - Q_ASSERT(projects.count() == configurations.count()); + QTC_ASSERT(projects.count() == configurations.count(), /**/); QList<QString>::const_iterator cit = configurations.constBegin(); QList<Project *>::const_iterator it, end; end = projects.constEnd(); @@ -376,7 +378,7 @@ void BuildManager::decrementActiveBuildSteps(Project *pro) QHash<Project *, int>::iterator it = m_activeBuildSteps.find(pro); QHash<Project *, int>::iterator end = m_activeBuildSteps.end(); if (it == end) { - Q_ASSERT(false && "BuildManager m_activeBuildSteps says project is not building, but apparently a build step was still in the queue."); + QTC_ASSERT(false && "BuildManager m_activeBuildSteps says project is not building, but apparently a build step was still in the queue.", return); } else if (*it == 1) { --*it; emit buildStateChanged(pro); diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index 5367b50812d..ef1dec4d2cb 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -34,6 +34,8 @@ #include "buildstep.h" #include "buildconfiguration.h" +#include <utils/qtcassert.h> + namespace ProjectExplorer { BuildStep::BuildStep(Project * pro) @@ -78,7 +80,7 @@ void BuildStep::copyBuildConfiguration(const QString &source, const QString &des void BuildStep::setValue(const QString &buildConfiguration, const QString &name, const QVariant &value) { BuildConfiguration *bc = getBuildConfiguration(buildConfiguration); - Q_ASSERT(bc); + QTC_ASSERT(bc, return); bc->setValue(name, value); } diff --git a/src/plugins/projectexplorer/buildstepspage.cpp b/src/plugins/projectexplorer/buildstepspage.cpp index 84f23c46bbf..a0e103ebca5 100644 --- a/src/plugins/projectexplorer/buildstepspage.cpp +++ b/src/plugins/projectexplorer/buildstepspage.cpp @@ -32,10 +32,12 @@ ***************************************************************************/ #include "buildstepspage.h" + #include "ui_buildstepspage.h" #include "project.h" #include <extensionsystem/pluginmanager.h> +#include <utils/qtcassert.h> using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; @@ -121,15 +123,14 @@ void BuildStepsPage::updateBuildStepWidget(QTreeWidgetItem *newItem, QTreeWidget { if (oldItem == newItem) return; - Q_ASSERT(m_pro); + QTC_ASSERT(m_pro, return); if (newItem) { int row = m_ui->buildSettingsList->indexOfTopLevelItem(newItem); m_ui->buildSettingsWidget->setCurrentIndex(row); BuildStepConfigWidget *widget = qobject_cast<BuildStepConfigWidget *>(m_ui->buildSettingsWidget->currentWidget()); - Q_ASSERT(widget); - if (widget) - widget->init(m_configuration); + QTC_ASSERT(widget, return); + widget->init(m_configuration); } updateBuildStepButtonsState(); } diff --git a/src/plugins/projectexplorer/currentprojectfind.cpp b/src/plugins/projectexplorer/currentprojectfind.cpp index fb55df3e0fd..bcef3183b9c 100644 --- a/src/plugins/projectexplorer/currentprojectfind.cpp +++ b/src/plugins/projectexplorer/currentprojectfind.cpp @@ -32,10 +32,13 @@ ***************************************************************************/ #include "currentprojectfind.h" + #include "projectexplorer.h" #include "project.h" -#include <QtDebug> +#include <utils/qtcassert.h> + +#include <QtCore/QDebug> #include <QtCore/QRegExp> #include <QtGui/QGridLayout> @@ -71,9 +74,7 @@ QKeySequence CurrentProjectFind::defaultShortcut() const QStringList CurrentProjectFind::files() { Project *project = m_plugin->currentProject(); - Q_ASSERT(project); - if (!project) - return QStringList(); + QTC_ASSERT(project, return QStringList()); QList<QRegExp> filterRegs; QStringList nameFilters = fileNameFilters(); foreach (const QString &filter, nameFilters) { diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 9cecd7b6841..2aaed472dd4 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -40,9 +40,10 @@ #include <coreplugin/ifile.h> #include <extensionsystem/pluginmanager.h> +#include <utils/qtcassert.h> -#include <QtCore/QTextCodec> #include <QtCore/QDebug> +#include <QtCore/QTextCodec> using namespace ProjectExplorer; using ExtensionSystem::PluginManager; @@ -410,7 +411,7 @@ BuildConfiguration * Project::getBuildConfiguration(const QString &name) const void Project::setValue(const QString &buildConfiguration, const QString &name, const QVariant &value) { BuildConfiguration *bc = getBuildConfiguration(buildConfiguration); - Q_ASSERT(bc); + QTC_ASSERT(bc, return); bc->setValue(name, value); } @@ -444,13 +445,13 @@ QList<QSharedPointer<RunConfiguration> > Project::runConfigurations() const void Project::addRunConfiguration(QSharedPointer<RunConfiguration> runConfiguration) { - Q_ASSERT(!m_runConfigurations.contains(runConfiguration)); + QTC_ASSERT(!m_runConfigurations.contains(runConfiguration), return); m_runConfigurations.push_back(runConfiguration); } void Project::removeRunConfiguration(QSharedPointer<RunConfiguration> runConfiguration) { - Q_ASSERT(m_runConfigurations.contains(runConfiguration)); + QTC_ASSERT(m_runConfigurations.contains(runConfiguration), /**/); m_runConfigurations.removeOne(runConfiguration); if (m_activeRunConfiguration == runConfiguration) { if (m_runConfigurations.isEmpty()) @@ -469,7 +470,7 @@ void Project::setActiveRunConfiguration(QSharedPointer<RunConfiguration> runConf { if (runConfiguration == m_activeRunConfiguration) return; - Q_ASSERT(m_runConfigurations.contains(runConfiguration) || runConfiguration == 0); + QTC_ASSERT(m_runConfigurations.contains(runConfiguration) || runConfiguration == 0, return); m_activeRunConfiguration = runConfiguration; emit activeRunConfigurationChanged(); } diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 7b721b208ff..f9149786bea 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -78,23 +78,24 @@ #include <coreplugin/iversioncontrol.h> #include <coreplugin/vcsmanager.h> #include <utils/listutils.h> +#include <utils/qtcassert.h> #include <QtCore/qplugin.h> +#include <QtCore/QDateTime> #include <QtCore/QDebug> #include <QtCore/QSettings> -#include <QtCore/QDateTime> -#include <QtGui/QAction> -#include <QtGui/QFileDialog> -#include <QtGui/QFileSystemModel> + #include <QtGui/QAction> #include <QtGui/QApplication> -#include <QtGui/QMessageBox> -#include <QtGui/QMenu> #include <QtGui/QContextMenuEvent> -#include <QtGui/QToolBar> -#include <QtGui/QMainWindow> +#include <QtGui/QFileDialog> +#include <QtGui/QFileSystemModel> #include <QtGui/QHeaderView> #include <QtGui/QInputDialog> +#include <QtGui/QMainWindow> +#include <QtGui/QMenu> +#include <QtGui/QMessageBox> +#include <QtGui/QToolBar> Q_DECLARE_METATYPE(QSharedPointer<ProjectExplorer::RunConfiguration>); Q_DECLARE_METATYPE(Core::IEditorFactory *); @@ -788,7 +789,7 @@ void ProjectExplorerPlugin::setStartupProject(Project *project) if (!project) project = m_currentProject; - Q_ASSERT(project); + QTC_ASSERT(project, return); m_session->setStartupProject(project); // NPE: Visually mark startup project updateActions(); @@ -1537,7 +1538,7 @@ void ProjectExplorerPlugin::updateContextMenuActions() void ProjectExplorerPlugin::addNewFile() { - Q_ASSERT(m_currentNode && m_currentNode->nodeType() == ProjectNodeType); + QTC_ASSERT(m_currentNode && m_currentNode->nodeType() == ProjectNodeType, return); const QString location = QFileInfo(m_currentNode->path()).dir().absolutePath(); m_core->showNewItemDialog(tr("New File", "Title of dialog"), Core::BaseFileWizard::findWizardsOfKind(Core::IWizard::FileWizard) @@ -1547,7 +1548,7 @@ void ProjectExplorerPlugin::addNewFile() void ProjectExplorerPlugin::addExistingFiles() { - Q_ASSERT(m_currentNode && m_currentNode->nodeType() == ProjectNodeType); + QTC_ASSERT(m_currentNode && m_currentNode->nodeType() == ProjectNodeType, return); ProjectNode *projectNode = qobject_cast<ProjectNode*>(m_currentNode); const QString dir = QFileInfo(m_currentNode->path()).dir().absolutePath(); QStringList fileNames = QFileDialog::getOpenFileNames(m_core->mainWindow(), tr("Add Existing Files"), dir); @@ -1599,14 +1600,14 @@ void ProjectExplorerPlugin::addExistingFiles() void ProjectExplorerPlugin::openFile() { - Q_ASSERT(m_currentNode); + QTC_ASSERT(m_currentNode, return); m_core->editorManager()->openEditor(m_currentNode->path()); m_core->editorManager()->ensureEditorManagerVisible(); } void ProjectExplorerPlugin::removeFile() { - Q_ASSERT(m_currentNode && m_currentNode->nodeType() == FileNodeType); + QTC_ASSERT(m_currentNode && m_currentNode->nodeType() == FileNodeType, return); FileNode *fileNode = qobject_cast<FileNode*>(m_currentNode); const QString filePath = m_currentNode->path(); @@ -1618,7 +1619,7 @@ void ProjectExplorerPlugin::removeFile() // remove from project ProjectNode *projectNode = fileNode->projectNode(); - Q_ASSERT(projectNode); + QTC_ASSERT(projectNode, return); if (!projectNode->removeFiles(fileNode->fileType(), QStringList(filePath))) { QMessageBox::warning(m_core->mainWindow(), tr("Remove file failed"), @@ -1770,11 +1771,11 @@ void ProjectExplorerPlugin::populateOpenWithMenu() void ProjectExplorerPlugin::openWithMenuTriggered(QAction *action) { - Q_ASSERT(action != NULL); + QTC_ASSERT(action, return); Core::IEditorFactory * const editorFactory = qVariantValue<Core::IEditorFactory *>(action->data()); - Q_ASSERT(m_core != NULL); - Q_ASSERT(m_core->editorManager() != NULL); - Q_ASSERT(editorFactory != NULL); + QTC_ASSERT(m_core, return); + QTC_ASSERT(m_core->editorManager(), return); + QTC_ASSERT(editorFactory, return); m_core->editorManager()->openEditor(currentNode()->path(), editorFactory->kind()); m_core->editorManager()->ensureEditorManagerVisible(); } diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index a3d601364f4..e5a2e702650 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -31,19 +31,22 @@ ** ***************************************************************************/ -#include "project.h" #include "projectmodels.h" + +#include "project.h" #include "projectexplorerconstants.h" #include <coreplugin/fileiconprovider.h> +#include <utils/qtcassert.h> + +#include <QtCore/QDebug> +#include <QtCore/QFileInfo> #include <QtGui/QApplication> #include <QtGui/QIcon> -#include <QtGui/QStyle> #include <QtGui/QMessageBox> #include <QtGui/QSortFilterProxyModel> -#include <QtCore/QFileInfo> -#include <QtCore/QDebug> +#include <QtGui/QStyle> using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; @@ -173,7 +176,7 @@ QModelIndex DetailedModel::index(int row, int column, const QModelIndex &parent) result = createIndex(0, 0, m_rootNode); } else if (column == 0) { FolderNode *parentNode = qobject_cast<FolderNode*>(nodeForIndex(parent)); - Q_ASSERT(parentNode); + QTC_ASSERT(parentNode, return result); result = createIndex(row, 0, m_childNodes.value(parentNode).at(row)); } return result; @@ -186,7 +189,7 @@ QModelIndex DetailedModel::parent(const QModelIndex &index) const if (Node *node = nodeForIndex(index)) { if (FolderNode *parentFolderNode = node->parentFolderNode()) { if (FolderNode *grandParentFolderNode = parentFolderNode->parentFolderNode()) { - Q_ASSERT(m_childNodes.contains(grandParentFolderNode)); + QTC_ASSERT(m_childNodes.contains(grandParentFolderNode), return parentIndex); int row = m_childNodes.value(grandParentFolderNode).indexOf(parentFolderNode); parentIndex = createIndex(row, 0, parentFolderNode); } else { @@ -348,8 +351,8 @@ bool DetailedModel::canFetchMore(const QModelIndex & parent) const void DetailedModel::fetchMore(const QModelIndex & parent) { FolderNode *folderNode = qobject_cast<FolderNode*>(nodeForIndex(parent)); - Q_ASSERT(folderNode); - Q_ASSERT(!m_childNodes.contains(folderNode)); + QTC_ASSERT(folderNode, return); + QTC_ASSERT(!m_childNodes.contains(folderNode), return); m_childNodes.insert(folderNode, childNodeList(folderNode)); } @@ -365,7 +368,7 @@ void DetailedModel::foldersAboutToBeAdded(FolderNode *parentFolder, const QList<FolderNode*> &newFolders) { Q_UNUSED(newFolders); - Q_ASSERT(parentFolder); + QTC_ASSERT(parentFolder, return); if (m_childNodes.contains(parentFolder)) m_folderToAddTo = parentFolder; @@ -383,7 +386,7 @@ void DetailedModel::foldersAdded() void DetailedModel::foldersAboutToBeRemoved(FolderNode *parentFolder, const QList<FolderNode*> &staleFolders) { - Q_ASSERT(parentFolder); + QTC_ASSERT(parentFolder, return); if (m_childNodes.contains(parentFolder)) { QList<Node*> newChildNodes = m_childNodes.value(parentFolder); @@ -413,7 +416,7 @@ void DetailedModel::filesAboutToBeAdded(FolderNode *parentFolder, const QList<FileNode*> &newFiles) { Q_UNUSED(newFiles); - Q_ASSERT(parentFolder); + QTC_ASSERT(parentFolder, return); if (m_childNodes.contains(parentFolder)) m_folderToAddTo = parentFolder; @@ -431,7 +434,7 @@ void DetailedModel::filesAdded() void DetailedModel::filesAboutToBeRemoved(FolderNode *parentFolder, const QList<FileNode*> &staleFiles) { - Q_ASSERT(parentFolder); + QTC_ASSERT(parentFolder, return); if (m_childNodes.contains(parentFolder)) { QList<Node*> newChildNodes = m_childNodes.value(parentFolder); @@ -470,7 +473,7 @@ QModelIndex DetailedModel::indexForNode(const Node *node) // update internal cache if (canFetchMore(parentIndex)) fetchMore(parentIndex); - Q_ASSERT(m_childNodes.contains(parentFolder)); + QTC_ASSERT(m_childNodes.contains(parentFolder), return QModelIndex()); int row = m_childNodes.value(parentFolder).indexOf(const_cast<Node*>(node)); if (row >= 0) @@ -503,7 +506,7 @@ void DetailedModel::addToChildNodes(FolderNode *parentFolder, QList<Node*> newCh { QList<Node*> childNodes = m_childNodes.value(parentFolder); QModelIndex parentIndex = indexForNode(parentFolder); - Q_ASSERT(parentIndex.isValid()); + QTC_ASSERT(parentIndex.isValid(), return); // position -> nodes, with positions in decreasing order QList<QPair<int, QList<Node*> > > insertions; @@ -547,14 +550,14 @@ void DetailedModel::addToChildNodes(FolderNode *parentFolder, QList<Node*> newCh endInsertRows(); } - Q_ASSERT(childNodes == newChildNodes); + QTC_ASSERT(childNodes == newChildNodes, /**/); } void DetailedModel::removeFromChildNodes(FolderNode *parentFolder, QList<Node*> newChildNodes) { QList<Node*> childNodes = m_childNodes.value(parentFolder); QModelIndex parentIndex = indexForNode(parentFolder); - Q_ASSERT(parentIndex.isValid()); + QTC_ASSERT(parentIndex.isValid(), return); // position -> nodes, with positions in decreasing order QList<QPair<int, QList<Node*> > > deletions; @@ -597,7 +600,7 @@ void DetailedModel::removeFromChildNodes(FolderNode *parentFolder, QList<Node*> endRemoveRows(); } - Q_ASSERT(childNodes == newChildNodes); + QTC_ASSERT(childNodes == newChildNodes, /**/); } QList<FolderNode*> DetailedModel::recursiveSubFolders(FolderNode *parentFolder) @@ -660,7 +663,7 @@ QModelIndex FlatModel::index(int row, int column, const QModelIndex &parent) con result = createIndex(0, 0, m_rootNode); } else if (parent.isValid() && column == 0) { FolderNode *parentNode = qobject_cast<FolderNode*>(nodeForIndex(parent)); - Q_ASSERT(parentNode); + QTC_ASSERT(parentNode, return QModelIndex()); QHash<FolderNode*, QList<Node*> >::const_iterator it = m_childNodes.constFind(parentNode); if (it == m_childNodes.constEnd()) { fetchMore(parentNode); @@ -687,9 +690,9 @@ QModelIndex FlatModel::parent(const QModelIndex &idx) const fetchMore(grandParentNode); it = m_childNodes.constFind(grandParentNode); } - Q_ASSERT(it != m_childNodes.constEnd()); + QTC_ASSERT(it != m_childNodes.constEnd(), return QModelIndex()); const int row = it.value().indexOf(parentNode); - Q_ASSERT(row >= 0); + QTC_ASSERT(row >= 0, return QModelIndex()); parentIndex = createIndex(row, 0, parentNode); } else { // top level node, parent is session @@ -847,8 +850,8 @@ QList<Node*> FlatModel::childNodes(FolderNode *parentNode, const QSet<Node*> &bl void FlatModel::fetchMore(FolderNode *folderNode) const { - Q_ASSERT(folderNode); - Q_ASSERT(!m_childNodes.contains(folderNode)); + QTC_ASSERT(folderNode, return); + QTC_ASSERT(!m_childNodes.contains(folderNode), return); QList<Node*> nodeList = childNodes(folderNode); m_childNodes.insert(folderNode, nodeList); @@ -857,7 +860,7 @@ void FlatModel::fetchMore(FolderNode *folderNode) const void FlatModel::fetchMore(const QModelIndex &parent) { FolderNode *folderNode = qobject_cast<FolderNode*>(nodeForIndex(parent)); - Q_ASSERT(folderNode); + QTC_ASSERT(folderNode, return); fetchMore(folderNode); } diff --git a/src/plugins/projectexplorer/projectnodes.cpp b/src/plugins/projectexplorer/projectnodes.cpp index bf6174a4a36..1c30bbe1094 100644 --- a/src/plugins/projectexplorer/projectnodes.cpp +++ b/src/plugins/projectexplorer/projectnodes.cpp @@ -31,11 +31,13 @@ ** ***************************************************************************/ -#include "nodesvisitor.h" #include "projectnodes.h" + +#include "nodesvisitor.h" #include "projectexplorerconstants.h" #include <coreplugin/mimedatabase.h> +#include <utils/qtcassert.h> #include <QtCore/QFileInfo> #include <QtGui/QApplication> @@ -374,7 +376,7 @@ void ProjectNode::removeProjectNodes(const QList<ProjectNode*> &subProjects) */ void ProjectNode::addFolderNodes(const QList<FolderNode*> &subFolders, FolderNode *parentFolder) { - Q_ASSERT(parentFolder); + QTC_ASSERT(parentFolder, return); if (!subFolders.isEmpty()) { const bool emitSignals = (parentFolder->projectNode() == this); @@ -410,7 +412,7 @@ void ProjectNode::addFolderNodes(const QList<FolderNode*> &subFolders, FolderNod void ProjectNode::removeFolderNodes(const QList<FolderNode*> &subFolders, FolderNode *parentFolder) { - Q_ASSERT(parentFolder); + QTC_ASSERT(parentFolder, return); if (!subFolders.isEmpty()) { const bool emitSignals = (parentFolder->projectNode() == this); @@ -448,7 +450,7 @@ void ProjectNode::removeFolderNodes(const QList<FolderNode*> &subFolders, */ void ProjectNode::addFileNodes(const QList<FileNode*> &files, FolderNode *folder) { - Q_ASSERT(folder); + QTC_ASSERT(folder, return); if (!files.isEmpty()) { const bool emitSignals = (folder->projectNode() == this); @@ -480,7 +482,7 @@ void ProjectNode::addFileNodes(const QList<FileNode*> &files, FolderNode *folder */ void ProjectNode::removeFileNodes(const QList<FileNode*> &files, FolderNode *folder) { - Q_ASSERT(folder); + QTC_ASSERT(folder, return); if (!files.isEmpty()) { const bool emitSignals = (folder->projectNode() == this); diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index 50882e67d9e..6285bb81dee 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -32,18 +32,21 @@ ***************************************************************************/ #include "projecttreewidget.h" + #include "projectexplorer.h" #include "projectexplorerconstants.h" #include "projectmodels.h" #include <coreplugin/icore.h> #include <coreplugin/editormanager/editormanager.h> +#include <utils/qtcassert.h> + +#include <QtCore/QDebug> #include <QtGui/QHeaderView> #include <QtGui/QVBoxLayout> #include <QtGui/QToolButton> #include <QtGui/QFocusEvent> -#include <QtCore/QDebug> using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; @@ -208,7 +211,7 @@ void ProjectTreeWidget::setCurrentItem(Node *node, Project *project) void ProjectTreeWidget::handleCurrentItemChange(const QModelIndex ¤t) { Node *node = m_model->nodeForIndex(current); - Q_ASSERT(node); + QTC_ASSERT(node, return); bool autoSync = autoSynchronization(); setAutoSynchronization(false); diff --git a/src/plugins/projectexplorer/runsettingspropertiespage.cpp b/src/plugins/projectexplorer/runsettingspropertiespage.cpp index abbfd8c1d15..ce26ce4da92 100644 --- a/src/plugins/projectexplorer/runsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/runsettingspropertiespage.cpp @@ -37,19 +37,22 @@ #include "ui_runsettingspropertiespage.h" #include <extensionsystem/pluginmanager.h> +#include <utils/qtcassert.h> -#include <QDebug> +#include <QtCore/QDebug> #include <QtCore/QPair> namespace ProjectExplorer { namespace Internal { + struct FactoryAndType { ProjectExplorer::IRunConfigurationFactory *factory; QString type; }; -} // namespace -} // namespace + +} // namespace Internal +} // namespace ProjectExplorer Q_DECLARE_METATYPE(ProjectExplorer::Internal::FactoryAndType); @@ -170,9 +173,9 @@ void RunConfigurationsModel::setRunConfigurations(const QList<QSharedPointer<Run /// RunSettingsWidget::RunSettingsWidget(Project *project) - : m_project(project) - , m_runConfigurationsModel(new RunConfigurationsModel(this)) - , m_runConfigurationWidget(0) + : m_project(project), + m_runConfigurationsModel(new RunConfigurationsModel(this)), + m_runConfigurationWidget(0) { m_ui = new Ui::RunSettingsPropertiesPage; m_ui->setupUi(this); @@ -214,8 +217,9 @@ RunSettingsWidget::~RunSettingsWidget() void RunSettingsWidget::aboutToShowAddMenu() { m_addMenu->clear(); - QList<IRunConfigurationFactory *> factories = ExtensionSystem::PluginManager::instance()->getObjects<IRunConfigurationFactory>(); - foreach (IRunConfigurationFactory * factory, factories) { + QList<IRunConfigurationFactory *> factories = + ExtensionSystem::PluginManager::instance()->getObjects<IRunConfigurationFactory>(); + foreach (IRunConfigurationFactory *factory, factories) { QStringList types = factory->canCreate(m_project); foreach (const QString &type, types) { QAction *action = m_addMenu->addAction(factory->nameForType(type));; @@ -243,16 +247,14 @@ void RunSettingsWidget::addRunConfiguration() m_project->addRunConfiguration(newRC); m_project->setActiveRunConfiguration(newRC); initRunConfigurationComboBox(); - connect(newRC.data(), SIGNAL(nameChanged()), - this, SLOT(nameChanged())); + connect(newRC.data(), SIGNAL(nameChanged()), this, SLOT(nameChanged())); } void RunSettingsWidget::removeRunConfiguration() { int index = m_ui->runConfigurationCombo->currentIndex(); QSharedPointer<RunConfiguration> rc = m_project->runConfigurations().at(index); - disconnect(rc.data(), SIGNAL(nameChanged()), - this, SLOT(nameChanged())); + disconnect(rc.data(), SIGNAL(nameChanged()), this, SLOT(nameChanged())); m_project->removeRunConfiguration(rc); initRunConfigurationComboBox(); } @@ -272,9 +274,9 @@ void RunSettingsWidget::initRunConfigurationComboBox() void RunSettingsWidget::activateRunConfiguration(int index) { - Q_ASSERT(m_project); + QTC_ASSERT(m_project, return); const QList<QSharedPointer<RunConfiguration> > runConfigurations = m_project->runConfigurations(); - Q_ASSERT(index < runConfigurations.size()); + QTC_ASSERT(index < runConfigurations.size(), return); QSharedPointer<RunConfiguration> selectedRunConfiguration = runConfigurations.at(index); // Change the active run configuration of the project diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index 6f17dd51a17..a9bded02c61 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -47,17 +47,20 @@ #include <coreplugin/editormanager/ieditor.h> #include <coreplugin/progressmanager/progressmanagerinterface.h> #include <coreplugin/modemanager.h> -#include <utils/listutils.h> #include <texteditor/itexteditor.h> -#include <QtCore/QDir> +#include <utils/listutils.h> +#include <utils/qtcassert.h> + #include <QtCore/QDebug> +#include <QtCore/QDir> #include <QtCore/QFileInfo> -#include <QtCore/QSettings> #include <QtCore/QFuture> -#include <QtGui/QMessageBox> +#include <QtCore/QSettings> + #include <QtGui/QMainWindow> +#include <QtGui/QMessageBox> namespace { bool debug = false; @@ -138,21 +141,17 @@ QString SessionFile::mimeType() const bool SessionFile::load(const QString &fileName) { - Q_ASSERT(!fileName.isEmpty()); + QTC_ASSERT(!fileName.isEmpty(), return false); if (debug) qDebug() << "SessionFile::load " << fileName; - - m_fileName = fileName; // NPE: Load the session in the background? // NPE: Let FileManager monitor filename QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - - PersistentSettingsReader reader; if (!reader.load(m_fileName)) { qWarning() << "SessionManager::load failed!" << fileName; @@ -161,8 +160,8 @@ bool SessionFile::load(const QString &fileName) } m_core->progressManager()->addTask(future.future(), tr("Session"), - QLatin1String("ProjectExplorer.SessionFile.Load"), - Core::ProgressManagerInterface::CloseOnSuccess); + QLatin1String("ProjectExplorer.SessionFile.Load"), + Core::ProgressManagerInterface::CloseOnSuccess); const QStringList &keys = reader.restoreValue(QLatin1String("valueKeys")).toStringList(); foreach (const QString &key, keys) { @@ -184,7 +183,6 @@ bool SessionFile::load(const QString &fileName) } } - int openEditorsCount = reader.restoreValue(QLatin1String("OpenEditors")).toInt(); future.setProgressRange(0, fileList.count() + openEditorsCount + 2); @@ -248,7 +246,7 @@ bool SessionFile::save(const QString &fileName) if (!fileName.isEmpty()) m_fileName = fileName; - Q_ASSERT(!m_fileName.isEmpty()); + QTC_ASSERT(!m_fileName.isEmpty(), return false); if (debug) qDebug() << "SessionFile - saving " << m_fileName; @@ -495,7 +493,7 @@ void SessionManager::setStartupProject(Project *startupProject) qDebug() << Q_FUNC_INFO << (startupProject ? startupProject->name() : "0"); if (startupProject) { - Q_ASSERT(m_file->m_projects.contains(startupProject)); + QTC_ASSERT(m_file->m_projects.contains(startupProject), return); } m_file->m_startupProject = startupProject; @@ -568,7 +566,7 @@ void SessionManager::removeProject(Project *project) bool SessionManager::createImpl(const QString &fileName) { - Q_ASSERT(!fileName.isEmpty()); + QTC_ASSERT(!fileName.isEmpty(), return false); if (debug) qDebug() << "SessionManager - creating new session " << fileName << " ..."; @@ -576,9 +574,8 @@ bool SessionManager::createImpl(const QString &fileName) bool success = true; if (!m_file->fileName().isEmpty()) { - if (!save() || !clear()) { + if (!save() || !clear()) success = false; - } } if (success) { @@ -600,7 +597,7 @@ bool SessionManager::createImpl(const QString &fileName) bool SessionManager::loadImpl(const QString &fileName) { - Q_ASSERT(!fileName.isEmpty()); + QTC_ASSERT(!fileName.isEmpty(), return false); if (debug) qDebug() << "SessionManager - loading session " << fileName << " ..."; @@ -804,7 +801,7 @@ Project *SessionManager::projectForNode(Node *node) const while (rootProjectNode && rootProjectNode->parentFolderNode() != m_sessionNode) rootProjectNode = rootProjectNode->parentFolderNode(); - Q_ASSERT(rootProjectNode); + QTC_ASSERT(rootProjectNode, return 0); QList<Project *> projectList = projects(); foreach (Project *p, projectList) { diff --git a/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp b/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp index bd2c367f696..d7f55ba7114 100644 --- a/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp +++ b/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp @@ -33,10 +33,12 @@ #include "gdbmacrosbuildstep.h" -#include "qt4projectmanagerconstants.h" -#include "qt4project.h" -#include "qmakestep.h" #include "makestep.h" +#include "qmakestep.h" +#include "qt4project.h" +#include "qt4projectmanagerconstants.h" + +#include <utils/qtcassert.h> using namespace Qt4ProjectManager; using namespace Qt4ProjectManager::Internal; @@ -160,9 +162,9 @@ bool GdbMacrosBuildStepFactory::canCreate(const QString &name) const ProjectExplorer::BuildStep *GdbMacrosBuildStepFactory::create(ProjectExplorer::Project *pro, const QString &name) const { - Q_ASSERT(name == Constants::GDBMACROSBUILDSTEP); + QTC_ASSERT(name == Constants::GDBMACROSBUILDSTEP, return 0); Qt4Project *qt4project = qobject_cast<Qt4Project *>(pro); - Q_ASSERT(qt4project); + QTC_ASSERT(qt4project, return 0); return new GdbMacrosBuildStep(qt4project); } diff --git a/src/plugins/qt4projectmanager/makestep.cpp b/src/plugins/qt4projectmanager/makestep.cpp index 59acdb1b5e0..55ef402fb97 100644 --- a/src/plugins/qt4projectmanager/makestep.cpp +++ b/src/plugins/qt4projectmanager/makestep.cpp @@ -37,9 +37,10 @@ #include "qt4projectmanagerconstants.h" #include <extensionsystem/ExtensionSystemInterfaces> +#include <utils/qtcassert.h> -#include <QFileInfo> -#include <QDir> +#include <QtCore/QDir> +#include <QtCore/QFileInfo> using ProjectExplorer::IBuildParserFactory; using ProjectExplorer::BuildParserInterface; @@ -289,10 +290,11 @@ void MakeStepConfigWidget::init(const QString &buildConfiguration) { m_buildConfiguration = buildConfiguration; bool showPage0 = buildConfiguration.isNull(); - m_ui.stackedWidget->setCurrentIndex(showPage0? 0 : 1); + m_ui.stackedWidget->setCurrentIndex(showPage0 ? 0 : 1); if (!showPage0) { Qt4Project *pro = qobject_cast<Qt4Project *>(m_makeStep->project()); + QTC_ASSERT(pro, return); m_ui.makeLabel->setText(tr("Override %1:").arg(pro->qtVersion(buildConfiguration)->makeCommand())); const QString &makeCmd = m_makeStep->value(buildConfiguration, "makeCmd").toString(); @@ -307,12 +309,12 @@ void MakeStepConfigWidget::init(const QString &buildConfiguration) void MakeStepConfigWidget::makeLineEditTextEdited() { - Q_ASSERT(!m_buildConfiguration.isNull()); + QTC_ASSERT(!m_buildConfiguration.isNull(), return); m_makeStep->setValue(m_buildConfiguration, "makeCmd", m_ui.makeLineEdit->text()); } void MakeStepConfigWidget::makeArgumentsLineEditTextEdited() { - Q_ASSERT(!m_buildConfiguration.isNull()); + QTC_ASSERT(!m_buildConfiguration.isNull(), return); m_makeStep->setValue(m_buildConfiguration, "makeargs", ProjectExplorer::Environment::parseCombinedArgString(m_ui.makeArgumentsLineEdit->text())); } diff --git a/src/plugins/qt4projectmanager/qmakestep.cpp b/src/plugins/qt4projectmanager/qmakestep.cpp index 786675e84b3..85852f01885 100644 --- a/src/plugins/qt4projectmanager/qmakestep.cpp +++ b/src/plugins/qt4projectmanager/qmakestep.cpp @@ -40,6 +40,7 @@ #include "qtversionmanager.h" #include <coreplugin/icore.h> +#include <utils/qtcassert.h> #include <QFileDialog> #include <QDir> @@ -233,7 +234,7 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step) void QMakeStepConfigWidget::qmakeArgumentsLineEditTextEdited() { - Q_ASSERT(!m_buildConfiguration.isNull()); + QTC_ASSERT(!m_buildConfiguration.isNull(), return); m_step->setValue(m_buildConfiguration, "qmakeArgs", ProjectExplorer::Environment::parseCombinedArgString(m_ui.qmakeAdditonalArgumentsLineEdit->text())); m_ui.qmakeArgumentsEdit->setPlainText(ProjectExplorer::Environment::joinArgumentList(m_step->arguments(m_buildConfiguration))); } diff --git a/src/plugins/qt4projectmanager/qt4nodes.cpp b/src/plugins/qt4projectmanager/qt4nodes.cpp index 556e7798f9f..58486fd9a13 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.cpp +++ b/src/plugins/qt4projectmanager/qt4nodes.cpp @@ -33,12 +33,12 @@ #include "proeditormodel.h" +#include "directorywatcher.h" #include "profilereader.h" #include "prowriter.h" #include "qt4nodes.h" #include "qt4project.h" #include "qt4projectmanager.h" -#include "directorywatcher.h" #include <projectexplorer/nodesvisitor.h> @@ -50,11 +50,14 @@ #include <cpptools/cppmodelmanagerinterface.h> +#include <utils/qtcassert.h> + #include <QtCore/QDebug> #include <QtCore/QDir> #include <QtCore/QFile> #include <QtCore/QFileInfo> #include <QtCore/QTimer> + #include <QtGui/QMainWindow> #include <QtGui/QMessageBox> #include <QtGui/QPushButton> @@ -86,15 +89,15 @@ Qt4PriFileNode::Qt4PriFileNode(Qt4Project *project, Qt4ProFileNode* qt4ProFileNo m_projectFilePath(QDir::fromNativeSeparators(filePath)), m_projectDir(QFileInfo(filePath).absolutePath()) { - Q_ASSERT(project); + QTC_ASSERT(project, return); setFolderName(QFileInfo(filePath).baseName()); setIcon(QIcon(":/qt4projectmanager/images/qt_project.png")); } void Qt4PriFileNode::update(ProFile *includeFile, ProFileReader *reader) { - Q_ASSERT(includeFile); - Q_ASSERT(reader); + QTC_ASSERT(includeFile, return); + QTC_ASSERT(reader, return); // add project file node if (m_fileNodes.isEmpty()) @@ -167,7 +170,7 @@ QList<ProjectNode::ProjectAction> Qt4PriFileNode::supportedActions() const const Qt4ProFileNode *proFileNode; while (!(proFileNode = qobject_cast<const Qt4ProFileNode*>(folderNode))) folderNode = folderNode->parentFolderNode(); - Q_ASSERT(proFileNode); + QTC_ASSERT(proFileNode, return actions); switch (proFileNode->projectType()) { case ApplicationTemplate: diff --git a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp index b3aaa817ab0..2c0b4f34697 100644 --- a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp @@ -33,15 +33,16 @@ #include "qt4runconfiguration.h" -#include "qt4project.h" +#include "makestep.h" #include "profilereader.h" #include "qt4nodes.h" -#include "makestep.h" +#include "qt4project.h" #include <coreplugin/icore.h> #include <coreplugin/messagemanager.h> #include <coreplugin/variablemanager.h> #include <projectexplorer/buildstep.h> +#include <utils/qtcassert.h> #include <QtGui/QFormLayout> #include <QtGui/QInputDialog> @@ -148,7 +149,7 @@ QStringList Qt4RunConfiguration::commandLineArguments() const ProjectExplorer::Environment Qt4RunConfiguration::environment() const { Qt4Project *pro = qobject_cast<Qt4Project *>(project()); - Q_ASSERT(pro); + QTC_ASSERT(pro, return ProjectExplorer::Environment()); return pro->environment(pro->activeBuildConfiguration()); } @@ -369,11 +370,12 @@ bool Qt4RunConfigurationFactory::canCreate(const QString &type) const return type == "Qt4ProjectManager.Qt4RunConfiguration"; } -QSharedPointer<ProjectExplorer::RunConfiguration> Qt4RunConfigurationFactory::create(ProjectExplorer::Project *project, const QString &type) +QSharedPointer<ProjectExplorer::RunConfiguration> Qt4RunConfigurationFactory::create + (ProjectExplorer::Project *project, const QString &type) { Qt4Project *p = qobject_cast<Qt4Project *>(project); - Q_ASSERT(p); - Q_ASSERT(type == "Qt4ProjectManager.Qt4RunConfiguration"); + QTC_ASSERT(p, /**/); + QTC_ASSERT(type == "Qt4ProjectManager.Qt4RunConfiguration", /**/); // The right path is set in restoreSettings QSharedPointer<ProjectExplorer::RunConfiguration> rc(new Qt4RunConfiguration(p, QString::null)); return rc; @@ -416,7 +418,7 @@ bool Qt4RunConfigurationFactoryUser::canCreate(const QString &type) const QSharedPointer<ProjectExplorer::RunConfiguration> Qt4RunConfigurationFactoryUser::create(ProjectExplorer::Project *project, const QString &type) { Qt4Project *p = qobject_cast<Qt4Project *>(project); - Q_ASSERT(p); + QTC_ASSERT(p, /**/); QString fileName = type.mid(QString("Qt4RunConfiguration.").size()); return QSharedPointer<ProjectExplorer::RunConfiguration>(new Qt4RunConfiguration(p, fileName)); diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp index 8bb4ca20af0..246d4737bd1 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.cpp +++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp @@ -39,14 +39,16 @@ #include <coreplugin/coreconstants.h> #include <help/helpplugin.h> +#include <utils/qtcassert.h> +#include <QtCore/QDebug> +#include <QtCore/QProcess> #include <QtCore/QSettings> #include <QtCore/QStringRef> #include <QtCore/QTime> -#include <QtCore/QProcess> -#include <QtGui/QHeaderView> + #include <QtGui/QFileDialog> -#include <QtCore/QDebug> +#include <QtGui/QHeaderView> #include <QtGui/QMessageBox> using namespace Qt4ProjectManager::Internal; @@ -114,9 +116,7 @@ void QtVersionManager::addVersion(QtVersion *version) void QtVersionManager::updateDocumentation() { Help::HelpManager *helpManager = m_core->pluginManager()->getObject<Help::HelpManager>(); - Q_ASSERT(helpManager); - if (!helpManager) - return; + QTC_ASSERT(helpManager, return); QStringList fileEndings = QStringList() << "/qch/qt.qch" << "/qch/qmake.qch" << "/qch/designer.qch"; QStringList files; foreach (QtVersion *version, m_versions) { @@ -596,7 +596,7 @@ void QtDirWidget::defaultChanged(int) void QtDirWidget::updateCurrentQtName() { QTreeWidgetItem *currentItem = m_ui.qtdirList->currentItem(); - Q_ASSERT(currentItem); + QTC_ASSERT(currentItem, return); int currentItemIndex = m_ui.qtdirList->indexOfTopLevelItem(currentItem); m_versions[currentItemIndex]->setName(m_ui.nameEdit->text()); currentItem->setText(0, m_versions[currentItemIndex]->name()); @@ -645,7 +645,7 @@ void QtDirWidget::fixQtVersionName(int index) void QtDirWidget::updateCurrentQtPath() { QTreeWidgetItem *currentItem = m_ui.qtdirList->currentItem(); - Q_ASSERT(currentItem); + QTC_ASSERT(currentItem, return); int currentItemIndex = m_ui.qtdirList->indexOfTopLevelItem(currentItem); m_versions[currentItemIndex]->setPath(m_ui.pathEdit->text()); currentItem->setText(1, m_versions[currentItemIndex]->path()); @@ -656,7 +656,7 @@ void QtDirWidget::updateCurrentQtPath() void QtDirWidget::updateCurrentMingwDirectory() { QTreeWidgetItem *currentItem = m_ui.qtdirList->currentItem(); - Q_ASSERT(currentItem); + QTC_ASSERT(currentItem, return); int currentItemIndex = m_ui.qtdirList->indexOfTopLevelItem(currentItem); m_versions[currentItemIndex]->setMingwDirectory(m_ui.mingwLineEdit->text()); } @@ -665,7 +665,7 @@ void QtDirWidget::msvcVersionChanged() { const QString &msvcVersion = m_ui.msvcComboBox->currentText(); QTreeWidgetItem *currentItem = m_ui.qtdirList->currentItem(); - Q_ASSERT(currentItem); + QTC_ASSERT(currentItem, return); int currentItemIndex = m_ui.qtdirList->indexOfTopLevelItem(currentItem); m_versions[currentItemIndex]->setMsvcVersion(msvcVersion); diff --git a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp index bf77fde7a3f..c95bea8217b 100644 --- a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp +++ b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp @@ -32,12 +32,14 @@ ***************************************************************************/ #include "librarywizarddialog.h" + #include "consoleappwizard.h" -#include "modulespage.h" #include "filespage.h" #include "libraryparameters.h" +#include "modulespage.h" #include <utils/projectintropage.h> +#include <utils/qtcassert.h> #include <QtGui/QComboBox> #include <QtGui/QLabel> @@ -231,7 +233,7 @@ void LibraryWizardDialog::slotCurrentIdChanged(int id) qDebug("initializing for plugins"); QStringList baseClasses; const int pluginBaseClassCount = sizeof(pluginBaseClasses)/sizeof(PluginBaseClasses); - Q_ASSERT(defaultPluginBaseClass < pluginBaseClassCount); + QTC_ASSERT(defaultPluginBaseClass < pluginBaseClassCount, return); for (int i = 0; i < pluginBaseClassCount; i++) baseClasses.push_back(QLatin1String(pluginBaseClasses[i].name)); m_filesPage->setBaseClassChoices(baseClasses); diff --git a/src/plugins/qt4projectmanager/wizards/modulespage.cpp b/src/plugins/qt4projectmanager/wizards/modulespage.cpp index a2b5b3e4f09..7e11c50de9a 100644 --- a/src/plugins/qt4projectmanager/wizards/modulespage.cpp +++ b/src/plugins/qt4projectmanager/wizards/modulespage.cpp @@ -32,15 +32,18 @@ ***************************************************************************/ #include "modulespage.h" + #include "speinfo.h" -#include <QtGui/QLabel> -#include <QtGui/QLayout> -#include <QtGui/QCheckBox> -#include <QtGui/QWidget> +#include <utils/qtcassert.h> #include <QtCore/QDebug> +#include <QtGui/QCheckBox> +#include <QtGui/QLabel> +#include <QtGui/QLayout> +#include <QtGui/QWidget> + #include <math.h> using namespace Qt4ProjectManager::Internal; @@ -101,17 +104,15 @@ QString ModulesPage::deselectedModules() const void ModulesPage::setModuleSelected(const QString &module, bool selected) const { QCheckBox *checkBox = m_moduleCheckBoxMap[module]; - Q_ASSERT(checkBox); - if (checkBox) - checkBox->setCheckState(selected?Qt::Checked:Qt::Unchecked); + QTC_ASSERT(checkBox, return); + checkBox->setCheckState(selected?Qt::Checked:Qt::Unchecked); } void ModulesPage::setModuleEnabled(const QString &module, bool enabled) const { QCheckBox *checkBox = m_moduleCheckBoxMap[module]; - Q_ASSERT(checkBox); - if (checkBox) - checkBox->setEnabled(enabled); + QTC_ASSERT(checkBox, return); + checkBox->setEnabled(enabled); } QString ModulesPage::modules(bool selected) const diff --git a/src/plugins/qtscripteditor/qtscripteditorplugin.cpp b/src/plugins/qtscripteditor/qtscripteditorplugin.cpp index 0cc69b82c45..9f724d4d09d 100644 --- a/src/plugins/qtscripteditor/qtscripteditorplugin.cpp +++ b/src/plugins/qtscripteditor/qtscripteditorplugin.cpp @@ -32,10 +32,11 @@ ***************************************************************************/ #include "qtscripteditorplugin.h" + +#include "qscripthighlighter.h" +#include "qtscripteditor.h" #include "qtscripteditorconstants.h" #include "qtscripteditorfactory.h" -#include "qtscripteditor.h" -#include "qscripthighlighter.h" #include <coreplugin/icore.h> #include <coreplugin/coreconstants.h> @@ -47,6 +48,7 @@ #include <texteditor/texteditorconstants.h> #include <texteditor/texteditorsettings.h> #include <texteditor/textfilewizard.h> +#include <utils/qtcassert.h> #include <QtCore/qplugin.h> #include <QtCore/QDebug> @@ -108,7 +110,7 @@ void QtScriptEditorPlugin::extensionsInitialized() void QtScriptEditorPlugin::initializeEditor(QtScriptEditor::Internal::ScriptEditor *editor) { - Q_ASSERT(m_instance); + QTC_ASSERT(m_instance, /**/); TextEditor::TextEditorSettings *settings = TextEditor::TextEditorSettings::instance(); connect(settings, SIGNAL(fontSettingsChanged(TextEditor::FontSettings)), diff --git a/src/plugins/qtscripteditor/qtscripthighlighter.cpp b/src/plugins/qtscripteditor/qtscripthighlighter.cpp index b362f6a2ad6..0e7cd342cbd 100644 --- a/src/plugins/qtscripteditor/qtscripthighlighter.cpp +++ b/src/plugins/qtscripteditor/qtscripthighlighter.cpp @@ -33,6 +33,8 @@ #include "qtscripthighlighter.h" +#include <utils/qtcassert.h> + namespace QtScriptEditor { namespace Internal { @@ -94,7 +96,7 @@ void QtScriptHighlighter::onBlockEnd(int state, int firstNonSpace) blockData->setCollapseMode(TextEditor::TextBlockUserData::NoCollapse); } if (!m_currentBlockParentheses.isEmpty()) { - Q_ASSERT(blockData); + QTC_ASSERT(blockData, return); int collapse = Parenthesis::collapseAtPos(m_currentBlockParentheses); if (collapse >= 0) { if (collapse == firstNonSpace) diff --git a/src/plugins/quickopen/quickopenmanager.cpp b/src/plugins/quickopen/quickopenmanager.cpp index 99e9bcc6f1d..1cabeb6bc2d 100644 --- a/src/plugins/quickopen/quickopenmanager.cpp +++ b/src/plugins/quickopen/quickopenmanager.cpp @@ -35,6 +35,7 @@ #include "quickopentoolwindow.h" #include <extensionsystem/pluginmanager.h> +#include <utils/qtcassert.h> using namespace QuickOpen; using namespace QuickOpen::Internal; @@ -57,6 +58,6 @@ QuickOpenManager::~QuickOpenManager() void QuickOpenManager::show(const QString &text, int selectionStart, int selectionLength) { - Q_ASSERT(m_toolWindow); + QTC_ASSERT(m_toolWindow, return); m_toolWindow->show(text, selectionStart, selectionLength); } diff --git a/src/plugins/quickopen/quickopentoolwindow.cpp b/src/plugins/quickopen/quickopentoolwindow.cpp index 7184a05fa1f..cd279fd7638 100644 --- a/src/plugins/quickopen/quickopentoolwindow.cpp +++ b/src/plugins/quickopen/quickopentoolwindow.cpp @@ -51,6 +51,7 @@ QT_END_NAMESPACE #include <coreplugin/coreconstants.h> #include <coreplugin/fileiconprovider.h> #include <utils/fancylineedit.h> +#include <utils/qtcassert.h> #include <QtCore/QFileInfo> #include <QtCore/QFile> @@ -452,9 +453,9 @@ void QuickOpenToolWindow::filterSelected() { const char * const TEXT = "<type here>"; QAction *action = qobject_cast<QAction*>(sender()); - Q_ASSERT(action); + QTC_ASSERT(action, return); IQuickOpenFilter *filter = action->data().value<IQuickOpenFilter*>(); - Q_ASSERT(filter); + QTC_ASSERT(filter, return); show(filter->shortcutString() + " " + TEXT, filter->shortcutString().length() + 1, QString(TEXT).length()); diff --git a/src/plugins/quickopen/settingspage.cpp b/src/plugins/quickopen/settingspage.cpp index 8fa032ffcac..76263c731ba 100644 --- a/src/plugins/quickopen/settingspage.cpp +++ b/src/plugins/quickopen/settingspage.cpp @@ -32,13 +32,15 @@ ***************************************************************************/ #include "settingspage.h" + #include "quickopenplugin.h" #include "iquickopenfilter.h" #include "directoryfilter.h" -#include <QtGui/QMessageBox> - #include <qtconcurrent/QtConcurrentTools> +#include <utils/qtcassert.h> + +#include <QtGui/QMessageBox> Q_DECLARE_METATYPE(QuickOpen::IQuickOpenFilter*) @@ -46,7 +48,7 @@ using namespace QuickOpen; using namespace QuickOpen::Internal; SettingsPage::SettingsPage(Core::ICore *core, QuickOpenPlugin *plugin) - : m_core(core), m_plugin(plugin), m_page(0) + : m_core(core), m_plugin(plugin), m_page(0) { } @@ -144,9 +146,10 @@ void SettingsPage::configureFilter(QListWidgetItem *item) { if (!item) item = m_ui.filterList->currentItem(); - Q_ASSERT(item); + QTC_ASSERT(item, return); IQuickOpenFilter *filter = item->data(Qt::UserRole).value<IQuickOpenFilter *>(); - Q_ASSERT(filter); + QTC_ASSERT(filter, return); + if (!filter->isConfigurable()) return; bool needsRefresh = false; @@ -172,9 +175,9 @@ void SettingsPage::addCustomFilter() void SettingsPage::removeCustomFilter() { QListWidgetItem *item = m_ui.filterList->currentItem(); - Q_ASSERT(item); + QTC_ASSERT(item, return); IQuickOpenFilter *filter = item->data(Qt::UserRole).value<IQuickOpenFilter *>(); - Q_ASSERT(m_customFilters.contains(filter)); + QTC_ASSERT(m_customFilters.contains(filter), return); m_filters.removeAll(filter); m_customFilters.removeAll(filter); m_refreshFilters.removeAll(filter); diff --git a/src/plugins/resourceeditor/resourceeditorplugin.cpp b/src/plugins/resourceeditor/resourceeditorplugin.cpp index 43ad4ddd90c..44284f06fd7 100644 --- a/src/plugins/resourceeditor/resourceeditorplugin.cpp +++ b/src/plugins/resourceeditor/resourceeditorplugin.cpp @@ -32,6 +32,7 @@ ***************************************************************************/ #include "resourceeditorplugin.h" + #include "resourceeditorw.h" #include "resourceeditorconstants.h" #include "resourcewizard.h" @@ -44,6 +45,8 @@ #include <coreplugin/actionmanager/actionmanagerinterface.h> #include <coreplugin/editormanager/editormanager.h> +#include <utils/qtcassert.h> + #include <QtCore/qplugin.h> #include <QtGui/QAction> @@ -122,10 +125,11 @@ void ResourceEditorPlugin::onUndoStackChanged(ResourceEditorW const *editor, } } -ResourceEditorW * ResourceEditorPlugin::currentEditor() const { +ResourceEditorW * ResourceEditorPlugin::currentEditor() const +{ ResourceEditorW * const focusEditor = qobject_cast<ResourceEditorW *>( m_core->editorManager()->currentEditor()); - Q_ASSERT(focusEditor); + QTC_ASSERT(focusEditor, return 0); return focusEditor; } diff --git a/src/plugins/subversion/subversioneditor.cpp b/src/plugins/subversion/subversioneditor.cpp index 82f8fd55513..3552c0f9b49 100644 --- a/src/plugins/subversion/subversioneditor.cpp +++ b/src/plugins/subversion/subversioneditor.cpp @@ -32,9 +32,11 @@ ***************************************************************************/ #include "subversioneditor.h" + #include "annotationhighlighter.h" #include "subversionconstants.h" +#include <utils/qtcassert.h> #include <vcsbase/diffhighlighter.h> #include <QtCore/QDebug> @@ -49,8 +51,8 @@ SubversionEditor::SubversionEditor(const VCSBase::VCSBaseEditorParameters *type, m_changeNumberPattern(QLatin1String("^\\d+$")), m_revisionNumberPattern(QLatin1String("^r\\d+$")) { - Q_ASSERT(m_changeNumberPattern.isValid()); - Q_ASSERT(m_revisionNumberPattern.isValid()); + QTC_ASSERT(m_changeNumberPattern.isValid(), return); + QTC_ASSERT(m_revisionNumberPattern.isValid(), return); } QSet<QString> SubversionEditor::annotationChanges() const @@ -61,11 +63,11 @@ QSet<QString> SubversionEditor::annotationChanges() const return changes; // Hunt for first change number in annotation: "<change>:" QRegExp r(QLatin1String("^(\\d+):")); - Q_ASSERT(r.isValid()); + QTC_ASSERT(r.isValid(), return changes); if (r.indexIn(txt) != -1) { changes.insert(r.cap(1)); r.setPattern(QLatin1String("\n(\\d+):")); - Q_ASSERT(r.isValid()); + QTC_ASSERT(r.isValid(), return changes); int pos = 0; while ((pos = r.indexIn(txt, pos)) != -1) { pos += r.matchedLength(); @@ -108,7 +110,7 @@ QString SubversionEditor::changeUnderCursor(const QTextCursor &c) const VCSBase::DiffHighlighter *SubversionEditor::createDiffHighlighter() const { const QRegExp filePattern(QLatin1String("^[-+][-+][-+] .*|^Index: .*|^==*$")); - Q_ASSERT(filePattern.isValid()); + QTC_ASSERT(filePattern.isValid(), /**/); return new VCSBase::DiffHighlighter(filePattern); } diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index aad871187f5..06929913806 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -56,6 +56,7 @@ #include <coreplugin/actionmanager/actionmanagerinterface.h> #include <coreplugin/editormanager/editormanager.h> #include <projectexplorer/ProjectExplorerInterfaces> +#include <utils/qtcassert.h> #include <QtCore/qplugin.h> #include <QtCore/QDebug> @@ -504,7 +505,7 @@ SubversionSubmitEditor *SubversionPlugin::openSubversionSubmitEditor(const QStri { Core::IEditor *editor = m_coreInstance->editorManager()->openEditor(fileName, QLatin1String(Constants::SUBVERSIONCOMMITEDITOR_KIND)); SubversionSubmitEditor *submitEditor = qobject_cast<SubversionSubmitEditor*>(editor); - Q_ASSERT(submitEditor); + QTC_ASSERT(submitEditor, /**/); // The actions are for some reason enabled by the context switching // mechanism. Disable them correctly. m_submitDiffAction->setEnabled(false); @@ -981,7 +982,7 @@ Core::IEditor * SubversionPlugin::showOutputInEditor(const QString& title, const QTextCodec *codec) { const VCSBase::VCSBaseEditorParameters *params = findType(editorType); - Q_ASSERT(params); + QTC_ASSERT(params, return 0); const QString kind = QLatin1String(params->kind); if (Subversion::Constants::debug) qDebug() << "SubversionPlugin::showOutputInEditor" << title << kind << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec); @@ -1015,13 +1016,13 @@ void SubversionPlugin::setSettings(const SubversionSettings &s) Core::ICore *SubversionPlugin::coreInstance() { - Q_ASSERT(m_coreInstance); + QTC_ASSERT(m_coreInstance, return 0); return m_coreInstance; } SubversionPlugin *SubversionPlugin::subversionPluginInstance() { - Q_ASSERT(m_subversionPluginInstance); + QTC_ASSERT(m_subversionPluginInstance, m_subversionPluginInstance); return m_subversionPluginInstance; } diff --git a/src/plugins/texteditor/basetextdocument.cpp b/src/plugins/texteditor/basetextdocument.cpp index 81427e7024a..0d5bd8c2dea 100644 --- a/src/plugins/texteditor/basetextdocument.cpp +++ b/src/plugins/texteditor/basetextdocument.cpp @@ -45,8 +45,9 @@ #ifndef TEXTEDITOR_STANDALONE #include <utils/reloadpromptutils.h> -#include "coreplugin/icore.h" +#include <coreplugin/icore.h> #endif +#include <utils/qtcassert.h> using namespace TextEditor; @@ -236,7 +237,7 @@ bool BaseTextDocument::open(const QString &fileName) m_document->setPlainText(text); m_document->setUndoRedoEnabled(true); TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(m_document->documentLayout()); - Q_ASSERT(documentLayout); + QTC_ASSERT(documentLayout, return true); documentLayout->lastSaveRevision = 0; m_document->setModified(false); emit titleChanged(title); @@ -247,7 +248,7 @@ bool BaseTextDocument::open(const QString &fileName) void BaseTextDocument::reload(QTextCodec *codec) { - Q_ASSERT(codec); + QTC_ASSERT(codec, return); m_codec = codec; reload(); } @@ -255,9 +256,8 @@ void BaseTextDocument::reload(QTextCodec *codec) void BaseTextDocument::reload() { emit aboutToReload(); - if (open(m_fileName)) { + if (open(m_fileName)) emit reloaded(); - } } void BaseTextDocument::modified(Core::IFile::ReloadBehavior *behavior) diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 168e8431501..e6b42c55328 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -53,6 +53,7 @@ #include <aggregation/aggregate.h> #endif #include <utils/linecolumnlabel.h> +#include <utils/qtcassert.h> #include <QtCore/QCoreApplication> #include <QtCore/QTextCodec> @@ -415,10 +416,10 @@ UserCanceled: bool DocumentMarker::addMark(TextEditor::ITextMark *mark, int line) { - Q_ASSERT(line >= 1); + QTC_ASSERT(line >= 1, return false); int blockNumber = line - 1; TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(document->documentLayout()); - Q_ASSERT(documentLayout); + QTC_ASSERT(documentLayout, return false); QTextBlock block = document->findBlockByNumber(blockNumber); if (block.isValid()) { @@ -436,7 +437,7 @@ bool DocumentMarker::addMark(TextEditor::ITextMark *mark, int line) TextEditor::TextMarks DocumentMarker::marksAt(int line) const { - Q_ASSERT(line >= 1); + QTC_ASSERT(line >= 1, return TextMarks()); int blockNumber = line - 1; QTextBlock block = document->findBlockByNumber(blockNumber); @@ -531,9 +532,9 @@ void BaseTextEditor::selectEncoding() void DocumentMarker::updateMark(ITextMark *mark) { - TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(document->documentLayout()); - Q_ASSERT(documentLayout); Q_UNUSED(mark); + TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(document->documentLayout()); + QTC_ASSERT(documentLayout, return); documentLayout->requestUpdate(); } @@ -857,7 +858,7 @@ void BaseTextEditor::keyPressEvent(QKeyEvent *e) } #if 0 TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(document()->documentLayout()); - Q_ASSERT(documentLayout); + QTC_ASSERT(documentLayout, return); documentLayout->requestUpdate(); // a bit drastic e->accept(); #endif @@ -1628,7 +1629,7 @@ void BaseTextEditor::paintEvent(QPaintEvent *e) QPainter painter(viewport()); QTextDocument *doc = document(); TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout()); - Q_ASSERT(documentLayout); + QTC_ASSERT(documentLayout, return); QPointF offset(contentOffset()); @@ -2055,7 +2056,7 @@ void BaseTextEditor::slotModificationChanged(bool m) QTextDocument *doc = document(); TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout()); - Q_ASSERT(documentLayout); + QTC_ASSERT(documentLayout, return); int oldLastSaveRevision = documentLayout->lastSaveRevision; documentLayout->lastSaveRevision = doc->revision(); @@ -2113,7 +2114,7 @@ void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e) { QTextDocument *doc = document(); TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout()); - Q_ASSERT(documentLayout); + QTC_ASSERT(documentLayout, return); QPalette pal = d->m_extraArea->palette(); pal.setCurrentColorGroup(QPalette::Active); @@ -2612,7 +2613,7 @@ void BaseTextEditor::ensureCursorVisible() void BaseTextEditor::toggleBlockVisible(const QTextBlock &block) { TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(document()->documentLayout()); - Q_ASSERT(documentLayout); + QTC_ASSERT(documentLayout, return); bool visible = block.next().isVisible(); TextBlockUserData::doCollapse(block, !visible); @@ -2711,7 +2712,7 @@ void BaseTextEditor::handleHomeKey(bool anchor) void BaseTextEditor::handleBackspaceKey() { QTextCursor cursor = textCursor(); - Q_ASSERT(!cursor.hasSelection()); + QTC_ASSERT(!cursor.hasSelection(), return); const TextEditor::TabSettings &tabSettings = d->m_document->tabSettings(); QTextBlock currentBlock = cursor.block(); @@ -3271,7 +3272,7 @@ void BaseTextEditor::setIfdefedOutBlocks(const QList<BaseTextEditor::BlockRange> { QTextDocument *doc = document(); TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout()); - Q_ASSERT(documentLayout); + QTC_ASSERT(documentLayout, return); bool needUpdate = false; @@ -3316,7 +3317,7 @@ void BaseTextEditor::collapse() { QTextDocument *doc = document(); TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout()); - Q_ASSERT(documentLayout); + QTC_ASSERT(documentLayout, return); QTextBlock block = textCursor().block(); qDebug() << "collapse at block" << block.blockNumber(); while (block.isValid()) { @@ -3340,7 +3341,7 @@ void BaseTextEditor::expand() { QTextDocument *doc = document(); TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout()); - Q_ASSERT(documentLayout); + QTC_ASSERT(documentLayout, return); QTextBlock block = textCursor().block(); while (block.isValid() && !block.isVisible()) block = block.previous(); @@ -3354,7 +3355,7 @@ void BaseTextEditor::unCollapseAll() { QTextDocument *doc = document(); TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout()); - Q_ASSERT(documentLayout); + QTC_ASSERT(documentLayout, return); QTextBlock block = doc->firstBlock(); bool makeVisible = true; diff --git a/src/plugins/texteditor/completionsupport.cpp b/src/plugins/texteditor/completionsupport.cpp index 38c017040e9..e7f6a5879a0 100644 --- a/src/plugins/texteditor/completionsupport.cpp +++ b/src/plugins/texteditor/completionsupport.cpp @@ -37,6 +37,7 @@ #include <coreplugin/icore.h> #include <texteditor/itexteditable.h> +#include <utils/qtcassert.h> #include <QString> #include <QList> @@ -103,7 +104,7 @@ void CompletionSupport::autoComplete(ITextEditable *editor, bool forced) m_startPosition = m_completionCollector->startCompletion(editor); completionItems = getCompletions(); - Q_ASSERT(m_startPosition != -1 || completionItems.size() == 0); + QTC_ASSERT(m_startPosition != -1 || completionItems.size() == 0, return); if (completionItems.isEmpty()) { cleanupCompletions(); diff --git a/src/plugins/texteditor/completionwidget.cpp b/src/plugins/texteditor/completionwidget.cpp index ae296dca557..be2a2091c37 100644 --- a/src/plugins/texteditor/completionwidget.cpp +++ b/src/plugins/texteditor/completionwidget.cpp @@ -36,6 +36,7 @@ #include "icompletioncollector.h" #include <texteditor/itexteditable.h> +#include <utils/qtcassert.h> #include <QtCore/QEvent> #include <QtGui/QKeyEvent> @@ -107,7 +108,7 @@ CompletionWidget::CompletionWidget(CompletionSupport *support, ITextEditable *ed m_model(0), m_support(support) { - Q_ASSERT(m_editorWidget); + QTC_ASSERT(m_editorWidget, return); setUniformItemSizes(true); setSelectionBehavior(QAbstractItemView::SelectItems); diff --git a/src/plugins/texteditor/fontsettings.cpp b/src/plugins/texteditor/fontsettings.cpp index bbde495f8dd..28181654174 100644 --- a/src/plugins/texteditor/fontsettings.cpp +++ b/src/plugins/texteditor/fontsettings.cpp @@ -34,6 +34,8 @@ #include "fontsettings.h" #include "fontsettingspage.h" +#include <utils/qtcassert.h> + #include <QtCore/QSettings> #include <QtGui/QTextCharFormat> @@ -133,11 +135,13 @@ bool Format::equals(const Format &f) const return m_foreground == f.m_foreground && m_background == f.m_background && m_bold == f.m_bold && m_italic == f.m_italic; } + // -- FontSettings -FontSettings::FontSettings(const FormatDescriptions & /* fd */) : +FontSettings::FontSettings(const FormatDescriptions &fd) : m_family(defaultFixedFontFamily()), m_fontSize(DEFAULT_FONT_SIZE) { + Q_UNUSED(fd); } void FontSettings::clear() @@ -152,7 +156,7 @@ void FontSettings::toSettings(const QString &category, QSettings *s) const { const int numFormats = m_formats.size(); - Q_ASSERT(descriptions.size() == numFormats); + QTC_ASSERT(descriptions.size() == numFormats, /**/); s->beginGroup(category); if (m_family != defaultFixedFontFamily() || s->contains(QLatin1String(fontFamilyKey))) s->setValue(QLatin1String(fontFamilyKey), m_family); diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp index 635f9654576..5ffd79e6d02 100644 --- a/src/plugins/texteditor/texteditoractionhandler.cpp +++ b/src/plugins/texteditor/texteditoractionhandler.cpp @@ -42,6 +42,7 @@ #include <coreplugin/uniqueidmanager.h> #include <coreplugin/actionmanager/actionmanagerinterface.h> #include <coreplugin/editormanager/editormanager.h> +#include <utils/qtcassert.h> #include <QtCore/QSet> #include <QtCore/QtDebug> @@ -355,7 +356,7 @@ void TextEditorActionHandler::selectAllAction() void TextEditorActionHandler::gotoAction() { QuickOpen::QuickOpenManager *quickopen = QuickOpen::QuickOpenManager::instance(); - Q_ASSERT(quickopen); + QTC_ASSERT(quickopen, return); QString shortcut = TextEditorPlugin::instance()->lineNumberFilter()->shortcutString(); quickopen->show(shortcut + " <line number>", 2, 13); } diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp index f50d6dacc96..ff102b53117 100644 --- a/src/plugins/texteditor/texteditorplugin.cpp +++ b/src/plugins/texteditor/texteditorplugin.cpp @@ -50,6 +50,7 @@ #include <coreplugin/actionmanager/icommand.h> #include <coreplugin/editormanager/editormanager.h> #include <texteditor/texteditoractionhandler.h> +#include <utils/qtcassert.h> #include <QtCore/qplugin.h> #include <QtGui/QShortcut> @@ -67,7 +68,7 @@ TextEditorPlugin::TextEditorPlugin() : m_editorFactory(0), m_lineNumberFilter(0) { - Q_ASSERT(!m_instance); + QTC_ASSERT(!m_instance, return); m_instance = this; } diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp index 3350e2bee16..20b4e1037fe 100644 --- a/src/plugins/texteditor/texteditorsettings.cpp +++ b/src/plugins/texteditor/texteditorsettings.cpp @@ -41,6 +41,8 @@ #include "texteditorconstants.h" #include "texteditorplugin.h" +#include <utils/qtcassert.h> + #include <QApplication> using namespace TextEditor; @@ -52,7 +54,7 @@ TextEditorSettings::TextEditorSettings(Internal::TextEditorPlugin *plugin, QObject *parent) : QObject(parent) { - Q_ASSERT(!m_instance); + QTC_ASSERT(!m_instance, return); m_instance = this; ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); diff --git a/src/plugins/vcsbase/diffhighlighter.cpp b/src/plugins/vcsbase/diffhighlighter.cpp index 60f219842fc..f5fe9fff92d 100644 --- a/src/plugins/vcsbase/diffhighlighter.cpp +++ b/src/plugins/vcsbase/diffhighlighter.cpp @@ -33,6 +33,8 @@ #include "diffhighlighter.h" +#include <utils/qtcassert.h> + #include <QtCore/QDebug> #include <QtCore/QtAlgorithms> #include <QtCore/QRegExp> @@ -67,7 +69,7 @@ DiffHighlighterPrivate::DiffHighlighterPrivate(const QRegExp &filePattern) : m_diffInIndicator(QLatin1Char('+')), m_diffOutIndicator(QLatin1Char('-')) { - Q_ASSERT(filePattern.isValid()); + QTC_ASSERT(filePattern.isValid(), /**/); } DiffFormats DiffHighlighterPrivate::analyzeLine(const QString &text) const diff --git a/src/tools/makespy/main.cpp b/src/tools/makespy/main.cpp index 9cce394f0a0..e8ebd7dea09 100644 --- a/src/tools/makespy/main.cpp +++ b/src/tools/makespy/main.cpp @@ -108,7 +108,6 @@ void MakeProcess::handleOutput() } } - void MakeProcess::handleMakeLine(const QString &line) { int pos1 = line.indexOf('`'); diff --git a/tests/manual/cplusplus/main.cpp b/tests/manual/cplusplus/main.cpp index 234c9684a39..fd3c730f41d 100644 --- a/tests/manual/cplusplus/main.cpp +++ b/tests/manual/cplusplus/main.cpp @@ -31,17 +31,17 @@ ** ***************************************************************************/ -#include <QFile> +#include <AST.h> +#include <Control.h> +#include <Scope.h> +#include <Semantic.h> +#include <TranslationUnit.h> + +#include <QtCore/QFile> #include <cstdio> #include <cstdlib> -#include <TranslationUnit.h> -#include <Control.h> -#include <AST.h> -#include <Semantic.h> -#include <Scope.h> - int main(int, char *[]) { Control control; From 23872bb9974778b6a5e44569129e5622d1fa804d Mon Sep 17 00:00:00 2001 From: mae <qtc-committer@nokia.com> Date: Tue, 9 Dec 2008 15:41:01 +0100 Subject: [PATCH 55/77] make indenting the selection a single undo/redo command --- src/plugins/texteditor/basetexteditor.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 82a4201b264..ff9be893a75 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -2751,7 +2751,9 @@ void BaseTextEditor::handleBackspaceKey() void BaseTextEditor::format() { QTextCursor cursor = textCursor(); + cursor.beginEditBlock(); indent(document(), cursor, QChar::Null); + cursor.endEditBlock(); } void BaseTextEditor::unCommentSelection() @@ -3319,16 +3321,13 @@ void BaseTextEditor::collapse() TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout()); Q_ASSERT(documentLayout); QTextBlock block = textCursor().block(); - qDebug() << "collapse at block" << block.blockNumber(); while (block.isValid()) { - qDebug() << "test block" << block.blockNumber(); if (TextBlockUserData::canCollapse(block) && block.next().isVisible()) { if ((block.next().userState()) >> 8 <= (textCursor().block().userState() >> 8)) break; } block = block.previous(); } - qDebug() << "found" << block.blockNumber(); if (block.isValid()) { TextBlockUserData::doCollapse(block, false); d->moveCursorVisible(); From b3f0f33b39bc1505257e7fccf9a2bd58b9941db4 Mon Sep 17 00:00:00 2001 From: Roberto Raggi <qtc-committer@nokia.com> Date: Tue, 9 Dec 2008 15:42:48 +0100 Subject: [PATCH 56/77] oops! fixed a typo --- src/libs/cplusplus/pp-macro.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/cplusplus/pp-macro.h b/src/libs/cplusplus/pp-macro.h index 73cdab7e3a0..887fff53b0a 100644 --- a/src/libs/cplusplus/pp-macro.h +++ b/src/libs/cplusplus/pp-macro.h @@ -111,7 +111,7 @@ public: } if (variadics) text += QLatin1String("..."); - text += QLatin1Char(' '); + text += QLatin1Char(')'); } text += QLatin1Char(' '); text += QString::fromUtf8(definition.constData(), definition.size()); From 18b3d258641ccf8d1a763ede3ea45b279c76e834 Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Tue, 9 Dec 2008 16:18:28 +0100 Subject: [PATCH 57/77] some QTC_ASSERT polishing --- src/libs/utils/qtcassert.h | 8 ++-- src/plugins/debugger/breakhandler.cpp | 3 +- src/plugins/debugger/debugger.pro | 2 - src/plugins/debugger/debuggerplugin.cpp | 10 +++- src/plugins/debugger/gdbengine.cpp | 3 +- src/plugins/debugger/gdbmi.cpp | 4 +- src/plugins/debugger/mode.cpp | 5 +- src/plugins/debugger/scriptengine.cpp | 9 ++-- src/plugins/debugger/stackhandler.cpp | 2 +- src/plugins/debugger/watchhandler.cpp | 2 +- src/plugins/projectexplorer/projectnodes.cpp | 48 ++++++++++---------- 11 files changed, 51 insertions(+), 45 deletions(-) diff --git a/src/libs/utils/qtcassert.h b/src/libs/utils/qtcassert.h index d05be20df81..f75d225f6e6 100644 --- a/src/libs/utils/qtcassert.h +++ b/src/libs/utils/qtcassert.h @@ -36,13 +36,11 @@ #include <QtCore/QDebug> -#ifdef Q_OS_UNIX +// we do not use the 'do {...} while (0)' idiom here to be able to use +// 'break' and 'continue' as 'actions'. + #define QTC_ASSERT(cond, action) \ if(cond){}else{qDebug()<<"ASSERTION"<<#cond<<"FAILED"<<__FILE__<<__LINE__;action;} -#else -#define QTC_ASSERT(cond, action) \ - if(cond){}else{qDebug()<<"ASSERTION"<<#cond<<"FAILED";action;} -#endif #endif // QTC_ASSERT_H diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index 926568517da..e27aa5ec41d 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -34,7 +34,8 @@ #include "breakhandler.h" #include "imports.h" // TextEditor::BaseTextMark -#include "qtcassert.h" + +#include <utils/qtcassert.h> #include <QtCore/QDebug> #include <QtCore/QFileInfo> diff --git a/src/plugins/debugger/debugger.pro b/src/plugins/debugger/debugger.pro index 6b8c2e74ca4..3d67e19c6aa 100644 --- a/src/plugins/debugger/debugger.pro +++ b/src/plugins/debugger/debugger.pro @@ -10,8 +10,6 @@ include(../../plugins/texteditor/texteditor.pri) include(../../plugins/cpptools/cpptools.pri) include(../../libs/cplusplus/cplusplus.pri) -INCLUDEPATH += ../../libs/utils - # DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII QT += gui network script diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 03f86bec249..37406f70cc1 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -39,7 +39,6 @@ #include "gdboptionpage.h" #include "gdbengine.h" #include "mode.h" -#include "qtcassert.h" #include <coreplugin/actionmanager/actionmanagerinterface.h> #include <coreplugin/coreconstants.h> @@ -48,20 +47,27 @@ #include <coreplugin/messagemanager.h> #include <coreplugin/modemanager.h> #include <coreplugin/uniqueidmanager.h> + #include <cplusplus/ExpressionUnderCursor.h> + #include <cppeditor/cppeditorconstants.h> + #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/session.h> + +#include <texteditor/basetexteditor.h> #include <texteditor/basetextmark.h> #include <texteditor/itexteditor.h> #include <texteditor/texteditorconstants.h> -#include <texteditor/basetexteditor.h> + +#include <utils/qtcassert.h> #include <QtCore/QDebug> #include <QtCore/qplugin.h> #include <QtCore/QObject> #include <QtCore/QPoint> #include <QtCore/QSettings> + #include <QtGui/QPlainTextEdit> #include <QtGui/QTextBlock> #include <QtGui/QTextCursor> diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp index 13af8e3075b..d7ac5b1aaa1 100644 --- a/src/plugins/debugger/gdbengine.cpp +++ b/src/plugins/debugger/gdbengine.cpp @@ -37,7 +37,6 @@ #include "debuggermanager.h" #include "gdbmi.h" #include "procinterrupt.h" -#include "qtcassert.h" #include "disassemblerhandler.h" #include "breakhandler.h" @@ -49,6 +48,8 @@ #include "startexternaldialog.h" #include "attachexternaldialog.h" +#include <utils/qtcassert.h> + #include <QtCore/QDebug> #include <QtCore/QDir> #include <QtCore/QFileInfo> diff --git a/src/plugins/debugger/gdbmi.cpp b/src/plugins/debugger/gdbmi.cpp index 3beadc385fa..f14bb752e3e 100644 --- a/src/plugins/debugger/gdbmi.cpp +++ b/src/plugins/debugger/gdbmi.cpp @@ -32,10 +32,10 @@ ***************************************************************************/ #include "gdbmi.h" -#include "qtcassert.h" + +#include <utils/qtcassert.h> #include <QtCore/QByteArray> -#include <QtCore/QDebug> #include <QtCore/QTextStream> namespace Debugger { diff --git a/src/plugins/debugger/mode.cpp b/src/plugins/debugger/mode.cpp index c1bbdd550f1..234f09c2079 100644 --- a/src/plugins/debugger/mode.cpp +++ b/src/plugins/debugger/mode.cpp @@ -35,7 +35,6 @@ #include "debuggerconstants.h" #include "debuggermanager.h" -#include "qtcassert.h" #include <coreplugin/coreconstants.h> #include <coreplugin/icore.h> @@ -48,10 +47,14 @@ #include <coreplugin/outputpane.h> #include <coreplugin/navigationwidget.h> #include <coreplugin/rightpane.h> + #include <projectexplorer/projectexplorerconstants.h> +#include <utils/qtcassert.h> + #include <QtCore/QDebug> #include <QtCore/QSettings> + #include <QtGui/QDockWidget> #include <QtGui/QLabel> #include <QtGui/QMainWindow> diff --git a/src/plugins/debugger/scriptengine.cpp b/src/plugins/debugger/scriptengine.cpp index 50f9dcdf4e2..e6387bfdda9 100644 --- a/src/plugins/debugger/scriptengine.cpp +++ b/src/plugins/debugger/scriptengine.cpp @@ -33,19 +33,18 @@ #include "scriptengine.h" -#include "qtcassert.h" +#include "attachexternaldialog.h" +#include "breakhandler.h" #include "debuggerconstants.h" #include "debuggermanager.h" - #include "disassemblerhandler.h" -#include "breakhandler.h" #include "moduleshandler.h" #include "registerhandler.h" #include "stackhandler.h" +#include "startexternaldialog.h" #include "watchhandler.h" -#include "startexternaldialog.h" -#include "attachexternaldialog.h" +#include <utils/qtcassert.h> #include <QtCore/QDateTime> #include <QtCore/QDebug> diff --git a/src/plugins/debugger/stackhandler.cpp b/src/plugins/debugger/stackhandler.cpp index 818b6b61888..fd70e1e1ab9 100644 --- a/src/plugins/debugger/stackhandler.cpp +++ b/src/plugins/debugger/stackhandler.cpp @@ -33,7 +33,7 @@ #include "stackhandler.h" -#include "qtcassert.h" +#include <utils/qtcassert.h> #include <QtCore/QAbstractTableModel> #include <QtCore/QDebug> diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index e03c91f7100..07824735ebf 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -37,7 +37,7 @@ #include "modeltest.h" #endif -#include "qtcassert.h" +#include <utils/qtcassert.h> #include <QtCore/QDebug> #include <QtCore/QEvent> diff --git a/src/plugins/projectexplorer/projectnodes.cpp b/src/plugins/projectexplorer/projectnodes.cpp index 1c30bbe1094..7c85aae6ae3 100644 --- a/src/plugins/projectexplorer/projectnodes.cpp +++ b/src/plugins/projectexplorer/projectnodes.cpp @@ -314,8 +314,8 @@ void ProjectNode::addProjectNodes(const QList<ProjectNode*> &subProjects) emit watcher->foldersAboutToBeAdded(this, folderNodes); foreach (ProjectNode *project, subProjects) { - Q_ASSERT_X(!project->parentFolderNode(), "addProjectNodes", - "Project node has already a parent"); + QTC_ASSERT(!project->parentFolderNode(), + qDebug("Project node has already a parent")); project->setParentFolderNode(this); foreach (NodesWatcher *watcher, m_watchers) project->registerWatcher(watcher); @@ -353,13 +353,13 @@ void ProjectNode::removeProjectNodes(const QList<ProjectNode*> &subProjects) for (; toRemoveIter != toRemove.constEnd(); ++toRemoveIter) { while ((*projectIter)->path() != (*toRemoveIter)->path()) { ++projectIter; - Q_ASSERT_X(projectIter != m_subProjectNodes.end(), "removeProjectNodes", - "Project to remove is not part of specified folder!"); + QTC_ASSERT(projectIter != m_subProjectNodes.end(), + qDebug("Project to remove is not part of specified folder!")); } while ((*folderIter)->path() != (*toRemoveIter)->path()) { ++folderIter; - Q_ASSERT_X(folderIter != m_subFolderNodes.end(), "removeProjectNodes", - "Project to remove is not part of specified folder!"); + QTC_ASSERT(folderIter != m_subFolderNodes.end(), + qDebug("Project to remove is not part of specified folder!")); } delete *projectIter; projectIter = m_subProjectNodes.erase(projectIter); @@ -386,15 +386,15 @@ void ProjectNode::addFolderNodes(const QList<FolderNode*> &subFolders, FolderNod watcher->foldersAboutToBeAdded(parentFolder, subFolders); foreach (FolderNode *folder, subFolders) { - Q_ASSERT_X(!folder->parentFolderNode(), "addFolderNodes", - "Project node has already a parent folder"); + QTC_ASSERT(!folder->parentFolderNode(), + qDebug("Project node has already a parent folder")); folder->setParentFolderNode(parentFolder); folder->setProjectNode(this); parentFolder->m_subFolderNodes.append(folder); // project nodes have to be added via addProjectNodes - Q_ASSERT_X(folder->nodeType() != ProjectNodeType, "addFolderNodes", - "project nodes have to be added via addProjectNodes"); + QTC_ASSERT(folder->nodeType() != ProjectNodeType, + qDebug("project nodes have to be added via addProjectNodes")); } qSort(parentFolder->m_subFolderNodes.begin(), parentFolder->m_subFolderNodes.end(), sortNodesByPath); @@ -427,12 +427,12 @@ void ProjectNode::removeFolderNodes(const QList<FolderNode*> &subFolders, QList<FolderNode*>::const_iterator toRemoveIter = toRemove.constBegin(); QList<FolderNode*>::iterator folderIter = parentFolder->m_subFolderNodes.begin(); for (; toRemoveIter != toRemove.constEnd(); ++toRemoveIter) { - Q_ASSERT_X(((*toRemoveIter)->nodeType() != ProjectNodeType), "removeFolderNodes", - "project nodes have to be removed via removeProjectNodes"); + QTC_ASSERT((*toRemoveIter)->nodeType() != ProjectNodeType, + qDebug("project nodes have to be removed via removeProjectNodes")); while ((*folderIter)->path() != (*toRemoveIter)->path()) { ++folderIter; - Q_ASSERT_X(folderIter != parentFolder->m_subFolderNodes.end(), "removeFileNodes", - "Folder to remove is not part of specified folder!"); + QTC_ASSERT(folderIter != parentFolder->m_subFolderNodes.end(), + qDebug("Folder to remove is not part of specified folder!")); } delete *folderIter; folderIter = parentFolder->m_subFolderNodes.erase(folderIter); @@ -460,8 +460,8 @@ void ProjectNode::addFileNodes(const QList<FileNode*> &files, FolderNode *folder emit watcher->filesAboutToBeAdded(folder, files); foreach (FileNode *file, files) { - Q_ASSERT_X(!file->parentFolderNode(), "addFileNodes", - "File node has already a parent folder"); + QTC_ASSERT(!file->parentFolderNode(), + qDebug("File node has already a parent folder")); file->setParentFolderNode(folder); file->setProjectNode(this); @@ -499,8 +499,8 @@ void ProjectNode::removeFileNodes(const QList<FileNode*> &files, FolderNode *fol for (; toRemoveIter != toRemove.constEnd(); ++toRemoveIter) { while ((*filesIter)->path() != (*toRemoveIter)->path()) { ++filesIter; - Q_ASSERT_X(filesIter != folder->m_fileNodes.end(), "removeFileNodes", - "File to remove is not part of specified folder!"); + QTC_ASSERT(filesIter != folder->m_fileNodes.end(), + qDebug("File to remove is not part of specified folder!")); } delete *filesIter; filesIter = folder->m_fileNodes.erase(filesIter); @@ -591,8 +591,8 @@ void SessionNode::addProjectNodes(const QList<ProjectNode*> &projectNodes) emit watcher->foldersAboutToBeAdded(this, folderNodes); foreach (ProjectNode *project, projectNodes) { - Q_ASSERT_X(!project->parentFolderNode(), "addProjectNodes", - "Project node has already a parent folder"); + QTC_ASSERT(!project->parentFolderNode(), + qDebug("Project node has already a parent folder")); project->setParentFolderNode(this); foreach (NodesWatcher *watcher, m_watchers) project->registerWatcher(watcher); @@ -621,13 +621,13 @@ void SessionNode::removeProjectNodes(const QList<ProjectNode*> &projectNodes) for (; toRemoveIter != toRemove.constEnd(); ++toRemoveIter) { while ((*projectIter)->path() != (*toRemoveIter)->path()) { ++projectIter; - Q_ASSERT_X(projectIter != m_projectNodes.end(), "removeProjectNodes", - "Project to remove is not part of specified folder!"); + QTC_ASSERT(projectIter != m_projectNodes.end(), + qDebug("Project to remove is not part of specified folder!")); } while ((*folderIter)->path() != (*toRemoveIter)->path()) { ++folderIter; - Q_ASSERT_X(folderIter != m_subFolderNodes.end(), "removeProjectNodes", - "Project to remove is not part of specified folder!"); + QTC_ASSERT(folderIter != m_subFolderNodes.end(), + qDebug("Project to remove is not part of specified folder!")); } projectIter = m_projectNodes.erase(projectIter); folderIter = m_subFolderNodes.erase(folderIter); From 9653f4b7e9a5d238fb80f28446c0c04c1dd19b4f Mon Sep 17 00:00:00 2001 From: Roberto Raggi <qtc-committer@nokia.com> Date: Tue, 9 Dec 2008 16:19:56 +0100 Subject: [PATCH 58/77] Fixed macro locations. --- src/libs/cplusplus/pp-engine.cpp | 10 ++++++---- src/libs/cplusplus/pp-environment.cpp | 6 +++--- src/libs/cplusplus/pp-environment.h | 2 +- src/libs/cplusplus/pp-macro-expander.cpp | 4 ++-- src/plugins/cpptools/cppmodelmanager.cpp | 8 ++++---- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp index fd618d27065..d2ed3ee73f3 100644 --- a/src/libs/cplusplus/pp-engine.cpp +++ b/src/libs/cplusplus/pp-engine.cpp @@ -481,12 +481,12 @@ void pp::operator () (const QByteArray &filename, const QByteArray &source, QByteArray *result) { - const QByteArray previousFile = env.current_file; - env.current_file = filename; + const QByteArray previousFile = env.currentFile; + env.currentFile = filename; operator () (source, result); - env.current_file = previousFile; + env.currentFile = previousFile; } pp::State pp::createStateFromSource(const QByteArray &source) const @@ -518,7 +518,7 @@ void pp::operator()(const QByteArray &source, QByteArray *result) result->append(QByteArray::number(_dot->lineno)); result->append(' '); result->append('"'); - result->append(env.current_file); + result->append(env.currentFile); result->append('"'); result->append('\n'); } else { @@ -844,6 +844,8 @@ void pp::processDefine(TokenIterator firstToken, TokenIterator lastToken) } Macro macro; + macro.fileName = env.currentFile; + macro.line = env.currentLine; macro.name = tokenText(*tk); ++tk; // skip T_IDENTIFIER diff --git a/src/libs/cplusplus/pp-environment.cpp b/src/libs/cplusplus/pp-environment.cpp index ff2ca77e4f2..20491727a4c 100644 --- a/src/libs/cplusplus/pp-environment.cpp +++ b/src/libs/cplusplus/pp-environment.cpp @@ -97,8 +97,6 @@ Macro *Environment::bind(const Macro &__macro) Macro *m = new Macro (__macro); m->hashcode = hash_code(m->name); - m->fileName = current_file; - m->line = currentLine; if (++_macro_count == _allocated_macros) { if (! _allocated_macros) @@ -122,11 +120,13 @@ Macro *Environment::bind(const Macro &__macro) return m; } -Macro *Environment::remove (const QByteArray &name) +Macro *Environment::remove(const QByteArray &name) { Macro macro; macro.name = name; macro.hidden = true; + macro.fileName = currentFile; + macro.line = currentLine; return bind(macro); } diff --git a/src/libs/cplusplus/pp-environment.h b/src/libs/cplusplus/pp-environment.h index e2a75d29b81..4200b5ea0ff 100644 --- a/src/libs/cplusplus/pp-environment.h +++ b/src/libs/cplusplus/pp-environment.h @@ -94,7 +94,7 @@ private: void rehash(); public: - QByteArray current_file; + QByteArray currentFile; unsigned currentLine; bool hide_next; diff --git a/src/libs/cplusplus/pp-macro-expander.cpp b/src/libs/cplusplus/pp-macro-expander.cpp index 9ae9702fe18..e17dd873dba 100644 --- a/src/libs/cplusplus/pp-macro-expander.cpp +++ b/src/libs/cplusplus/pp-macro-expander.cpp @@ -73,7 +73,7 @@ const char *MacroExpander::operator () (const char *__first, const char *__last, __result->append(QByteArray::number(env.currentLine)); __result->append(' '); __result->append('"'); - __result->append(env.current_file); + __result->append(env.currentFile); __result->append('"'); __result->append('\n'); ++lines; @@ -218,7 +218,7 @@ const char *MacroExpander::operator () (const char *__first, const char *__last, else if (fast_name == "__FILE__") { __result->append('"'); - __result->append(env.current_file); + __result->append(env.currentFile); __result->append('"'); continue; } diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index 5111aa31996..40888d99f3f 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -390,17 +390,17 @@ void CppPreprocessor::sourceNeeded(QString &fileName, IncludeType type) } else { Document::Ptr previousDoc = switchDocument(Document::create(fileName)); - const QByteArray previousFile = env.current_file; + const QByteArray previousFile = env.currentFile; const unsigned previousLine = env.currentLine; - env.current_file = QByteArray(m_currentDoc->translationUnit()->fileName(), - m_currentDoc->translationUnit()->fileNameLength()); + env.currentFile = QByteArray(m_currentDoc->translationUnit()->fileName(), + m_currentDoc->translationUnit()->fileNameLength()); QByteArray preprocessedCode; m_proc(contents, &preprocessedCode); //qDebug() << preprocessedCode; - env.current_file = previousFile; + env.currentFile = previousFile; env.currentLine = previousLine; m_currentDoc->setSource(preprocessedCode); From 0e27bc5aa3772a8fe529ef457fbe4a313696842b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com> Date: Tue, 9 Dec 2008 16:30:47 +0100 Subject: [PATCH 59/77] Exclude anonymous symbols from the QuickOpen They're not overly useful to have in there, since they don't have a name you could type to jump to them. Reviewed-by: Roberto Raggi --- src/plugins/cpptools/searchsymbols.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/cpptools/searchsymbols.cpp b/src/plugins/cpptools/searchsymbols.cpp index 308449ab581..47f540c6ddb 100644 --- a/src/plugins/cpptools/searchsymbols.cpp +++ b/src/plugins/cpptools/searchsymbols.cpp @@ -153,7 +153,7 @@ bool SearchSymbols::visit(Class *symbol) QString SearchSymbols::scopedSymbolName(const QString &symbolName) const { QString name = _scope; - if (! name.isEmpty()) + if (!name.isEmpty()) name += QLatin1String("::"); name += symbolName; return name; @@ -196,6 +196,9 @@ void SearchSymbols::appendItem(const QString &name, ModelItemInfo::ItemType type, const Symbol *symbol) { + if (!symbol->name()) + return; + const QIcon icon = icons.iconForSymbol(symbol); items.append(ModelItemInfo(name, info, type, QString::fromUtf8(symbol->fileName(), symbol->fileNameLength()), From 187434df96a2c7ebc4025c456c80ce46c54c3062 Mon Sep 17 00:00:00 2001 From: Roberto Raggi <qtc-committer@nokia.com> Date: Tue, 9 Dec 2008 16:39:52 +0100 Subject: [PATCH 60/77] Follow macro under cursor. --- src/plugins/cppeditor/cppeditor.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index ff68bd0bac2..8d4a36178ce 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -520,6 +520,15 @@ void CPPEditor::jumpToDefinition() #endif } } else { + foreach (const Document::MacroUse use, doc->macroUses()) { + if (use.contains(endOfName - 1)) { + const Macro ¯o = use.macro(); + const QString fileName = QString::fromUtf8(macro.fileName); + if (TextEditor::BaseTextEditor::openEditorAt(fileName, macro.line, 0)) + return; // done + } + } + qDebug() << "No results for expression:" << expression; } } From bbc97c394426287c67f9b0248d6fa4afb17afcd2 Mon Sep 17 00:00:00 2001 From: con <qtc-committer@nokia.com> Date: Tue, 9 Dec 2008 17:04:50 +0100 Subject: [PATCH 61/77] Fixes: - "Problems" -> "Build Issues" --- src/plugins/projectexplorer/taskwindow.cpp | 2 +- src/plugins/projectexplorer/taskwindow.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index 236b2069ae0..2e3131e36fc 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -257,7 +257,7 @@ TaskWindow::TaskWindow() m_listview->setModel(m_model); m_listview->setFrameStyle(QFrame::NoFrame); - m_listview->setWindowTitle(tr("Problems")); + m_listview->setWindowTitle(tr("Build Issues")); m_listview->setSelectionMode(QAbstractItemView::SingleSelection); TaskDelegate *tld = new TaskDelegate(this); m_listview->setItemDelegate(tld); diff --git a/src/plugins/projectexplorer/taskwindow.h b/src/plugins/projectexplorer/taskwindow.h index 70253411530..a3bdf47621d 100644 --- a/src/plugins/projectexplorer/taskwindow.h +++ b/src/plugins/projectexplorer/taskwindow.h @@ -63,7 +63,7 @@ public: QWidget *outputWidget(QWidget *); QList<QWidget*> toolBarWidgets(void) const; - QString name() const { return tr("Problems"); } + QString name() const { return tr("Build Issues"); } int priorityInStatusBar() const; void clearContents(); void visibilityChanged(bool visible); From a908e6737c5995bac68daf94d76fa1d0fb0a46bd Mon Sep 17 00:00:00 2001 From: Patrick Star <qtc-committer@nokia.com> Date: Tue, 9 Dec 2008 17:08:00 +0100 Subject: [PATCH 62/77] Fixes: - crash on windows --- src/plugins/debugger/watchhandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 07824735ebf..053fcadcd19 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -118,7 +118,7 @@ static QByteArray quoteUnprintable(const QByteArray &ba) QByteArray res; char buf[10]; for (int i = 0, n = ba.size(); i != n; ++i) { - char c = ba.at(i); + unsigned char c = ba.at(i); if (isprint(c)) { res += c; } else { From 5f544b4daf99356baf3535cf0b776b8cf5789b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com> Date: Tue, 9 Dec 2008 17:15:00 +0100 Subject: [PATCH 63/77] Added the CppFunctionsFilter to QuickOpen In the GUI this is currently called "Methods" with the shortcut 'm'. --- src/plugins/cpptools/cppfunctionsfilter.cpp | 50 ++++++++++++++++++ src/plugins/cpptools/cppfunctionsfilter.h | 58 +++++++++++++++++++++ src/plugins/cpptools/cpptools.cpp | 2 + src/plugins/cpptools/cpptools.pro | 7 +-- src/plugins/cpptools/searchsymbols.cpp | 17 +++++- 5 files changed, 129 insertions(+), 5 deletions(-) create mode 100644 src/plugins/cpptools/cppfunctionsfilter.cpp create mode 100644 src/plugins/cpptools/cppfunctionsfilter.h diff --git a/src/plugins/cpptools/cppfunctionsfilter.cpp b/src/plugins/cpptools/cppfunctionsfilter.cpp new file mode 100644 index 00000000000..61bb8e2d00d --- /dev/null +++ b/src/plugins/cpptools/cppfunctionsfilter.cpp @@ -0,0 +1,50 @@ +/*************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** +** Non-Open Source Usage +** +** Licensees may use this file in accordance with the Qt Beta Version +** License Agreement, Agreement version 2.2 provided with the Software or, +** alternatively, in accordance with the terms contained in a written +** agreement between you and Nokia. +** +** GNU General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the packaging +** of this file. Please review the following information to ensure GNU +** General Public Licensing requirements will be met: +** +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt GPL Exception +** version 1.2, included in the file GPL_EXCEPTION.txt in this package. +** +***************************************************************************/ + +#include "cppfunctionsfilter.h" + +using namespace CppTools::Internal; + +CppFunctionsFilter::CppFunctionsFilter(CppModelManager *manager, Core::EditorManager *editorManager) + : CppQuickOpenFilter(manager, editorManager) +{ + setShortcutString("m"); + setIncludedByDefault(false); + + search.setSymbolsToSearchFor(SearchSymbols::Functions); + search.setSeparateScope(true); +} + +CppFunctionsFilter::~CppFunctionsFilter() +{ +} diff --git a/src/plugins/cpptools/cppfunctionsfilter.h b/src/plugins/cpptools/cppfunctionsfilter.h new file mode 100644 index 00000000000..6e48d65b26f --- /dev/null +++ b/src/plugins/cpptools/cppfunctionsfilter.h @@ -0,0 +1,58 @@ +/*************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** +** Non-Open Source Usage +** +** Licensees may use this file in accordance with the Qt Beta Version +** License Agreement, Agreement version 2.2 provided with the Software or, +** alternatively, in accordance with the terms contained in a written +** agreement between you and Nokia. +** +** GNU General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the packaging +** of this file. Please review the following information to ensure GNU +** General Public Licensing requirements will be met: +** +** http://www.fsf.org/licensing/licenses/info/GPLv2.html and +** http://www.gnu.org/copyleft/gpl.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt GPL Exception +** version 1.2, included in the file GPL_EXCEPTION.txt in this package. +** +***************************************************************************/ + +#ifndef CPPFUNCTIONSFILTER_H +#define CPPFUNCTIONSFILTER_H + +#include <cppquickopenfilter.h> + +namespace CppTools { +namespace Internal { + +class CppFunctionsFilter : public CppQuickOpenFilter +{ + Q_OBJECT + +public: + CppFunctionsFilter(CppModelManager *manager, Core::EditorManager *editorManager); + ~CppFunctionsFilter(); + + QString trName() const { return tr("Methods"); } + QString name() const { return QLatin1String("Methods"); } + Priority priority() const { return Medium; } +}; + +} // namespace Internal +} // namespace CppTools + +#endif // CPPFUNCTIONSFILTER_H diff --git a/src/plugins/cpptools/cpptools.cpp b/src/plugins/cpptools/cpptools.cpp index 957f0cae9b0..5e9f6dca45f 100644 --- a/src/plugins/cpptools/cpptools.cpp +++ b/src/plugins/cpptools/cpptools.cpp @@ -34,6 +34,7 @@ #include "cpptools.h" #include "cppclassesfilter.h" #include "cppcodecompletion.h" +#include "cppfunctionsfilter.h" #include "cpphoverhandler.h" #include "cppmodelmanager.h" #include "cpptoolsconstants.h" @@ -89,6 +90,7 @@ bool CppToolsPlugin::initialize(const QStringList & /*arguments*/, QString *) m_core->editorManager()); addAutoReleasedObject(quickOpenFilter); addAutoReleasedObject(new CppClassesFilter(m_modelManager, m_core->editorManager())); + addAutoReleasedObject(new CppFunctionsFilter(m_modelManager, m_core->editorManager())); // Menus Core::IActionContainer *mtools = am->actionContainer(Core::Constants::M_TOOLS); diff --git a/src/plugins/cpptools/cpptools.pro b/src/plugins/cpptools/cpptools.pro index 92905e42ef9..74112379e39 100644 --- a/src/plugins/cpptools/cpptools.pro +++ b/src/plugins/cpptools/cpptools.pro @@ -10,15 +10,16 @@ unix:QMAKE_CXXFLAGS_DEBUG += -O3 INCLUDEPATH += . DEFINES += CPPTOOLS_LIBRARY CONFIG += help - HEADERS += cpptools_global.h \ cppquickopenfilter.h \ cppclassesfilter.h \ - searchsymbols.h + searchsymbols.h \ + cppfunctionsfilter.h SOURCES += cppquickopenfilter.cpp \ cpptoolseditorsupport.cpp \ cppclassesfilter.cpp \ - searchsymbols.cpp + searchsymbols.cpp \ + cppfunctionsfilter.cpp # Input SOURCES += cpptools.cpp \ diff --git a/src/plugins/cpptools/searchsymbols.cpp b/src/plugins/cpptools/searchsymbols.cpp index 47f540c6ddb..2669ea7bc79 100644 --- a/src/plugins/cpptools/searchsymbols.cpp +++ b/src/plugins/cpptools/searchsymbols.cpp @@ -35,6 +35,7 @@ #include <Literals.h> #include <Scope.h> +#include <Names.h> using namespace CPlusPlus; using namespace CppTools::Internal; @@ -97,12 +98,24 @@ bool SearchSymbols::visit(Function *symbol) if (!(symbolsToSearchFor & Functions)) return false; + QString extraScope; + if (Name *name = symbol->name()) { + if (QualifiedNameId *nameId = name->asQualifiedNameId()) { + if (nameId->nameCount() > 1) { + extraScope = overview.prettyName(nameId->nameAt(nameId->nameCount() - 2)); + } + } + } + QString fullScope = _scope; + if (!_scope.isEmpty() && !extraScope.isEmpty()) + fullScope += QLatin1String("::"); + fullScope += extraScope; QString name = symbolName(symbol); QString scopedName = scopedSymbolName(name); QString type = overview.prettyType(symbol->type(), - separateScope ? symbol->name() : 0); + separateScope ? symbol->identity() : 0); appendItem(separateScope ? type : scopedName, - separateScope ? _scope : type, + separateScope ? fullScope : type, ModelItemInfo::Method, symbol); return false; } From 1e8b9167ef1c07b0f9c6d59a5de60740dad127d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com> Date: Tue, 9 Dec 2008 17:16:26 +0100 Subject: [PATCH 64/77] Sort C++ QuickOpen with less than 1000 results In this case it's fast enough and sorting the list makes it easier to find what you're looking for. Though because of the substring matching, what you're looking for might still be way down the list. Reviewed-by: con --- src/plugins/cpptools/cppquickopenfilter.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plugins/cpptools/cppquickopenfilter.cpp b/src/plugins/cpptools/cppquickopenfilter.cpp index a1f1a9b3713..ac69c9cc6df 100644 --- a/src/plugins/cpptools/cppquickopenfilter.cpp +++ b/src/plugins/cpptools/cppquickopenfilter.cpp @@ -75,6 +75,12 @@ void CppQuickOpenFilter::refresh(QFutureInterface<void> &future) Q_UNUSED(future); } +static bool compareLexigraphically(const QuickOpen::FilterEntry &a, + const QuickOpen::FilterEntry &b) +{ + return a.displayName < b.displayName; +} + QList<QuickOpen::FilterEntry> CppQuickOpenFilter::matchesFor(const QString &origEntry) { QString entry = trimWildcards(origEntry); @@ -109,6 +115,9 @@ QList<QuickOpen::FilterEntry> CppQuickOpenFilter::matchesFor(const QString &orig } } + if (entries.size() < 1000) + qSort(entries.begin(), entries.end(), compareLexigraphically); + return entries; } From ae3fda8b8454e946004174e0b335db6034d334b0 Mon Sep 17 00:00:00 2001 From: dt <qtc-committer@nokia.com> Date: Tue, 9 Dec 2008 17:17:12 +0100 Subject: [PATCH 65/77] Fixes: Don't call Qt4ProFileNode::update on rebuild. Task: Found by Roberto. --- .../qt4projectmanager/directorywatcher.cpp | 54 +++++++++++++++++++ .../qt4projectmanager/directorywatcher.h | 25 +++++++++ src/plugins/qt4projectmanager/qt4nodes.cpp | 30 ++++++++++- src/plugins/qt4projectmanager/qt4nodes.h | 16 ++++-- src/plugins/qt4projectmanager/qt4project.cpp | 10 ++-- 5 files changed, 123 insertions(+), 12 deletions(-) diff --git a/src/plugins/qt4projectmanager/directorywatcher.cpp b/src/plugins/qt4projectmanager/directorywatcher.cpp index 689cd0dfd03..daf47834838 100644 --- a/src/plugins/qt4projectmanager/directorywatcher.cpp +++ b/src/plugins/qt4projectmanager/directorywatcher.cpp @@ -203,5 +203,59 @@ void DirectoryWatcher::updateFileList(const QString &dir) } } +int FileWatcher::m_objectCount = 0; +QHash<QString,int> FileWatcher::m_fileCount; +QFileSystemWatcher *FileWatcher::m_watcher = 0; + +FileWatcher::FileWatcher(QObject *parent) +{ + if (!m_watcher) + m_watcher = new QFileSystemWatcher(); + ++m_objectCount; + connect(m_watcher, SIGNAL(fileChanged(QString)), + this, SLOT(slotFileChanged(QString))); +} + +FileWatcher::~FileWatcher() +{ + foreach (const QString &file, m_files) + removeFile(file); + if (--m_objectCount == 0) { + delete m_watcher; + m_watcher = 0; + } +} + +void FileWatcher::slotFileChanged(const QString &file) +{ + if (m_files.contains(file)) + emit fileChanged(file); +} + +QStringList FileWatcher::files() +{ + return m_files; +} + +void FileWatcher::addFile(const QString &file) +{ + if (m_files.contains(file)) + return; + m_files += file; + if (m_fileCount[file] == 0) + m_watcher->addPath(file); + m_fileCount[file] += 1; +} + +void FileWatcher::removeFile(const QString &file) +{ + m_files.removeOne(file); + m_fileCount[file] -= 1; + if (m_fileCount[file] == 0) + m_watcher->removePath(file); +} + + + } // namespace Internal } // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/directorywatcher.h b/src/plugins/qt4projectmanager/directorywatcher.h index 3f5f5a846fa..b529ec07e78 100644 --- a/src/plugins/qt4projectmanager/directorywatcher.h +++ b/src/plugins/qt4projectmanager/directorywatcher.h @@ -87,6 +87,31 @@ private: FileModificationTimeMap m_files; }; +class FileWatcher : public QObject +{ + Q_DISABLE_COPY(FileWatcher) + Q_OBJECT +public: + explicit FileWatcher(QObject *parent = 0); + virtual ~FileWatcher(); + + QStringList files(); + void addFile(const QString &file); + void removeFile(const QString &file); +signals: + void fileChanged(const QString &path); + void debugOutout(const QString &path); + +private slots: + void slotFileChanged(const QString&); + +private: + static int m_objectCount; + static QHash<QString, int> m_fileCount; + static QFileSystemWatcher *m_watcher; + QStringList m_files; +}; + } // namespace Internal } // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt4nodes.cpp b/src/plugins/qt4projectmanager/qt4nodes.cpp index 58486fd9a13..dc004580b2b 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.cpp +++ b/src/plugins/qt4projectmanager/qt4nodes.cpp @@ -87,11 +87,20 @@ Qt4PriFileNode::Qt4PriFileNode(Qt4Project *project, Qt4ProFileNode* qt4ProFileNo m_project(project), m_qt4ProFileNode(qt4ProFileNode), m_projectFilePath(QDir::fromNativeSeparators(filePath)), - m_projectDir(QFileInfo(filePath).absolutePath()) + m_projectDir(QFileInfo(filePath).absolutePath()), + m_fileWatcher(new FileWatcher(this)) { QTC_ASSERT(project, return); setFolderName(QFileInfo(filePath).baseName()); setIcon(QIcon(":/qt4projectmanager/images/qt_project.png")); + m_fileWatcher->addFile(filePath); + connect(m_fileWatcher, SIGNAL(fileChanged(QString)), + this, SLOT(scheduleUpdate())); +} + +void Qt4PriFileNode::scheduleUpdate() +{ + m_qt4ProFileNode->scheduleUpdate(); } void Qt4PriFileNode::update(ProFile *includeFile, ProFileReader *reader) @@ -495,12 +504,17 @@ Qt4ProFileNode::Qt4ProFileNode(Qt4Project *project, if (parent) setParent(parent); + m_updateTimer.setInterval(100); + m_updateTimer.setSingleShot(true); + connect(m_dirWatcher, SIGNAL(directoryChanged(const QString&)), - this, SLOT(update())); + this, SLOT(updateGeneratedFiles())); connect(m_dirWatcher, SIGNAL(fileChanged(const QString&)), this, SLOT(fileChanged(const QString&))); connect(m_project, SIGNAL(activeBuildConfigurationChanged()), this, SLOT(update())); + connect(&m_updateTimer, SIGNAL(timeout()), + this, SLOT(update())); } Qt4ProFileNode::~Qt4ProFileNode() @@ -523,6 +537,11 @@ QStringList Qt4ProFileNode::variableValue(const Qt4Variable var) const return m_varValues.value(var); } +void Qt4ProFileNode::scheduleUpdate() +{ + m_updateTimer.start(); +} + void Qt4ProFileNode::update() { ProFileReader *reader = createProFileReader(); @@ -681,9 +700,11 @@ void Qt4ProFileNode::update() void Qt4ProFileNode::fileChanged(const QString &filePath) { + qDebug()<<"+++++"<<filePath; CppTools::CppModelManagerInterface *modelManager = ExtensionSystem::PluginManager::instance()->getObject<CppTools::CppModelManagerInterface>(); + // TODO compress modelManager->updateSourceFiles(QStringList() << filePath); } @@ -731,11 +752,16 @@ void Qt4ProFileNode::updateGeneratedFiles() // update generated files + // Already existing FileNodes QList<FileNode*> existingFileNodes; foreach (FileNode *file, fileNodes()) { if (file->isGenerated()) existingFileNodes << file; } + + + // Convert uiFile to uiHeaderFilePath, find all headers that correspond + // and try to find them in uicDirs QStringList newFilePaths; foreach (const QString &uicDir, m_varValues[UiDirVar]) { foreach (FileNode *uiFile, uiFiles) { diff --git a/src/plugins/qt4projectmanager/qt4nodes.h b/src/plugins/qt4projectmanager/qt4nodes.h index 97bc06a08f4..6b858bc5259 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.h +++ b/src/plugins/qt4projectmanager/qt4nodes.h @@ -75,6 +75,7 @@ using ProjectExplorer::FileType; class ProFileReader; class DirectoryWatcher; +class FileWatcher; // Type of projects enum Qt4ProjectType { @@ -142,6 +143,9 @@ protected: QString buildDir() const; ProFileReader *createProFileReader() const; +private slots: + void scheduleUpdate(); + private: void save(ProFile *includeFile); bool priFileWritable(const QString &path); @@ -151,7 +155,10 @@ private: Qt4ProFileNode *m_qt4ProFileNode; QString m_projectFilePath; QString m_projectDir; - QTimer *m_saveTimer; + + // TODO we might be better off using an IFile* and the FileManager for + // watching changes to the .pro and .pri files on disk + FileWatcher *m_fileWatcher; // managed by Qt4ProFileNode friend class Qt4ProFileNode; @@ -174,14 +181,13 @@ public: QStringList variableValue(const Qt4Variable var) const; public slots: + void scheduleUpdate(); void update(); - private slots: void fileChanged(const QString &filePath); - -private: void updateGeneratedFiles(); +private: Qt4ProFileNode *createSubProFileNode(const QString &path); QStringList uiDirPaths(ProFileReader *reader) const; @@ -197,9 +203,9 @@ private: Qt4ProjectType m_projectType; QHash<Qt4Variable, QStringList> m_varValues; bool m_isQBuildProject; + QTimer m_updateTimer; DirectoryWatcher *m_dirWatcher; - friend class Qt4NodeHierarchy; }; diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp index edaabdf154e..c9263201937 100644 --- a/src/plugins/qt4projectmanager/qt4project.cpp +++ b/src/plugins/qt4projectmanager/qt4project.cpp @@ -265,7 +265,7 @@ Qt4Project::~Qt4Project() void Qt4Project::defaultQtVersionChanged() { if (qtVersionId(activeBuildConfiguration()) == 0) - update(); + m_rootProjectNode->update(); } void Qt4Project::qtVersionsChanged() @@ -274,7 +274,7 @@ void Qt4Project::qtVersionsChanged() if (!qt4ProjectManager()->versionManager()->version(qtVersionId(bc))->isValid()) { setQtVersion(bc, 0); if (bc == activeBuildConfiguration()) - update(); + m_rootProjectNode->update(); } } } @@ -507,9 +507,9 @@ void Qt4Project::updateCodeModel() } -/*! - Updates complete project - */ +///*! +// Updates complete project +// */ void Qt4Project::update() { // TODO Maybe remove this method completely? From 4c20a8afc756346b44e8f185974caf491631a012 Mon Sep 17 00:00:00 2001 From: mae <qtc-committer@nokia.com> Date: Tue, 9 Dec 2008 17:41:58 +0100 Subject: [PATCH 66/77] fix focus policy of the buttons so tab makes more sense --- src/plugins/find/findwidget.ui | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/plugins/find/findwidget.ui b/src/plugins/find/findwidget.ui index c85f3362997..f4b0c82ed25 100644 --- a/src/plugins/find/findwidget.ui +++ b/src/plugins/find/findwidget.ui @@ -56,6 +56,9 @@ </item> <item> <widget class="QToolButton" name="findPreviousButton"> + <property name="focusPolicy"> + <enum>Qt::NoFocus</enum> + </property> <property name="arrowType"> <enum>Qt::LeftArrow</enum> </property> @@ -66,6 +69,9 @@ <property name="font"> <font/> </property> + <property name="focusPolicy"> + <enum>Qt::NoFocus</enum> + </property> <property name="arrowType"> <enum>Qt::RightArrow</enum> </property> @@ -103,6 +109,9 @@ </item> <item> <widget class="QToolButton" name="replacePreviousButton"> + <property name="focusPolicy"> + <enum>Qt::NoFocus</enum> + </property> <property name="arrowType"> <enum>Qt::LeftArrow</enum> </property> @@ -113,6 +122,9 @@ <property name="font"> <font/> </property> + <property name="focusPolicy"> + <enum>Qt::NoFocus</enum> + </property> <property name="arrowType"> <enum>Qt::RightArrow</enum> </property> From 98f35da62952bd7b4a4514b821395daa9b9f2bd2 Mon Sep 17 00:00:00 2001 From: mae <qtc-committer@nokia.com> Date: Tue, 9 Dec 2008 17:43:04 +0100 Subject: [PATCH 67/77] fix TabSettings::isIndentationClean(), it had false positives --- src/plugins/texteditor/tabsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/texteditor/tabsettings.cpp b/src/plugins/texteditor/tabsettings.cpp index f87ab2ac8cf..19145a7cd97 100644 --- a/src/plugins/texteditor/tabsettings.cpp +++ b/src/plugins/texteditor/tabsettings.cpp @@ -132,7 +132,7 @@ bool TabSettings::isIndentationClean(const QString &text) const if (c == QLatin1Char(' ')) { ++spaceCount; - if (spaceCount == m_tabSize) + if (!m_spacesForTabs && spaceCount == m_tabSize) return false; } else if (c == QLatin1Char('\t')) { if (m_spacesForTabs || spaceCount != m_indentSize) From 1931304da1b59fcc396b3a550d0c9817ba73f8af Mon Sep 17 00:00:00 2001 From: mae <qtc-committer@nokia.com> Date: Tue, 9 Dec 2008 17:43:31 +0100 Subject: [PATCH 68/77] add explicit "Clean Whitespace" advanced action --- src/plugins/texteditor/basetextdocument.cpp | 12 ++++ src/plugins/texteditor/basetextdocument.h | 2 + src/plugins/texteditor/basetexteditor.cpp | 4 ++ src/plugins/texteditor/basetexteditor.h | 2 + .../texteditor/texteditoractionhandler.cpp | 65 ++++++------------- .../texteditor/texteditoractionhandler.h | 2 + src/plugins/texteditor/texteditorconstants.h | 1 + 7 files changed, 42 insertions(+), 46 deletions(-) diff --git a/src/plugins/texteditor/basetextdocument.cpp b/src/plugins/texteditor/basetextdocument.cpp index 0d5bd8c2dea..3758b133278 100644 --- a/src/plugins/texteditor/basetextdocument.cpp +++ b/src/plugins/texteditor/basetextdocument.cpp @@ -302,6 +302,18 @@ void BaseTextDocument::setSyntaxHighlighter(QSyntaxHighlighter *highlighter) m_highlighter->setDocument(m_document); } + + +void BaseTextDocument::cleanWhitespace() +{ + QTextCursor cursor(m_document); + cursor.beginEditBlock(); + cleanWhitespace(cursor, true); + if (m_storageSettings.m_addFinalNewLine) + ensureFinalNewLine(cursor); + cursor.endEditBlock(); +} + void BaseTextDocument::cleanWhitespace(QTextCursor& cursor, bool inEntireDocument) { diff --git a/src/plugins/texteditor/basetextdocument.h b/src/plugins/texteditor/basetextdocument.h index ee8e5eb427a..b945129c474 100644 --- a/src/plugins/texteditor/basetextdocument.h +++ b/src/plugins/texteditor/basetextdocument.h @@ -118,6 +118,8 @@ public: void reload(QTextCodec *codec); + void cleanWhitespace(); + signals: void titleChanged(QString title); void changed(); diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index cb222dd9fd2..db5413c3446 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -685,6 +685,10 @@ void BaseTextEditor::selectBlockDown() } +void BaseTextEditor::cleanWhitespace() +{ + d->m_document->cleanWhitespace(); +} void BaseTextEditor::keyPressEvent(QKeyEvent *e) { diff --git a/src/plugins/texteditor/basetexteditor.h b/src/plugins/texteditor/basetexteditor.h index 40454a9c7d4..1219439fc98 100644 --- a/src/plugins/texteditor/basetexteditor.h +++ b/src/plugins/texteditor/basetexteditor.h @@ -329,6 +329,8 @@ public slots: void selectBlockUp(); void selectBlockDown(); + void cleanWhitespace(); + signals: void changed(); diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp index 5ffd79e6d02..12fc7d1fac5 100644 --- a/src/plugins/texteditor/texteditoractionhandler.cpp +++ b/src/plugins/texteditor/texteditoractionhandler.cpp @@ -63,7 +63,7 @@ TextEditorActionHandler::TextEditorActionHandler(Core::ICore *core, { m_undoAction = m_redoAction = m_copyAction = m_cutAction = m_pasteAction = m_selectAllAction = m_gotoAction = m_printAction = m_formatAction - = m_visualizeWhitespaceAction = m_textWrappingAction + = m_visualizeWhitespaceAction = m_cleanWhitespaceAction = m_textWrappingAction = m_unCommentSelectionAction = m_unCollapseAllAction = m_collapseAction = m_expandAction = m_deleteLineAction = m_selectEncodingAction @@ -128,17 +128,23 @@ void TextEditorActionHandler::createActions() connect(m_formatAction, SIGNAL(triggered(bool)), this, SLOT(formatAction())); - m_visualizeWhitespaceAction = new QAction(tr("Visualize &Whitespace"), this); + m_visualizeWhitespaceAction = new QAction(tr("&Visualize Whitespace"), this); m_visualizeWhitespaceAction->setCheckable(true); command = am->registerAction(m_visualizeWhitespaceAction, TextEditor::Constants::VISUALIZE_WHITESPACE, m_contextId); #ifndef Q_OS_MAC command->setDefaultKeySequence(QKeySequence(tr("Ctrl+E, Ctrl+V"))); #endif - advancedMenu->addAction(command); connect(m_visualizeWhitespaceAction, SIGNAL(triggered(bool)), this, SLOT(setVisualizeWhitespace(bool))); + m_cleanWhitespaceAction = new QAction(tr("Clean Whitespace"), this); + command = am->registerAction(m_cleanWhitespaceAction, + TextEditor::Constants::CLEAN_WHITESPACE, m_contextId); + + advancedMenu->addAction(command); + connect(m_cleanWhitespaceAction, SIGNAL(triggered()), this, SLOT(cleanWhitespace())); + m_textWrappingAction = new QAction(tr("Enable Text &Wrapping"), this); m_textWrappingAction->setCheckable(true); command = am->registerAction(m_textWrappingAction, @@ -285,6 +291,7 @@ void TextEditorActionHandler::updateActions(UpdateMode um) m_visualizeWhitespaceAction->setEnabled(um != NoEditor); if (m_currentEditor) m_visualizeWhitespaceAction->setChecked(m_currentEditor->displaySettings().m_visualizeWhitespace); + m_cleanWhitespaceAction->setEnabled(um != NoEditor); if (m_textWrappingAction) { m_textWrappingAction->setEnabled(um != NoEditor); if (m_currentEditor) @@ -317,42 +324,6 @@ void TextEditorActionHandler::updateCopyAction() m_copyAction->setEnabled(hasCopyableText); } -void TextEditorActionHandler::undoAction() -{ - if (m_currentEditor) - m_currentEditor->undo(); -} - -void TextEditorActionHandler::redoAction() -{ - if (m_currentEditor) - m_currentEditor->redo(); -} - -void TextEditorActionHandler::copyAction() -{ - if (m_currentEditor) - m_currentEditor->copy(); -} - -void TextEditorActionHandler::cutAction() -{ - if (m_currentEditor) - m_currentEditor->cut(); -} - -void TextEditorActionHandler::pasteAction() -{ - if (m_currentEditor) - m_currentEditor->paste(); -} - -void TextEditorActionHandler::selectAllAction() -{ - if (m_currentEditor) - m_currentEditor->selectAll(); -} - void TextEditorActionHandler::gotoAction() { QuickOpen::QuickOpenManager *quickopen = QuickOpen::QuickOpenManager::instance(); @@ -367,13 +338,6 @@ void TextEditorActionHandler::printAction() m_currentEditor->print(m_core->printer()); } -void TextEditorActionHandler::formatAction() -{ - if (m_currentEditor) - m_currentEditor->format(); -} - - void TextEditorActionHandler::setVisualizeWhitespace(bool checked) { if (m_currentEditor) { @@ -403,6 +367,15 @@ void TextEditorActionHandler::setTextWrapping(bool checked) m_currentEditor->funcname2 ();\ } + +FUNCTION2(undoAction, undo) +FUNCTION2(redoAction, redo) +FUNCTION2(copyAction, copy) +FUNCTION2(cutAction, cut) +FUNCTION2(pasteAction, paste) +FUNCTION2(formatAction, format) +FUNCTION2(selectAllAction, selectAll) +FUNCTION(cleanWhitespace) FUNCTION(unCommentSelection) FUNCTION(deleteLine) FUNCTION(unCollapseAll) diff --git a/src/plugins/texteditor/texteditoractionhandler.h b/src/plugins/texteditor/texteditoractionhandler.h index 9a8c7b9f57c..520ae26ddf6 100644 --- a/src/plugins/texteditor/texteditoractionhandler.h +++ b/src/plugins/texteditor/texteditoractionhandler.h @@ -100,6 +100,7 @@ private slots: void printAction(); void formatAction(); void setVisualizeWhitespace(bool); + void cleanWhitespace(); void setTextWrapping(bool); void unCommentSelection(); void unCollapseAll(); @@ -128,6 +129,7 @@ private: QAction *m_printAction; QAction *m_formatAction; QAction *m_visualizeWhitespaceAction; + QAction *m_cleanWhitespaceAction; QAction *m_textWrappingAction; QAction *m_unCommentSelectionAction; QAction *m_unCollapseAllAction; diff --git a/src/plugins/texteditor/texteditorconstants.h b/src/plugins/texteditor/texteditorconstants.h index 9ac9fdff0e4..192a07c257e 100644 --- a/src/plugins/texteditor/texteditorconstants.h +++ b/src/plugins/texteditor/texteditorconstants.h @@ -40,6 +40,7 @@ namespace Constants { const char * const C_TEXTEDITOR = "Text Editor"; const char * const COMPLETE_THIS = "TextEditor.CompleteThis"; const char * const VISUALIZE_WHITESPACE = "TextEditor.VisualizeWhitespace"; +const char * const CLEAN_WHITESPACE = "TextEditor.CleanWhitespace"; const char * const TEXT_WRAPPING = "TextEditor.TextWrapping"; const char * const UN_COMMENT_SELECTION = "TextEditor.UnCommentSelection"; const char * const COLLAPSE = "TextEditor.Collapse"; From 774e53659fe13fb1bbcc70b90629453a0977b1de Mon Sep 17 00:00:00 2001 From: Ariya Hidayat <ariya.hidayat@trolltech.com> Date: Wed, 10 Dec 2008 09:28:53 +0100 Subject: [PATCH 69/77] Show pointing hand cursor when hovering a change number (e.g. git SHA1). RevBy: Friedemann Kleint --- src/plugins/vcsbase/vcsbaseeditor.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index eb65457c109..004792b8730 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -214,6 +214,9 @@ void VCSBaseEditor::contextMenuEvent(QContextMenuEvent *e) void VCSBaseEditor::mouseMoveEvent(QMouseEvent *e) { + bool overrideCursor = false; + Qt::CursorShape cursorShape; + if (m_d->m_parameters->type == LogOutput || m_d->m_parameters->type == AnnotateOutput) { // Link emulation behaviour for 'click on change-interaction' QTextCursor cursor = cursorForPosition(e->pos()); @@ -226,13 +229,18 @@ void VCSBaseEditor::mouseMoveEvent(QMouseEvent *e) change = changeUnderCursor(cursor); sel.format.setProperty(QTextFormat::UserProperty, change); setExtraSelections(OtherSelection, QList<QTextEdit::ExtraSelection>() << sel); - viewport()->setCursor(Qt::PointingHandCursor); + overrideCursor = true; + cursorShape = Qt::PointingHandCursor; } } else { setExtraSelections(OtherSelection, QList<QTextEdit::ExtraSelection>()); - viewport()->setCursor(Qt::IBeamCursor); + overrideCursor = true; + cursorShape = Qt::IBeamCursor; } TextEditor::BaseTextEditor::mouseMoveEvent(e); + + if (overrideCursor) + viewport()->setCursor(cursorShape); } void VCSBaseEditor::mouseReleaseEvent(QMouseEvent *e) From 9c9308b91b116138ed5cc7753cf59eefd5a86db9 Mon Sep 17 00:00:00 2001 From: Roberto Raggi <qtc-committer@nokia.com> Date: Wed, 10 Dec 2008 10:47:26 +0100 Subject: [PATCH 70/77] QByteArray::toLong() does not auto-detect the base and also fixed a typo in the evaluator of bit-or expressions. --- src/libs/cplusplus/pp-engine.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp index d2ed3ee73f3..83386e8079c 100644 --- a/src/libs/cplusplus/pp-engine.cpp +++ b/src/libs/cplusplus/pp-engine.cpp @@ -164,7 +164,15 @@ protected: bool process_primary() { if ((*_lex)->is(T_INT_LITERAL)) { - _value.set_long(tokenSpell().toLong()); + int base = 10; + const QByteArray spell = tokenSpell(); + if (spell.at(0) == '0') { + if (spell.size() > 1 && (spell.at(1) == 'x' || spell.at(1) == 'X')) + base = 16; + else + base = 8; + } + _value.set_long(tokenSpell().toLong(0, base)); ++(*_lex); return true; } else if (isTokenDefined()) { @@ -367,7 +375,7 @@ protected: { process_xor(); - while ((*_lex)->is(T_CARET)) { + while ((*_lex)->is(T_PIPE)) { const Token op = *(*_lex); ++(*_lex); From a6c6b2c4aeba6d87fc91e224223a81dd70b93bd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com> Date: Wed, 10 Dec 2008 11:58:25 +0100 Subject: [PATCH 71/77] Fixed macro tooltip overriding type information The macro tooltip is supposed to be a fallback, since otherwise you won't be able to see type information for macro parameters. Reviewed-by: Roberto Raggi --- src/plugins/cpptools/cpphoverhandler.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/plugins/cpptools/cpphoverhandler.cpp b/src/plugins/cpptools/cpphoverhandler.cpp index 1265ef9da7f..3cbb473e6df 100644 --- a/src/plugins/cpptools/cpphoverhandler.cpp +++ b/src/plugins/cpptools/cpphoverhandler.cpp @@ -175,15 +175,6 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in break; } } - - if (m_toolTip.isEmpty()) { - foreach (const Document::MacroUse use, doc->macroUses()) { - if (use.contains(pos)) { - m_toolTip = use.macro().toString(); - break; - } - } - } } if (m_toolTip.isEmpty()) { @@ -240,6 +231,15 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in } } + if (doc && m_toolTip.isEmpty()) { + foreach (const Document::MacroUse &use, doc->macroUses()) { + if (use.contains(pos)) { + m_toolTip = use.macro().toString(); + break; + } + } + } + if (m_helpEngineNeedsSetup && m_helpEngine->registeredDocumentations().count() > 0) { m_helpEngine->setupData(); @@ -248,7 +248,8 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in if (!m_helpId.isEmpty() && !m_helpEngine->linksForIdentifier(m_helpId).isEmpty()) { m_toolTip = QString(QLatin1String("<table><tr><td valign=middle><nobr>%1</td>" - "<td><img src=\":/cpptools/images/f1.svg\"></td></tr></table>")).arg(Qt::escape(m_toolTip)); + "<td><img src=\":/cpptools/images/f1.svg\"></td></tr></table>")) + .arg(Qt::escape(m_toolTip)); editor->setContextHelpId(m_helpId); } else if (!m_toolTip.isEmpty()) { m_toolTip = QString(QLatin1String("<nobr>%1")).arg(Qt::escape(m_toolTip)); From 037a9bb57935dfa8ae825b6f0fb2800e3bd8a749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com> Date: Wed, 10 Dec 2008 12:07:39 +0100 Subject: [PATCH 72/77] Set the help id for macros to their name Enables F1 for opening their help pages. Seems to work nicely. --- src/plugins/cpptools/cpphoverhandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/cpptools/cpphoverhandler.cpp b/src/plugins/cpptools/cpphoverhandler.cpp index 3cbb473e6df..338123bc5e6 100644 --- a/src/plugins/cpptools/cpphoverhandler.cpp +++ b/src/plugins/cpptools/cpphoverhandler.cpp @@ -235,6 +235,7 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in foreach (const Document::MacroUse &use, doc->macroUses()) { if (use.contains(pos)) { m_toolTip = use.macro().toString(); + m_helpId = use.macro().name; break; } } From fdd87280b2bcb4dee5f0575450591409bab48bf4 Mon Sep 17 00:00:00 2001 From: mae <qtc-committer@nokia.com> Date: Wed, 10 Dec 2008 12:11:57 +0100 Subject: [PATCH 73/77] rename visible parts of QuickOpen to "Type to locate", "Locate...", and "Locator", suggestion and request by the doc team. --- src/plugins/quickopen/quickopenconstants.h | 2 +- src/plugins/quickopen/quickopentoolwindow.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/quickopen/quickopenconstants.h b/src/plugins/quickopen/quickopenconstants.h index 8ae0380f371..9cce4268770 100644 --- a/src/plugins/quickopen/quickopenconstants.h +++ b/src/plugins/quickopen/quickopenconstants.h @@ -38,7 +38,7 @@ namespace QuickOpen { namespace Constants { const char * const FILTER_OPTIONS_PAGE = "Filters"; -const char * const QUICKOPEN_CATEGORY = "QuickOpen"; +const char * const QUICKOPEN_CATEGORY = "Locator"; const char * const TASK_INDEX = "QuickOpen.Task.Index"; } // namespace Constants diff --git a/src/plugins/quickopen/quickopentoolwindow.cpp b/src/plugins/quickopen/quickopentoolwindow.cpp index cd279fd7638..211947be8d0 100644 --- a/src/plugins/quickopen/quickopentoolwindow.cpp +++ b/src/plugins/quickopen/quickopentoolwindow.cpp @@ -264,7 +264,7 @@ QuickOpenToolWindow::QuickOpenToolWindow(QuickOpenPlugin *qop) : // Explcitly hide the completion list popup. m_completionList->hide(); - setWindowTitle("Quick Open"); + setWindowTitle("Locate..."); resize(200, 90); QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); sizePolicy.setHorizontalStretch(0); @@ -281,7 +281,7 @@ QuickOpenToolWindow::QuickOpenToolWindow(QuickOpenPlugin *qop) : QPixmap image(Core::Constants::ICON_MAGNIFIER); m_fileLineEdit->setPixmap(image); m_fileLineEdit->setUseLayoutDirection(true); - m_fileLineEdit->setHintText(tr("Type to QuickOpen")); + m_fileLineEdit->setHintText(tr("Type to locate")); m_fileLineEdit->setFocusPolicy(Qt::ClickFocus); m_fileLineEdit->installEventFilter(this); From 7a4ef123ef051c33c796199776bfab3bf37b6c75 Mon Sep 17 00:00:00 2001 From: con <qtc-committer@nokia.com> Date: Wed, 10 Dec 2008 12:27:08 +0100 Subject: [PATCH 74/77] Fixes: - tools->git->show commit dialog broken Task: - 237689 Details: - .git is a hidden file, so we need the QDir::Hidden flag as well --- src/plugins/git/changeselectiondialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/git/changeselectiondialog.cpp b/src/plugins/git/changeselectiondialog.cpp index 70004dbadfa..a8a706c8472 100644 --- a/src/plugins/git/changeselectiondialog.cpp +++ b/src/plugins/git/changeselectiondialog.cpp @@ -59,7 +59,7 @@ void ChangeSelectionDialog::selectWorkingDirectory() // the head directory of the repository. QDir repository(location); do { - if (repository.entryList(QDir::AllDirs).contains(QLatin1String(".git"))) { + if (repository.entryList(QDir::AllDirs|QDir::Hidden).contains(QLatin1String(".git"))) { m_ui.repositoryEdit->setText(repository.absolutePath()); return; } From 766ca41cec03acd9caf378483aa4dd56a0f812de Mon Sep 17 00:00:00 2001 From: con <qtc-committer@nokia.com> Date: Wed, 10 Dec 2008 12:36:02 +0100 Subject: [PATCH 75/77] Fixes: - Give show commit dialog a window title --- src/plugins/git/changeselectiondialog.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/git/changeselectiondialog.cpp b/src/plugins/git/changeselectiondialog.cpp index a8a706c8472..46eab385ac8 100644 --- a/src/plugins/git/changeselectiondialog.cpp +++ b/src/plugins/git/changeselectiondialog.cpp @@ -43,6 +43,7 @@ ChangeSelectionDialog::ChangeSelectionDialog(QWidget *parent) { m_ui.setupUi(this); connect(m_ui.repositoryButton, SIGNAL(clicked()), this, SLOT(selectWorkingDirectory())); + setWindowTitle(tr("Select a Git commit")); } void ChangeSelectionDialog::selectWorkingDirectory() From 824db4c6e70ad7b76662cd7e5d0bc7df14ad6628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com> Date: Wed, 10 Dec 2008 12:33:14 +0100 Subject: [PATCH 76/77] Don't allow collapsing the settings pages It makes no sense. --- src/plugins/coreplugin/dialogs/settingsdialog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index 2d8531f3ed7..0f9758b1429 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -47,6 +47,7 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &initialCategory, setupUi(this); buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); + splitter->setCollapsible(1, false); pageTree->header()->setVisible(false); connect(pageTree, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), @@ -59,7 +60,7 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &initialCategory, int index = 0; foreach (IOptionsPage *page, pages) { - QTreeWidgetItem *item = new QTreeWidgetItem(); + QTreeWidgetItem *item = new QTreeWidgetItem; item->setText(0, page->name()); item->setData(0, Qt::UserRole, index); From f52fc4589df2e2b8da3158e248a53d881e9cecb1 Mon Sep 17 00:00:00 2001 From: Kavindra Palaraja <kavindra.palaraja@nokia.com> Date: Thu, 11 Dec 2008 11:20:25 +0100 Subject: [PATCH 77/77] Fixes: Doc - updating the documentation to reflect the new changes. --- doc/qtcreator.qdoc | 77 +++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 38 deletions(-) diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index 021fe4a9999..8ac302ce481 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -23,6 +23,8 @@ \o \inlineimage qtcreator.png \o Qt Creator includes a wide range of useful features. Among them are: \list 1 + \o \bold{Smart Code Editor}: The code editor provides syntax + highlighting as well as code completion. \o \bold{Qt4 Project Generating Wizard}: This wizard allows the user to generate a project for a console application, a GUI application, or a C++ library. @@ -48,7 +50,7 @@ \o \l{Creating a Project in Qt Creator} \o \l{Build Settings} \o \l{Writing a Simple Program with Qt Creator} - \o \l{Quick Navigation} + \o \l{Navigating Quickly Around Your Code} \o \l{Debugging with Qt Creator} \o \l{Tips and Tricks} \o \l{Glossary} @@ -64,86 +66,85 @@ \title A Quick Tour Around Qt Creator - The labeled screenshot below shows some of the components of Qt Creator, - in \gui Edit mode. + The labeled screenshot below shows some of the components of Qt Creator, in + \gui Edit mode. \image qtcreator-breakdown.png \section1 The Mode Selectors - When working in Qt Creator, you can be in one of five modes: \bold Project, - \bold Edit, \bold Debug, \bold Help, and \bold Output. + When working in Qt Creator, you can be in one of six modes: \bold Welcome, + \bold Edit, \bold Debug, \bold Projects, \bold Help, and \bold Output. - Mode selectors allow you to quickly switch between tasks: Editing, - browsing the Qt manual, setting up the build environment, etc. You can + Mode selectors allow you to quickly switch between tasks: Editing, browsing + the Qt Creator manual, setting up the build environment, etc. You can activate a mode by either clicking on its mode selector, or using the \l{keyboard-shortcuts}{corresponding shortcut}. Certain actions also trigger a mode change, e.g., \gui{Debug}/\gui{Start Debugging} will switch to the \gui Debug mode. - \list \o \gui{Welcome Mode} - Displays a welcome screen allowing you to quickly - load recent sessions or individual projects. This is the first mode - displayed if Qt Creator is run without command line switches. + load recent sessions or individual projects. This is the mode you will see + if Qt Creator is run without command line switches. - \o \gui{Edit Mode} - You can edit both project and source files here. An - optional sidebar on the left provides different views to navigate between - files. + \o \gui{Edit Mode} - Lets you edit both project and source files. A sidebar + on the left provides different views to navigate between files. \o \gui{Debug Mode} - Provides various ways to inspect the state of the program while debugging. See \l{qtcreator-debugging}{Debugging With Qt - Creator} for a hands-on description of the mode. + Creator} for a hands-on description of how to use this mode. - \o \gui{Build & Run Mode} - Lets you configure how projects can be built - and executed. Under the list of projects, there are tabs to configure the - build and run settings. + \o \gui{Projects Mode} - Lets you configure how projects can be built and + executed. Under the list of projects, there are tabs to configure the + build, run, and editor settings. \o \gui{Help Mode} - Shows any documentation registered by Qt Assistant, such as the Qt library and Qt Creator documentation. - \o \gui{Output Mode} - Lets you examine various logs in detail, for example - the task list, the compiler and application output. Some of these logs can - also be viewed in the output panes. + \o \gui{Output Mode} - Lets you examine various data in detail, for example + build issues as well as compile and application output. This information + is also available in the output panes. \endlist \section1 The Output Panes - The task pane in Qt Creator can display one out of four different panes: - Task List, Search Results, Application Output, and Compile Output. These - panes are available in all modes. + The task pane in Qt Creator can display one of four different panes: + \gui{Build Issues}, \gui{Search Results}, \gui{Application Output}, and + \gui{Compile}. These panes are available in all modes. - \section2 Task List + \section2 Build Issues - The Task List provides a list of important tasks such as error messages - that need to be fixed. It filters out irrelevant output from the compiler - and collects them in the form of tasks. + The {Build Issues} pane provides a list of issues, e.g., error messages or + warnings that need to be fixed. It filters out irrelevant output from the + compiler and collects them in an organized way. - \image qtcreator-task-list.png + \image qtcreator-build-issues.png \section2 Search Results - The Search Results pane displays the results for global searches such as - searching within a current document, files on disk, or all projects. - In the screenshot below, we searched for all occurrences of \c{textfinder} - within the "/TextFinder" folder. + The \gui{Search Results} pane displays the results for global searches such + as searching within a current document, files on disk, or all projects. In + the screenshot below, we searched for all occurrences of \c{textfinder} + within the \c{"/TextFinder"} folder. \image qtcreator-search-pane.png \section2 Application Output - This pane displays the status of the program when it is executed, as - well as debug output, for example, output from qDebug(). + The \gui{Application Output} pane displays the status of the program when + it is executed and debug output, e.g., output from qDebug(). \image qtcreator-application-output.png - \section2 Compile Output + \section2 Compile - The Compile Output provides all the output from the compiler. In other - words, it is a more verbose version of the Task List. + The \gui{Compile} pane provides all the output from the compiler. In other + words, it is a more verbose version of information displayed in the + \gui{Build Issues} \image qtcreator-compile-pane.png @@ -521,7 +522,7 @@ \page creator-navigation.html \nextpage creator-debugging.html - \title Quick Navigation + \title Navigating Quickly Around Your Code With Qt Creator, navigating to different locations in your project or on your disk, such as files, classes and methods, is trivial using the input