use QTC_ASSERT instead of Q_ASSERT

This commit is contained in:
hjk
2008-12-09 15:25:01 +01:00
parent e99d8ce3fc
commit 4a552ead9f
94 changed files with 923 additions and 673 deletions

View File

@@ -32,6 +32,7 @@
***************************************************************************/
#include "cppcodecompletion.h"
#include "cppmodelmanager.h"
#include <Control.h>
@@ -45,6 +46,7 @@
#include <SymbolVisitor.h>
#include <Scope.h>
#include <TranslationUnit.h>
#include <cplusplus/ResolveExpression.h>
#include <cplusplus/LookupContext.h>
#include <cplusplus/Overview.h>
@@ -55,6 +57,7 @@
#include <coreplugin/editormanager/editormanager.h>
#include <texteditor/itexteditor.h>
#include <texteditor/itexteditable.h>
#include <utils/qtcassert.h>
#include <texteditor/basetexteditor.h>
#include <QtCore/QDebug>
@@ -540,7 +543,7 @@ bool CppCodeCompletion::completeMember(FullySpecifiedType,
const QList<TypeOfExpression::Result> &results,
const LookupContext &context)
{
Q_ASSERT(! results.isEmpty());
QTC_ASSERT(!results.isEmpty(), return false);
QList<Symbol *> classObjectCandidates;
@@ -938,7 +941,7 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item)
if (m_completionOperator == T_LPAREN) {
if (symbol) {
Function *function = symbol->type()->asFunction();
Q_ASSERT(function != 0);
QTC_ASSERT(function, return);
m_functionArgumentWidget = new FunctionArgumentWidget(m_core);
m_functionArgumentWidget->showFunctionHint(function);

View File

@@ -52,6 +52,8 @@
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <utils/qtcassert.h>
#include <TranslationUnit.h>
#include <Semantic.h>
#include <AST.h>
@@ -64,10 +66,11 @@
#include <Lexer.h>
#include <Token.h>
#include <QPlainTextEdit>
#include <QMutexLocker>
#include <QTime>
#include <QDebug>
#include <QtCore/QDebug>
#include <QtCore/QMutexLocker>
#include <QtCore/QTime>
//#include <QtGui/QPlainTextEdit>
using namespace CppTools;
using namespace CppTools::Internal;
@@ -439,10 +442,10 @@ CppModelManager::CppModelManager(QObject *parent) :
m_projectExplorer = ExtensionSystem::PluginManager::instance()
->getObject<ProjectExplorer::ProjectExplorerPlugin>();
Q_ASSERT(m_projectExplorer);
QTC_ASSERT(m_projectExplorer, return);
ProjectExplorer::SessionManager *session = m_projectExplorer->session();
Q_ASSERT(session != 0);
QTC_ASSERT(session, return);
connect(session, SIGNAL(projectAdded(ProjectExplorer::Project*)),
this, SLOT(onProjectAdded(ProjectExplorer::Project*)));
@@ -626,7 +629,7 @@ void CppModelManager::editorOpened(Core::IEditor *editor)
{
if (isCppEditor(editor)) {
TextEditor::ITextEditor *textEditor = qobject_cast<TextEditor::ITextEditor *>(editor);
Q_ASSERT(textEditor != 0);
QTC_ASSERT(textEditor, return);
CppEditorSupport *editorSupport = new CppEditorSupport(this);
editorSupport->setTextEditor(textEditor);
@@ -646,7 +649,7 @@ void CppModelManager::editorAboutToClose(Core::IEditor *editor)
{
if (isCppEditor(editor)) {
TextEditor::ITextEditor *textEditor = qobject_cast<TextEditor::ITextEditor *>(editor);
Q_ASSERT(textEditor != 0);
QTC_ASSERT(textEditor, return);
CppEditorSupport *editorSupport = m_editorSupport.value(textEditor);
m_editorSupport.remove(textEditor);
@@ -785,7 +788,7 @@ void CppModelManager::parse(QFutureInterface<void> &future,
CppPreprocessor *preproc,
QStringList files)
{
Q_ASSERT(! files.isEmpty());
QTC_ASSERT(!files.isEmpty(), return);
// Change the priority of the background parser thread to idle.
QThread::currentThread()->setPriority(QThread::IdlePriority);