Commit d402ed29 authored by dt's avatar dt
Browse files

Fixes: Replace QTC_ASSERT with QT_ASSERT.

parent c7ad6ec5
......@@ -568,7 +568,7 @@ void CMakeCbpParser::parseUnit()
void CMakeCbpParser::parseUnknownElement()
{
QTC_ASSERT(isStartElement(), /**/);
Q_ASSERT(isStartElement());
while (!atEnd()) {
readNext();
......
......@@ -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));
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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) {
......
......@@ -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());
......
......@@ -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);
......
......@@ -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);
}
......
......@@ -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();
......
......@@ -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) {
......
......@@ -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();
}
......
......@@ -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();
......@@ -1360,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)) {
......@@ -1368,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();
}
}
......@@ -1534,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)
......@@ -1544,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);
......@@ -1596,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();
......@@ -1615,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"),
......@@ -1767,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();
}
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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
......
......@@ -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) {
......
......@@ -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);
}
......
......@@ -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()));
}
......@@ -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)));
}
......
......@@ -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)