VCS: Replace Q_ASSERTs with QTC_ASSERT

Also rename m to model

Change-Id: Ibb283dc2d5d0c306cbac9109a7e5fc6481ac86a8
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Orgad Shaneh
2013-01-07 22:15:03 +02:00
committed by hjk
parent 5abce3ab9f
commit 73a2717bed
2 changed files with 9 additions and 7 deletions

View File

@@ -31,6 +31,7 @@
#include "vcsbaseconstants.h"
#include <coreplugin/fileiconprovider.h>
#include <utils/qtcassert.h>
#include <QStandardItem>
#include <QFileInfo>
@@ -157,7 +158,7 @@ unsigned int SubmitFileModel::filterFiles(const QStringList &filter)
*/
void SubmitFileModel::updateSelections(SubmitFileModel *source)
{
Q_ASSERT(source);
QTC_ASSERT(source, return);
int rows = rowCount();
int sourceRows = source->rowCount();
int lastMatched = 0;

View File

@@ -57,6 +57,7 @@
#include <utils/checkablemessagebox.h>
#include <utils/synchronousprocess.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <find/basetextfind.h>
#include <texteditor/fontsettings.h>
#include <texteditor/texteditorsettings.h>
@@ -477,21 +478,21 @@ QStringList VcsBaseSubmitEditor::checkedFiles() const
return d->m_widget->checkedFiles();
}
void VcsBaseSubmitEditor::setFileModel(SubmitFileModel *m, const QString &repositoryDirectory)
void VcsBaseSubmitEditor::setFileModel(SubmitFileModel *model, const QString &repositoryDirectory)
{
Q_ASSERT(m);
QTC_ASSERT(model, return);
if (SubmitFileModel *oldModel = d->m_widget->fileModel()) {
m->updateSelections(oldModel);
model->updateSelections(oldModel);
delete oldModel;
}
d->m_widget->setFileModel(m);
d->m_widget->setFileModel(model);
QSet<QString> uniqueSymbols;
const CPlusPlus::Snapshot cppSnapShot = CPlusPlus::CppModelManagerInterface::instance()->snapshot();
// Iterate over the files and get interesting symbols
for (int row = 0; row < m->rowCount(); ++row) {
const QFileInfo fileInfo(repositoryDirectory, m->file(row));
for (int row = 0; row < model->rowCount(); ++row) {
const QFileInfo fileInfo(repositoryDirectory, model->file(row));
// Add file name
uniqueSymbols.insert(fileInfo.fileName());