diff --git a/doc/qtcreator.qch b/doc/qtcreator.qch index 2d2985d9cfea1477e0d099daf7f1554d72cfbf65..8733e749a0823e5c71ef692a926effabbfeb8106 100644 Binary files a/doc/qtcreator.qch and b/doc/qtcreator.qch differ diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index 31ef1d571aa36cdd1dff56bc9c2d4b0c63bf0ff6..072a6fb4f8fa0fbe8518cbefe5204129b5abdd32 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -1194,10 +1194,18 @@ \o The file system sidebar does not update automatically. As a workaround, switch to another directory and then back. - \o The resource system of the embedded version of Qt Designer does not - interact with the project manager. - \o Loading KDE4 designer plugins breaks the style, due to a bug in KDE. + + \o Scopes in .pro files are ignored, and environment variables not expanded. + + \o Code completion for generated UI header files is not updated properly + after the first time. + + \o Code completion does not support typedefs (e.g. std::string) and + private classes (e.g. class MyClass::Data {};). + + \o On Gnome, after minimizing Qt Creator and restoring again, the + application window does not repaint properly until resized. \endlist */ diff --git a/doc/qtcreator.qdocconf b/doc/qtcreator.qdocconf index 4cc07d2dc7009f2a1fc4c74db6f51b2ab0c20b97..b1a99f1319b62c3e64a66d7d13d76e69bb36536d 100644 --- a/doc/qtcreator.qdocconf +++ b/doc/qtcreator.qdocconf @@ -17,15 +17,15 @@ sources.fileextensions = "qtcreator.qdoc" qhp.projects = QtCreator qhp.QtCreator.file = qtcreator.qhp -qhp.QtCreator.namespace = com.nokia.qtcreator.09 +qhp.QtCreator.namespace = com.nokia.qtcreator.091 qhp.QtCreator.virtualFolder = doc qhp.QtCreator.indexTitle = Qt Creator qhp.QtCreator.indexRoot = qhp.QtCreator.extraFiles = classic.css \ images/qt-logo.png -qhp.QtCreator.filterAttributes = qtcreator 0.9 -qhp.QtCreator.customFilters.QtCreator.name = Qt Creator 0.9 -qhp.QtCreator.customFilters.QtCreator.filterAttributes = qtcreator 0.9 +qhp.QtCreator.filterAttributes = qtcreator 0.9.1 +qhp.QtCreator.customFilters.QtCreator.name = Qt Creator 0.9.1 +qhp.QtCreator.customFilters.QtCreator.filterAttributes = qtcreator 0.9.1 # macros.qdocconf @@ -201,5 +201,5 @@ HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \ "<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \ "<td width=\"30%\" align=\"left\">Copyright © 2008 Nokia</td>\n" \ "<td width=\"40%\" align=\"center\"> </td>\n" \ - "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt Creator 0.9</div></td>\n" \ + "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt Creator 0.9.1</div></td>\n" \ "</tr></table></div></address>" diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index b28989b168065d54b9a1988ee606e485cf41be2d..b6e1f159b79a0b6bc6c62c8ea39ed8f9855b408a 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -568,7 +568,7 @@ void CMakeCbpParser::parseUnit() void CMakeCbpParser::parseUnknownElement() { - QTC_ASSERT(isStartElement(), /**/); + Q_ASSERT(isStartElement()); while (!atEnd()) { readNext(); diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp index f9cc2b914e721e819745115efeb983cb295dd257..356cfba3b38e9dba4f2f7b4938bde594281eb5c4 100644 --- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp @@ -136,7 +136,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 { - QTC_ASSERT(type.startsWith(Constants::CMAKERUNCONFIGURATION), /**/); + Q_ASSERT(type.startsWith(Constants::CMAKERUNCONFIGURATION)); if (type == Constants::CMAKERUNCONFIGURATION) return "CMake"; // Doesn't happen @@ -147,7 +147,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); - QTC_ASSERT(pro, /**/); + 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)); diff --git a/src/plugins/cmakeprojectmanager/cmakestep.cpp b/src/plugins/cmakeprojectmanager/cmakestep.cpp index a24c3f085bea6d368fa6c043707dc59a79bd8314..88572968040caea7f0e29c9bc8d6b388853fee55 100644 --- a/src/plugins/cmakeprojectmanager/cmakestep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakestep.cpp @@ -115,9 +115,9 @@ bool CMakeBuildStepFactory::canCreate(const QString &name) const ProjectExplorer::BuildStep *CMakeBuildStepFactory::create(ProjectExplorer::Project *project, const QString &name) const { - QTC_ASSERT(name == Constants::CMAKESTEP, /**/); + Q_ASSERT(name == Constants::CMAKESTEP); CMakeProject *pro = qobject_cast<CMakeProject *>(project); - QTC_ASSERT(pro, /**/); + Q_ASSERT(pro); return new CMakeStep(pro); } diff --git a/src/plugins/cmakeprojectmanager/makestep.cpp b/src/plugins/cmakeprojectmanager/makestep.cpp index 716f548af59a8d8370b18a919ef80688838dc1e6..1c7e7f055f5dc3d7030e6e02f9b5a727e3e36916 100644 --- a/src/plugins/cmakeprojectmanager/makestep.cpp +++ b/src/plugins/cmakeprojectmanager/makestep.cpp @@ -109,9 +109,9 @@ bool MakeBuildStepFactory::canCreate(const QString &name) const ProjectExplorer::BuildStep *MakeBuildStepFactory::create(ProjectExplorer::Project *project, const QString &name) const { - QTC_ASSERT(name == Constants::MAKESTEP, return 0); + Q_ASSERT(name == Constants::MAKESTEP); CMakeProject *pro = qobject_cast<CMakeProject *>(project); - QTC_ASSERT(pro, return 0); + Q_ASSERT(pro); return new MakeStep(pro); } diff --git a/src/plugins/projectexplorer/allprojectsfind.cpp b/src/plugins/projectexplorer/allprojectsfind.cpp index c5bf77fba40dacd1b183e5bf154c750e18e38e87..2118ccc658a987250b3eed25525712c17a0cc1d4 100644 --- a/src/plugins/projectexplorer/allprojectsfind.cpp +++ b/src/plugins/projectexplorer/allprojectsfind.cpp @@ -74,7 +74,7 @@ QKeySequence AllProjectsFind::defaultShortcut() const QStringList AllProjectsFind::files() { - QTC_ASSERT(m_plugin->session(), return QStringList()); + Q_ASSERT(m_plugin->session()); 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 1f923160b39ceef993338468d4d759223b829efd..a0eb7af6a1947ad2f1094f1c23ff1ebfce5153f0 100644 --- a/src/plugins/projectexplorer/applicationrunconfiguration.cpp +++ b/src/plugins/projectexplorer/applicationrunconfiguration.cpp @@ -95,8 +95,8 @@ QString ApplicationRunConfigurationRunner::displayName() const RunControl* ApplicationRunConfigurationRunner::run(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode) { QSharedPointer<ApplicationRunConfiguration> rc = qSharedPointerCast<ApplicationRunConfiguration>(runConfiguration); - QTC_ASSERT(rc, return 0); - QTC_ASSERT(mode == ProjectExplorer::Constants::RUNMODE, return 0); + Q_ASSERT(rc); + Q_ASSERT(mode == ProjectExplorer::Constants::RUNMODE); ApplicationRunControl *runControl = new ApplicationRunControl(rc); return runControl; @@ -130,7 +130,7 @@ ApplicationRunControl::~ApplicationRunControl() void ApplicationRunControl::start() { QSharedPointer<ApplicationRunConfiguration> rc = qSharedPointerCast<ApplicationRunConfiguration>(runConfiguration()); - QTC_ASSERT(rc, return); + Q_ASSERT(rc); 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 933987441da6aa44d147c55d0d049f9efffbe25f..72eb1766f11f24661d25671d53c2a4ae06995c97 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -302,7 +302,7 @@ void BuildManager::buildQueueAppend(BuildStep * bs, const QString &configuration void BuildManager::buildProjects(const QList<Project *> &projects, const QList<QString> &configurations) { - QTC_ASSERT(projects.count() == configurations.count(), /**/); + Q_ASSERT(projects.count() == configurations.count()); QList<QString>::const_iterator cit = configurations.constBegin(); QList<Project *>::const_iterator it, end; end = projects.constEnd(); @@ -318,7 +318,7 @@ void BuildManager::buildProjects(const QList<Project *> &projects, const QList<Q void BuildManager::cleanProjects(const QList<Project *> &projects, const QList<QString> &configurations) { - QTC_ASSERT(projects.count() == configurations.count(), /**/); + Q_ASSERT(projects.count() == configurations.count()); QList<QString>::const_iterator cit = configurations.constBegin(); QList<Project *>::const_iterator it, end; end = projects.constEnd(); @@ -378,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) { - QTC_ASSERT(false && "BuildManager m_activeBuildSteps says project is not building, but apparently a build step was still in the queue.", return); + Q_ASSERT(false && "BuildManager m_activeBuildSteps says project is not building, but apparently a build step was still in the queue."); } else if (*it == 1) { --*it; emit buildStateChanged(pro); diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index c6f25fc96d2b80814a63035b0ff2aab6dacaf4b7..abcc431f05ead356e8449e12deab2af7e4e2afd3 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -80,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); - QTC_ASSERT(bc, return); + Q_ASSERT(bc); bc->setValue(name, value); } diff --git a/src/plugins/projectexplorer/buildstepspage.cpp b/src/plugins/projectexplorer/buildstepspage.cpp index 5986de549ad8f65d7c99d7e87833f1288540471a..88536a09e09637757b5944e1773bcda604ca1317 100644 --- a/src/plugins/projectexplorer/buildstepspage.cpp +++ b/src/plugins/projectexplorer/buildstepspage.cpp @@ -123,13 +123,13 @@ void BuildStepsPage::updateBuildStepWidget(QTreeWidgetItem *newItem, QTreeWidget { if (oldItem == newItem) return; - QTC_ASSERT(m_pro, return); + Q_ASSERT(m_pro); if (newItem) { int row = m_ui->buildSettingsList->indexOfTopLevelItem(newItem); m_ui->buildSettingsWidget->setCurrentIndex(row); BuildStepConfigWidget *widget = qobject_cast<BuildStepConfigWidget *>(m_ui->buildSettingsWidget->currentWidget()); - QTC_ASSERT(widget, return); + Q_ASSERT(widget); widget->init(m_configuration); } updateBuildStepButtonsState(); diff --git a/src/plugins/projectexplorer/currentprojectfind.cpp b/src/plugins/projectexplorer/currentprojectfind.cpp index d0221cc98058c326dd002e61787a0a60557ba1d5..451ae521c0cc0fa1e5c062ef2ec4a6ddbd13ded2 100644 --- a/src/plugins/projectexplorer/currentprojectfind.cpp +++ b/src/plugins/projectexplorer/currentprojectfind.cpp @@ -74,7 +74,7 @@ QKeySequence CurrentProjectFind::defaultShortcut() const QStringList CurrentProjectFind::files() { Project *project = m_plugin->currentProject(); - QTC_ASSERT(project, return QStringList()); + Q_ASSERT(project); 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 7945ddefe4a04b145b28ee1a32278e8d6ed852a7..3d8d8c7b802457298a70c936e8cb39a0038917de 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -411,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); - QTC_ASSERT(bc, return); + Q_ASSERT(bc); bc->setValue(name, value); } @@ -445,13 +445,19 @@ QList<QSharedPointer<RunConfiguration> > Project::runConfigurations() const void Project::addRunConfiguration(QSharedPointer<RunConfiguration> runConfiguration) { - QTC_ASSERT(!m_runConfigurations.contains(runConfiguration), return); + if (m_runConfigurations.contains(runConfiguration)) { + qWarning()<<"Not adding already existing runConfiguration"<<runConfiguration->name(); + return; + } m_runConfigurations.push_back(runConfiguration); } void Project::removeRunConfiguration(QSharedPointer<RunConfiguration> runConfiguration) { - QTC_ASSERT(m_runConfigurations.contains(runConfiguration), /**/); + if(!m_runConfigurations.contains(runConfiguration)) { + qWarning()<<"Not removing runConfiguration"<<runConfiguration->name()<<"becasue it doesn't exist"; + return; + } m_runConfigurations.removeOne(runConfiguration); if (m_activeRunConfiguration == runConfiguration) { if (m_runConfigurations.isEmpty()) @@ -470,7 +476,7 @@ void Project::setActiveRunConfiguration(QSharedPointer<RunConfiguration> runConf { if (runConfiguration == m_activeRunConfiguration) return; - QTC_ASSERT(m_runConfigurations.contains(runConfiguration) || runConfiguration == 0, return); + Q_ASSERT(m_runConfigurations.contains(runConfiguration) || runConfiguration == 0); m_activeRunConfiguration = runConfiguration; emit activeRunConfigurationChanged(); } diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index dd3cd836cc87035a244a4153d4e777bda761eda2..eb99816e6c838052214b845ebfd0ae597f2329a1 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -787,7 +787,8 @@ void ProjectExplorerPlugin::setStartupProject(Project *project) if (!project) project = m_currentProject; - QTC_ASSERT(project, return); + if (!project) + return; m_session->setStartupProject(project); // NPE: Visually mark startup project updateActions(); @@ -1086,12 +1087,11 @@ void ProjectExplorerPlugin::buildQueueFinished(bool success) this, SLOT(addErrorToApplicationOutputWindow(RunControl *, const QString &))); connect(control, SIGNAL(finished()), this, SLOT(runControlFinished())); - control->start(); - if (m_runMode == ProjectExplorer::Constants::DEBUGMODE) m_debuggingRunControl = control; + control->start(); updateRunAction(); } } else { @@ -1361,7 +1361,7 @@ void ProjectExplorerPlugin::runProject() void ProjectExplorerPlugin::debugProject() { Project *pro = startupProject(); - if (!pro || m_debuggingRunControl) + if (!pro || m_debuggingRunControl ) return; if (saveModifiedFiles(QList<Project *>() << pro)) { @@ -1369,6 +1369,7 @@ void ProjectExplorerPlugin::debugProject() m_delayedRunConfiguration = pro->activeRunConfiguration(); //NBS TODO make the build project step take into account project dependencies m_buildManager->buildProject(pro, pro->activeBuildConfiguration()); + updateRunAction(); } } @@ -1535,7 +1536,8 @@ void ProjectExplorerPlugin::updateContextMenuActions() void ProjectExplorerPlugin::addNewFile() { - QTC_ASSERT(m_currentNode && m_currentNode->nodeType() == ProjectNodeType, return); + if (!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) @@ -1545,7 +1547,8 @@ void ProjectExplorerPlugin::addNewFile() void ProjectExplorerPlugin::addExistingFiles() { - QTC_ASSERT(m_currentNode && m_currentNode->nodeType() == ProjectNodeType, return); + if (!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); @@ -1597,14 +1600,16 @@ void ProjectExplorerPlugin::addExistingFiles() void ProjectExplorerPlugin::openFile() { - QTC_ASSERT(m_currentNode, return); + if (m_currentNode) + return; m_core->editorManager()->openEditor(m_currentNode->path()); m_core->editorManager()->ensureEditorManagerVisible(); } void ProjectExplorerPlugin::removeFile() { - QTC_ASSERT(m_currentNode && m_currentNode->nodeType() == FileNodeType, return); + if (!m_currentNode && m_currentNode->nodeType() == FileNodeType) + return; FileNode *fileNode = qobject_cast<FileNode*>(m_currentNode); const QString filePath = m_currentNode->path(); @@ -1616,7 +1621,7 @@ void ProjectExplorerPlugin::removeFile() // remove from project ProjectNode *projectNode = fileNode->projectNode(); - QTC_ASSERT(projectNode, return); + Q_ASSERT(projectNode); if (!projectNode->removeFiles(fileNode->fileType(), QStringList(filePath))) { QMessageBox::warning(m_core->mainWindow(), tr("Remove file failed"), @@ -1768,11 +1773,15 @@ void ProjectExplorerPlugin::populateOpenWithMenu() void ProjectExplorerPlugin::openWithMenuTriggered(QAction *action) { - QTC_ASSERT(action, return); + if (!action) { + qWarning() << "ProjectExplorerPlugin::openWithMenuTriggered no action, can't happen."; + return; + } Core::IEditorFactory * const editorFactory = qVariantValue<Core::IEditorFactory *>(action->data()); - QTC_ASSERT(m_core, return); - QTC_ASSERT(m_core->editorManager(), return); - QTC_ASSERT(editorFactory, return); + if (!editorFactory) { + qWarning() << "Editor Factory not attached to action, can't happen"<<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 81a35c9b65b3c7b62424d0686524a9c220d9c0f4..7c82264df953304da4a8815d2cbc5aba763e1437 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -176,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)); - QTC_ASSERT(parentNode, return result); + Q_ASSERT(parentNode); result = createIndex(row, 0, m_childNodes.value(parentNode).at(row)); } return result; @@ -189,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()) { - QTC_ASSERT(m_childNodes.contains(grandParentFolderNode), return parentIndex); + Q_ASSERT(m_childNodes.contains(grandParentFolderNode)); int row = m_childNodes.value(grandParentFolderNode).indexOf(parentFolderNode); parentIndex = createIndex(row, 0, parentFolderNode); } else { @@ -351,8 +351,8 @@ bool DetailedModel::canFetchMore(const QModelIndex & parent) const void DetailedModel::fetchMore(const QModelIndex & parent) { FolderNode *folderNode = qobject_cast<FolderNode*>(nodeForIndex(parent)); - QTC_ASSERT(folderNode, return); - QTC_ASSERT(!m_childNodes.contains(folderNode), return); + Q_ASSERT(folderNode); + Q_ASSERT(!m_childNodes.contains(folderNode)); m_childNodes.insert(folderNode, childNodeList(folderNode)); } @@ -368,7 +368,7 @@ void DetailedModel::foldersAboutToBeAdded(FolderNode *parentFolder, const QList<FolderNode*> &newFolders) { Q_UNUSED(newFolders); - QTC_ASSERT(parentFolder, return); + Q_ASSERT(parentFolder); if (m_childNodes.contains(parentFolder)) m_folderToAddTo = parentFolder; @@ -386,7 +386,7 @@ void DetailedModel::foldersAdded() void DetailedModel::foldersAboutToBeRemoved(FolderNode *parentFolder, const QList<FolderNode*> &staleFolders) { - QTC_ASSERT(parentFolder, return); + Q_ASSERT(parentFolder); if (m_childNodes.contains(parentFolder)) { QList<Node*> newChildNodes = m_childNodes.value(parentFolder); @@ -416,7 +416,7 @@ void DetailedModel::filesAboutToBeAdded(FolderNode *parentFolder, const QList<FileNode*> &newFiles) { Q_UNUSED(newFiles); - QTC_ASSERT(parentFolder, return); + Q_ASSERT(parentFolder); if (m_childNodes.contains(parentFolder)) m_folderToAddTo = parentFolder; @@ -434,7 +434,7 @@ void DetailedModel::filesAdded() void DetailedModel::filesAboutToBeRemoved(FolderNode *parentFolder, const QList<FileNode*> &staleFiles) { - QTC_ASSERT(parentFolder, return); + Q_ASSERT(parentFolder); if (m_childNodes.contains(parentFolder)) { QList<Node*> newChildNodes = m_childNodes.value(parentFolder); @@ -473,7 +473,7 @@ QModelIndex DetailedModel::indexForNode(const Node *node) // update internal cache if (canFetchMore(parentIndex)) fetchMore(parentIndex); - QTC_ASSERT(m_childNodes.contains(parentFolder), return QModelIndex()); + Q_ASSERT(m_childNodes.contains(parentFolder)); int row = m_childNodes.value(parentFolder).indexOf(const_cast<Node*>(node)); if (row >= 0) @@ -506,7 +506,7 @@ void DetailedModel::addToChildNodes(FolderNode *parentFolder, QList<Node*> newCh { QList<Node*> childNodes = m_childNodes.value(parentFolder); QModelIndex parentIndex = indexForNode(parentFolder); - QTC_ASSERT(parentIndex.isValid(), return); + Q_ASSERT(parentIndex.isValid()); // position -> nodes, with positions in decreasing order QList<QPair<int, QList<Node*> > > insertions; @@ -550,14 +550,14 @@ void DetailedModel::addToChildNodes(FolderNode *parentFolder, QList<Node*> newCh endInsertRows(); } - QTC_ASSERT(childNodes == newChildNodes, /**/); + Q_ASSERT(childNodes == newChildNodes); } void DetailedModel::removeFromChildNodes(FolderNode *parentFolder, QList<Node*> newChildNodes) { QList<Node*> childNodes = m_childNodes.value(parentFolder); QModelIndex parentIndex = indexForNode(parentFolder); - QTC_ASSERT(parentIndex.isValid(), return); + Q_ASSERT(parentIndex.isValid()); // position -> nodes, with positions in decreasing order QList<QPair<int, QList<Node*> > > deletions; @@ -600,7 +600,7 @@ void DetailedModel::removeFromChildNodes(FolderNode *parentFolder, QList<Node*> endRemoveRows(); } - QTC_ASSERT(childNodes == newChildNodes, /**/); + Q_ASSERT(childNodes == newChildNodes); } QList<FolderNode*> DetailedModel::recursiveSubFolders(FolderNode *parentFolder) @@ -663,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)); - QTC_ASSERT(parentNode, return QModelIndex()); + Q_ASSERT(parentNode); QHash<FolderNode*, QList<Node*> >::const_iterator it = m_childNodes.constFind(parentNode); if (it == m_childNodes.constEnd()) { fetchMore(parentNode); @@ -690,9 +690,9 @@ QModelIndex FlatModel::parent(const QModelIndex &idx) const fetchMore(grandParentNode); it = m_childNodes.constFind(grandParentNode); } - QTC_ASSERT(it != m_childNodes.constEnd(), return QModelIndex()); + Q_ASSERT(it != m_childNodes.constEnd()); const int row = it.value().indexOf(parentNode); - QTC_ASSERT(row >= 0, return QModelIndex()); + Q_ASSERT(row >= 0); parentIndex = createIndex(row, 0, parentNode); } else { // top level node, parent is session @@ -850,8 +850,8 @@ QList<Node*> FlatModel::childNodes(FolderNode *parentNode, const QSet<Node*> &bl void FlatModel::fetchMore(FolderNode *folderNode) const { - QTC_ASSERT(folderNode, return); - QTC_ASSERT(!m_childNodes.contains(folderNode), return); + Q_ASSERT(folderNode); + Q_ASSERT(!m_childNodes.contains(folderNode)); QList<Node*> nodeList = childNodes(folderNode); m_childNodes.insert(folderNode, nodeList); @@ -860,7 +860,7 @@ void FlatModel::fetchMore(FolderNode *folderNode) const void FlatModel::fetchMore(const QModelIndex &parent) { FolderNode *folderNode = qobject_cast<FolderNode*>(nodeForIndex(parent)); - QTC_ASSERT(folderNode, return); + Q_ASSERT(folderNode); fetchMore(folderNode); } diff --git a/src/plugins/projectexplorer/projectnodes.cpp b/src/plugins/projectexplorer/projectnodes.cpp index a3f1b307528a006ba281c22a8322593ac679e6a3..e7404b5753839a0f814af67cc8142dcfc316b39d 100644 --- a/src/plugins/projectexplorer/projectnodes.cpp +++ b/src/plugins/projectexplorer/projectnodes.cpp @@ -376,7 +376,7 @@ void ProjectNode::removeProjectNodes(const QList<ProjectNode*> &subProjects) */ void ProjectNode::addFolderNodes(const QList<FolderNode*> &subFolders, FolderNode *parentFolder) { - QTC_ASSERT(parentFolder, return); + Q_ASSERT(parentFolder); if (!subFolders.isEmpty()) { const bool emitSignals = (parentFolder->projectNode() == this); @@ -412,7 +412,7 @@ void ProjectNode::addFolderNodes(const QList<FolderNode*> &subFolders, FolderNod void ProjectNode::removeFolderNodes(const QList<FolderNode*> &subFolders, FolderNode *parentFolder) { - QTC_ASSERT(parentFolder, return); + Q_ASSERT(parentFolder); if (!subFolders.isEmpty()) { const bool emitSignals = (parentFolder->projectNode() == this); @@ -450,7 +450,7 @@ void ProjectNode::removeFolderNodes(const QList<FolderNode*> &subFolders, */ void ProjectNode::addFileNodes(const QList<FileNode*> &files, FolderNode *folder) { - QTC_ASSERT(folder, return); + Q_ASSERT(folder); if (!files.isEmpty()) { const bool emitSignals = (folder->projectNode() == this); @@ -482,7 +482,7 @@ void ProjectNode::addFileNodes(const QList<FileNode*> &files, FolderNode *folder */ void ProjectNode::removeFileNodes(const QList<FileNode*> &files, FolderNode *folder) { - QTC_ASSERT(folder, return); + Q_ASSERT(folder); if (!files.isEmpty()) { const bool emitSignals = (folder->projectNode() == this); diff --git a/src/plugins/projectexplorer/runsettingspropertiespage.cpp b/src/plugins/projectexplorer/runsettingspropertiespage.cpp index 2d20ba3b67bc6a9bc953ca685f53035b0f0777a9..afaa8b04cceb00bb5dfcd92ed4b1393a5a254c15 100644 --- a/src/plugins/projectexplorer/runsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/runsettingspropertiespage.cpp @@ -274,9 +274,9 @@ void RunSettingsWidget::initRunConfigurationComboBox() void RunSettingsWidget::activateRunConfiguration(int index) { - QTC_ASSERT(m_project, return); + Q_ASSERT(m_project); const QList<QSharedPointer<RunConfiguration> > runConfigurations = m_project->runConfigurations(); - QTC_ASSERT(index < runConfigurations.size(), return); + Q_ASSERT(index < runConfigurations.size()); 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 e6461e302a9175e654c2a796c3faffd72a27a624..c8fdaf50c98085aa204198b05111e9ed268b45e0 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -141,7 +141,7 @@ QString SessionFile::mimeType() const bool SessionFile::load(const QString &fileName) { - QTC_ASSERT(!fileName.isEmpty(), return false); + Q_ASSERT(!fileName.isEmpty()); if (debug) qDebug() << "SessionFile::load " << fileName; @@ -246,7 +246,7 @@ bool SessionFile::save(const QString &fileName) if (!fileName.isEmpty()) m_fileName = fileName; - QTC_ASSERT(!m_fileName.isEmpty(), return false); + Q_ASSERT(!m_fileName.isEmpty()); if (debug) qDebug() << "SessionFile - saving " << m_fileName; @@ -493,7 +493,7 @@ void SessionManager::setStartupProject(Project *startupProject) qDebug() << Q_FUNC_INFO << (startupProject ? startupProject->name() : "0"); if (startupProject) { - QTC_ASSERT(m_file->m_projects.contains(startupProject), return); + Q_ASSERT(m_file->m_projects.contains(startupProject)); } m_file->m_startupProject = startupProject; @@ -566,7 +566,7 @@ void SessionManager::removeProject(Project *project) bool SessionManager::createImpl(const QString &fileName) { - QTC_ASSERT(!fileName.isEmpty(), return false); + Q_ASSERT(!fileName.isEmpty()); if (debug) qDebug() << "SessionManager - creating new session " << fileName << " ..."; @@ -597,7 +597,7 @@ bool SessionManager::createImpl(const QString &fileName) bool SessionManager::loadImpl(const QString &fileName) { - QTC_ASSERT(!fileName.isEmpty(), return false); + Q_ASSERT(!fileName.isEmpty()); if (debug) qDebug() << "SessionManager - loading session " << fileName << " ..."; @@ -803,7 +803,7 @@ Project *SessionManager::projectForNode(Node *node) const while (rootProjectNode && rootProjectNode->parentFolderNode() != m_sessionNode) rootProjectNode = rootProjectNode->parentFolderNode(); - QTC_ASSERT(rootProjectNode, return 0); + Q_ASSERT(rootProjectNode); QList<Project *> projectList = projects(); foreach (Project *p, projectList) { diff --git a/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp b/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp index 584d443e3eac5af0d35b6d5712cc0216046af779..5b03ba2d5b0bc31aaa0fe964ba097bd431cbc764 100644 --- a/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp +++ b/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp @@ -157,9 +157,9 @@ bool GdbMacrosBuildStepFactory::canCreate(const QString &name) const ProjectExplorer::BuildStep *GdbMacrosBuildStepFactory::create(ProjectExplorer::Project *pro, const QString &name) const { - QTC_ASSERT(name == Constants::GDBMACROSBUILDSTEP, return 0); + Q_ASSERT(name == Constants::GDBMACROSBUILDSTEP); Qt4Project *qt4project = qobject_cast<Qt4Project *>(pro); - QTC_ASSERT(qt4project, return 0); + Q_ASSERT(qt4project); return new GdbMacrosBuildStep(qt4project); } diff --git a/src/plugins/qt4projectmanager/makestep.cpp b/src/plugins/qt4projectmanager/makestep.cpp index 71fc51f796283e4c0e8d30929fecfefc811a12a3..5e6d3fce824df9226db3e3262acc86345d407be3 100644 --- a/src/plugins/qt4projectmanager/makestep.cpp +++ b/src/plugins/qt4projectmanager/makestep.cpp @@ -294,7 +294,7 @@ void MakeStepConfigWidget::init(const QString &buildConfiguration) if (!showPage0) { Qt4Project *pro = qobject_cast<Qt4Project *>(m_makeStep->project()); - QTC_ASSERT(pro, return); + Q_ASSERT(pro); m_ui.makeLabel->setText(tr("Override %1:").arg(pro->qtVersion(buildConfiguration)->makeCommand())); const QString &makeCmd = m_makeStep->value(buildConfiguration, "makeCmd").toString(); @@ -309,12 +309,12 @@ void MakeStepConfigWidget::init(const QString &buildConfiguration) void MakeStepConfigWidget::makeLineEditTextEdited() { - QTC_ASSERT(!m_buildConfiguration.isNull(), return); + Q_ASSERT(!m_buildConfiguration.isNull()); m_makeStep->setValue(m_buildConfiguration, "makeCmd", m_ui.makeLineEdit->text()); } void MakeStepConfigWidget::makeArgumentsLineEditTextEdited() { - QTC_ASSERT(!m_buildConfiguration.isNull(), return); + Q_ASSERT(!m_buildConfiguration.isNull()); 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 fcb07fcf8ae6387be54c93669bccb92fb0858591..1b50ee296d23e5fefc9845a12e0c1cbe5d128276 100644 --- a/src/plugins/qt4projectmanager/qmakestep.cpp +++ b/src/plugins/qt4projectmanager/qmakestep.cpp @@ -234,7 +234,7 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step) void QMakeStepConfigWidget::qmakeArgumentsLineEditTextEdited() { - QTC_ASSERT(!m_buildConfiguration.isNull(), return); + Q_ASSERT(!m_buildConfiguration.isNull()); 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 03765104ca7d4c006c66112a9b7f99dc9cc7a6d9..7157c8788f5123f9df392b515f44b1b0d31aaf0c 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.cpp +++ b/src/plugins/qt4projectmanager/qt4nodes.cpp @@ -90,7 +90,7 @@ Qt4PriFileNode::Qt4PriFileNode(Qt4Project *project, Qt4ProFileNode* qt4ProFileNo m_projectDir(QFileInfo(filePath).absolutePath()), m_fileWatcher(new FileWatcher(this)) { - QTC_ASSERT(project, return); + Q_ASSERT(project); setFolderName(QFileInfo(filePath).baseName()); setIcon(QIcon(":/qt4projectmanager/images/qt_project.png")); m_fileWatcher->addFile(filePath); @@ -105,8 +105,8 @@ void Qt4PriFileNode::scheduleUpdate() void Qt4PriFileNode::update(ProFile *includeFile, ProFileReader *reader) { - QTC_ASSERT(includeFile, return); - QTC_ASSERT(reader, return); + Q_ASSERT(includeFile); + Q_ASSERT(reader); // add project file node if (m_fileNodes.isEmpty()) @@ -179,7 +179,7 @@ QList<ProjectNode::ProjectAction> Qt4PriFileNode::supportedActions() const const Qt4ProFileNode *proFileNode; while (!(proFileNode = qobject_cast<const Qt4ProFileNode*>(folderNode))) folderNode = folderNode->parentFolderNode(); - QTC_ASSERT(proFileNode, return actions); + Q_ASSERT(proFileNode); switch (proFileNode->projectType()) { case ApplicationTemplate: diff --git a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp index f9a5053fbbee15392c5e42912835a70eadd4f6f4..606e0be123929df66d7e45613d207448c8392d80 100644 --- a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp @@ -149,7 +149,7 @@ QStringList Qt4RunConfiguration::commandLineArguments() const ProjectExplorer::Environment Qt4RunConfiguration::environment() const { Qt4Project *pro = qobject_cast<Qt4Project *>(project()); - QTC_ASSERT(pro, return ProjectExplorer::Environment()); + Q_ASSERT(pro); return pro->environment(pro->activeBuildConfiguration()); } @@ -374,8 +374,8 @@ QSharedPointer<ProjectExplorer::RunConfiguration> Qt4RunConfigurationFactory::cr (ProjectExplorer::Project *project, const QString &type) { Qt4Project *p = qobject_cast<Qt4Project *>(project); - QTC_ASSERT(p, /**/); - QTC_ASSERT(type == "Qt4ProjectManager.Qt4RunConfiguration", /**/); + Q_ASSERT(p); + Q_ASSERT(type == "Qt4ProjectManager.Qt4RunConfiguration"); // The right path is set in restoreSettings QSharedPointer<ProjectExplorer::RunConfiguration> rc(new Qt4RunConfiguration(p, QString::null)); return rc; @@ -418,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); - QTC_ASSERT(p, /**/); + Q_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 2df789946430240f13ea838ca22295b19acf2993..3c3de8fd0e03b6607712b4ca863c0c0b29ede738 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.cpp +++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp @@ -116,7 +116,7 @@ void QtVersionManager::addVersion(QtVersion *version) void QtVersionManager::updateDocumentation() { Help::HelpManager *helpManager = m_core->pluginManager()->getObject<Help::HelpManager>(); - QTC_ASSERT(helpManager, return); + Q_ASSERT(helpManager); 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(); - QTC_ASSERT(currentItem, return); + Q_ASSERT(currentItem); 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(); - QTC_ASSERT(currentItem, return); + Q_ASSERT(currentItem); 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(); - QTC_ASSERT(currentItem, return); + Q_ASSERT(currentItem); 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(); - QTC_ASSERT(currentItem, return); + Q_ASSERT(currentItem); 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 96f0fd86e5858184fb9c1d3d5f18db0d0f2dc4e3..6b435b5e41586dee03801253990f55234164e37f 100644 --- a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp +++ b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp @@ -233,7 +233,7 @@ void LibraryWizardDialog::slotCurrentIdChanged(int id) qDebug("initializing for plugins"); QStringList baseClasses; const int pluginBaseClassCount = sizeof(pluginBaseClasses)/sizeof(PluginBaseClasses); - QTC_ASSERT(defaultPluginBaseClass < pluginBaseClassCount, return); + Q_ASSERT(defaultPluginBaseClass < pluginBaseClassCount); 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 959936f1245d9440005c0df9904128159c52b18c..fb362732d55f9b90f92405d879c9fdbf2c34a238 100644 --- a/src/plugins/qt4projectmanager/wizards/modulespage.cpp +++ b/src/plugins/qt4projectmanager/wizards/modulespage.cpp @@ -104,14 +104,14 @@ QString ModulesPage::deselectedModules() const void ModulesPage::setModuleSelected(const QString &module, bool selected) const { QCheckBox *checkBox = m_moduleCheckBoxMap[module]; - QTC_ASSERT(checkBox, return); + Q_ASSERT(checkBox); checkBox->setCheckState(selected?Qt::Checked:Qt::Unchecked); } void ModulesPage::setModuleEnabled(const QString &module, bool enabled) const { QCheckBox *checkBox = m_moduleCheckBoxMap[module]; - QTC_ASSERT(checkBox, return); + Q_ASSERT(checkBox); checkBox->setEnabled(enabled); }