Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline

This commit is contained in:
hjk
2008-12-17 17:43:24 +01:00
27 changed files with 119 additions and 96 deletions

Binary file not shown.

View File

@@ -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
*/

View File

@@ -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 &copy; 2008 Nokia</td>\n" \
"<td width=\"40%\" align=\"center\">&nbsp;</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>"

View File

@@ -568,7 +568,7 @@ void CMakeCbpParser::parseUnit()
void CMakeCbpParser::parseUnknownElement()
{
QTC_ASSERT(isStartElement(), /**/);
Q_ASSERT(isStartElement());
while (!atEnd()) {
readNext();

View File

@@ -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));

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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) {

View File

@@ -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());

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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();

View File

@@ -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) {

View File

@@ -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();
}

View File

@@ -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();
}

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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

View File

@@ -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) {

View File

@@ -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);
}

View File

@@ -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()));
}

View File

@@ -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)));
}

View File

@@ -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:

View File

@@ -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));

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);
}