forked from qt-creator/qt-creator
Fixes: Replace QTC_ASSERT with QT_ASSERT.
This commit is contained in:
@@ -568,7 +568,7 @@ void CMakeCbpParser::parseUnit()
|
|||||||
|
|
||||||
void CMakeCbpParser::parseUnknownElement()
|
void CMakeCbpParser::parseUnknownElement()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(isStartElement(), /**/);
|
Q_ASSERT(isStartElement());
|
||||||
|
|
||||||
while (!atEnd()) {
|
while (!atEnd()) {
|
||||||
readNext();
|
readNext();
|
||||||
|
@@ -136,7 +136,7 @@ QStringList CMakeRunConfigurationFactory::canCreate(ProjectExplorer::Project *pr
|
|||||||
// used to translate the types to names to display to the user
|
// used to translate the types to names to display to the user
|
||||||
QString CMakeRunConfigurationFactory::nameForType(const QString &type) const
|
QString CMakeRunConfigurationFactory::nameForType(const QString &type) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(type.startsWith(Constants::CMAKERUNCONFIGURATION), /**/);
|
Q_ASSERT(type.startsWith(Constants::CMAKERUNCONFIGURATION));
|
||||||
|
|
||||||
if (type == Constants::CMAKERUNCONFIGURATION)
|
if (type == Constants::CMAKERUNCONFIGURATION)
|
||||||
return "CMake"; // Doesn't happen
|
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)
|
QSharedPointer<ProjectExplorer::RunConfiguration> CMakeRunConfigurationFactory::create(ProjectExplorer::Project *project, const QString &type)
|
||||||
{
|
{
|
||||||
CMakeProject *pro = qobject_cast<CMakeProject *>(project);
|
CMakeProject *pro = qobject_cast<CMakeProject *>(project);
|
||||||
QTC_ASSERT(pro, /**/);
|
Q_ASSERT(pro);
|
||||||
if (type == Constants::CMAKERUNCONFIGURATION) {
|
if (type == Constants::CMAKERUNCONFIGURATION) {
|
||||||
// Restoring, filename will be added by restoreSettings
|
// Restoring, filename will be added by restoreSettings
|
||||||
QSharedPointer<ProjectExplorer::RunConfiguration> rc(new CMakeRunConfiguration(pro, QString::null, QString::null));
|
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
|
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);
|
CMakeProject *pro = qobject_cast<CMakeProject *>(project);
|
||||||
QTC_ASSERT(pro, /**/);
|
Q_ASSERT(pro);
|
||||||
return new CMakeStep(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
|
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);
|
CMakeProject *pro = qobject_cast<CMakeProject *>(project);
|
||||||
QTC_ASSERT(pro, return 0);
|
Q_ASSERT(pro);
|
||||||
return new MakeStep(pro);
|
return new MakeStep(pro);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -74,7 +74,7 @@ QKeySequence AllProjectsFind::defaultShortcut() const
|
|||||||
|
|
||||||
QStringList AllProjectsFind::files()
|
QStringList AllProjectsFind::files()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_plugin->session(), return QStringList());
|
Q_ASSERT(m_plugin->session());
|
||||||
QList<QRegExp> filterRegs;
|
QList<QRegExp> filterRegs;
|
||||||
QStringList nameFilters = fileNameFilters();
|
QStringList nameFilters = fileNameFilters();
|
||||||
foreach (const QString &filter, nameFilters) {
|
foreach (const QString &filter, nameFilters) {
|
||||||
|
@@ -95,8 +95,8 @@ QString ApplicationRunConfigurationRunner::displayName() const
|
|||||||
RunControl* ApplicationRunConfigurationRunner::run(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode)
|
RunControl* ApplicationRunConfigurationRunner::run(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode)
|
||||||
{
|
{
|
||||||
QSharedPointer<ApplicationRunConfiguration> rc = qSharedPointerCast<ApplicationRunConfiguration>(runConfiguration);
|
QSharedPointer<ApplicationRunConfiguration> rc = qSharedPointerCast<ApplicationRunConfiguration>(runConfiguration);
|
||||||
QTC_ASSERT(rc, return 0);
|
Q_ASSERT(rc);
|
||||||
QTC_ASSERT(mode == ProjectExplorer::Constants::RUNMODE, return 0);
|
Q_ASSERT(mode == ProjectExplorer::Constants::RUNMODE);
|
||||||
|
|
||||||
ApplicationRunControl *runControl = new ApplicationRunControl(rc);
|
ApplicationRunControl *runControl = new ApplicationRunControl(rc);
|
||||||
return runControl;
|
return runControl;
|
||||||
@@ -130,7 +130,7 @@ ApplicationRunControl::~ApplicationRunControl()
|
|||||||
void ApplicationRunControl::start()
|
void ApplicationRunControl::start()
|
||||||
{
|
{
|
||||||
QSharedPointer<ApplicationRunConfiguration> rc = qSharedPointerCast<ApplicationRunConfiguration>(runConfiguration());
|
QSharedPointer<ApplicationRunConfiguration> rc = qSharedPointerCast<ApplicationRunConfiguration>(runConfiguration());
|
||||||
QTC_ASSERT(rc, return);
|
Q_ASSERT(rc);
|
||||||
|
|
||||||
m_applicationLauncher.setEnvironment(rc->environment().toStringList());
|
m_applicationLauncher.setEnvironment(rc->environment().toStringList());
|
||||||
m_applicationLauncher.setWorkingDirectory(rc->workingDirectory());
|
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)
|
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<QString>::const_iterator cit = configurations.constBegin();
|
||||||
QList<Project *>::const_iterator it, end;
|
QList<Project *>::const_iterator it, end;
|
||||||
end = projects.constEnd();
|
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)
|
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<QString>::const_iterator cit = configurations.constBegin();
|
||||||
QList<Project *>::const_iterator it, end;
|
QList<Project *>::const_iterator it, end;
|
||||||
end = projects.constEnd();
|
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 it = m_activeBuildSteps.find(pro);
|
||||||
QHash<Project *, int>::iterator end = m_activeBuildSteps.end();
|
QHash<Project *, int>::iterator end = m_activeBuildSteps.end();
|
||||||
if (it == 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) {
|
} else if (*it == 1) {
|
||||||
--*it;
|
--*it;
|
||||||
emit buildStateChanged(pro);
|
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)
|
void BuildStep::setValue(const QString &buildConfiguration, const QString &name, const QVariant &value)
|
||||||
{
|
{
|
||||||
BuildConfiguration *bc = getBuildConfiguration(buildConfiguration);
|
BuildConfiguration *bc = getBuildConfiguration(buildConfiguration);
|
||||||
QTC_ASSERT(bc, return);
|
Q_ASSERT(bc);
|
||||||
bc->setValue(name, value);
|
bc->setValue(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -123,13 +123,13 @@ void BuildStepsPage::updateBuildStepWidget(QTreeWidgetItem *newItem, QTreeWidget
|
|||||||
{
|
{
|
||||||
if (oldItem == newItem)
|
if (oldItem == newItem)
|
||||||
return;
|
return;
|
||||||
QTC_ASSERT(m_pro, return);
|
Q_ASSERT(m_pro);
|
||||||
|
|
||||||
if (newItem) {
|
if (newItem) {
|
||||||
int row = m_ui->buildSettingsList->indexOfTopLevelItem(newItem);
|
int row = m_ui->buildSettingsList->indexOfTopLevelItem(newItem);
|
||||||
m_ui->buildSettingsWidget->setCurrentIndex(row);
|
m_ui->buildSettingsWidget->setCurrentIndex(row);
|
||||||
BuildStepConfigWidget *widget = qobject_cast<BuildStepConfigWidget *>(m_ui->buildSettingsWidget->currentWidget());
|
BuildStepConfigWidget *widget = qobject_cast<BuildStepConfigWidget *>(m_ui->buildSettingsWidget->currentWidget());
|
||||||
QTC_ASSERT(widget, return);
|
Q_ASSERT(widget);
|
||||||
widget->init(m_configuration);
|
widget->init(m_configuration);
|
||||||
}
|
}
|
||||||
updateBuildStepButtonsState();
|
updateBuildStepButtonsState();
|
||||||
|
@@ -74,7 +74,7 @@ QKeySequence CurrentProjectFind::defaultShortcut() const
|
|||||||
QStringList CurrentProjectFind::files()
|
QStringList CurrentProjectFind::files()
|
||||||
{
|
{
|
||||||
Project *project = m_plugin->currentProject();
|
Project *project = m_plugin->currentProject();
|
||||||
QTC_ASSERT(project, return QStringList());
|
Q_ASSERT(project);
|
||||||
QList<QRegExp> filterRegs;
|
QList<QRegExp> filterRegs;
|
||||||
QStringList nameFilters = fileNameFilters();
|
QStringList nameFilters = fileNameFilters();
|
||||||
foreach (const QString &filter, nameFilters) {
|
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)
|
void Project::setValue(const QString &buildConfiguration, const QString &name, const QVariant &value)
|
||||||
{
|
{
|
||||||
BuildConfiguration *bc = getBuildConfiguration(buildConfiguration);
|
BuildConfiguration *bc = getBuildConfiguration(buildConfiguration);
|
||||||
QTC_ASSERT(bc, return);
|
Q_ASSERT(bc);
|
||||||
bc->setValue(name, value);
|
bc->setValue(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -445,13 +445,19 @@ QList<QSharedPointer<RunConfiguration> > Project::runConfigurations() const
|
|||||||
|
|
||||||
void Project::addRunConfiguration(QSharedPointer<RunConfiguration> runConfiguration)
|
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);
|
m_runConfigurations.push_back(runConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Project::removeRunConfiguration(QSharedPointer<RunConfiguration> 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);
|
m_runConfigurations.removeOne(runConfiguration);
|
||||||
if (m_activeRunConfiguration == runConfiguration) {
|
if (m_activeRunConfiguration == runConfiguration) {
|
||||||
if (m_runConfigurations.isEmpty())
|
if (m_runConfigurations.isEmpty())
|
||||||
@@ -470,7 +476,7 @@ void Project::setActiveRunConfiguration(QSharedPointer<RunConfiguration> runConf
|
|||||||
{
|
{
|
||||||
if (runConfiguration == m_activeRunConfiguration)
|
if (runConfiguration == m_activeRunConfiguration)
|
||||||
return;
|
return;
|
||||||
QTC_ASSERT(m_runConfigurations.contains(runConfiguration) || runConfiguration == 0, return);
|
Q_ASSERT(m_runConfigurations.contains(runConfiguration) || runConfiguration == 0);
|
||||||
m_activeRunConfiguration = runConfiguration;
|
m_activeRunConfiguration = runConfiguration;
|
||||||
emit activeRunConfigurationChanged();
|
emit activeRunConfigurationChanged();
|
||||||
}
|
}
|
||||||
|
@@ -787,7 +787,8 @@ void ProjectExplorerPlugin::setStartupProject(Project *project)
|
|||||||
|
|
||||||
if (!project)
|
if (!project)
|
||||||
project = m_currentProject;
|
project = m_currentProject;
|
||||||
QTC_ASSERT(project, return);
|
if (!project)
|
||||||
|
return;
|
||||||
m_session->setStartupProject(project);
|
m_session->setStartupProject(project);
|
||||||
// NPE: Visually mark startup project
|
// NPE: Visually mark startup project
|
||||||
updateActions();
|
updateActions();
|
||||||
@@ -1360,7 +1361,7 @@ void ProjectExplorerPlugin::runProject()
|
|||||||
void ProjectExplorerPlugin::debugProject()
|
void ProjectExplorerPlugin::debugProject()
|
||||||
{
|
{
|
||||||
Project *pro = startupProject();
|
Project *pro = startupProject();
|
||||||
if (!pro || m_debuggingRunControl)
|
if (!pro || m_debuggingRunControl )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (saveModifiedFiles(QList<Project *>() << pro)) {
|
if (saveModifiedFiles(QList<Project *>() << pro)) {
|
||||||
@@ -1368,6 +1369,7 @@ void ProjectExplorerPlugin::debugProject()
|
|||||||
m_delayedRunConfiguration = pro->activeRunConfiguration();
|
m_delayedRunConfiguration = pro->activeRunConfiguration();
|
||||||
//NBS TODO make the build project step take into account project dependencies
|
//NBS TODO make the build project step take into account project dependencies
|
||||||
m_buildManager->buildProject(pro, pro->activeBuildConfiguration());
|
m_buildManager->buildProject(pro, pro->activeBuildConfiguration());
|
||||||
|
updateRunAction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1534,7 +1536,8 @@ void ProjectExplorerPlugin::updateContextMenuActions()
|
|||||||
|
|
||||||
void ProjectExplorerPlugin::addNewFile()
|
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();
|
const QString location = QFileInfo(m_currentNode->path()).dir().absolutePath();
|
||||||
m_core->showNewItemDialog(tr("New File", "Title of dialog"),
|
m_core->showNewItemDialog(tr("New File", "Title of dialog"),
|
||||||
Core::BaseFileWizard::findWizardsOfKind(Core::IWizard::FileWizard)
|
Core::BaseFileWizard::findWizardsOfKind(Core::IWizard::FileWizard)
|
||||||
@@ -1544,7 +1547,8 @@ void ProjectExplorerPlugin::addNewFile()
|
|||||||
|
|
||||||
void ProjectExplorerPlugin::addExistingFiles()
|
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);
|
ProjectNode *projectNode = qobject_cast<ProjectNode*>(m_currentNode);
|
||||||
const QString dir = QFileInfo(m_currentNode->path()).dir().absolutePath();
|
const QString dir = QFileInfo(m_currentNode->path()).dir().absolutePath();
|
||||||
QStringList fileNames = QFileDialog::getOpenFileNames(m_core->mainWindow(), tr("Add Existing Files"), dir);
|
QStringList fileNames = QFileDialog::getOpenFileNames(m_core->mainWindow(), tr("Add Existing Files"), dir);
|
||||||
@@ -1596,14 +1600,16 @@ void ProjectExplorerPlugin::addExistingFiles()
|
|||||||
|
|
||||||
void ProjectExplorerPlugin::openFile()
|
void ProjectExplorerPlugin::openFile()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_currentNode, return);
|
if (m_currentNode)
|
||||||
|
return;
|
||||||
m_core->editorManager()->openEditor(m_currentNode->path());
|
m_core->editorManager()->openEditor(m_currentNode->path());
|
||||||
m_core->editorManager()->ensureEditorManagerVisible();
|
m_core->editorManager()->ensureEditorManagerVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectExplorerPlugin::removeFile()
|
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);
|
FileNode *fileNode = qobject_cast<FileNode*>(m_currentNode);
|
||||||
|
|
||||||
const QString filePath = m_currentNode->path();
|
const QString filePath = m_currentNode->path();
|
||||||
@@ -1615,7 +1621,7 @@ void ProjectExplorerPlugin::removeFile()
|
|||||||
|
|
||||||
// remove from project
|
// remove from project
|
||||||
ProjectNode *projectNode = fileNode->projectNode();
|
ProjectNode *projectNode = fileNode->projectNode();
|
||||||
QTC_ASSERT(projectNode, return);
|
Q_ASSERT(projectNode);
|
||||||
|
|
||||||
if (!projectNode->removeFiles(fileNode->fileType(), QStringList(filePath))) {
|
if (!projectNode->removeFiles(fileNode->fileType(), QStringList(filePath))) {
|
||||||
QMessageBox::warning(m_core->mainWindow(), tr("Remove file failed"),
|
QMessageBox::warning(m_core->mainWindow(), tr("Remove file failed"),
|
||||||
@@ -1767,11 +1773,15 @@ void ProjectExplorerPlugin::populateOpenWithMenu()
|
|||||||
|
|
||||||
void ProjectExplorerPlugin::openWithMenuTriggered(QAction *action)
|
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());
|
Core::IEditorFactory * const editorFactory = qVariantValue<Core::IEditorFactory *>(action->data());
|
||||||
QTC_ASSERT(m_core, return);
|
if (!editorFactory) {
|
||||||
QTC_ASSERT(m_core->editorManager(), return);
|
qWarning() << "Editor Factory not attached to action, can't happen"<<editorFactory;
|
||||||
QTC_ASSERT(editorFactory, return);
|
return;
|
||||||
|
}
|
||||||
m_core->editorManager()->openEditor(currentNode()->path(), editorFactory->kind());
|
m_core->editorManager()->openEditor(currentNode()->path(), editorFactory->kind());
|
||||||
m_core->editorManager()->ensureEditorManagerVisible();
|
m_core->editorManager()->ensureEditorManagerVisible();
|
||||||
}
|
}
|
||||||
|
@@ -176,7 +176,7 @@ QModelIndex DetailedModel::index(int row, int column, const QModelIndex &parent)
|
|||||||
result = createIndex(0, 0, m_rootNode);
|
result = createIndex(0, 0, m_rootNode);
|
||||||
} else if (column == 0) {
|
} else if (column == 0) {
|
||||||
FolderNode *parentNode = qobject_cast<FolderNode*>(nodeForIndex(parent));
|
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));
|
result = createIndex(row, 0, m_childNodes.value(parentNode).at(row));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@@ -189,7 +189,7 @@ QModelIndex DetailedModel::parent(const QModelIndex &index) const
|
|||||||
if (Node *node = nodeForIndex(index)) {
|
if (Node *node = nodeForIndex(index)) {
|
||||||
if (FolderNode *parentFolderNode = node->parentFolderNode()) {
|
if (FolderNode *parentFolderNode = node->parentFolderNode()) {
|
||||||
if (FolderNode *grandParentFolderNode = parentFolderNode->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);
|
int row = m_childNodes.value(grandParentFolderNode).indexOf(parentFolderNode);
|
||||||
parentIndex = createIndex(row, 0, parentFolderNode);
|
parentIndex = createIndex(row, 0, parentFolderNode);
|
||||||
} else {
|
} else {
|
||||||
@@ -351,8 +351,8 @@ bool DetailedModel::canFetchMore(const QModelIndex & parent) const
|
|||||||
void DetailedModel::fetchMore(const QModelIndex & parent)
|
void DetailedModel::fetchMore(const QModelIndex & parent)
|
||||||
{
|
{
|
||||||
FolderNode *folderNode = qobject_cast<FolderNode*>(nodeForIndex(parent));
|
FolderNode *folderNode = qobject_cast<FolderNode*>(nodeForIndex(parent));
|
||||||
QTC_ASSERT(folderNode, return);
|
Q_ASSERT(folderNode);
|
||||||
QTC_ASSERT(!m_childNodes.contains(folderNode), return);
|
Q_ASSERT(!m_childNodes.contains(folderNode));
|
||||||
|
|
||||||
m_childNodes.insert(folderNode, childNodeList(folderNode));
|
m_childNodes.insert(folderNode, childNodeList(folderNode));
|
||||||
}
|
}
|
||||||
@@ -368,7 +368,7 @@ void DetailedModel::foldersAboutToBeAdded(FolderNode *parentFolder,
|
|||||||
const QList<FolderNode*> &newFolders)
|
const QList<FolderNode*> &newFolders)
|
||||||
{
|
{
|
||||||
Q_UNUSED(newFolders);
|
Q_UNUSED(newFolders);
|
||||||
QTC_ASSERT(parentFolder, return);
|
Q_ASSERT(parentFolder);
|
||||||
|
|
||||||
if (m_childNodes.contains(parentFolder))
|
if (m_childNodes.contains(parentFolder))
|
||||||
m_folderToAddTo = parentFolder;
|
m_folderToAddTo = parentFolder;
|
||||||
@@ -386,7 +386,7 @@ void DetailedModel::foldersAdded()
|
|||||||
void DetailedModel::foldersAboutToBeRemoved(FolderNode *parentFolder,
|
void DetailedModel::foldersAboutToBeRemoved(FolderNode *parentFolder,
|
||||||
const QList<FolderNode*> &staleFolders)
|
const QList<FolderNode*> &staleFolders)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(parentFolder, return);
|
Q_ASSERT(parentFolder);
|
||||||
|
|
||||||
if (m_childNodes.contains(parentFolder)) {
|
if (m_childNodes.contains(parentFolder)) {
|
||||||
QList<Node*> newChildNodes = m_childNodes.value(parentFolder);
|
QList<Node*> newChildNodes = m_childNodes.value(parentFolder);
|
||||||
@@ -416,7 +416,7 @@ void DetailedModel::filesAboutToBeAdded(FolderNode *parentFolder,
|
|||||||
const QList<FileNode*> &newFiles)
|
const QList<FileNode*> &newFiles)
|
||||||
{
|
{
|
||||||
Q_UNUSED(newFiles);
|
Q_UNUSED(newFiles);
|
||||||
QTC_ASSERT(parentFolder, return);
|
Q_ASSERT(parentFolder);
|
||||||
|
|
||||||
if (m_childNodes.contains(parentFolder))
|
if (m_childNodes.contains(parentFolder))
|
||||||
m_folderToAddTo = parentFolder;
|
m_folderToAddTo = parentFolder;
|
||||||
@@ -434,7 +434,7 @@ void DetailedModel::filesAdded()
|
|||||||
void DetailedModel::filesAboutToBeRemoved(FolderNode *parentFolder,
|
void DetailedModel::filesAboutToBeRemoved(FolderNode *parentFolder,
|
||||||
const QList<FileNode*> &staleFiles)
|
const QList<FileNode*> &staleFiles)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(parentFolder, return);
|
Q_ASSERT(parentFolder);
|
||||||
|
|
||||||
if (m_childNodes.contains(parentFolder)) {
|
if (m_childNodes.contains(parentFolder)) {
|
||||||
QList<Node*> newChildNodes = m_childNodes.value(parentFolder);
|
QList<Node*> newChildNodes = m_childNodes.value(parentFolder);
|
||||||
@@ -473,7 +473,7 @@ QModelIndex DetailedModel::indexForNode(const Node *node)
|
|||||||
// update internal cache
|
// update internal cache
|
||||||
if (canFetchMore(parentIndex))
|
if (canFetchMore(parentIndex))
|
||||||
fetchMore(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));
|
int row = m_childNodes.value(parentFolder).indexOf(const_cast<Node*>(node));
|
||||||
if (row >= 0)
|
if (row >= 0)
|
||||||
@@ -506,7 +506,7 @@ void DetailedModel::addToChildNodes(FolderNode *parentFolder, QList<Node*> newCh
|
|||||||
{
|
{
|
||||||
QList<Node*> childNodes = m_childNodes.value(parentFolder);
|
QList<Node*> childNodes = m_childNodes.value(parentFolder);
|
||||||
QModelIndex parentIndex = indexForNode(parentFolder);
|
QModelIndex parentIndex = indexForNode(parentFolder);
|
||||||
QTC_ASSERT(parentIndex.isValid(), return);
|
Q_ASSERT(parentIndex.isValid());
|
||||||
|
|
||||||
// position -> nodes, with positions in decreasing order
|
// position -> nodes, with positions in decreasing order
|
||||||
QList<QPair<int, QList<Node*> > > insertions;
|
QList<QPair<int, QList<Node*> > > insertions;
|
||||||
@@ -550,14 +550,14 @@ void DetailedModel::addToChildNodes(FolderNode *parentFolder, QList<Node*> newCh
|
|||||||
endInsertRows();
|
endInsertRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
QTC_ASSERT(childNodes == newChildNodes, /**/);
|
Q_ASSERT(childNodes == newChildNodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DetailedModel::removeFromChildNodes(FolderNode *parentFolder, QList<Node*> newChildNodes)
|
void DetailedModel::removeFromChildNodes(FolderNode *parentFolder, QList<Node*> newChildNodes)
|
||||||
{
|
{
|
||||||
QList<Node*> childNodes = m_childNodes.value(parentFolder);
|
QList<Node*> childNodes = m_childNodes.value(parentFolder);
|
||||||
QModelIndex parentIndex = indexForNode(parentFolder);
|
QModelIndex parentIndex = indexForNode(parentFolder);
|
||||||
QTC_ASSERT(parentIndex.isValid(), return);
|
Q_ASSERT(parentIndex.isValid());
|
||||||
|
|
||||||
// position -> nodes, with positions in decreasing order
|
// position -> nodes, with positions in decreasing order
|
||||||
QList<QPair<int, QList<Node*> > > deletions;
|
QList<QPair<int, QList<Node*> > > deletions;
|
||||||
@@ -600,7 +600,7 @@ void DetailedModel::removeFromChildNodes(FolderNode *parentFolder, QList<Node*>
|
|||||||
endRemoveRows();
|
endRemoveRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
QTC_ASSERT(childNodes == newChildNodes, /**/);
|
Q_ASSERT(childNodes == newChildNodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<FolderNode*> DetailedModel::recursiveSubFolders(FolderNode *parentFolder)
|
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);
|
result = createIndex(0, 0, m_rootNode);
|
||||||
} else if (parent.isValid() && column == 0) {
|
} else if (parent.isValid() && column == 0) {
|
||||||
FolderNode *parentNode = qobject_cast<FolderNode*>(nodeForIndex(parent));
|
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);
|
QHash<FolderNode*, QList<Node*> >::const_iterator it = m_childNodes.constFind(parentNode);
|
||||||
if (it == m_childNodes.constEnd()) {
|
if (it == m_childNodes.constEnd()) {
|
||||||
fetchMore(parentNode);
|
fetchMore(parentNode);
|
||||||
@@ -690,9 +690,9 @@ QModelIndex FlatModel::parent(const QModelIndex &idx) const
|
|||||||
fetchMore(grandParentNode);
|
fetchMore(grandParentNode);
|
||||||
it = m_childNodes.constFind(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);
|
const int row = it.value().indexOf(parentNode);
|
||||||
QTC_ASSERT(row >= 0, return QModelIndex());
|
Q_ASSERT(row >= 0);
|
||||||
parentIndex = createIndex(row, 0, parentNode);
|
parentIndex = createIndex(row, 0, parentNode);
|
||||||
} else {
|
} else {
|
||||||
// top level node, parent is session
|
// 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
|
void FlatModel::fetchMore(FolderNode *folderNode) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(folderNode, return);
|
Q_ASSERT(folderNode);
|
||||||
QTC_ASSERT(!m_childNodes.contains(folderNode), return);
|
Q_ASSERT(!m_childNodes.contains(folderNode));
|
||||||
|
|
||||||
QList<Node*> nodeList = childNodes(folderNode);
|
QList<Node*> nodeList = childNodes(folderNode);
|
||||||
m_childNodes.insert(folderNode, nodeList);
|
m_childNodes.insert(folderNode, nodeList);
|
||||||
@@ -860,7 +860,7 @@ void FlatModel::fetchMore(FolderNode *folderNode) const
|
|||||||
void FlatModel::fetchMore(const QModelIndex &parent)
|
void FlatModel::fetchMore(const QModelIndex &parent)
|
||||||
{
|
{
|
||||||
FolderNode *folderNode = qobject_cast<FolderNode*>(nodeForIndex(parent));
|
FolderNode *folderNode = qobject_cast<FolderNode*>(nodeForIndex(parent));
|
||||||
QTC_ASSERT(folderNode, return);
|
Q_ASSERT(folderNode);
|
||||||
|
|
||||||
fetchMore(folderNode);
|
fetchMore(folderNode);
|
||||||
}
|
}
|
||||||
|
@@ -376,7 +376,7 @@ void ProjectNode::removeProjectNodes(const QList<ProjectNode*> &subProjects)
|
|||||||
*/
|
*/
|
||||||
void ProjectNode::addFolderNodes(const QList<FolderNode*> &subFolders, FolderNode *parentFolder)
|
void ProjectNode::addFolderNodes(const QList<FolderNode*> &subFolders, FolderNode *parentFolder)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(parentFolder, return);
|
Q_ASSERT(parentFolder);
|
||||||
|
|
||||||
if (!subFolders.isEmpty()) {
|
if (!subFolders.isEmpty()) {
|
||||||
const bool emitSignals = (parentFolder->projectNode() == this);
|
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,
|
void ProjectNode::removeFolderNodes(const QList<FolderNode*> &subFolders,
|
||||||
FolderNode *parentFolder)
|
FolderNode *parentFolder)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(parentFolder, return);
|
Q_ASSERT(parentFolder);
|
||||||
|
|
||||||
if (!subFolders.isEmpty()) {
|
if (!subFolders.isEmpty()) {
|
||||||
const bool emitSignals = (parentFolder->projectNode() == this);
|
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)
|
void ProjectNode::addFileNodes(const QList<FileNode*> &files, FolderNode *folder)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(folder, return);
|
Q_ASSERT(folder);
|
||||||
|
|
||||||
if (!files.isEmpty()) {
|
if (!files.isEmpty()) {
|
||||||
const bool emitSignals = (folder->projectNode() == this);
|
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)
|
void ProjectNode::removeFileNodes(const QList<FileNode*> &files, FolderNode *folder)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(folder, return);
|
Q_ASSERT(folder);
|
||||||
|
|
||||||
if (!files.isEmpty()) {
|
if (!files.isEmpty()) {
|
||||||
const bool emitSignals = (folder->projectNode() == this);
|
const bool emitSignals = (folder->projectNode() == this);
|
||||||
|
@@ -274,9 +274,9 @@ void RunSettingsWidget::initRunConfigurationComboBox()
|
|||||||
|
|
||||||
void RunSettingsWidget::activateRunConfiguration(int index)
|
void RunSettingsWidget::activateRunConfiguration(int index)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_project, return);
|
Q_ASSERT(m_project);
|
||||||
const QList<QSharedPointer<RunConfiguration> > runConfigurations = m_project->runConfigurations();
|
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);
|
QSharedPointer<RunConfiguration> selectedRunConfiguration = runConfigurations.at(index);
|
||||||
|
|
||||||
// Change the active run configuration of the project
|
// Change the active run configuration of the project
|
||||||
|
@@ -141,7 +141,7 @@ QString SessionFile::mimeType() const
|
|||||||
|
|
||||||
bool SessionFile::load(const QString &fileName)
|
bool SessionFile::load(const QString &fileName)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!fileName.isEmpty(), return false);
|
Q_ASSERT(!fileName.isEmpty());
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << "SessionFile::load " << fileName;
|
qDebug() << "SessionFile::load " << fileName;
|
||||||
@@ -246,7 +246,7 @@ bool SessionFile::save(const QString &fileName)
|
|||||||
if (!fileName.isEmpty())
|
if (!fileName.isEmpty())
|
||||||
m_fileName = fileName;
|
m_fileName = fileName;
|
||||||
|
|
||||||
QTC_ASSERT(!m_fileName.isEmpty(), return false);
|
Q_ASSERT(!m_fileName.isEmpty());
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << "SessionFile - saving " << m_fileName;
|
qDebug() << "SessionFile - saving " << m_fileName;
|
||||||
@@ -493,7 +493,7 @@ void SessionManager::setStartupProject(Project *startupProject)
|
|||||||
qDebug() << Q_FUNC_INFO << (startupProject ? startupProject->name() : "0");
|
qDebug() << Q_FUNC_INFO << (startupProject ? startupProject->name() : "0");
|
||||||
|
|
||||||
if (startupProject) {
|
if (startupProject) {
|
||||||
QTC_ASSERT(m_file->m_projects.contains(startupProject), return);
|
Q_ASSERT(m_file->m_projects.contains(startupProject));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_file->m_startupProject = startupProject;
|
m_file->m_startupProject = startupProject;
|
||||||
@@ -566,7 +566,7 @@ void SessionManager::removeProject(Project *project)
|
|||||||
|
|
||||||
bool SessionManager::createImpl(const QString &fileName)
|
bool SessionManager::createImpl(const QString &fileName)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!fileName.isEmpty(), return false);
|
Q_ASSERT(!fileName.isEmpty());
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << "SessionManager - creating new session " << fileName << " ...";
|
qDebug() << "SessionManager - creating new session " << fileName << " ...";
|
||||||
@@ -597,7 +597,7 @@ bool SessionManager::createImpl(const QString &fileName)
|
|||||||
|
|
||||||
bool SessionManager::loadImpl(const QString &fileName)
|
bool SessionManager::loadImpl(const QString &fileName)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!fileName.isEmpty(), return false);
|
Q_ASSERT(!fileName.isEmpty());
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << "SessionManager - loading session " << fileName << " ...";
|
qDebug() << "SessionManager - loading session " << fileName << " ...";
|
||||||
@@ -803,7 +803,7 @@ Project *SessionManager::projectForNode(Node *node) const
|
|||||||
while (rootProjectNode && rootProjectNode->parentFolderNode() != m_sessionNode)
|
while (rootProjectNode && rootProjectNode->parentFolderNode() != m_sessionNode)
|
||||||
rootProjectNode = rootProjectNode->parentFolderNode();
|
rootProjectNode = rootProjectNode->parentFolderNode();
|
||||||
|
|
||||||
QTC_ASSERT(rootProjectNode, return 0);
|
Q_ASSERT(rootProjectNode);
|
||||||
|
|
||||||
QList<Project *> projectList = projects();
|
QList<Project *> projectList = projects();
|
||||||
foreach (Project *p, projectList) {
|
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
|
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);
|
Qt4Project *qt4project = qobject_cast<Qt4Project *>(pro);
|
||||||
QTC_ASSERT(qt4project, return 0);
|
Q_ASSERT(qt4project);
|
||||||
return new GdbMacrosBuildStep(qt4project);
|
return new GdbMacrosBuildStep(qt4project);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -294,7 +294,7 @@ void MakeStepConfigWidget::init(const QString &buildConfiguration)
|
|||||||
|
|
||||||
if (!showPage0) {
|
if (!showPage0) {
|
||||||
Qt4Project *pro = qobject_cast<Qt4Project *>(m_makeStep->project());
|
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()));
|
m_ui.makeLabel->setText(tr("Override %1:").arg(pro->qtVersion(buildConfiguration)->makeCommand()));
|
||||||
|
|
||||||
const QString &makeCmd = m_makeStep->value(buildConfiguration, "makeCmd").toString();
|
const QString &makeCmd = m_makeStep->value(buildConfiguration, "makeCmd").toString();
|
||||||
@@ -309,12 +309,12 @@ void MakeStepConfigWidget::init(const QString &buildConfiguration)
|
|||||||
|
|
||||||
void MakeStepConfigWidget::makeLineEditTextEdited()
|
void MakeStepConfigWidget::makeLineEditTextEdited()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!m_buildConfiguration.isNull(), return);
|
Q_ASSERT(!m_buildConfiguration.isNull());
|
||||||
m_makeStep->setValue(m_buildConfiguration, "makeCmd", m_ui.makeLineEdit->text());
|
m_makeStep->setValue(m_buildConfiguration, "makeCmd", m_ui.makeLineEdit->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeStepConfigWidget::makeArgumentsLineEditTextEdited()
|
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()));
|
m_makeStep->setValue(m_buildConfiguration, "makeargs", ProjectExplorer::Environment::parseCombinedArgString(m_ui.makeArgumentsLineEdit->text()));
|
||||||
}
|
}
|
||||||
|
@@ -234,7 +234,7 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
|
|||||||
|
|
||||||
void QMakeStepConfigWidget::qmakeArgumentsLineEditTextEdited()
|
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_step->setValue(m_buildConfiguration, "qmakeArgs", ProjectExplorer::Environment::parseCombinedArgString(m_ui.qmakeAdditonalArgumentsLineEdit->text()));
|
||||||
m_ui.qmakeArgumentsEdit->setPlainText(ProjectExplorer::Environment::joinArgumentList(m_step->arguments(m_buildConfiguration)));
|
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_projectDir(QFileInfo(filePath).absolutePath()),
|
||||||
m_fileWatcher(new FileWatcher(this))
|
m_fileWatcher(new FileWatcher(this))
|
||||||
{
|
{
|
||||||
QTC_ASSERT(project, return);
|
Q_ASSERT(project);
|
||||||
setFolderName(QFileInfo(filePath).baseName());
|
setFolderName(QFileInfo(filePath).baseName());
|
||||||
setIcon(QIcon(":/qt4projectmanager/images/qt_project.png"));
|
setIcon(QIcon(":/qt4projectmanager/images/qt_project.png"));
|
||||||
m_fileWatcher->addFile(filePath);
|
m_fileWatcher->addFile(filePath);
|
||||||
@@ -105,8 +105,8 @@ void Qt4PriFileNode::scheduleUpdate()
|
|||||||
|
|
||||||
void Qt4PriFileNode::update(ProFile *includeFile, ProFileReader *reader)
|
void Qt4PriFileNode::update(ProFile *includeFile, ProFileReader *reader)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(includeFile, return);
|
Q_ASSERT(includeFile);
|
||||||
QTC_ASSERT(reader, return);
|
Q_ASSERT(reader);
|
||||||
|
|
||||||
// add project file node
|
// add project file node
|
||||||
if (m_fileNodes.isEmpty())
|
if (m_fileNodes.isEmpty())
|
||||||
@@ -179,7 +179,7 @@ QList<ProjectNode::ProjectAction> Qt4PriFileNode::supportedActions() const
|
|||||||
const Qt4ProFileNode *proFileNode;
|
const Qt4ProFileNode *proFileNode;
|
||||||
while (!(proFileNode = qobject_cast<const Qt4ProFileNode*>(folderNode)))
|
while (!(proFileNode = qobject_cast<const Qt4ProFileNode*>(folderNode)))
|
||||||
folderNode = folderNode->parentFolderNode();
|
folderNode = folderNode->parentFolderNode();
|
||||||
QTC_ASSERT(proFileNode, return actions);
|
Q_ASSERT(proFileNode);
|
||||||
|
|
||||||
switch (proFileNode->projectType()) {
|
switch (proFileNode->projectType()) {
|
||||||
case ApplicationTemplate:
|
case ApplicationTemplate:
|
||||||
|
@@ -149,7 +149,7 @@ QStringList Qt4RunConfiguration::commandLineArguments() const
|
|||||||
ProjectExplorer::Environment Qt4RunConfiguration::environment() const
|
ProjectExplorer::Environment Qt4RunConfiguration::environment() const
|
||||||
{
|
{
|
||||||
Qt4Project *pro = qobject_cast<Qt4Project *>(project());
|
Qt4Project *pro = qobject_cast<Qt4Project *>(project());
|
||||||
QTC_ASSERT(pro, return ProjectExplorer::Environment());
|
Q_ASSERT(pro);
|
||||||
return pro->environment(pro->activeBuildConfiguration());
|
return pro->environment(pro->activeBuildConfiguration());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -374,8 +374,8 @@ QSharedPointer<ProjectExplorer::RunConfiguration> Qt4RunConfigurationFactory::cr
|
|||||||
(ProjectExplorer::Project *project, const QString &type)
|
(ProjectExplorer::Project *project, const QString &type)
|
||||||
{
|
{
|
||||||
Qt4Project *p = qobject_cast<Qt4Project *>(project);
|
Qt4Project *p = qobject_cast<Qt4Project *>(project);
|
||||||
QTC_ASSERT(p, /**/);
|
Q_ASSERT(p);
|
||||||
QTC_ASSERT(type == "Qt4ProjectManager.Qt4RunConfiguration", /**/);
|
Q_ASSERT(type == "Qt4ProjectManager.Qt4RunConfiguration");
|
||||||
// The right path is set in restoreSettings
|
// The right path is set in restoreSettings
|
||||||
QSharedPointer<ProjectExplorer::RunConfiguration> rc(new Qt4RunConfiguration(p, QString::null));
|
QSharedPointer<ProjectExplorer::RunConfiguration> rc(new Qt4RunConfiguration(p, QString::null));
|
||||||
return rc;
|
return rc;
|
||||||
@@ -418,7 +418,7 @@ bool Qt4RunConfigurationFactoryUser::canCreate(const QString &type) const
|
|||||||
QSharedPointer<ProjectExplorer::RunConfiguration> Qt4RunConfigurationFactoryUser::create(ProjectExplorer::Project *project, const QString &type)
|
QSharedPointer<ProjectExplorer::RunConfiguration> Qt4RunConfigurationFactoryUser::create(ProjectExplorer::Project *project, const QString &type)
|
||||||
{
|
{
|
||||||
Qt4Project *p = qobject_cast<Qt4Project *>(project);
|
Qt4Project *p = qobject_cast<Qt4Project *>(project);
|
||||||
QTC_ASSERT(p, /**/);
|
Q_ASSERT(p);
|
||||||
|
|
||||||
QString fileName = type.mid(QString("Qt4RunConfiguration.").size());
|
QString fileName = type.mid(QString("Qt4RunConfiguration.").size());
|
||||||
return QSharedPointer<ProjectExplorer::RunConfiguration>(new Qt4RunConfiguration(p, fileName));
|
return QSharedPointer<ProjectExplorer::RunConfiguration>(new Qt4RunConfiguration(p, fileName));
|
||||||
|
@@ -116,7 +116,7 @@ void QtVersionManager::addVersion(QtVersion *version)
|
|||||||
void QtVersionManager::updateDocumentation()
|
void QtVersionManager::updateDocumentation()
|
||||||
{
|
{
|
||||||
Help::HelpManager *helpManager = m_core->pluginManager()->getObject<Help::HelpManager>();
|
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 fileEndings = QStringList() << "/qch/qt.qch" << "/qch/qmake.qch" << "/qch/designer.qch";
|
||||||
QStringList files;
|
QStringList files;
|
||||||
foreach (QtVersion *version, m_versions) {
|
foreach (QtVersion *version, m_versions) {
|
||||||
@@ -596,7 +596,7 @@ void QtDirWidget::defaultChanged(int)
|
|||||||
void QtDirWidget::updateCurrentQtName()
|
void QtDirWidget::updateCurrentQtName()
|
||||||
{
|
{
|
||||||
QTreeWidgetItem *currentItem = m_ui.qtdirList->currentItem();
|
QTreeWidgetItem *currentItem = m_ui.qtdirList->currentItem();
|
||||||
QTC_ASSERT(currentItem, return);
|
Q_ASSERT(currentItem);
|
||||||
int currentItemIndex = m_ui.qtdirList->indexOfTopLevelItem(currentItem);
|
int currentItemIndex = m_ui.qtdirList->indexOfTopLevelItem(currentItem);
|
||||||
m_versions[currentItemIndex]->setName(m_ui.nameEdit->text());
|
m_versions[currentItemIndex]->setName(m_ui.nameEdit->text());
|
||||||
currentItem->setText(0, m_versions[currentItemIndex]->name());
|
currentItem->setText(0, m_versions[currentItemIndex]->name());
|
||||||
@@ -645,7 +645,7 @@ void QtDirWidget::fixQtVersionName(int index)
|
|||||||
void QtDirWidget::updateCurrentQtPath()
|
void QtDirWidget::updateCurrentQtPath()
|
||||||
{
|
{
|
||||||
QTreeWidgetItem *currentItem = m_ui.qtdirList->currentItem();
|
QTreeWidgetItem *currentItem = m_ui.qtdirList->currentItem();
|
||||||
QTC_ASSERT(currentItem, return);
|
Q_ASSERT(currentItem);
|
||||||
int currentItemIndex = m_ui.qtdirList->indexOfTopLevelItem(currentItem);
|
int currentItemIndex = m_ui.qtdirList->indexOfTopLevelItem(currentItem);
|
||||||
m_versions[currentItemIndex]->setPath(m_ui.pathEdit->text());
|
m_versions[currentItemIndex]->setPath(m_ui.pathEdit->text());
|
||||||
currentItem->setText(1, m_versions[currentItemIndex]->path());
|
currentItem->setText(1, m_versions[currentItemIndex]->path());
|
||||||
@@ -656,7 +656,7 @@ void QtDirWidget::updateCurrentQtPath()
|
|||||||
void QtDirWidget::updateCurrentMingwDirectory()
|
void QtDirWidget::updateCurrentMingwDirectory()
|
||||||
{
|
{
|
||||||
QTreeWidgetItem *currentItem = m_ui.qtdirList->currentItem();
|
QTreeWidgetItem *currentItem = m_ui.qtdirList->currentItem();
|
||||||
QTC_ASSERT(currentItem, return);
|
Q_ASSERT(currentItem);
|
||||||
int currentItemIndex = m_ui.qtdirList->indexOfTopLevelItem(currentItem);
|
int currentItemIndex = m_ui.qtdirList->indexOfTopLevelItem(currentItem);
|
||||||
m_versions[currentItemIndex]->setMingwDirectory(m_ui.mingwLineEdit->text());
|
m_versions[currentItemIndex]->setMingwDirectory(m_ui.mingwLineEdit->text());
|
||||||
}
|
}
|
||||||
@@ -665,7 +665,7 @@ void QtDirWidget::msvcVersionChanged()
|
|||||||
{
|
{
|
||||||
const QString &msvcVersion = m_ui.msvcComboBox->currentText();
|
const QString &msvcVersion = m_ui.msvcComboBox->currentText();
|
||||||
QTreeWidgetItem *currentItem = m_ui.qtdirList->currentItem();
|
QTreeWidgetItem *currentItem = m_ui.qtdirList->currentItem();
|
||||||
QTC_ASSERT(currentItem, return);
|
Q_ASSERT(currentItem);
|
||||||
int currentItemIndex = m_ui.qtdirList->indexOfTopLevelItem(currentItem);
|
int currentItemIndex = m_ui.qtdirList->indexOfTopLevelItem(currentItem);
|
||||||
m_versions[currentItemIndex]->setMsvcVersion(msvcVersion);
|
m_versions[currentItemIndex]->setMsvcVersion(msvcVersion);
|
||||||
|
|
||||||
|
@@ -233,7 +233,7 @@ void LibraryWizardDialog::slotCurrentIdChanged(int id)
|
|||||||
qDebug("initializing for plugins");
|
qDebug("initializing for plugins");
|
||||||
QStringList baseClasses;
|
QStringList baseClasses;
|
||||||
const int pluginBaseClassCount = sizeof(pluginBaseClasses)/sizeof(PluginBaseClasses);
|
const int pluginBaseClassCount = sizeof(pluginBaseClasses)/sizeof(PluginBaseClasses);
|
||||||
QTC_ASSERT(defaultPluginBaseClass < pluginBaseClassCount, return);
|
Q_ASSERT(defaultPluginBaseClass < pluginBaseClassCount);
|
||||||
for (int i = 0; i < pluginBaseClassCount; i++)
|
for (int i = 0; i < pluginBaseClassCount; i++)
|
||||||
baseClasses.push_back(QLatin1String(pluginBaseClasses[i].name));
|
baseClasses.push_back(QLatin1String(pluginBaseClasses[i].name));
|
||||||
m_filesPage->setBaseClassChoices(baseClasses);
|
m_filesPage->setBaseClassChoices(baseClasses);
|
||||||
|
@@ -104,14 +104,14 @@ QString ModulesPage::deselectedModules() const
|
|||||||
void ModulesPage::setModuleSelected(const QString &module, bool selected) const
|
void ModulesPage::setModuleSelected(const QString &module, bool selected) const
|
||||||
{
|
{
|
||||||
QCheckBox *checkBox = m_moduleCheckBoxMap[module];
|
QCheckBox *checkBox = m_moduleCheckBoxMap[module];
|
||||||
QTC_ASSERT(checkBox, return);
|
Q_ASSERT(checkBox);
|
||||||
checkBox->setCheckState(selected?Qt::Checked:Qt::Unchecked);
|
checkBox->setCheckState(selected?Qt::Checked:Qt::Unchecked);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModulesPage::setModuleEnabled(const QString &module, bool enabled) const
|
void ModulesPage::setModuleEnabled(const QString &module, bool enabled) const
|
||||||
{
|
{
|
||||||
QCheckBox *checkBox = m_moduleCheckBoxMap[module];
|
QCheckBox *checkBox = m_moduleCheckBoxMap[module];
|
||||||
QTC_ASSERT(checkBox, return);
|
Q_ASSERT(checkBox);
|
||||||
checkBox->setEnabled(enabled);
|
checkBox->setEnabled(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user