diff options
Diffstat (limited to 'src/plugins/cppeditor/cppinsertqtpropertymembers.cpp')
-rw-r--r-- | src/plugins/cppeditor/cppinsertqtpropertymembers.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/cppeditor/cppinsertqtpropertymembers.cpp b/src/plugins/cppeditor/cppinsertqtpropertymembers.cpp index 2834ec3720..49653864fd 100644 --- a/src/plugins/cppeditor/cppinsertqtpropertymembers.cpp +++ b/src/plugins/cppeditor/cppinsertqtpropertymembers.cpp @@ -42,6 +42,8 @@ #include <cppeditor/cppquickfix.h> #include <coreplugin/ifile.h> +#include <utils/qtcassert.h> + #include <QtCore/QTextStream> using namespace CPlusPlus; @@ -159,7 +161,7 @@ void InsertQtPropertyMembers::Operation::performChanges(const CppRefactoringFile const QString getterDeclaration = typeName + QLatin1Char(' ') + m_getterName + QLatin1String("() const\n{\nreturn ") + m_storageName + QLatin1String(";\n}\n"); InsertionLocation getterLoc = locator.methodDeclarationInClass(file->fileName(), m_class, InsertionPointLocator::Public); - Q_ASSERT(getterLoc.isValid()); + QTC_ASSERT(getterLoc.isValid(), return); insertAndIndent(file, &declarations, getterLoc, getterDeclaration); } @@ -176,7 +178,7 @@ void InsertQtPropertyMembers::Operation::performChanges(const CppRefactoringFile << " = arg;\nemit " << m_signalName << "(arg);\n}\n}\n"; } InsertionLocation setterLoc = locator.methodDeclarationInClass(file->fileName(), m_class, InsertionPointLocator::PublicSlot); - Q_ASSERT(setterLoc.isValid()); + QTC_ASSERT(setterLoc.isValid(), return); insertAndIndent(file, &declarations, setterLoc, setterDeclaration); } @@ -185,7 +187,7 @@ void InsertQtPropertyMembers::Operation::performChanges(const CppRefactoringFile const QString declaration = QLatin1String("void ") + m_signalName + QLatin1Char('(') + typeName + QLatin1String(" arg);\n"); InsertionLocation loc = locator.methodDeclarationInClass(file->fileName(), m_class, InsertionPointLocator::Signals); - Q_ASSERT(loc.isValid()); + QTC_ASSERT(loc.isValid(), return); insertAndIndent(file, &declarations, loc, declaration); } @@ -194,7 +196,7 @@ void InsertQtPropertyMembers::Operation::performChanges(const CppRefactoringFile const QString storageDeclaration = typeName + QLatin1String(" m_") + propertyName + QLatin1String(";\n"); InsertionLocation storageLoc = locator.methodDeclarationInClass(file->fileName(), m_class, InsertionPointLocator::Private); - Q_ASSERT(storageLoc.isValid()); + QTC_ASSERT(storageLoc.isValid(), return); insertAndIndent(file, &declarations, storageLoc, storageDeclaration); } |