forked from qt-creator/qt-creator
use QTC_ASSERT instead of Q_ASSERT
This commit is contained in:
@@ -239,7 +239,7 @@ static void appendFileData(QIODevice *out, const QString &fileName)
|
||||
|
||||
static void appendFileData(QIODevice *out, QIODevice *in)
|
||||
{
|
||||
Q_ASSERT(!in->isSequential());
|
||||
QTC_ASSERT(!in->isSequential(), return);
|
||||
qint64 size = in->size();
|
||||
QByteArray &b = theBuffer(size);
|
||||
rawRead(in, b.data(), size);
|
||||
|
@@ -30,19 +30,22 @@
|
||||
** version 1.2, included in the file GPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
***************************************************************************/
|
||||
|
||||
#include "formresizer.h"
|
||||
#include "sizehandlerect.h"
|
||||
#include "widgethostconstants.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtDesigner/QDesignerFormWindowInterface>
|
||||
|
||||
#include <QtGui/QResizeEvent>
|
||||
#include <QtGui/QPalette>
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QFrame>
|
||||
#include <QtGui/QResizeEvent>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
enum { debugFormResizer=0 };
|
||||
enum { debugFormResizer = 0 };
|
||||
|
||||
using namespace SharedTools::Internal;
|
||||
|
||||
@@ -140,7 +143,7 @@ void FormResizer::setFormWindow(QDesignerFormWindowInterface *fw)
|
||||
if (debugFormResizer)
|
||||
qDebug() << "FormResizer::setFormWindow " << fw;
|
||||
QVBoxLayout *layout = qobject_cast<QVBoxLayout *>(m_frame->layout());
|
||||
Q_ASSERT(layout);
|
||||
QTC_ASSERT(layout, return);
|
||||
if (layout->count())
|
||||
delete layout->takeAt(0);
|
||||
m_formWindow = fw;
|
||||
|
@@ -33,6 +33,8 @@
|
||||
|
||||
#include "indenter.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace SharedTools::IndenterInternal;
|
||||
|
||||
// --- Constants
|
||||
@@ -55,12 +57,12 @@ Constants::Constants() :
|
||||
"|(?:public|protected|private|signals|Q_SIGNALS|default)(?:\\s+slots|\\s+Q_SLOTS)?\\s*"
|
||||
")?:.*"))
|
||||
{
|
||||
m_literal.setMinimal( true );
|
||||
m_inlineCComment.setMinimal( true );
|
||||
Q_ASSERT(m_literal.isValid());
|
||||
Q_ASSERT(m_label.isValid());
|
||||
Q_ASSERT(m_inlineCComment.isValid());
|
||||
Q_ASSERT(m_braceX.isValid());
|
||||
Q_ASSERT(m_iflikeKeyword.isValid());
|
||||
Q_ASSERT(m_caseLabel.isValid());
|
||||
m_literal.setMinimal(true);
|
||||
m_inlineCComment.setMinimal(true);
|
||||
QTC_ASSERT(m_literal.isValid(), return);
|
||||
QTC_ASSERT(m_label.isValid(), return);
|
||||
QTC_ASSERT(m_inlineCComment.isValid(), return);
|
||||
QTC_ASSERT(m_braceX.isValid(), return);
|
||||
QTC_ASSERT(m_iflikeKeyword.isValid(), return);
|
||||
QTC_ASSERT(m_caseLabel.isValid(), return);
|
||||
}
|
||||
|
@@ -33,6 +33,8 @@
|
||||
|
||||
#include "procommandmanager.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
|
||||
ProCommandGroup::ProCommandGroup(const QString &name)
|
||||
@@ -76,7 +78,7 @@ ProCommandManager::~ProCommandManager()
|
||||
|
||||
void ProCommandManager::beginGroup(const QString &name)
|
||||
{
|
||||
Q_ASSERT(!m_group);
|
||||
QTC_ASSERT(!m_group, return);
|
||||
|
||||
if (m_pos != m_groups.count()) {
|
||||
int removecount = m_groups.count() - m_pos;
|
||||
@@ -95,7 +97,7 @@ bool ProCommandManager::hasGroup() const
|
||||
|
||||
void ProCommandManager::endGroup()
|
||||
{
|
||||
Q_ASSERT(m_group);
|
||||
QTC_ASSERT(m_group, return);
|
||||
|
||||
m_groups.append(m_group);
|
||||
m_pos = m_groups.count();
|
||||
@@ -106,7 +108,7 @@ void ProCommandManager::endGroup()
|
||||
|
||||
bool ProCommandManager::command(ProCommand *cmd)
|
||||
{
|
||||
Q_ASSERT(m_group);
|
||||
QTC_ASSERT(m_group, return false);
|
||||
|
||||
if (cmd->redo()) {
|
||||
m_group->appendCommand(cmd);
|
||||
|
@@ -35,6 +35,8 @@
|
||||
#include "proparserutils.h"
|
||||
#include "proitems.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QDir>
|
||||
@@ -683,7 +685,7 @@ bool ProFileEvaluator::Private::visitProFunction(ProFunction *func)
|
||||
QString text = func->text();
|
||||
int lparen = text.indexOf(QLatin1Char('('));
|
||||
int rparen = text.lastIndexOf(QLatin1Char(')'));
|
||||
Q_ASSERT(lparen < rparen);
|
||||
QTC_ASSERT(lparen < rparen, return false);
|
||||
|
||||
QString arguments = text.mid(lparen + 1, rparen - lparen - 1);
|
||||
QString funcName = text.left(lparen);
|
||||
|
@@ -33,13 +33,16 @@
|
||||
|
||||
#include "resourcefile_p.h"
|
||||
|
||||
#include <QtCore/QtAlgorithms>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QTextStream>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QMimeData>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QMimeData>
|
||||
#include <QtCore/QtAlgorithms>
|
||||
#include <QtCore/QTextStream>
|
||||
|
||||
#include <QtGui/QIcon>
|
||||
#include <QtGui/QImageReader>
|
||||
|
||||
@@ -109,14 +112,14 @@ bool ResourceFile::load()
|
||||
const QString language = relt.attribute(QLatin1String("lang"));
|
||||
|
||||
const int idx = indexOfPrefix(prefix);
|
||||
Prefix * p = NULL;
|
||||
Prefix * p = 0;
|
||||
if (idx == -1) {
|
||||
p = new Prefix(prefix, language);
|
||||
m_prefix_list.append(p);
|
||||
} else {
|
||||
p = m_prefix_list[idx];
|
||||
}
|
||||
Q_ASSERT(p != NULL);
|
||||
QTC_ASSERT(p, return false);
|
||||
|
||||
QDomElement felt = relt.firstChildElement(QLatin1String("file"));
|
||||
for (; !felt.isNull(); felt = felt.nextSiblingElement(QLatin1String("file"))) {
|
||||
@@ -247,9 +250,9 @@ bool ResourceFile::isEmpty() const
|
||||
|
||||
QStringList ResourceFile::fileList(int pref_idx) const
|
||||
{
|
||||
Q_ASSERT((pref_idx >= 0) && (pref_idx < m_prefix_list.count()));
|
||||
const FileList &abs_file_list = m_prefix_list.at(pref_idx)->file_list;
|
||||
QStringList result;
|
||||
QTC_ASSERT(pref_idx >= 0 && pref_idx < m_prefix_list.count(), return result);
|
||||
const FileList &abs_file_list = m_prefix_list.at(pref_idx)->file_list;
|
||||
foreach (const File *abs_file, abs_file_list)
|
||||
result.append(relativePath(abs_file->name));
|
||||
return result;
|
||||
@@ -258,9 +261,9 @@ QStringList ResourceFile::fileList(int pref_idx) const
|
||||
void ResourceFile::addFile(int prefix_idx, const QString &file, int file_idx)
|
||||
{
|
||||
Prefix * const p = m_prefix_list[prefix_idx];
|
||||
Q_ASSERT(p != NULL);
|
||||
QTC_ASSERT(p, return);
|
||||
FileList &files = p->file_list;
|
||||
Q_ASSERT((file_idx >= -1) && (file_idx <= files.size()));
|
||||
QTC_ASSERT(file_idx >= -1 && file_idx <= files.size(), return);
|
||||
if (file_idx == -1)
|
||||
file_idx = files.size();
|
||||
files.insert(file_idx, new File(p, absolutePath(file)));
|
||||
@@ -272,7 +275,7 @@ void ResourceFile::addPrefix(const QString &prefix, int prefix_idx)
|
||||
if (indexOfPrefix(fixed_prefix) != -1)
|
||||
return;
|
||||
|
||||
Q_ASSERT((prefix_idx >= -1) && (prefix_idx <= m_prefix_list.size()));
|
||||
QTC_ASSERT(prefix_idx >= -1 && prefix_idx <= m_prefix_list.size(), return);
|
||||
if (prefix_idx == -1)
|
||||
prefix_idx = m_prefix_list.size();
|
||||
m_prefix_list.insert(prefix_idx, new Prefix(fixed_prefix));
|
||||
@@ -280,7 +283,7 @@ void ResourceFile::addPrefix(const QString &prefix, int prefix_idx)
|
||||
|
||||
void ResourceFile::removePrefix(int prefix_idx)
|
||||
{
|
||||
Q_ASSERT((prefix_idx >= 0) && (prefix_idx < m_prefix_list.count()));
|
||||
QTC_ASSERT(prefix_idx >= 0 && prefix_idx < m_prefix_list.count(), return);
|
||||
Prefix * const p = m_prefix_list.at(prefix_idx);
|
||||
delete p;
|
||||
m_prefix_list.removeAt(prefix_idx);
|
||||
@@ -288,39 +291,39 @@ void ResourceFile::removePrefix(int prefix_idx)
|
||||
|
||||
void ResourceFile::removeFile(int prefix_idx, int file_idx)
|
||||
{
|
||||
Q_ASSERT((prefix_idx >= 0) && (prefix_idx < m_prefix_list.count()));
|
||||
QTC_ASSERT(prefix_idx >= 0 && prefix_idx < m_prefix_list.count(), return);
|
||||
FileList &fileList = m_prefix_list[prefix_idx]->file_list;
|
||||
Q_ASSERT((file_idx >= 0) && (file_idx < fileList.count()));
|
||||
QTC_ASSERT(file_idx >= 0 && file_idx < fileList.count(), return);
|
||||
delete fileList.at(file_idx);
|
||||
fileList.removeAt(file_idx);
|
||||
}
|
||||
|
||||
void ResourceFile::replacePrefix(int prefix_idx, const QString &prefix)
|
||||
{
|
||||
Q_ASSERT((prefix_idx >= 0) && (prefix_idx < m_prefix_list.count()));
|
||||
QTC_ASSERT(prefix_idx >= 0 && prefix_idx < m_prefix_list.count(), return);
|
||||
m_prefix_list[prefix_idx]->name = fixPrefix(prefix);
|
||||
}
|
||||
|
||||
void ResourceFile::replaceLang(int prefix_idx, const QString &lang)
|
||||
{
|
||||
Q_ASSERT((prefix_idx >= 0) && (prefix_idx < m_prefix_list.count()));
|
||||
QTC_ASSERT(prefix_idx >= 0 && prefix_idx < m_prefix_list.count(), return);
|
||||
m_prefix_list[prefix_idx]->lang = lang;
|
||||
}
|
||||
|
||||
void ResourceFile::replaceAlias(int prefix_idx, int file_idx, const QString &alias)
|
||||
{
|
||||
Q_ASSERT((prefix_idx >= 0) && (prefix_idx < m_prefix_list.count()));
|
||||
QTC_ASSERT(prefix_idx >= 0 && prefix_idx < m_prefix_list.count(), return);
|
||||
FileList &fileList = m_prefix_list.at(prefix_idx)->file_list;
|
||||
Q_ASSERT((file_idx >= 0) && (file_idx < fileList.count()));
|
||||
QTC_ASSERT(file_idx >= 0 && file_idx < fileList.count(), return);
|
||||
fileList[file_idx]->alias = alias;
|
||||
}
|
||||
|
||||
|
||||
void ResourceFile::replaceFile(int pref_idx, int file_idx, const QString &file)
|
||||
{
|
||||
Q_ASSERT((pref_idx >= 0) && (pref_idx < m_prefix_list.count()));
|
||||
QTC_ASSERT(pref_idx >= 0 && pref_idx < m_prefix_list.count(), return);
|
||||
FileList &fileList = m_prefix_list.at(pref_idx)->file_list;
|
||||
Q_ASSERT((file_idx >= 0) && (file_idx < fileList.count()));
|
||||
QTC_ASSERT(file_idx >= 0 && file_idx < fileList.count(), return);
|
||||
fileList[file_idx]->name = file;
|
||||
}
|
||||
|
||||
@@ -336,7 +339,7 @@ int ResourceFile::indexOfPrefix(const QString &prefix) const
|
||||
|
||||
int ResourceFile::indexOfFile(int pref_idx, const QString &file) const
|
||||
{
|
||||
Q_ASSERT((pref_idx >= 0) && (pref_idx < m_prefix_list.count()));
|
||||
QTC_ASSERT(pref_idx >= 0 && pref_idx < m_prefix_list.count(), return -1);
|
||||
Prefix * const p = m_prefix_list.at(pref_idx);
|
||||
File equalFile(p, absolutePath(file));
|
||||
return p->file_list.indexOf(&equalFile);
|
||||
@@ -370,16 +373,16 @@ bool ResourceFile::contains(const QString &prefix, const QString &file) const
|
||||
return false;
|
||||
if (file.isEmpty())
|
||||
return true;
|
||||
Q_ASSERT((pref_idx >= 0) && (pref_idx < m_prefix_list.count()));
|
||||
QTC_ASSERT(pref_idx >= 0 && pref_idx < m_prefix_list.count(), return false);
|
||||
Prefix * const p = m_prefix_list.at(pref_idx);
|
||||
Q_ASSERT(p != NULL);
|
||||
QTC_ASSERT(p, return false);
|
||||
File equalFile(p, absolutePath(file));
|
||||
return p->file_list.contains(&equalFile);
|
||||
}
|
||||
|
||||
bool ResourceFile::contains(int pref_idx, const QString &file) const
|
||||
{
|
||||
Q_ASSERT((pref_idx >= 0) && (pref_idx < m_prefix_list.count()));
|
||||
QTC_ASSERT(pref_idx >= 0 && pref_idx < m_prefix_list.count(), return false);
|
||||
Prefix * const p = m_prefix_list.at(pref_idx);
|
||||
File equalFile(p, absolutePath(file));
|
||||
return p->file_list.contains(&equalFile);
|
||||
@@ -409,49 +412,49 @@ int ResourceFile::prefixCount() const
|
||||
|
||||
QString ResourceFile::prefix(int idx) const
|
||||
{
|
||||
Q_ASSERT((idx >= 0) && (idx < m_prefix_list.count()));
|
||||
QTC_ASSERT((idx >= 0) && (idx < m_prefix_list.count()), return QString());
|
||||
return m_prefix_list.at(idx)->name;
|
||||
}
|
||||
|
||||
QString ResourceFile::lang(int idx) const
|
||||
{
|
||||
Q_ASSERT((idx >= 0) && (idx < m_prefix_list.count()));
|
||||
QTC_ASSERT(idx >= 0 && idx < m_prefix_list.count(), return QString());
|
||||
return m_prefix_list.at(idx)->lang;
|
||||
}
|
||||
|
||||
int ResourceFile::fileCount(int prefix_idx) const
|
||||
{
|
||||
Q_ASSERT((prefix_idx >= 0) && (prefix_idx < m_prefix_list.count()));
|
||||
QTC_ASSERT(prefix_idx >= 0 && prefix_idx < m_prefix_list.count(), return 0);
|
||||
return m_prefix_list.at(prefix_idx)->file_list.size();
|
||||
}
|
||||
|
||||
QString ResourceFile::file(int prefix_idx, int file_idx) const
|
||||
{
|
||||
Q_ASSERT((prefix_idx >= 0) && (prefix_idx < m_prefix_list.count()));
|
||||
QTC_ASSERT(prefix_idx >= 0 && prefix_idx < m_prefix_list.count(), return QString());
|
||||
FileList &fileList = m_prefix_list.at(prefix_idx)->file_list;
|
||||
Q_ASSERT((file_idx >= 0) && (file_idx < fileList.count()));
|
||||
QTC_ASSERT(file_idx >= 0 && file_idx < fileList.count(), return QString());
|
||||
return fileList.at(file_idx)->name;
|
||||
}
|
||||
|
||||
QString ResourceFile::alias(int prefix_idx, int file_idx) const
|
||||
{
|
||||
Q_ASSERT((prefix_idx >= 0) && (prefix_idx < m_prefix_list.count()));
|
||||
QTC_ASSERT(prefix_idx >= 0 && prefix_idx < m_prefix_list.count(), return QString());
|
||||
FileList &fileList = m_prefix_list.at(prefix_idx)->file_list;
|
||||
Q_ASSERT((file_idx >= 0) && (file_idx < fileList.count()));
|
||||
QTC_ASSERT(file_idx >= 0 && file_idx < fileList.count(), return QString());
|
||||
return fileList.at(file_idx)->alias;
|
||||
}
|
||||
|
||||
void * ResourceFile::prefixPointer(int prefixIndex) const
|
||||
{
|
||||
Q_ASSERT((prefixIndex >= 0) && (prefixIndex < m_prefix_list.count()));
|
||||
QTC_ASSERT(prefixIndex >= 0 && prefixIndex < m_prefix_list.count(), return 0);
|
||||
return m_prefix_list.at(prefixIndex);
|
||||
}
|
||||
|
||||
void * ResourceFile::filePointer(int prefixIndex, int fileIndex) const
|
||||
{
|
||||
Q_ASSERT((prefixIndex >= 0) && (prefixIndex < m_prefix_list.count()));
|
||||
QTC_ASSERT(prefixIndex >= 0 && prefixIndex < m_prefix_list.count(), return 0);
|
||||
FileList &fileList = m_prefix_list.at(prefixIndex)->file_list;
|
||||
Q_ASSERT((fileIndex >= 0) && (fileIndex < fileList.count()));
|
||||
QTC_ASSERT(fileIndex >= 0 && fileIndex < fileList.count(), return 0);
|
||||
return fileList.at(fileIndex);
|
||||
}
|
||||
|
||||
@@ -497,28 +500,28 @@ QModelIndex ResourceModel::index(int row, int column, const QModelIndex &parent)
|
||||
if (column != 0)
|
||||
return QModelIndex();
|
||||
|
||||
void * internalPointer = NULL;
|
||||
void * internalPointer = 0;
|
||||
if (parent.isValid()) {
|
||||
void * const pip = parent.internalPointer();
|
||||
if (pip == NULL)
|
||||
if (pip == 0)
|
||||
return QModelIndex();
|
||||
|
||||
// File node
|
||||
Node * const node = reinterpret_cast<Node *>(pip);
|
||||
Prefix * const prefix = node->prefix();
|
||||
Q_ASSERT(prefix != NULL);
|
||||
if ((row < 0) || (row >= prefix->file_list.count()))
|
||||
QTC_ASSERT(prefix, return QModelIndex());
|
||||
if (row < 0 || row >= prefix->file_list.count())
|
||||
return QModelIndex();
|
||||
const int prefixIndex = m_resource_file.prefixPointerIndex(prefix);
|
||||
const int fileIndex = row;
|
||||
internalPointer = m_resource_file.filePointer(prefixIndex, fileIndex);
|
||||
} else {
|
||||
// Prefix node
|
||||
if ((row < 0) || (row >= m_resource_file.prefixCount()))
|
||||
if (row < 0 || row >= m_resource_file.prefixCount())
|
||||
return QModelIndex();
|
||||
internalPointer = m_resource_file.prefixPointer(row);
|
||||
}
|
||||
Q_ASSERT(internalPointer != NULL);
|
||||
QTC_ASSERT(internalPointer, return QModelIndex());
|
||||
return createIndex(row, 0, internalPointer);
|
||||
}
|
||||
|
||||
@@ -528,16 +531,16 @@ QModelIndex ResourceModel::parent(const QModelIndex &index) const
|
||||
return QModelIndex();
|
||||
|
||||
void * const internalPointer = index.internalPointer();
|
||||
if (internalPointer == NULL)
|
||||
if (internalPointer == 0)
|
||||
return QModelIndex();
|
||||
Node * const node = reinterpret_cast<Node *>(internalPointer);
|
||||
Prefix * const prefix = node->prefix();
|
||||
Q_ASSERT(prefix != NULL);
|
||||
QTC_ASSERT(prefix, return QModelIndex());
|
||||
bool const isFileNode = (prefix != node);
|
||||
|
||||
if (isFileNode) {
|
||||
const int row = m_resource_file.prefixPointerIndex(prefix);
|
||||
Q_ASSERT(row >= 0);
|
||||
QTC_ASSERT(row >= 0, return QModelIndex());
|
||||
return createIndex(row, 0, prefix);
|
||||
} else {
|
||||
return QModelIndex();
|
||||
@@ -550,7 +553,7 @@ int ResourceModel::rowCount(const QModelIndex &parent) const
|
||||
void * const internalPointer = parent.internalPointer();
|
||||
Node * const node = reinterpret_cast<Node *>(internalPointer);
|
||||
Prefix * const prefix = node->prefix();
|
||||
Q_ASSERT(prefix != NULL);
|
||||
QTC_ASSERT(prefix, return 0);
|
||||
bool const isFileNode = (prefix != node);
|
||||
|
||||
if (isFileNode) {
|
||||
@@ -609,7 +612,7 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const
|
||||
Node * const node = reinterpret_cast<Node *>(internalPointer);
|
||||
Prefix const * const prefix = node->prefix();
|
||||
File const * const file = node->file();
|
||||
Q_ASSERT(prefix != NULL);
|
||||
QTC_ASSERT(prefix, return QVariant());
|
||||
bool const isFileNode = (prefix != node);
|
||||
|
||||
QVariant result;
|
||||
@@ -626,7 +629,7 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const
|
||||
appendParenthesized(lang, stringRes);
|
||||
} else {
|
||||
// File node
|
||||
Q_ASSERT(file != NULL);
|
||||
QTC_ASSERT(file, return result);
|
||||
stringRes = QFileInfo(file->name).fileName();
|
||||
const QString alias = file->alias;
|
||||
if (!alias.isEmpty())
|
||||
@@ -638,7 +641,7 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const
|
||||
case Qt::DecorationRole:
|
||||
if (isFileNode) {
|
||||
// File node
|
||||
Q_ASSERT(file != NULL);
|
||||
QTC_ASSERT(file, return result);
|
||||
const QString path = m_resource_file.absolutePath(file->name);
|
||||
if (iconFileExtension(path)) {
|
||||
const QIcon icon(path);
|
||||
@@ -650,7 +653,7 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const
|
||||
case Qt::ToolTipRole:
|
||||
if (isFileNode) {
|
||||
// File node
|
||||
Q_ASSERT(file != NULL);
|
||||
QTC_ASSERT(file, return result);
|
||||
QString conv_file = m_resource_file.relativePath(file->name);
|
||||
QString stringRes = conv_file.replace(QDir::separator(), QLatin1Char('/'));
|
||||
const QString &alias_file = file->alias;
|
||||
@@ -679,12 +682,12 @@ void ResourceModel::getItem(const QModelIndex &index, QString &prefix, QString &
|
||||
void * const internalPointer = index.internalPointer();
|
||||
Node * const node = reinterpret_cast<Node *>(internalPointer);
|
||||
Prefix * const p = node->prefix();
|
||||
Q_ASSERT(p != NULL);
|
||||
QTC_ASSERT(p, return);
|
||||
bool const isFileNode = (p != node);
|
||||
|
||||
if (isFileNode) {
|
||||
File * const f = node->file();
|
||||
Q_ASSERT(f != NULL);
|
||||
File *const f = node->file();
|
||||
QTC_ASSERT(f, return);
|
||||
if (!f->alias.isEmpty())
|
||||
file = f->alias;
|
||||
else
|
||||
|
@@ -36,10 +36,12 @@
|
||||
|
||||
#include "namespace_global.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QAbstractItemModel>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QAbstractItemModel>
|
||||
|
||||
#include "shared_global_p.h"
|
||||
|
||||
@@ -66,11 +68,11 @@ class Node
|
||||
protected:
|
||||
Node(File *file, Prefix *prefix) : m_file(file), m_prefix(prefix)
|
||||
{
|
||||
Q_ASSERT(m_prefix != NULL);
|
||||
QTC_ASSERT(m_prefix, return);
|
||||
}
|
||||
public:
|
||||
File * file() { return m_file; }
|
||||
Prefix * prefix() { Q_ASSERT(m_prefix != NULL); return m_prefix; }
|
||||
File *file() { return m_file; }
|
||||
Prefix *prefix() { return m_prefix; }
|
||||
private:
|
||||
File *m_file;
|
||||
Prefix *m_prefix;
|
||||
|
@@ -32,16 +32,20 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "resourceview.h"
|
||||
|
||||
#include "undocommands_p.h"
|
||||
|
||||
#include <QtGui/QHeaderView>
|
||||
#include <QtGui/QMenu>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QInputDialog>
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtCore/QtDebug>
|
||||
#include <QtGui/QHeaderView>
|
||||
#include <QtGui/QInputDialog>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QUndoStack>
|
||||
|
||||
namespace SharedTools {
|
||||
@@ -308,14 +312,14 @@ void ResourceView::findSamePlacePostDeletionModelIndex(int &row, QModelIndex &pa
|
||||
|
||||
EntryBackup * ResourceView::removeEntry(const QModelIndex &index)
|
||||
{
|
||||
Q_ASSERT(m_qrcModel != NULL);
|
||||
QTC_ASSERT(m_qrcModel, return 0);
|
||||
return m_qrcModel->removeEntry(index);
|
||||
}
|
||||
|
||||
void ResourceView::addFiles(int prefixIndex, const QStringList &fileNames, int cursorFile,
|
||||
int &firstFile, int &lastFile)
|
||||
{
|
||||
Q_ASSERT(m_qrcModel != NULL);
|
||||
QTC_ASSERT(m_qrcModel, return);
|
||||
m_qrcModel->addFiles(prefixIndex, fileNames, cursorFile, firstFile, lastFile);
|
||||
|
||||
// Expand prefix node
|
||||
@@ -327,11 +331,11 @@ void ResourceView::addFiles(int prefixIndex, const QStringList &fileNames, int c
|
||||
|
||||
void ResourceView::removeFiles(int prefixIndex, int firstFileIndex, int lastFileIndex)
|
||||
{
|
||||
Q_ASSERT((prefixIndex >= 0) && (prefixIndex < m_qrcModel->rowCount(QModelIndex())));
|
||||
QTC_ASSERT(prefixIndex >= 0 && prefixIndex < m_qrcModel->rowCount(QModelIndex()), return);
|
||||
const QModelIndex prefixModelIndex = m_qrcModel->index(prefixIndex, 0, QModelIndex());
|
||||
Q_ASSERT(prefixModelIndex != QModelIndex());
|
||||
Q_ASSERT((firstFileIndex >= 0) && (firstFileIndex < m_qrcModel->rowCount(prefixModelIndex)));
|
||||
Q_ASSERT((lastFileIndex >= 0) && (lastFileIndex < m_qrcModel->rowCount(prefixModelIndex)));
|
||||
QTC_ASSERT(prefixModelIndex != QModelIndex(), return);
|
||||
QTC_ASSERT(firstFileIndex >= 0 && firstFileIndex < m_qrcModel->rowCount(prefixModelIndex), return);
|
||||
QTC_ASSERT(lastFileIndex >= 0 && lastFileIndex < m_qrcModel->rowCount(prefixModelIndex), return);
|
||||
|
||||
for (int i = lastFileIndex; i >= firstFileIndex; i--) {
|
||||
const QModelIndex index = m_qrcModel->index(i, 0, prefixModelIndex);
|
||||
@@ -568,7 +572,7 @@ QString ResourceView::getCurrentValue(NodeProperty property) const
|
||||
case AliasProperty: return currentAlias();
|
||||
case PrefixProperty: return currentPrefix();
|
||||
case LanguageProperty: return currentLanguage();
|
||||
default: Q_ASSERT(false); return QString(); // Kill warning
|
||||
default: QTC_ASSERT(false, /**/); return QString(); // Kill warning
|
||||
}
|
||||
}
|
||||
|
||||
@@ -579,7 +583,7 @@ void ResourceView::changeValue(const QModelIndex &nodeIndex, NodeProperty proper
|
||||
case AliasProperty: m_qrcModel->changeAlias(nodeIndex, value); return;
|
||||
case PrefixProperty: m_qrcModel->changePrefix(nodeIndex, value); return;
|
||||
case LanguageProperty: m_qrcModel->changeLang(nodeIndex, value); return;
|
||||
default: Q_ASSERT(false);
|
||||
default: QTC_ASSERT(false, /**/);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -92,7 +92,7 @@ bool ModifyPropertyCommand::mergeWith(const QUndoCommand * command)
|
||||
{
|
||||
const ModifyPropertyCommand * const brother
|
||||
= dynamic_cast<const ModifyPropertyCommand *>(command);
|
||||
if (command == NULL || m_property != brother->m_property)
|
||||
if (command == 0 || m_property != brother->m_property)
|
||||
return false;
|
||||
|
||||
// Choose older command (this) and forgot the other
|
||||
@@ -101,7 +101,7 @@ bool ModifyPropertyCommand::mergeWith(const QUndoCommand * command)
|
||||
|
||||
void ModifyPropertyCommand::undo()
|
||||
{
|
||||
Q_ASSERT(m_view != NULL);
|
||||
QTC_ASSERT(m_view, return);
|
||||
|
||||
// Save current text in m_after for redo()
|
||||
m_after = m_view->getCurrentValue(m_property);
|
||||
@@ -117,12 +117,12 @@ void ModifyPropertyCommand::redo()
|
||||
return;
|
||||
|
||||
// Bring back text before undo
|
||||
Q_ASSERT(m_view != NULL);
|
||||
QTC_ASSERT(m_view, return);
|
||||
m_view->changeValue(makeIndex(), m_property, m_after);
|
||||
}
|
||||
|
||||
RemoveEntryCommand::RemoveEntryCommand(ResourceView *view, const QModelIndex &index)
|
||||
: ModelIndexViewCommand(view), m_entry(NULL), m_isExpanded(true)
|
||||
: ModelIndexViewCommand(view), m_entry(0), m_isExpanded(true)
|
||||
{
|
||||
storeIndex(index);
|
||||
}
|
||||
@@ -142,9 +142,9 @@ void RemoveEntryCommand::redo()
|
||||
|
||||
void RemoveEntryCommand::undo()
|
||||
{
|
||||
if (m_entry != NULL) {
|
||||
if (m_entry == 0) {
|
||||
m_entry->restore();
|
||||
Q_ASSERT(m_view != NULL);
|
||||
QTC_ASSERT(m_view != 0, return);
|
||||
const QModelIndex index = makeIndex();
|
||||
m_view->setExpanded(index, m_isExpanded);
|
||||
m_view->setCurrentIndex(index);
|
||||
@@ -155,7 +155,7 @@ void RemoveEntryCommand::undo()
|
||||
void RemoveEntryCommand::freeEntry()
|
||||
{
|
||||
delete m_entry;
|
||||
m_entry = NULL;
|
||||
m_entry = 0;
|
||||
}
|
||||
|
||||
AddFilesCommand::AddFilesCommand(ResourceView *view, int prefixIndex, int cursorFileIndex,
|
||||
|
@@ -34,6 +34,8 @@
|
||||
#ifndef WRAP_HELPERS_H
|
||||
#define WRAP_HELPERS_H
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtScript/QScriptEngine>
|
||||
#include <QtScript/QScriptContext>
|
||||
#include <QtScript/QScriptValue>
|
||||
@@ -87,7 +89,7 @@ template <class Wrapper, class Wrapped>
|
||||
Wrapped * (Wrapper::*wrappedAccessor) () const)
|
||||
{
|
||||
Wrapped *wrapped = wrappedFromScriptValue(context->thisObject(), wrappedAccessor);
|
||||
Q_ASSERT(wrapped);
|
||||
QTC_ASSERT(wrapped, return 0);
|
||||
return wrapped;
|
||||
}
|
||||
|
||||
@@ -314,7 +316,7 @@ static void scriptValueToQObject(const QScriptValue &sv, SomeQObject * &p)
|
||||
{
|
||||
QObject *qObject = sv.toQObject();
|
||||
p = qobject_cast<SomeQObject*>(qObject);
|
||||
Q_ASSERT(p);
|
||||
QTC_ASSERT(p, return);
|
||||
}
|
||||
|
||||
// Register a QObject-derived class which has Q_DECLARE_METATYPE(Ptr*)
|
||||
|
@@ -32,6 +32,9 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "CppDocument.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <Control.h>
|
||||
#include <TranslationUnit.h>
|
||||
#include <DiagnosticClient.h>
|
||||
@@ -270,7 +273,7 @@ bool Document::parse(ParseMode mode)
|
||||
|
||||
void Document::check()
|
||||
{
|
||||
Q_ASSERT(! _globalNamespace);
|
||||
QTC_ASSERT(!_globalNamespace, return);
|
||||
|
||||
Semantic semantic(_control);
|
||||
|
||||
|
@@ -34,6 +34,8 @@
|
||||
#include "OverviewModel.h"
|
||||
#include "Overview.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <Scope.h>
|
||||
#include <Semantic.h>
|
||||
#include <Literals.h>
|
||||
@@ -81,13 +83,13 @@ QModelIndex OverviewModel::index(int row, int column, const QModelIndex &parent)
|
||||
return createIndex(row, column, symbol);
|
||||
} else {
|
||||
Symbol *parentSymbol = static_cast<Symbol *>(parent.internalPointer());
|
||||
Q_ASSERT(parentSymbol != 0);
|
||||
QTC_ASSERT(parentSymbol, return QModelIndex());
|
||||
|
||||
ScopedSymbol *scopedSymbol = parentSymbol->asScopedSymbol();
|
||||
Q_ASSERT(scopedSymbol != 0);
|
||||
QTC_ASSERT(scopedSymbol, return QModelIndex());
|
||||
|
||||
Scope *scope = scopedSymbol->members();
|
||||
Q_ASSERT(scope != 0);
|
||||
QTC_ASSERT(scope, return QModelIndex());
|
||||
|
||||
return createIndex(row, 0, scope->symbolAt(row));
|
||||
}
|
||||
@@ -124,12 +126,12 @@ int OverviewModel::rowCount(const QModelIndex &parent) const
|
||||
if (!parent.parent().isValid() && parent.row() == 0) // account for no symbol item
|
||||
return 0;
|
||||
Symbol *parentSymbol = static_cast<Symbol *>(parent.internalPointer());
|
||||
Q_ASSERT(parentSymbol != 0);
|
||||
QTC_ASSERT(parentSymbol, return 0);
|
||||
|
||||
if (ScopedSymbol *scopedSymbol = parentSymbol->asScopedSymbol()) {
|
||||
if (!scopedSymbol->isFunction()) {
|
||||
Scope *parentScope = scopedSymbol->members();
|
||||
Q_ASSERT(parentScope != 0);
|
||||
QTC_ASSERT(parentScope, return 0);
|
||||
|
||||
return parentScope->symbolCount();
|
||||
}
|
||||
|
@@ -45,12 +45,14 @@
|
||||
#include <TypeVisitor.h>
|
||||
#include <NameVisitor.h>
|
||||
|
||||
#include <QList>
|
||||
#include <QtDebug>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QtDebug>
|
||||
|
||||
using namespace CPlusPlus;
|
||||
|
||||
namespace {
|
||||
namespace {
|
||||
|
||||
typedef QList< QPair<Name *, FullySpecifiedType> > Substitution;
|
||||
|
||||
@@ -98,7 +100,7 @@ protected:
|
||||
// types
|
||||
virtual void visit(PointerToMemberType * /*ty*/)
|
||||
{
|
||||
Q_ASSERT(0);
|
||||
QTC_ASSERT(false, /**/);
|
||||
}
|
||||
|
||||
virtual void visit(PointerType *ty)
|
||||
@@ -150,32 +152,32 @@ protected:
|
||||
{ /* nothing to do*/ }
|
||||
|
||||
virtual void visit(Namespace *)
|
||||
{ Q_ASSERT(0); }
|
||||
{ QTC_ASSERT(false, /**/); }
|
||||
|
||||
virtual void visit(Class *)
|
||||
{ Q_ASSERT(0); }
|
||||
{ QTC_ASSERT(false, /**/); }
|
||||
|
||||
virtual void visit(Enum *)
|
||||
{ Q_ASSERT(0); }
|
||||
{ QTC_ASSERT(false, /**/); }
|
||||
|
||||
// names
|
||||
virtual void visit(NameId *)
|
||||
{ Q_ASSERT(0); }
|
||||
{ QTC_ASSERT(false, /**/); }
|
||||
|
||||
virtual void visit(TemplateNameId *)
|
||||
{ Q_ASSERT(0); }
|
||||
{ QTC_ASSERT(false, /**/); }
|
||||
|
||||
virtual void visit(DestructorNameId *)
|
||||
{ Q_ASSERT(0); }
|
||||
{ QTC_ASSERT(false, /**/); }
|
||||
|
||||
virtual void visit(OperatorNameId *)
|
||||
{ Q_ASSERT(0); }
|
||||
{ QTC_ASSERT(false, /**/); }
|
||||
|
||||
virtual void visit(ConversionNameId *)
|
||||
{ Q_ASSERT(0); }
|
||||
{ QTC_ASSERT(false, /**/); }
|
||||
|
||||
virtual void visit(QualifiedNameId *)
|
||||
{ Q_ASSERT(0); }
|
||||
{ QTC_ASSERT(false, /**/); }
|
||||
};
|
||||
|
||||
} // end of anonymous namespace
|
||||
|
@@ -52,11 +52,14 @@
|
||||
|
||||
#include "pp-environment.h"
|
||||
#include "pp.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <cstring>
|
||||
|
||||
using namespace CPlusPlus;
|
||||
|
||||
Environment::Environment ()
|
||||
Environment::Environment()
|
||||
: currentLine(0),
|
||||
hide_next(false),
|
||||
_macros(0),
|
||||
@@ -67,7 +70,7 @@ Environment::Environment ()
|
||||
{
|
||||
}
|
||||
|
||||
Environment::~Environment ()
|
||||
Environment::~Environment()
|
||||
{
|
||||
if (_macros) {
|
||||
qDeleteAll(firstMacro(), lastMacro());
|
||||
@@ -78,15 +81,19 @@ Environment::~Environment ()
|
||||
free(_hash);
|
||||
}
|
||||
|
||||
unsigned Environment::macroCount () const
|
||||
{ return _macro_count + 1; }
|
||||
unsigned Environment::macroCount() const
|
||||
{
|
||||
return _macro_count + 1;
|
||||
}
|
||||
|
||||
Macro *Environment::macroAt (unsigned index) const
|
||||
{ return _macros[index]; }
|
||||
Macro *Environment::macroAt(unsigned index) const
|
||||
{
|
||||
return _macros[index];
|
||||
}
|
||||
|
||||
Macro *Environment::bind(const Macro &__macro)
|
||||
{
|
||||
Q_ASSERT(! __macro.name.isEmpty());
|
||||
QTC_ASSERT(! __macro.name.isEmpty(), return 0);
|
||||
|
||||
Macro *m = new Macro (__macro);
|
||||
m->hashcode = hash_code(m->name);
|
||||
|
@@ -33,6 +33,8 @@
|
||||
|
||||
#include "classnamevalidatinglineedit.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QRegExp>
|
||||
|
||||
@@ -53,7 +55,7 @@ ClassNameValidatingLineEditPrivate:: ClassNameValidatingLineEditPrivate() :
|
||||
m_namespaceDelimiter(QLatin1String("::")),
|
||||
m_namespacesEnabled(false)
|
||||
{
|
||||
Q_ASSERT(m_nameRegexp.isValid());
|
||||
QTC_ASSERT(m_nameRegexp.isValid(), return);
|
||||
}
|
||||
|
||||
// --------------------- ClassNameValidatingLineEdit
|
||||
@@ -113,7 +115,7 @@ QString ClassNameValidatingLineEdit::createClassName(const QString &name)
|
||||
// Remove spaces and convert the adjacent characters to uppercase
|
||||
QString className = name;
|
||||
QRegExp spaceMatcher(QLatin1String(" +(\\w)"), Qt::CaseSensitive, QRegExp::RegExp2);
|
||||
Q_ASSERT(spaceMatcher.isValid());
|
||||
QTC_ASSERT(spaceMatcher.isValid(), /**/);
|
||||
int pos;
|
||||
while ((pos = spaceMatcher.indexIn(className)) != -1) {
|
||||
className.replace(pos, spaceMatcher.matchedLength(),
|
||||
|
@@ -32,6 +32,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "filenamevalidatinglineedit.h"
|
||||
#include "qtcassert.h"
|
||||
|
||||
#include <QtCore/QRegExp>
|
||||
#include <QtCore/QDebug>
|
||||
@@ -46,7 +47,7 @@ static const QRegExp &windowsDeviceNoSubDirPattern()
|
||||
{
|
||||
static const QRegExp rc(QLatin1String("CON|AUX|PRN|COM1|COM2|LPT1|LPT2|NUL"),
|
||||
Qt::CaseInsensitive);
|
||||
Q_ASSERT(rc.isValid());
|
||||
QTC_ASSERT(rc.isValid(), return rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -54,7 +55,7 @@ static const QRegExp &windowsDeviceSubDirPattern()
|
||||
{
|
||||
static const QRegExp rc(QLatin1String(".*[/\\\\]CON|.*[/\\\\]AUX|.*[/\\\\]PRN|.*[/\\\\]COM1|.*[/\\\\]COM2|.*[/\\\\]LPT1|.*[/\\\\]LPT2|.*[/\\\\]NUL"),
|
||||
Qt::CaseInsensitive);
|
||||
Q_ASSERT(rc.isValid());
|
||||
QTC_ASSERT(rc.isValid(), return rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@@ -32,18 +32,20 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "pathchooser.h"
|
||||
|
||||
#include "basevalidatinglineedit.h"
|
||||
#include "qtcassert.h"
|
||||
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QHBoxLayout>
|
||||
#include <QtGui/QToolButton>
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtGui/QDesktopServices>
|
||||
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QSettings>
|
||||
|
||||
#include <QtGui/QDesktopServices>
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtGui/QHBoxLayout>
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QToolButton>
|
||||
|
||||
namespace Core {
|
||||
namespace Utils {
|
||||
@@ -71,7 +73,7 @@ PathValidatingLineEdit::PathValidatingLineEdit(PathChooser *chooser, QWidget *pa
|
||||
BaseValidatingLineEdit(parent),
|
||||
m_chooser(chooser)
|
||||
{
|
||||
Q_ASSERT(chooser != NULL);
|
||||
QTC_ASSERT(chooser, return);
|
||||
}
|
||||
|
||||
bool PathValidatingLineEdit::validate(const QString &value, QString *errorMessage) const
|
||||
|
@@ -34,6 +34,8 @@
|
||||
#ifndef QTC_ASSERT_H
|
||||
#define QTC_ASSERT_H
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
#define QTC_ASSERT(cond, action) \
|
||||
if(cond){}else{qDebug()<<"ASSERTION"<<#cond<<"FAILED"<<__FILE__<<__LINE__;action;}
|
||||
|
@@ -32,6 +32,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "bookmarkmanager.h"
|
||||
|
||||
#include "bookmark.h"
|
||||
#include "bookmarksplugin.h"
|
||||
#include "bookmarks_global.h"
|
||||
@@ -41,12 +42,14 @@
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <texteditor/basetexteditor.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QFileInfo>
|
||||
|
||||
#include <QtGui/QAction>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QContextMenuEvent>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
Q_DECLARE_METATYPE(Bookmarks::Internal::Bookmark*)
|
||||
|
||||
@@ -272,7 +275,7 @@ void BookmarkView::removeAll()
|
||||
void BookmarkView::setModel(QAbstractItemModel *model)
|
||||
{
|
||||
BookmarkManager *manager = qobject_cast<BookmarkManager *>(model);
|
||||
Q_ASSERT(manager);
|
||||
QTC_ASSERT(manager, return);
|
||||
QListView::setModel(model);
|
||||
setSelectionModel(manager->selectionModel());
|
||||
setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
|
@@ -32,18 +32,20 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "cmakeproject.h"
|
||||
|
||||
#include "cmakeprojectconstants.h"
|
||||
#include "cmakeprojectnodes.h"
|
||||
#include "cmakerunconfiguration.h"
|
||||
#include "cmakestep.h"
|
||||
#include "makestep.h"
|
||||
#include "cmakerunconfiguration.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <cpptools/cppmodelmanagerinterface.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QProcess>
|
||||
#include <QDir>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QProcess>
|
||||
|
||||
using namespace CMakeProjectManager;
|
||||
using namespace CMakeProjectManager::Internal;
|
||||
@@ -550,7 +552,7 @@ void CMakeCbpParser::parseUnit()
|
||||
|
||||
void CMakeCbpParser::parseUnknownElement()
|
||||
{
|
||||
Q_ASSERT(isStartElement());
|
||||
QTC_ASSERT(isStartElement(), /**/);
|
||||
|
||||
while (!atEnd()) {
|
||||
readNext();
|
||||
|
@@ -32,10 +32,12 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "cmakerunconfiguration.h"
|
||||
#include "cmakeprojectconstants.h"
|
||||
|
||||
#include "cmakeproject.h"
|
||||
#include "cmakeprojectconstants.h"
|
||||
|
||||
#include <projectexplorer/environment.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace CMakeProjectManager;
|
||||
using namespace CMakeProjectManager::Internal;
|
||||
@@ -45,9 +47,9 @@ CMakeRunConfiguration::CMakeRunConfiguration(CMakeProject *pro, const QString &t
|
||||
{
|
||||
setName(target);
|
||||
}
|
||||
|
||||
CMakeRunConfiguration::~CMakeRunConfiguration()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QString CMakeRunConfiguration::type() const
|
||||
@@ -130,7 +132,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
|
||||
{
|
||||
Q_ASSERT(type.startsWith(Constants::CMAKERUNCONFIGURATION));
|
||||
QTC_ASSERT(type.startsWith(Constants::CMAKERUNCONFIGURATION), /**/);
|
||||
|
||||
if (type == Constants::CMAKERUNCONFIGURATION)
|
||||
return "CMake"; // Doesn't happen
|
||||
@@ -141,7 +143,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);
|
||||
Q_ASSERT(pro);
|
||||
QTC_ASSERT(pro, /**/);
|
||||
if (type == Constants::CMAKERUNCONFIGURATION) {
|
||||
// Restoring, filename will be added by restoreSettings
|
||||
QSharedPointer<ProjectExplorer::RunConfiguration> rc(new CMakeRunConfiguration(pro, QString::null, QString::null));
|
||||
|
@@ -32,8 +32,11 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "cmakestep.h"
|
||||
#include "cmakeprojectconstants.h"
|
||||
|
||||
#include "cmakeproject.h"
|
||||
#include "cmakeprojectconstants.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace CMakeProjectManager;
|
||||
using namespace CMakeProjectManager::Internal;
|
||||
@@ -41,12 +44,10 @@ using namespace CMakeProjectManager::Internal;
|
||||
CMakeStep::CMakeStep(CMakeProject *pro)
|
||||
: AbstractProcessStep(pro), m_pro(pro)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CMakeStep::~CMakeStep()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool CMakeStep::init(const QString &buildConfiguration)
|
||||
@@ -114,9 +115,9 @@ bool CMakeBuildStepFactory::canCreate(const QString &name) const
|
||||
|
||||
ProjectExplorer::BuildStep *CMakeBuildStepFactory::create(ProjectExplorer::Project *project, const QString &name) const
|
||||
{
|
||||
Q_ASSERT(name == Constants::CMAKESTEP);
|
||||
QTC_ASSERT(name == Constants::CMAKESTEP, /**/);
|
||||
CMakeProject *pro = qobject_cast<CMakeProject *>(project);
|
||||
Q_ASSERT(pro);
|
||||
QTC_ASSERT(pro, /**/);
|
||||
return new CMakeStep(pro);
|
||||
}
|
||||
|
||||
|
@@ -35,18 +35,18 @@
|
||||
#include "cmakeprojectconstants.h"
|
||||
#include "cmakeproject.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace CMakeProjectManager;
|
||||
using namespace CMakeProjectManager::Internal;
|
||||
|
||||
MakeStep::MakeStep(CMakeProject *pro)
|
||||
: AbstractProcessStep(pro), m_pro(pro)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
MakeStep::~MakeStep()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool MakeStep::init(const QString &buildConfiguration)
|
||||
@@ -109,9 +109,9 @@ bool MakeBuildStepFactory::canCreate(const QString &name) const
|
||||
|
||||
ProjectExplorer::BuildStep *MakeBuildStepFactory::create(ProjectExplorer::Project *project, const QString &name) const
|
||||
{
|
||||
Q_ASSERT(name == Constants::MAKESTEP);
|
||||
QTC_ASSERT(name == Constants::MAKESTEP, return 0);
|
||||
CMakeProject *pro = qobject_cast<CMakeProject *>(project);
|
||||
Q_ASSERT(pro);
|
||||
QTC_ASSERT(pro, return 0);
|
||||
return new MakeStep(pro);
|
||||
}
|
||||
|
||||
|
@@ -32,15 +32,18 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "editorgroup.h"
|
||||
|
||||
#include "editormanager.h"
|
||||
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QStyle>
|
||||
#include <QtGui/QStyleOption>
|
||||
#include <QtCore/QtDebug>
|
||||
#ifdef Q_WS_MAC
|
||||
#include <QtGui/QMacStyle>
|
||||
#endif
|
||||
@@ -107,20 +110,20 @@ QVariant EditorModel::data(const QModelIndex &index, int role) const
|
||||
if (!index.isValid())
|
||||
return QVariant();
|
||||
IEditor *editor = m_editors.at(index.row());
|
||||
Q_ASSERT(editor);
|
||||
QTC_ASSERT(editor, return QVariant());
|
||||
switch (role) {
|
||||
case Qt::DisplayRole:
|
||||
return editor->file()->isModified()
|
||||
?editor->displayName()+QLatin1String("*")
|
||||
:editor->displayName();
|
||||
? editor->displayName() + QLatin1String("*")
|
||||
: editor->displayName();
|
||||
case Qt::DecorationRole:
|
||||
return editor->file()->isReadOnly()
|
||||
?QIcon(QLatin1String(":/qworkbench/images/locked.png"))
|
||||
:QIcon();
|
||||
? QIcon(QLatin1String(":/qworkbench/images/locked.png"))
|
||||
: QIcon();
|
||||
case Qt::ToolTipRole:
|
||||
return editor->file()->fileName().isEmpty()
|
||||
?editor->displayName()
|
||||
:QDir::toNativeSeparators(editor->file()->fileName());
|
||||
? editor->displayName()
|
||||
: QDir::toNativeSeparators(editor->file()->fileName());
|
||||
case Qt::UserRole:
|
||||
return qVariantFromValue(editor);
|
||||
default:
|
||||
@@ -145,6 +148,7 @@ EditorGroupContext::EditorGroupContext(EditorGroup *editorGroup)
|
||||
m_editorGroup(editorGroup)
|
||||
{
|
||||
}
|
||||
|
||||
QList<int> EditorGroupContext::context() const
|
||||
{
|
||||
return m_context;
|
||||
|
@@ -53,21 +53,23 @@
|
||||
#include <coreplugin/baseview.h>
|
||||
#include <coreplugin/imode.h>
|
||||
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/QProcess>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QProcess>
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/QSettings>
|
||||
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QSplitter>
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QSplitter>
|
||||
|
||||
using namespace Core;
|
||||
using namespace Core::Internal;
|
||||
@@ -961,11 +963,10 @@ bool EditorManager::hasEditor(const QString &fileName) const
|
||||
|
||||
void EditorManager::restoreEditorState(IEditor *editor)
|
||||
{
|
||||
Q_ASSERT(editor);
|
||||
QTC_ASSERT(editor, return);
|
||||
QString fileName = editor->file()->fileName();
|
||||
if (m_d->m_editorStates.contains(fileName)) {
|
||||
if (m_d->m_editorStates.contains(fileName))
|
||||
editor->restoreState(m_d->m_editorStates.value(fileName).toByteArray());
|
||||
}
|
||||
}
|
||||
|
||||
bool EditorManager::saveEditor(IEditor *editor)
|
||||
|
@@ -32,16 +32,19 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "editorsplitter.h"
|
||||
|
||||
#include "editormanager.h"
|
||||
#include "minisplitter.h"
|
||||
#include "openeditorswindow.h"
|
||||
#include "stackededitorgroup.h"
|
||||
#include "minisplitter.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <coreplugin/actionmanager/actionmanagerinterface.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtGui/QHBoxLayout>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QApplication>
|
||||
@@ -160,7 +163,7 @@ void EditorSplitter::registerActions()
|
||||
void EditorSplitter::updateActions()
|
||||
{
|
||||
const bool hasMultipleGroups = (qobject_cast<QSplitter*>(m_root) != 0);
|
||||
Q_ASSERT(currentGroup());
|
||||
QTC_ASSERT(currentGroup(), return);
|
||||
const bool hasEditors = (currentGroup()->editorCount() != 0);
|
||||
m_unsplitAction->setEnabled(hasMultipleGroups);
|
||||
#if 0
|
||||
@@ -245,7 +248,7 @@ void EditorSplitter::collectGroups(QWidget *widget, QList<EditorGroup*> &groups)
|
||||
return;
|
||||
}
|
||||
QSplitter *splitter = qobject_cast<QSplitter*>(widget);
|
||||
Q_ASSERT(splitter);
|
||||
QTC_ASSERT(splitter, return);
|
||||
collectGroups(splitter->widget(LEFT), groups);
|
||||
collectGroups(splitter->widget(RIGHT), groups);
|
||||
}
|
||||
@@ -330,7 +333,7 @@ void EditorSplitter::unsplit()
|
||||
if (!curGroup)
|
||||
return;
|
||||
QWidget *curGroupWidget = curGroup->widget();
|
||||
Q_ASSERT(curGroupWidget);
|
||||
QTC_ASSERT(curGroupWidget, return);
|
||||
IEditor *selectedEditor = curGroup->currentEditor();
|
||||
|
||||
QSplitter *parentSplitter = qobject_cast<QSplitter*>(curGroupWidget->parentWidget());
|
||||
@@ -454,25 +457,25 @@ EditorGroup *EditorSplitter::groupFarthestOnSide(QWidget *node, Side side) const
|
||||
void EditorSplitter::selectNextGroup()
|
||||
{
|
||||
EditorGroup *curGroup = currentGroup();
|
||||
Q_ASSERT(curGroup);
|
||||
QTC_ASSERT(curGroup, return);
|
||||
setCurrentGroup(nextGroup(curGroup, RIGHT));
|
||||
}
|
||||
|
||||
void EditorSplitter::selectPreviousGroup()
|
||||
{
|
||||
EditorGroup *curGroup = currentGroup();
|
||||
Q_ASSERT(curGroup);
|
||||
QTC_ASSERT(curGroup, return);
|
||||
setCurrentGroup(nextGroup(curGroup, LEFT));
|
||||
}
|
||||
|
||||
EditorGroup *EditorSplitter::nextGroup(EditorGroup *curGroup, Side side) const
|
||||
{
|
||||
Q_ASSERT(curGroup);
|
||||
QTC_ASSERT(curGroup, return 0);
|
||||
QWidget *curWidget = curGroup->widget();
|
||||
QWidget *parent = curWidget->parentWidget();
|
||||
while (curWidget != m_root) {
|
||||
QSplitter *splitter = qobject_cast<QSplitter *>(parent);
|
||||
Q_ASSERT(splitter);
|
||||
QTC_ASSERT(splitter, return 0);
|
||||
if (splitter->widget(side) != curWidget) {
|
||||
curWidget = splitter->widget(side);
|
||||
break;
|
||||
@@ -486,7 +489,7 @@ EditorGroup *EditorSplitter::nextGroup(EditorGroup *curGroup, Side side) const
|
||||
void EditorSplitter::moveDocToAdjacentGroup(Side side)
|
||||
{
|
||||
EditorGroup *curGroup = currentGroup();
|
||||
Q_ASSERT(curGroup);
|
||||
QTC_ASSERT(curGroup, return);
|
||||
IEditor *editor = curGroup->currentEditor();
|
||||
if (!editor)
|
||||
return;
|
||||
@@ -510,7 +513,7 @@ QWidget *EditorSplitter::recreateGroupTree(QWidget *node)
|
||||
QSplitter *splitter = qobject_cast<QSplitter *>(node);
|
||||
if (!splitter) {
|
||||
EditorGroup *group = qobject_cast<EditorGroup *>(node);
|
||||
Q_ASSERT(group);
|
||||
QTC_ASSERT(group, return 0);
|
||||
IEditor *currentEditor = group->currentEditor();
|
||||
EditorGroup *newGroup = createGroup();
|
||||
bool block = newGroup->widget()->blockSignals(true);
|
||||
@@ -588,7 +591,7 @@ void EditorSplitter::saveState(QWidget *current, QDataStream &stream) const
|
||||
saveState(splitter->widget(1), stream);
|
||||
} else {
|
||||
EditorGroup *group = qobject_cast<EditorGroup *>(current);
|
||||
Q_ASSERT(group);
|
||||
QTC_ASSERT(group, /**/);
|
||||
if (group != currentGroup())
|
||||
type = 1;
|
||||
else
|
||||
@@ -639,7 +642,7 @@ void EditorSplitter::fillPathGroupMap(QWidget *current, QString currentPath,
|
||||
map.insert(currentPath, group);
|
||||
} else {
|
||||
QSplitter *splitter = qobject_cast<QSplitter *>(current);
|
||||
Q_ASSERT(splitter);
|
||||
QTC_ASSERT(splitter, return);
|
||||
fillPathGroupMap(splitter->widget(0), currentPath+"0", map);
|
||||
fillPathGroupMap(splitter->widget(1), currentPath+"1", map);
|
||||
}
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/filemanager.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtGui/QMenu>
|
||||
@@ -197,7 +198,7 @@ void OpenEditorsWidget::selectEditor(QTreeWidgetItem *item)
|
||||
void OpenEditorsWidget::updateEditor()
|
||||
{
|
||||
IEditor *editor = qobject_cast<IEditor *>(sender());
|
||||
Q_ASSERT(editor);
|
||||
QTC_ASSERT(editor, return);
|
||||
int num = m_ui.editorList->topLevelItemCount();
|
||||
for (int i = 0; i < num; ++i) {
|
||||
QTreeWidgetItem *item = m_ui.editorList->topLevelItem(i);
|
||||
|
@@ -35,21 +35,24 @@
|
||||
#include "editormanager.h"
|
||||
#include "coreimpl.h"
|
||||
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QMimeData>
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QComboBox>
|
||||
#include <QtGui/QHBoxLayout>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QStackedWidget>
|
||||
#include <QtGui/QStyle>
|
||||
#include <QtGui/QStyleOption>
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QToolBar>
|
||||
#include <QtGui/QToolButton>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QStackedWidget>
|
||||
#include <QtDebug>
|
||||
#ifdef Q_WS_MAC
|
||||
#include <qmacstyle_mac.h>
|
||||
#endif
|
||||
@@ -240,7 +243,7 @@ void StackedEditorGroup::sendCloseRequest()
|
||||
|
||||
void StackedEditorGroup::removeEditor(IEditor *editor)
|
||||
{
|
||||
Q_ASSERT(editor);
|
||||
QTC_ASSERT(editor, return);
|
||||
EditorGroup::removeEditor(editor);
|
||||
const int index = m_container->indexOf(editor->widget());
|
||||
if (index != -1) {
|
||||
@@ -280,7 +283,7 @@ void StackedEditorGroup::setCurrentEditor(IEditor *editor)
|
||||
return;
|
||||
m_toplevel->setVisible(true);
|
||||
const int idx = m_container->indexOf(editor->widget());
|
||||
Q_ASSERT(idx >= 0);
|
||||
QTC_ASSERT(idx >= 0, return);
|
||||
if (m_container->currentIndex() != idx) {
|
||||
m_container->setCurrentIndex(idx);
|
||||
|
||||
@@ -298,10 +301,11 @@ void StackedEditorGroup::setCurrentEditor(IEditor *editor)
|
||||
}
|
||||
}
|
||||
|
||||
void StackedEditorGroup::updateEditorStatus(IEditor *editor) {
|
||||
void StackedEditorGroup::updateEditorStatus(IEditor *editor)
|
||||
{
|
||||
if (!editor)
|
||||
editor = qobject_cast<IEditor *>(sender());
|
||||
Q_ASSERT(editor);
|
||||
QTC_ASSERT(editor, return);
|
||||
|
||||
static const QIcon lockedIcon(QLatin1String(":/qworkbench/images/locked.png"));
|
||||
static const QIcon unlockedIcon(QLatin1String(":/qworkbench/images/unlocked.png"));
|
||||
@@ -371,6 +375,6 @@ int StackedEditorGroup::indexOf(IEditor *editor)
|
||||
if (editor == model->data(model->index(i, 0), Qt::UserRole).value<IEditor*>())
|
||||
return i;
|
||||
}
|
||||
Q_ASSERT(false);
|
||||
QTC_ASSERT(false, /**/);
|
||||
return 0;
|
||||
}
|
||||
|
@@ -32,6 +32,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "filemanager.h"
|
||||
|
||||
#include "ifile.h"
|
||||
#include "mainwindow.h"
|
||||
#include "saveitemsdialog.h"
|
||||
@@ -40,6 +41,8 @@
|
||||
#include "mimedatabase.h"
|
||||
#include "iversioncontrol.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QFileInfo>
|
||||
@@ -177,22 +180,20 @@ bool FileManager::removeFile(IFile *file)
|
||||
|
||||
void FileManager::addWatch(const QString &filename)
|
||||
{
|
||||
if (!filename.isEmpty() && managedFiles(filename).isEmpty()) {
|
||||
if (!filename.isEmpty() && managedFiles(filename).isEmpty())
|
||||
m_fileWatcher->addPath(filename);
|
||||
}
|
||||
}
|
||||
|
||||
void FileManager::removeWatch(const QString &filename)
|
||||
{
|
||||
if (!filename.isEmpty() && managedFiles(filename).isEmpty()) {
|
||||
if (!filename.isEmpty() && managedFiles(filename).isEmpty())
|
||||
m_fileWatcher->removePath(filename);
|
||||
}
|
||||
}
|
||||
|
||||
void FileManager::checkForNewFileName()
|
||||
{
|
||||
IFile *file = qobject_cast<IFile *>(sender());
|
||||
Q_ASSERT(file);
|
||||
QTC_ASSERT(file, return);
|
||||
const QString newfilename = fixFileName(file->fileName());
|
||||
const QString oldfilename = m_managedFiles.value(file).fileName;
|
||||
if (!newfilename.isEmpty() && newfilename != oldfilename) {
|
||||
|
@@ -33,30 +33,34 @@
|
||||
|
||||
#include "manhattanstyle.h"
|
||||
|
||||
#include <QStyleOption>
|
||||
#include <QPainter>
|
||||
#include <QScrollArea>
|
||||
#include <QMainWindow>
|
||||
#include <QDockWidget>
|
||||
#include <QPixmapCache>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QPixmap>
|
||||
#include <QToolBar>
|
||||
#include <QDialog>
|
||||
#include <QLineEdit>
|
||||
#include <QComboBox>
|
||||
#include <QLibrary>
|
||||
#include <QStatusBar>
|
||||
#include <QApplication>
|
||||
#include <QStyleFactory>
|
||||
#include <QToolButton>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QSplitter>
|
||||
#include <QMenuBar>
|
||||
#include "stylehelper.h"
|
||||
#include "styleanimator.h"
|
||||
#include <qdebug.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QLibrary>
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QComboBox>
|
||||
#include <QtGui/QDialog>
|
||||
#include <QtGui/QDialogButtonBox>
|
||||
#include <QtGui/QDockWidget>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QMenuBar>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QPixmap>
|
||||
#include <QtGui/QPixmapCache>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QScrollArea>
|
||||
#include <QtGui/QSplitter>
|
||||
#include <QtGui/QStatusBar>
|
||||
#include <QtGui/QStyleFactory>
|
||||
#include <QtGui/QStyleOption>
|
||||
#include <QtGui/QToolBar>
|
||||
#include <QtGui/QToolButton>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
// We define a currently unused state for indicating animations
|
||||
#define State_Animating 0x00000040
|
||||
@@ -97,7 +101,7 @@ public:
|
||||
ManhattanStylePrivate(const QString &baseStyleName)
|
||||
{
|
||||
style = QStyleFactory::create(baseStyleName);
|
||||
Q_ASSERT(style);
|
||||
QTC_ASSERT(style, /**/);
|
||||
buttonImage_pressed = QImage(":/qworkbench/images/pushbutton_pressed.png");
|
||||
buttonImage = QImage(":/qworkbench/images/pushbutton.png");
|
||||
|
||||
@@ -105,12 +109,15 @@ public:
|
||||
lineeditImage_disabled = QImage(":/qworkbench/images/inputfield_disabled.png");
|
||||
}
|
||||
|
||||
~ManhattanStylePrivate() {
|
||||
~ManhattanStylePrivate()
|
||||
{
|
||||
delete style;
|
||||
style = 0;
|
||||
}
|
||||
|
||||
void init();
|
||||
|
||||
public:
|
||||
QStyle *style;
|
||||
QImage buttonImage;
|
||||
QImage buttonImage_pressed;
|
||||
|
@@ -33,19 +33,22 @@
|
||||
|
||||
#include "mimedatabase.h"
|
||||
|
||||
#include <QtCore/QStringList>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QLocale>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QMultiHash>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QRegExp>
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QSharedData>
|
||||
#include <QtCore/QSharedPointer>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QTextStream>
|
||||
#include <QtCore/QLocale>
|
||||
|
||||
#include <QtXml/QXmlStreamReader>
|
||||
|
||||
enum { debugMimeDB = 0 };
|
||||
@@ -574,7 +577,7 @@ BaseMimeTypeParser:: BaseMimeTypeParser() :
|
||||
// "*.log[1-9]"
|
||||
m_suffixPattern(QLatin1String("^\\*\\.[\\w]+$"))
|
||||
{
|
||||
Q_ASSERT(m_suffixPattern.isValid());
|
||||
QTC_ASSERT(m_suffixPattern.isValid(), /**/);
|
||||
}
|
||||
|
||||
void BaseMimeTypeParser::addGlobPattern(const QString &pattern, MimeTypeData *d) const
|
||||
|
@@ -32,11 +32,13 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "modemanager.h"
|
||||
|
||||
#include "fancytabwidget.h"
|
||||
#include "fancyactionbar.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include <aggregation/aggregate.h>
|
||||
|
||||
#include <coreplugin/actionmanager/actionmanagerinterface.h>
|
||||
#include <coreplugin/actionmanager/icommand.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
@@ -44,9 +46,12 @@
|
||||
#include <coreplugin/imode.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QSignalMapper>
|
||||
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QTabWidget>
|
||||
#include <QtGui/QVBoxLayout>
|
||||
@@ -225,7 +230,7 @@ void ModeManager::currentTabChanged(int index)
|
||||
void ModeManager::setFocusToCurrentMode()
|
||||
{
|
||||
IMode *mode = currentMode();
|
||||
Q_ASSERT(mode);
|
||||
QTC_ASSERT(mode, return);
|
||||
QWidget *widget = mode->widget();
|
||||
if (widget) {
|
||||
QWidget *focusWidget = widget->focusWidget();
|
||||
|
@@ -40,11 +40,13 @@
|
||||
#include "uniqueidmanager.h"
|
||||
#include "viewmanagerinterface.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace Core;
|
||||
using namespace Core::Internal;
|
||||
|
||||
ProgressManager::ProgressManager(QObject *parent) :
|
||||
ProgressManagerInterface(parent)
|
||||
ProgressManager::ProgressManager(QObject *parent)
|
||||
: ProgressManagerInterface(parent)
|
||||
{
|
||||
m_progressView = new ProgressView;
|
||||
ICore *core = CoreImpl::instance();
|
||||
@@ -103,7 +105,7 @@ QWidget *ProgressManager::progressView()
|
||||
void ProgressManager::taskFinished()
|
||||
{
|
||||
QObject *taskObject = sender();
|
||||
Q_ASSERT(taskObject);
|
||||
QTC_ASSERT(taskObject, return);
|
||||
QFutureWatcher<void> *task = static_cast<QFutureWatcher<void> *>(taskObject);
|
||||
m_runningTasks.remove(task);
|
||||
delete task;
|
||||
|
@@ -34,6 +34,8 @@
|
||||
#include "progressview.h"
|
||||
#include "futureprogress.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtGui/QHBoxLayout>
|
||||
|
||||
using namespace Core;
|
||||
@@ -136,7 +138,7 @@ void ProgressView::removeTask(FutureProgress *task)
|
||||
void ProgressView::slotFinished()
|
||||
{
|
||||
FutureProgress *progress = qobject_cast<FutureProgress *>(sender());
|
||||
Q_ASSERT(progress);
|
||||
QTC_ASSERT(progress, return);
|
||||
if (m_keep.contains(progress) && !m_keep.value(progress) && !progress->hasError())
|
||||
removeTask(progress);
|
||||
removeOldTasks(m_type.value(progress), true);
|
||||
|
@@ -38,12 +38,15 @@
|
||||
#include <coreplugin/messagemanager.h>
|
||||
#include <coreplugin/editormanager/editorgroup.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QSettings>
|
||||
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QStatusBar>
|
||||
#include <QtGui/QToolBar>
|
||||
|
||||
#include <QtScript/QScriptEngine>
|
||||
|
||||
namespace {
|
||||
@@ -107,7 +110,7 @@ QString CorePrototype::toString() const
|
||||
CorePrototype::ICore *CorePrototype::callee() const
|
||||
{
|
||||
ICore *rc = qscriptvalue_cast<ICore *>(thisObject());
|
||||
Q_ASSERT(rc);
|
||||
QTC_ASSERT(rc, return 0);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -121,14 +124,14 @@ MessageManagerPrototype::MessageManagerPrototype(QObject *parent) :
|
||||
void MessageManagerPrototype::displayStatusBarMessage(const QString &text, int ms)
|
||||
{
|
||||
MessageManager *mm = qscriptvalue_cast<MessageManager *>(thisObject());
|
||||
Q_ASSERT(mm);
|
||||
QTC_ASSERT(mm, return);
|
||||
mm->displayStatusBarMessage(text, ms);
|
||||
}
|
||||
|
||||
void MessageManagerPrototype::printToOutputPane(const QString &text, bool bringToForeground)
|
||||
{
|
||||
MessageManager *mm = qscriptvalue_cast<MessageManager *>(thisObject());
|
||||
Q_ASSERT(mm);
|
||||
QTC_ASSERT(mm, return);
|
||||
mm->printToOutputPane(text, bringToForeground);
|
||||
}
|
||||
|
||||
@@ -147,28 +150,66 @@ FileManagerPrototype::FileManagerPrototype(QObject *parent) :
|
||||
FileManager *FileManagerPrototype::callee() const
|
||||
{
|
||||
FileManager *rc = qscriptvalue_cast<FileManager *>(thisObject());
|
||||
Q_ASSERT(rc);
|
||||
QTC_ASSERT(rc, return 0);
|
||||
return rc;
|
||||
}
|
||||
|
||||
bool FileManagerPrototype::addFiles(const QList<Core::IFile *> &files) { return callee()->addFiles(files); }
|
||||
bool FileManagerPrototype::addFile(Core::IFile *file) { return callee()->addFile(file); }
|
||||
bool FileManagerPrototype::removeFile(Core::IFile *file) { return callee()->removeFile(file); }
|
||||
bool FileManagerPrototype::addFiles(const QList<Core::IFile *> &files)
|
||||
{
|
||||
return callee()->addFiles(files);
|
||||
}
|
||||
|
||||
bool FileManagerPrototype::addFile(Core::IFile *file)
|
||||
{
|
||||
return callee()->addFile(file);
|
||||
}
|
||||
|
||||
bool FileManagerPrototype::removeFile(Core::IFile *file)
|
||||
{
|
||||
return callee()->removeFile(file);
|
||||
}
|
||||
|
||||
QList<Core::IFile*>
|
||||
FileManagerPrototype::saveModifiedFilesSilently(const QList<Core::IFile*> &files) { return callee()->saveModifiedFilesSilently(files); }
|
||||
FileManagerPrototype::saveModifiedFilesSilently(const QList<Core::IFile*> &files)
|
||||
{
|
||||
return callee()->saveModifiedFilesSilently(files);
|
||||
}
|
||||
|
||||
QString FileManagerPrototype::getSaveAsFileName(Core::IFile *file) { return callee()->getSaveAsFileName(file); }
|
||||
QString FileManagerPrototype::getSaveAsFileName(Core::IFile *file)
|
||||
{
|
||||
return callee()->getSaveAsFileName(file);
|
||||
}
|
||||
|
||||
bool FileManagerPrototype::isFileManaged(const QString &fileName) const
|
||||
{
|
||||
return callee()->isFileManaged(fileName);
|
||||
}
|
||||
|
||||
bool FileManagerPrototype::isFileManaged(const QString &fileName) const { return callee()->isFileManaged(fileName); }
|
||||
QList<Core::IFile *>
|
||||
FileManagerPrototype::managedFiles(const QString &fileName) const { return callee()->managedFiles(fileName); }
|
||||
FileManagerPrototype::managedFiles(const QString &fileName) const
|
||||
{
|
||||
return callee()->managedFiles(fileName);
|
||||
}
|
||||
|
||||
void FileManagerPrototype::blockFileChange(Core::IFile *file) { callee()->blockFileChange(file); }
|
||||
void FileManagerPrototype::unblockFileChange(Core::IFile *file) { return callee()->unblockFileChange(file); }
|
||||
void FileManagerPrototype::blockFileChange(Core::IFile *file)
|
||||
{
|
||||
callee()->blockFileChange(file);
|
||||
}
|
||||
|
||||
void FileManagerPrototype::addToRecentFiles(const QString &fileName) { return callee()->addToRecentFiles(fileName); }
|
||||
QStringList FileManagerPrototype::recentFiles() const { return callee()->recentFiles(); }
|
||||
void FileManagerPrototype::unblockFileChange(Core::IFile *file)
|
||||
{
|
||||
return callee()->unblockFileChange(file);
|
||||
}
|
||||
|
||||
void FileManagerPrototype::addToRecentFiles(const QString &fileName)
|
||||
{
|
||||
return callee()->addToRecentFiles(fileName);
|
||||
}
|
||||
|
||||
QStringList FileManagerPrototype::recentFiles() const
|
||||
{
|
||||
return callee()->recentFiles();
|
||||
}
|
||||
|
||||
QString FileManagerPrototype::toString() const
|
||||
{
|
||||
@@ -185,7 +226,7 @@ FilePrototype::FilePrototype(QObject *parent) :
|
||||
IFile *FilePrototype::callee() const
|
||||
{
|
||||
IFile *rc = qscriptvalue_cast<IFile *>(thisObject());
|
||||
Q_ASSERT(rc);
|
||||
QTC_ASSERT(rc, return 0);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -270,39 +311,66 @@ QString EditorManagerPrototype::toString() const
|
||||
EditorManagerPrototype::EditorManager *EditorManagerPrototype::callee() const
|
||||
{
|
||||
EditorManager *rc = qscriptvalue_cast<EditorManager *>(thisObject());
|
||||
Q_ASSERT(rc);
|
||||
QTC_ASSERT(rc, return 0);
|
||||
return rc;
|
||||
|
||||
}
|
||||
|
||||
// ------------- EditorPrototype
|
||||
|
||||
EditorPrototype::EditorPrototype(QObject *parent) :
|
||||
QObject(parent)
|
||||
EditorPrototype::EditorPrototype(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
QString EditorPrototype::displayName() const { return callee()->displayName(); }
|
||||
void EditorPrototype::setDisplayName(const QString &title) { callee()->setDisplayName(title); }
|
||||
QString EditorPrototype::displayName() const
|
||||
{
|
||||
return callee()->displayName();
|
||||
}
|
||||
|
||||
QString EditorPrototype::kind() const { return QLatin1String(callee()->kind()); }
|
||||
bool EditorPrototype::duplicateSupported() const { return callee()->duplicateSupported(); }
|
||||
void EditorPrototype::setDisplayName(const QString &title)
|
||||
{
|
||||
callee()->setDisplayName(title);
|
||||
}
|
||||
|
||||
bool EditorPrototype::createNew(const QString &contents) { return callee()->createNew(contents); }
|
||||
bool EditorPrototype::open(const QString &fileName) { return callee()->open(fileName); }
|
||||
QString EditorPrototype::kind() const
|
||||
{
|
||||
return QLatin1String(callee()->kind());
|
||||
}
|
||||
|
||||
bool EditorPrototype::duplicateSupported() const
|
||||
{
|
||||
return callee()->duplicateSupported();
|
||||
}
|
||||
|
||||
bool EditorPrototype::createNew(const QString &contents)
|
||||
{
|
||||
return callee()->createNew(contents);
|
||||
}
|
||||
|
||||
bool EditorPrototype::open(const QString &fileName)
|
||||
{
|
||||
return callee()->open(fileName);
|
||||
}
|
||||
|
||||
Core::IEditor *EditorPrototype::duplicate(QWidget *parent)
|
||||
{
|
||||
return callee()->duplicate(parent);
|
||||
}
|
||||
|
||||
Core::IFile *EditorPrototype::file() const { return callee()->file(); }
|
||||
QToolBar* EditorPrototype::toolBar() const { return callee()->toolBar();}
|
||||
Core::IFile *EditorPrototype::file() const
|
||||
{
|
||||
return callee()->file();
|
||||
}
|
||||
|
||||
QToolBar* EditorPrototype::toolBar() const
|
||||
{
|
||||
return callee()->toolBar();
|
||||
}
|
||||
|
||||
Core::IEditor *EditorPrototype::callee() const
|
||||
{
|
||||
IEditor *rc = qscriptvalue_cast<IEditor *>(thisObject());
|
||||
Q_ASSERT(rc);
|
||||
QTC_ASSERT(rc, return 0);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -375,7 +443,7 @@ QString EditorGroupPrototype::toString() const
|
||||
Core::EditorGroup *EditorGroupPrototype::callee() const
|
||||
{
|
||||
EditorGroup *rc = qscriptvalue_cast<EditorGroup *>(thisObject());
|
||||
Q_ASSERT(rc);
|
||||
QTC_ASSERT(rc, return 0);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@@ -36,8 +36,10 @@
|
||||
#include "metatypedeclarations.h"
|
||||
|
||||
#include <extensionsystem/ExtensionSystemInterfaces>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <interface_wrap_helpers.h>
|
||||
#include <wrap_helpers.h>
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
@@ -154,7 +156,7 @@ static QScriptValue inputDialogGetItem(QScriptContext *context, QScriptEngine *e
|
||||
// Script function template to pop up a file box
|
||||
// with a certain icon and buttons.
|
||||
template <int TAcceptMode, int TFileMode>
|
||||
static QScriptValue fileBox(QScriptContext *context, QScriptEngine *engine)
|
||||
static QScriptValue fileBox(QScriptContext *context, QScriptEngine *engine)
|
||||
{
|
||||
const int argumentCount = context->argumentCount();
|
||||
if (argumentCount < 2)
|
||||
@@ -170,7 +172,7 @@ template <int TAcceptMode, int TFileMode>
|
||||
if (fileDialog.exec() == QDialog::Rejected)
|
||||
return QScriptValue(engine, QScriptValue::NullValue);
|
||||
const QStringList rc = fileDialog.selectedFiles();
|
||||
Q_ASSERT(!rc.empty());
|
||||
QTC_ASSERT(!rc.empty(), /**/);
|
||||
return TFileMode == QFileDialog::ExistingFiles ?
|
||||
engine->toScriptValue(rc) : engine->toScriptValue(rc.front());
|
||||
}
|
||||
@@ -249,7 +251,7 @@ void ScriptManager::ensureEngineInitialized()
|
||||
{
|
||||
if (m_initialized)
|
||||
return;
|
||||
Q_ASSERT(m_core);
|
||||
QTC_ASSERT(m_core, return);
|
||||
// register QObjects that occur as properties
|
||||
SharedTools::registerQObject<QMainWindow>(m_engine);
|
||||
SharedTools::registerQObject<QStatusBar>(m_engine);
|
||||
|
@@ -32,21 +32,25 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "versiondialog.h"
|
||||
|
||||
#include "coreconstants.h"
|
||||
#include "coreimpl.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDate>
|
||||
#include <QtCore/QFile>
|
||||
|
||||
#include <QtGui/QDialogButtonBox>
|
||||
#include <QtGui/QGridLayout>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QTextBrowser>
|
||||
|
||||
using namespace Core;
|
||||
using namespace Core::Internal;
|
||||
using namespace Core::Constants;
|
||||
|
||||
#include <QtCore/QDate>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtGui/QGridLayout>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QDialogButtonBox>
|
||||
#include <QtGui/QTextBrowser>
|
||||
|
||||
VersionDialog::VersionDialog(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
{
|
||||
@@ -90,7 +94,7 @@ VersionDialog::VersionDialog(QWidget *parent)
|
||||
|
||||
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
|
||||
QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close);
|
||||
Q_ASSERT(closeButton);
|
||||
QTC_ASSERT(closeButton, /**/);
|
||||
buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
|
||||
connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject()));
|
||||
|
||||
@@ -118,7 +122,7 @@ void VersionDialog::popupLicense()
|
||||
|
||||
// Read file into string
|
||||
ICore * core = CoreImpl::instance();
|
||||
Q_ASSERT(core != NULL);
|
||||
QTC_ASSERT(core, return);
|
||||
QString fileName = core->resourcePath() + "/license.txt";
|
||||
QFile file(fileName);
|
||||
|
||||
|
@@ -36,12 +36,14 @@
|
||||
|
||||
#include <utils/codegeneration.h>
|
||||
#include <utils/newclasswidget.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QTextStream>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtGui/QComboBox>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QTextStream>
|
||||
|
||||
#include <QtGui/QCheckBox>
|
||||
#include <QtGui/QComboBox>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QVBoxLayout>
|
||||
#include <QtGui/QWizard>
|
||||
@@ -196,7 +198,7 @@ bool CppClassWizard::generateHeaderAndSource(const CppClassWizardParameters &par
|
||||
<< "\n#define " << guard << '\n' << '\n';
|
||||
|
||||
const QRegExp qtClassExpr(QLatin1String("^Q[A-Z3].+"));
|
||||
Q_ASSERT(qtClassExpr.isValid());
|
||||
QTC_ASSERT(qtClassExpr.isValid(), /**/);
|
||||
const bool superIsQtClass = qtClassExpr.exactMatch(params.baseClass);
|
||||
if (superIsQtClass) {
|
||||
Core::Utils::writeIncludeFileDirective(params.baseClass, true, headerStr);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -34,16 +34,18 @@
|
||||
#include "debuggerrunner.h"
|
||||
|
||||
#include "debuggermanager.h"
|
||||
#include "qtcassert.h"
|
||||
|
||||
#include <projectexplorer/applicationrunconfiguration.h>
|
||||
#include <projectexplorer/environment.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFileInfo>
|
||||
|
||||
#include <QtGui/QTextDocument>
|
||||
|
||||
using namespace Debugger::Internal;
|
||||
@@ -76,11 +78,10 @@ QString DebuggerRunner::displayName() const
|
||||
|
||||
RunControl* DebuggerRunner::run(RunConfigurationPtr runConfiguration, const QString &mode)
|
||||
{
|
||||
Q_UNUSED(mode);
|
||||
Q_ASSERT(mode == ProjectExplorer::Constants::DEBUGMODE);
|
||||
QTC_ASSERT(mode == ProjectExplorer::Constants::DEBUGMODE, return 0);
|
||||
ApplicationRunConfigurationPtr rc =
|
||||
qSharedPointerCast<ApplicationRunConfiguration>(runConfiguration);
|
||||
Q_ASSERT(rc);
|
||||
QTC_ASSERT(rc, return 0);
|
||||
//qDebug() << "***** Debugging" << rc->name() << rc->executable();
|
||||
return new DebuggerRunControl(m_manager, rc);
|
||||
}
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#include "formeditorw.h"
|
||||
|
||||
#include <coreplugin/minisplitter.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QEvent>
|
||||
#include <QtGui/QVBoxLayout>
|
||||
@@ -54,7 +55,7 @@ SharedSubWindow::SharedSubWindow(QWidget *shared, QWidget *parent) :
|
||||
m_shared(shared),
|
||||
m_layout(new QVBoxLayout)
|
||||
{
|
||||
Q_ASSERT(m_shared);
|
||||
QTC_ASSERT(m_shared, /**/);
|
||||
m_layout->setContentsMargins(0, 0, 0, 0);
|
||||
setLayout(m_layout);
|
||||
}
|
||||
@@ -62,14 +63,14 @@ SharedSubWindow::SharedSubWindow(QWidget *shared, QWidget *parent) :
|
||||
void SharedSubWindow::activate()
|
||||
{
|
||||
// Take the widget off the other parent
|
||||
Q_ASSERT(m_shared);
|
||||
QTC_ASSERT(m_shared, return);
|
||||
QWidget *currentParent = m_shared->parentWidget();
|
||||
if (currentParent == this)
|
||||
return;
|
||||
|
||||
if (currentParent) {
|
||||
QVBoxLayout *lt = qobject_cast<QVBoxLayout *>(currentParent->layout());
|
||||
Q_ASSERT(lt);
|
||||
QTC_ASSERT(lt, return);
|
||||
m_shared->setParent(0);
|
||||
delete lt->takeAt(0);
|
||||
}
|
||||
|
@@ -43,6 +43,7 @@
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <coreplugin/actionmanager/actionmanagerinterface.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtDesigner/QDesignerFormEditorPluginInterface>
|
||||
#include <QtDesigner/private/pluginmanager_p.h>
|
||||
@@ -169,9 +170,9 @@ FormEditorW::FormEditorW() :
|
||||
{
|
||||
if (debugFormEditor)
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
Q_ASSERT(!m_self);
|
||||
QTC_ASSERT(!m_self, return);
|
||||
m_self = this;
|
||||
Q_ASSERT(m_core);
|
||||
QTC_ASSERT(m_core, return);
|
||||
|
||||
qFill(m_designerSubWindows, m_designerSubWindows + Designer::Constants::DesignerSubWindowCount,
|
||||
static_cast<QWidget *>(0));
|
||||
@@ -180,7 +181,7 @@ FormEditorW::FormEditorW() :
|
||||
m_formeditor->setSettingsManager(new SettingsManager());
|
||||
|
||||
m_fwm = qobject_cast<qdesigner_internal::QDesignerFormWindowManager*>(m_formeditor->formWindowManager());
|
||||
Q_ASSERT(m_fwm);
|
||||
QTC_ASSERT(m_fwm, return);
|
||||
|
||||
const int uid = m_core->uniqueIDManager()->uniqueIdentifier(QLatin1String(C_FORMEDITOR));
|
||||
m_context << uid;
|
||||
@@ -216,7 +217,7 @@ FormEditorW::~FormEditorW()
|
||||
|
||||
void FormEditorW::fullInit()
|
||||
{
|
||||
Q_ASSERT(m_initStage == RegisterPlugins);
|
||||
QTC_ASSERT(m_initStage == RegisterPlugins, return);
|
||||
QTime *initTime = 0;
|
||||
if (debugFormEditor) {
|
||||
initTime = new QTime;
|
||||
@@ -410,7 +411,7 @@ void FormEditorW::setupActions()
|
||||
createSeparator(this, am, m_context, mformtools, QLatin1String("FormEditor.Menu.Tools.Separator2"));
|
||||
|
||||
m_actionPreview = m_fwm->actionDefaultPreview();
|
||||
Q_ASSERT(m_actionPreview);
|
||||
QTC_ASSERT(m_actionPreview, return);
|
||||
addToolAction(m_actionPreview, am, m_context,
|
||||
QLatin1String("FormEditor.Preview"), mformtools, tr("Ctrl+Alt+R"));
|
||||
|
||||
@@ -445,8 +446,8 @@ QToolBar *FormEditorW::createEditorToolBar() const
|
||||
Core::ActionManagerInterface *am = m_core->actionManager();
|
||||
const QStringList::const_iterator cend = m_toolActionIds.constEnd();
|
||||
for (QStringList::const_iterator it = m_toolActionIds.constBegin(); it != cend; ++it) {
|
||||
Core::ICommand *cmd = am->command(*it);
|
||||
Q_ASSERT(cmd);
|
||||
Core::ICommand *cmd = am->command(*it);
|
||||
QTC_ASSERT(cmd, continue);
|
||||
QAction *action = cmd->action();
|
||||
if (!action->icon().isNull()) // Simplify grid has no action yet
|
||||
rc->addAction(action);
|
||||
@@ -591,7 +592,7 @@ void FormEditorW::currentEditorChanged(Core::IEditor *editor)
|
||||
// Deactivate Designer if a non-form is being edited
|
||||
if (editor && !qstrcmp(editor->kind(), Constants::C_FORMWINDOW)) {
|
||||
FormWindowEditor *fw = qobject_cast<FormWindowEditor *>(editor);
|
||||
Q_ASSERT(fw);
|
||||
QTC_ASSERT(fw, return);
|
||||
fw->activate();
|
||||
m_fwm->setActiveFormWindow(fw->formWindow());
|
||||
} else {
|
||||
|
@@ -33,6 +33,8 @@
|
||||
|
||||
#include "basetextfind.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtGui/QTextBlock>
|
||||
|
||||
using namespace Find;
|
||||
@@ -49,26 +51,26 @@ BaseTextFind::BaseTextFind(QPlainTextEdit *editor)
|
||||
|
||||
QTextCursor BaseTextFind::textCursor() const
|
||||
{
|
||||
Q_ASSERT(m_editor || m_plaineditor);
|
||||
QTC_ASSERT(m_editor || m_plaineditor, return QTextCursor());
|
||||
return m_editor ? m_editor->textCursor() : m_plaineditor->textCursor();
|
||||
|
||||
}
|
||||
|
||||
void BaseTextFind::setTextCursor(const QTextCursor& cursor)
|
||||
{
|
||||
Q_ASSERT(m_editor || m_plaineditor);
|
||||
QTC_ASSERT(m_editor || m_plaineditor, return);
|
||||
m_editor ? m_editor->setTextCursor(cursor) : m_plaineditor->setTextCursor(cursor);
|
||||
}
|
||||
|
||||
QTextDocument *BaseTextFind::document() const
|
||||
{
|
||||
Q_ASSERT(m_editor || m_plaineditor);
|
||||
QTC_ASSERT(m_editor || m_plaineditor, return 0);
|
||||
return m_editor ? m_editor->document() : m_plaineditor->document();
|
||||
}
|
||||
|
||||
bool BaseTextFind::isReadOnly() const
|
||||
{
|
||||
Q_ASSERT(m_editor || m_plaineditor);
|
||||
QTC_ASSERT(m_editor || m_plaineditor, return true);
|
||||
return m_editor ? m_editor->isReadOnly() : m_plaineditor->isReadOnly();
|
||||
}
|
||||
|
||||
|
@@ -36,16 +36,17 @@
|
||||
#include <aggregation/aggregate.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/modemanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtDebug>
|
||||
|
||||
using namespace Core;
|
||||
using namespace Find;
|
||||
using namespace Find::Internal;
|
||||
|
||||
CurrentDocumentFind::CurrentDocumentFind(ICore *core)
|
||||
: m_core(core), m_currentFind(0)
|
||||
: m_core(core), m_currentFind(0)
|
||||
{
|
||||
connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)),
|
||||
this, SLOT(updateCurrentFindFilter(QWidget*,QWidget*)));
|
||||
@@ -59,16 +60,14 @@ void CurrentDocumentFind::removeConnections()
|
||||
|
||||
void CurrentDocumentFind::resetIncrementalSearch()
|
||||
{
|
||||
Q_ASSERT(m_currentFind);
|
||||
if (m_currentFind)
|
||||
m_currentFind->resetIncrementalSearch();
|
||||
QTC_ASSERT(m_currentFind, return);
|
||||
m_currentFind->resetIncrementalSearch();
|
||||
}
|
||||
|
||||
void CurrentDocumentFind::clearResults()
|
||||
{
|
||||
Q_ASSERT(m_currentFind);
|
||||
if (m_currentFind)
|
||||
m_currentFind->clearResults();
|
||||
QTC_ASSERT(m_currentFind, return);
|
||||
m_currentFind->clearResults();
|
||||
}
|
||||
|
||||
bool CurrentDocumentFind::isEnabled() const
|
||||
@@ -78,67 +77,64 @@ bool CurrentDocumentFind::isEnabled() const
|
||||
|
||||
bool CurrentDocumentFind::supportsReplace() const
|
||||
{
|
||||
Q_ASSERT(m_currentFind);
|
||||
return m_currentFind ? m_currentFind->supportsReplace() : false;
|
||||
QTC_ASSERT(m_currentFind, return false);
|
||||
return m_currentFind->supportsReplace();
|
||||
}
|
||||
|
||||
QString CurrentDocumentFind::currentFindString() const
|
||||
{
|
||||
Q_ASSERT(m_currentFind);
|
||||
return m_currentFind ? m_currentFind->currentFindString() : QString();
|
||||
QTC_ASSERT(m_currentFind, return QString());
|
||||
return m_currentFind->currentFindString();
|
||||
}
|
||||
|
||||
QString CurrentDocumentFind::completedFindString() const
|
||||
{
|
||||
Q_ASSERT(m_currentFind);
|
||||
return m_currentFind ? m_currentFind->completedFindString() : QString();
|
||||
QTC_ASSERT(m_currentFind, return QString());
|
||||
return m_currentFind->completedFindString();
|
||||
}
|
||||
|
||||
void CurrentDocumentFind::highlightAll(const QString &txt, QTextDocument::FindFlags findFlags)
|
||||
{
|
||||
Q_ASSERT(m_currentFind);
|
||||
if (m_currentFind)
|
||||
m_currentFind->highlightAll(txt, findFlags);
|
||||
QTC_ASSERT(m_currentFind, return);
|
||||
m_currentFind->highlightAll(txt, findFlags);
|
||||
}
|
||||
|
||||
bool CurrentDocumentFind::findIncremental(const QString &txt, QTextDocument::FindFlags findFlags)
|
||||
{
|
||||
Q_ASSERT(m_currentFind);
|
||||
return (m_currentFind? m_currentFind->findIncremental(txt, findFlags) : false);
|
||||
QTC_ASSERT(m_currentFind, return false);
|
||||
return m_currentFind->findIncremental(txt, findFlags);
|
||||
}
|
||||
|
||||
bool CurrentDocumentFind::findStep(const QString &txt, QTextDocument::FindFlags findFlags)
|
||||
{
|
||||
Q_ASSERT(m_currentFind);
|
||||
return (m_currentFind? m_currentFind->findStep(txt, findFlags) : false);
|
||||
QTC_ASSERT(m_currentFind, return false);
|
||||
return m_currentFind->findStep(txt, findFlags);
|
||||
}
|
||||
|
||||
bool CurrentDocumentFind::replaceStep(const QString &before, const QString &after,
|
||||
QTextDocument::FindFlags findFlags)
|
||||
{
|
||||
Q_ASSERT(m_currentFind);
|
||||
return (m_currentFind? m_currentFind->replaceStep(before, after, findFlags) : false);
|
||||
QTC_ASSERT(m_currentFind, return false);
|
||||
return m_currentFind->replaceStep(before, after, findFlags);
|
||||
}
|
||||
|
||||
int CurrentDocumentFind::replaceAll(const QString &before, const QString &after,
|
||||
QTextDocument::FindFlags findFlags)
|
||||
{
|
||||
Q_ASSERT(m_currentFind);
|
||||
return (m_currentFind? m_currentFind->replaceAll(before, after, findFlags) : 0);
|
||||
QTC_ASSERT(m_currentFind, return 0);
|
||||
return m_currentFind->replaceAll(before, after, findFlags);
|
||||
}
|
||||
|
||||
void CurrentDocumentFind::defineFindScope()
|
||||
{
|
||||
Q_ASSERT(m_currentFind);
|
||||
if (m_currentFind)
|
||||
m_currentFind->defineFindScope();
|
||||
QTC_ASSERT(m_currentFind, return);
|
||||
m_currentFind->defineFindScope();
|
||||
}
|
||||
|
||||
void CurrentDocumentFind::clearFindScope()
|
||||
{
|
||||
Q_ASSERT(m_currentFind);
|
||||
if (m_currentFind)
|
||||
m_currentFind->clearFindScope();
|
||||
QTC_ASSERT(m_currentFind, return);
|
||||
m_currentFind->clearFindScope();
|
||||
}
|
||||
|
||||
void CurrentDocumentFind::updateCurrentFindFilter(QWidget *old, QWidget *now)
|
||||
|
@@ -30,6 +30,7 @@
|
||||
** version 1.2, included in the file GPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
***************************************************************************/
|
||||
|
||||
#include "findplugin.h"
|
||||
|
||||
#include "textfindconstants.h"
|
||||
@@ -42,6 +43,8 @@
|
||||
#include <coreplugin/actionmanager/icommand.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/qplugin.h>
|
||||
#include <QtCore/QSettings>
|
||||
|
||||
@@ -102,24 +105,18 @@ void FindPlugin::filterChanged()
|
||||
{
|
||||
IFindFilter *changedFilter = qobject_cast<IFindFilter *>(sender());
|
||||
QAction *action = m_filterActions.value(changedFilter);
|
||||
Q_ASSERT(changedFilter);
|
||||
Q_ASSERT(action);
|
||||
if (!changedFilter || !action)
|
||||
return;
|
||||
QTC_ASSERT(changedFilter, return);
|
||||
QTC_ASSERT(action, return);
|
||||
action->setEnabled(changedFilter->isEnabled());
|
||||
}
|
||||
|
||||
void FindPlugin::openFindFilter()
|
||||
{
|
||||
QAction *action = qobject_cast<QAction*>(sender());
|
||||
Q_ASSERT(action);
|
||||
if (!action)
|
||||
return;
|
||||
QTC_ASSERT(action, return);
|
||||
IFindFilter *filter = action->data().value<IFindFilter *>();
|
||||
Q_ASSERT(filter);
|
||||
Q_ASSERT(filter->isEnabled());
|
||||
if (!filter || !filter->isEnabled())
|
||||
return;
|
||||
QTC_ASSERT(filter, return);
|
||||
QTC_ASSERT(filter->isEnabled(), return);
|
||||
QString currentFindString = (m_currentDocumentFind->isEnabled() ? m_currentDocumentFind->currentFindString() : "");
|
||||
if (!currentFindString.isEmpty())
|
||||
m_findDialog->setFindText(currentFindString);
|
||||
|
@@ -32,36 +32,38 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "gitclient.h"
|
||||
#include "gitplugin.h"
|
||||
#include "gitconstants.h"
|
||||
|
||||
#include "commitdata.h"
|
||||
#include "gitconstants.h"
|
||||
#include "gitplugin.h"
|
||||
#include "gitsubmiteditor.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/messagemanager.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <coreplugin/actionmanager/actionmanagerinterface.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/messagemanager.h>
|
||||
#include <coreplugin/progressmanager/progressmanagerinterface.h>
|
||||
#include <vcsbase/vcsbaseeditor.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <texteditor/itexteditor.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <vcsbase/vcsbaseeditor.h>
|
||||
|
||||
#include <QtCore/QFuture>
|
||||
#include <QtCore/QRegExp>
|
||||
#include <QtCore/QTemporaryFile>
|
||||
#include <QtCore/QFuture>
|
||||
#include <QtCore/QTime>
|
||||
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QMainWindow> // for msg box parent
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QPushButton>
|
||||
|
||||
using namespace Git;
|
||||
using namespace Git::Internal;
|
||||
|
||||
const char* const kGitCommand = "git";
|
||||
const char* const kGitDirectoryC = ".git";
|
||||
const char* const kBranchIndicatorC = "# On branch";
|
||||
const char *const kGitCommand = "git";
|
||||
const char *const kGitDirectoryC = ".git";
|
||||
const char *const kBranchIndicatorC = "# On branch";
|
||||
|
||||
enum { untrackedFilesInCommit = 0 };
|
||||
|
||||
@@ -169,14 +171,14 @@ VCSBase::VCSBaseEditor
|
||||
// Exists already
|
||||
outputEditor->createNew(m_msgWait);
|
||||
rc = VCSBase::VCSBaseEditor::getVcsBaseEditor(outputEditor);
|
||||
Q_ASSERT(rc);
|
||||
QTC_ASSERT(rc, return 0);
|
||||
m_core->editorManager()->setCurrentEditor(outputEditor);
|
||||
} else {
|
||||
// Create new, set wait message, set up with source and codec
|
||||
outputEditor = m_core->editorManager()->newFile(kind, &title, m_msgWait);
|
||||
outputEditor->setProperty(registerDynamicProperty, dynamicPropertyValue);
|
||||
rc = VCSBase::VCSBaseEditor::getVcsBaseEditor(outputEditor);
|
||||
Q_ASSERT(rc);
|
||||
QTC_ASSERT(rc, return 0);
|
||||
rc->setSource(source);
|
||||
if (setSourceCodec)
|
||||
rc->setCodec(VCSBase::VCSBaseEditor::getCodec(m_core, source));
|
||||
@@ -394,11 +396,10 @@ void GitClient::executeGit(const QString &workingDirectory, const QStringList &a
|
||||
|
||||
GitCommand* command = new GitCommand();
|
||||
if (outputToWindow) {
|
||||
Q_ASSERT(outputWindow);
|
||||
connect(command, SIGNAL(outputText(QString)), outputWindow, SLOT(append(QString)));
|
||||
connect(command, SIGNAL(outputData(QByteArray)), outputWindow, SLOT(appendData(QByteArray)));
|
||||
} else {
|
||||
Q_ASSERT(editor);
|
||||
QTC_ASSERT(editor, /**/);
|
||||
connect(command, SIGNAL(outputText(QString)), editor, SLOT(setPlainText(QString)));
|
||||
connect(command, SIGNAL(outputData(QByteArray)), editor, SLOT(setPlainTextData(QByteArray)));
|
||||
}
|
||||
@@ -515,7 +516,7 @@ static bool parseFiles(const QString &output, CommitData *d)
|
||||
State s = None;
|
||||
// Match added/changed-not-updated files: "#<tab>modified: foo.cpp"
|
||||
QRegExp filesPattern(QLatin1String("#\\t[^:]+:\\s+.+"));
|
||||
Q_ASSERT(filesPattern.isValid());
|
||||
QTC_ASSERT(filesPattern.isValid(), return false);
|
||||
|
||||
const QStringList::const_iterator cend = lines.constEnd();
|
||||
for (QStringList::const_iterator it = lines.constBegin(); it != cend; ++it) {
|
||||
@@ -533,7 +534,7 @@ static bool parseFiles(const QString &output, CommitData *d)
|
||||
// Now match untracked: "#<tab>foo.cpp"
|
||||
s = UntrackedFiles;
|
||||
filesPattern = QRegExp(QLatin1String("#\\t.+"));
|
||||
Q_ASSERT(filesPattern.isValid());
|
||||
QTC_ASSERT(filesPattern.isValid(), return false);
|
||||
} else {
|
||||
if (filesPattern.exactMatch(line)) {
|
||||
const QString fileSpec = line.mid(2).trimmed();
|
||||
|
@@ -32,22 +32,25 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "giteditor.h"
|
||||
|
||||
#include "annotationhighlighter.h"
|
||||
#include "gitclient.h"
|
||||
#include "gitconstants.h"
|
||||
#include "gitplugin.h"
|
||||
#include "gitclient.h"
|
||||
|
||||
#include <vcsbase/diffhighlighter.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <vcsbase/diffhighlighter.h>
|
||||
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QTextStream>
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/QRegExp>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtGui/QTextEdit>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QRegExp>
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/QTextStream>
|
||||
|
||||
#include <QtGui/QTextCursor>
|
||||
#include <QtGui/QTextEdit>
|
||||
|
||||
#define CHANGE_PATTERN_8C "[a-f0-9]{8,8}"
|
||||
#define CHANGE_PATTERN_40C "[a-f0-9]{40,40}"
|
||||
@@ -62,8 +65,8 @@ GitEditor::GitEditor(const VCSBase::VCSBaseEditorParameters *type,
|
||||
m_changeNumberPattern8(QLatin1String(CHANGE_PATTERN_8C)),
|
||||
m_changeNumberPattern40(QLatin1String(CHANGE_PATTERN_40C))
|
||||
{
|
||||
Q_ASSERT(m_changeNumberPattern8.isValid());
|
||||
Q_ASSERT(m_changeNumberPattern40.isValid());
|
||||
QTC_ASSERT(m_changeNumberPattern8.isValid(), return);
|
||||
QTC_ASSERT(m_changeNumberPattern40.isValid(), return);
|
||||
if (Git::Constants::debug)
|
||||
qDebug() << "GitEditor::GitEditor" << type->type << type->kind;
|
||||
}
|
||||
@@ -76,11 +79,11 @@ QSet<QString> GitEditor::annotationChanges() const
|
||||
return changes;
|
||||
// Hunt for first change number in annotation: "<change>:"
|
||||
QRegExp r(QLatin1String("^("CHANGE_PATTERN_8C") "));
|
||||
Q_ASSERT(r.isValid());
|
||||
QTC_ASSERT(r.isValid(), return changes);
|
||||
if (r.indexIn(txt) != -1) {
|
||||
changes.insert(r.cap(1));
|
||||
r.setPattern(QLatin1String("\n("CHANGE_PATTERN_8C") "));
|
||||
Q_ASSERT(r.isValid());
|
||||
QTC_ASSERT(r.isValid(), return changes);
|
||||
int pos = 0;
|
||||
while ((pos = r.indexIn(txt, pos)) != -1) {
|
||||
pos += r.matchedLength();
|
||||
|
@@ -32,13 +32,14 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "gitplugin.h"
|
||||
#include "gitclient.h"
|
||||
#include "gitversioncontrol.h"
|
||||
#include "giteditor.h"
|
||||
#include "gitconstants.h"
|
||||
|
||||
#include "changeselectiondialog.h"
|
||||
#include "gitsubmiteditor.h"
|
||||
#include "commitdata.h"
|
||||
#include "gitclient.h"
|
||||
#include "gitconstants.h"
|
||||
#include "giteditor.h"
|
||||
#include "gitsubmiteditor.h"
|
||||
#include "gitversioncontrol.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
@@ -47,20 +48,24 @@
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <coreplugin/actionmanager/actionmanagerinterface.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <vcsbase/basevcseditorfactory.h>
|
||||
#include <vcsbase/vcsbaseeditor.h>
|
||||
#include <vcsbase/basevcssubmiteditorfactory.h>
|
||||
|
||||
#include <QtCore/qplugin.h>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QTemporaryFile>
|
||||
#include <QtCore/QDir>
|
||||
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QFileDialog>
|
||||
|
||||
static const VCSBase::VCSBaseEditorParameters editorParameters[] = {
|
||||
{
|
||||
@@ -142,7 +147,6 @@ GitPlugin::GitPlugin() :
|
||||
m_versionControl(0),
|
||||
m_changeTmpFile(0)
|
||||
{
|
||||
Q_ASSERT(m_instance == 0);
|
||||
m_instance = this;
|
||||
}
|
||||
|
||||
@@ -212,10 +216,10 @@ static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = {
|
||||
Git::Constants::DIFF_SELECTED
|
||||
};
|
||||
|
||||
static inline Core::ICommand *createSeparator(Core::ActionManagerInterface *am,
|
||||
const QList<int> &context,
|
||||
const QString &id,
|
||||
QObject *parent)
|
||||
static Core::ICommand *createSeparator(Core::ActionManagerInterface *am,
|
||||
const QList<int> &context,
|
||||
const QString &id,
|
||||
QObject *parent)
|
||||
{
|
||||
QAction *a = new QAction(parent);
|
||||
a->setSeparator(true);
|
||||
@@ -627,7 +631,7 @@ Core::IEditor *GitPlugin::openSubmitEditor(const QString &fileName, const Commit
|
||||
qDebug() << Q_FUNC_INFO << fileName << editor;
|
||||
m_core->editorManager()->ensureEditorManagerVisible();
|
||||
GitSubmitEditor *submitEditor = qobject_cast<GitSubmitEditor*>(editor);
|
||||
Q_ASSERT(submitEditor);
|
||||
QTC_ASSERT(submitEditor, return 0);
|
||||
// The actions are for some reason enabled by the context switching
|
||||
// mechanism. Disable them correctly.
|
||||
m_submitCurrentAction->setEnabled(!cd.stagedFiles.empty());
|
||||
|
@@ -34,6 +34,8 @@
|
||||
#include "helpfindsupport.h"
|
||||
#include "helpviewer.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace Help::Internal;
|
||||
|
||||
HelpFindSupport::HelpFindSupport(CentralWidget *centralWidget)
|
||||
@@ -52,8 +54,8 @@ bool HelpFindSupport::isEnabled() const
|
||||
|
||||
QString HelpFindSupport::currentFindString() const
|
||||
{
|
||||
Q_ASSERT(m_centralWidget);
|
||||
HelpViewer* viewer = m_centralWidget->currentHelpViewer();
|
||||
QTC_ASSERT(m_centralWidget, return QString());
|
||||
HelpViewer *viewer = m_centralWidget->currentHelpViewer();
|
||||
if (!viewer)
|
||||
return QString();
|
||||
#if !defined(QT_NO_WEBKIT)
|
||||
@@ -70,13 +72,13 @@ QString HelpFindSupport::completedFindString() const
|
||||
|
||||
bool HelpFindSupport::findIncremental(const QString &txt, QTextDocument::FindFlags findFlags)
|
||||
{
|
||||
Q_ASSERT(m_centralWidget);
|
||||
QTC_ASSERT(m_centralWidget, return false);
|
||||
findFlags &= ~QTextDocument::FindBackward;
|
||||
return m_centralWidget->find(txt, findFlags, true);
|
||||
}
|
||||
|
||||
bool HelpFindSupport::findStep(const QString &txt, QTextDocument::FindFlags findFlags)
|
||||
{
|
||||
Q_ASSERT(m_centralWidget);
|
||||
QTC_ASSERT(m_centralWidget, return false);
|
||||
return m_centralWidget->find(txt, findFlags, false);
|
||||
}
|
||||
|
@@ -32,26 +32,28 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "perforceeditor.h"
|
||||
|
||||
#include "annotationhighlighter.h"
|
||||
#include "perforceplugin.h"
|
||||
#include "perforceconstants.h"
|
||||
#include "perforceplugin.h"
|
||||
|
||||
#include <vcsbase/diffhighlighter.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <vcsbase/diffhighlighter.h>
|
||||
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QTextStream>
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/QRegExp>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QProcess>
|
||||
#include <QtCore/QRegExp>
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/QTextStream>
|
||||
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QKeyEvent>
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QTextEdit>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QTextCursor>
|
||||
#include <QtCore/QProcess>
|
||||
#include <QtGui/QTextEdit>
|
||||
|
||||
namespace Perforce {
|
||||
namespace Internal {
|
||||
@@ -63,7 +65,7 @@ PerforceEditor::PerforceEditor(const VCSBase::VCSBaseEditorParameters *type,
|
||||
m_changeNumberPattern(QLatin1String("^\\d+$")),
|
||||
m_plugin(PerforcePlugin::perforcePluginInstance())
|
||||
{
|
||||
Q_ASSERT(m_changeNumberPattern.isValid());
|
||||
QTC_ASSERT(m_changeNumberPattern.isValid(), /**/);
|
||||
if (Perforce::Constants::debug)
|
||||
qDebug() << "PerforceEditor::PerforceEditor" << type->type << type->kind;
|
||||
}
|
||||
@@ -76,11 +78,11 @@ QSet<QString> PerforceEditor::annotationChanges() const
|
||||
return changes;
|
||||
// Hunt for first change number in annotation: "<change>:"
|
||||
QRegExp r(QLatin1String("^(\\d+):"));
|
||||
Q_ASSERT(r.isValid());
|
||||
QTC_ASSERT(r.isValid(), return changes);
|
||||
if (r.indexIn(txt) != -1) {
|
||||
changes.insert(r.cap(1));
|
||||
r.setPattern(QLatin1String("\n(\\d+):"));
|
||||
Q_ASSERT(r.isValid());
|
||||
QTC_ASSERT(r.isValid(), return changes);
|
||||
int pos = 0;
|
||||
while ((pos = r.indexIn(txt, pos)) != -1) {
|
||||
pos += r.matchedLength();
|
||||
|
@@ -31,25 +31,27 @@
|
||||
**
|
||||
***************************************************************************/
|
||||
|
||||
#include "p4.h"
|
||||
#include "perforceplugin.h"
|
||||
#include "perforceoutputwindow.h"
|
||||
#include "settingspage.h"
|
||||
#include "perforcesubmiteditor.h"
|
||||
#include "changenumberdialog.h"
|
||||
#include "perforceconstants.h"
|
||||
#include "perforceversioncontrol.h"
|
||||
#include "perforceeditor.h"
|
||||
#include "pendingchangesdialog.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
#include <coreplugin/filemanager.h>
|
||||
#include <coreplugin/messagemanager.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include "changenumberdialog.h"
|
||||
#include "p4.h"
|
||||
#include "pendingchangesdialog.h"
|
||||
#include "perforceconstants.h"
|
||||
#include "perforceeditor.h"
|
||||
#include "perforceoutputwindow.h"
|
||||
#include "perforcesubmiteditor.h"
|
||||
#include "perforceversioncontrol.h"
|
||||
#include "settingspage.h"
|
||||
|
||||
#include <coreplugin/actionmanager/actionmanagerinterface.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/filemanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/messagemanager.h>
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/synchronousprocess.h>
|
||||
#include <vcsbase/basevcseditorfactory.h>
|
||||
#include <vcsbase/basevcssubmiteditorfactory.h>
|
||||
@@ -57,16 +59,17 @@
|
||||
|
||||
#include <QtCore/qplugin.h>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QTemporaryFile>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QTemporaryFile>
|
||||
#include <QtCore/QTextCodec>
|
||||
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QFileDialog>
|
||||
|
||||
using namespace Perforce::Internal;
|
||||
|
||||
@@ -420,7 +423,7 @@ void PerforcePlugin::deleteCurrentFile()
|
||||
|
||||
void PerforcePlugin::revertCurrentFile()
|
||||
{
|
||||
Q_ASSERT(m_coreInstance);
|
||||
QTC_ASSERT(m_coreInstance, return);
|
||||
|
||||
const QString fileName = currentFileName();
|
||||
QTextCodec *codec = VCSBase::VCSBaseEditor::getCodec(m_coreInstance, fileName);
|
||||
@@ -460,7 +463,7 @@ void PerforcePlugin::diffCurrentFile()
|
||||
|
||||
void PerforcePlugin::diffCurrentProject()
|
||||
{
|
||||
Q_ASSERT(m_projectExplorer);
|
||||
QTC_ASSERT(m_projectExplorer, return);
|
||||
QStringList files;
|
||||
QString name;
|
||||
ProjectExplorer::Project *currentProject = m_projectExplorer->currentProject();
|
||||
@@ -502,7 +505,8 @@ void PerforcePlugin::resolve()
|
||||
|
||||
void PerforcePlugin::submit()
|
||||
{
|
||||
Q_ASSERT(m_coreInstance);
|
||||
QTC_ASSERT(m_coreInstance, return);
|
||||
|
||||
if (!checkP4Command()) {
|
||||
showOutput(tr("No p4 executable specified!"));
|
||||
return;
|
||||
@@ -534,7 +538,7 @@ void PerforcePlugin::submit()
|
||||
m_changeTmpFile->seek(0);
|
||||
|
||||
// Assemble file list of project
|
||||
Q_ASSERT(m_projectExplorer);
|
||||
QTC_ASSERT(m_projectExplorer, return);
|
||||
QStringList files;
|
||||
QString name;
|
||||
ProjectExplorer::Project *currentProject = m_projectExplorer->currentProject();
|
||||
@@ -581,7 +585,7 @@ Core::IEditor *PerforcePlugin::openPerforceSubmitEditor(const QString &fileName,
|
||||
m_coreInstance->editorManager()->openEditor(fileName, Constants::PERFORCESUBMITEDITOR_KIND);
|
||||
m_coreInstance->editorManager()->ensureEditorManagerVisible();
|
||||
PerforceSubmitEditor *submitEditor = dynamic_cast<PerforceSubmitEditor*>(editor);
|
||||
Q_ASSERT(submitEditor);
|
||||
QTC_ASSERT(submitEditor, return 0);
|
||||
submitEditor->restrictToProjectFiles(depotFileNames);
|
||||
connect(submitEditor, SIGNAL(diffSelectedFiles(QStringList)), this, SLOT(slotDiff(QStringList)));
|
||||
// The actions are for some reason enabled by the context switching
|
||||
@@ -735,7 +739,7 @@ QString PerforcePlugin::findTopLevelForDirectory(const QString & /* dir */) cons
|
||||
return QString::null;
|
||||
|
||||
QRegExp regExp(QLatin1String("(\\n|\\r\\n|\\r)Root:\\s*(.*)(\\n|\\r\\n|\\r)"));
|
||||
Q_ASSERT(regExp.isValid());
|
||||
QTC_ASSERT(regExp.isValid(), /**/);
|
||||
regExp.setMinimal(true);
|
||||
if (regExp.indexIn(result.stdOut) != -1) {
|
||||
QString file = regExp.cap(2).trimmed();
|
||||
@@ -784,7 +788,7 @@ PerforceResponse PerforcePlugin::runP4Cmd(const QStringList &args,
|
||||
qDebug() << "PerforcePlugin::runP4Cmd" << args << extraArgs << debugCodec(outputCodec);
|
||||
PerforceResponse response;
|
||||
response.error = true;
|
||||
Q_ASSERT(m_coreInstance);
|
||||
QTC_ASSERT(m_coreInstance, return response);
|
||||
if (!checkP4Command()) {
|
||||
response.message = tr("No p4 executable specified!");
|
||||
m_perforceOutputWindow->append(response.message, true);
|
||||
@@ -874,7 +878,7 @@ Core::IEditor * PerforcePlugin::showOutputInEditor(const QString& title, const Q
|
||||
int editorType, QTextCodec *codec)
|
||||
{
|
||||
const VCSBase::VCSBaseEditorParameters *params = findType(editorType);
|
||||
Q_ASSERT(params);
|
||||
QTC_ASSERT(params, return 0);
|
||||
const QString kind = QLatin1String(params->kind);
|
||||
if (Perforce::Constants::debug)
|
||||
qDebug() << "PerforcePlugin::showOutputInEditor" << title << kind << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec);
|
||||
@@ -1047,10 +1051,9 @@ void PerforcePlugin::openFiles(const QStringList &files)
|
||||
|
||||
QString PerforcePlugin::clientFilePath(const QString &serverFilePath)
|
||||
{
|
||||
QString path;
|
||||
Q_ASSERT(m_coreInstance);
|
||||
QTC_ASSERT(m_coreInstance, return QString());
|
||||
if (!checkP4Command())
|
||||
return path;
|
||||
return QString();
|
||||
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
QProcess proc;
|
||||
@@ -1058,6 +1061,7 @@ QString PerforcePlugin::clientFilePath(const QString &serverFilePath)
|
||||
proc.start(m_settings.p4Command,
|
||||
basicP4Args() << QLatin1String("fstat") << serverFilePath);
|
||||
|
||||
QString path;
|
||||
if (proc.waitForFinished(3000)) {
|
||||
QString output = QString::fromUtf8(proc.readAllStandardOutput());
|
||||
if (!output.isEmpty()) {
|
||||
@@ -1284,5 +1288,17 @@ QString PerforcePlugin::fileNameFromPerforceName(const QString& perforceName,
|
||||
return rc;
|
||||
}
|
||||
|
||||
Core::ICore *PerforcePlugin::coreInstance()
|
||||
{
|
||||
QTC_ASSERT(m_coreInstance, return 0);
|
||||
return m_coreInstance;
|
||||
}
|
||||
|
||||
PerforcePlugin *PerforcePlugin::perforcePluginInstance()
|
||||
{
|
||||
QTC_ASSERT(m_perforcePluginInstance, return 0);
|
||||
return m_perforcePluginInstance;
|
||||
}
|
||||
|
||||
Q_EXPORT_PLUGIN(PerforcePlugin)
|
||||
|
||||
|
@@ -100,7 +100,7 @@ public:
|
||||
~PerforcePlugin();
|
||||
|
||||
QStringList basicP4Args() const;
|
||||
inline SettingsPage *settingsPage() const { return m_settingsPage; }
|
||||
SettingsPage *settingsPage() const { return m_settingsPage; }
|
||||
|
||||
bool initialize(const QStringList &arguments, QString *error_message);
|
||||
void extensionsInitialized();
|
||||
@@ -117,8 +117,8 @@ public:
|
||||
|
||||
Core::IEditor *openPerforceSubmitEditor(const QString &fileName, const QStringList &depotFileNames);
|
||||
|
||||
static Core::ICore *coreInstance() {Q_ASSERT(m_coreInstance); return m_coreInstance;}
|
||||
static PerforcePlugin *perforcePluginInstance() {Q_ASSERT(m_perforcePluginInstance); return m_perforcePluginInstance;}
|
||||
static Core::ICore *coreInstance();
|
||||
static PerforcePlugin *perforcePluginInstance();
|
||||
|
||||
PerforceSettings settings() const;
|
||||
void setSettings(const PerforceSettings &s);
|
||||
|
@@ -36,6 +36,8 @@
|
||||
#include "perforceplugin.h"
|
||||
#include "perforceconstants.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
namespace Perforce {
|
||||
@@ -153,7 +155,7 @@ void PerforceSubmitEditor::updateFields()
|
||||
lines.removeLast(); // that is the empty line at the end
|
||||
|
||||
const QRegExp leadingTabPattern = QRegExp(QLatin1String("^\\t"));
|
||||
Q_ASSERT(leadingTabPattern.isValid());
|
||||
QTC_ASSERT(leadingTabPattern.isValid(), /**/);
|
||||
|
||||
lines.replaceInStrings(leadingTabPattern, QString());
|
||||
widget->setDescriptionText(lines.join(newLine));
|
||||
|
@@ -32,10 +32,13 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "allprojectsfind.h"
|
||||
#include "projectexplorer.h"
|
||||
#include "project.h"
|
||||
|
||||
#include <QtDebug>
|
||||
#include "project.h"
|
||||
#include "projectexplorer.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QRegExp>
|
||||
#include <QtGui/QGridLayout>
|
||||
|
||||
@@ -71,9 +74,7 @@ QKeySequence AllProjectsFind::defaultShortcut() const
|
||||
|
||||
QStringList AllProjectsFind::files()
|
||||
{
|
||||
Q_ASSERT(m_plugin->session());
|
||||
if (!m_plugin->session())
|
||||
return QStringList();
|
||||
QTC_ASSERT(m_plugin->session(), return QStringList());
|
||||
QList<QRegExp> filterRegs;
|
||||
QStringList nameFilters = fileNameFilters();
|
||||
foreach (const QString &filter, nameFilters) {
|
||||
|
@@ -36,6 +36,7 @@
|
||||
#include "environment.h"
|
||||
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QTextDocument>
|
||||
@@ -94,8 +95,8 @@ QString ApplicationRunConfigurationRunner::displayName() const
|
||||
RunControl* ApplicationRunConfigurationRunner::run(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode)
|
||||
{
|
||||
QSharedPointer<ApplicationRunConfiguration> rc = qSharedPointerCast<ApplicationRunConfiguration>(runConfiguration);
|
||||
Q_ASSERT(rc);
|
||||
Q_ASSERT(mode == ProjectExplorer::Constants::RUNMODE);
|
||||
QTC_ASSERT(rc, return 0);
|
||||
QTC_ASSERT(mode == ProjectExplorer::Constants::RUNMODE, return 0);
|
||||
|
||||
ApplicationRunControl *runControl = new ApplicationRunControl(rc);
|
||||
return runControl;
|
||||
@@ -112,10 +113,10 @@ QWidget *ApplicationRunConfigurationRunner::configurationWidget(QSharedPointer<R
|
||||
ApplicationRunControl::ApplicationRunControl(QSharedPointer<ApplicationRunConfiguration> runConfiguration)
|
||||
: RunControl(runConfiguration), m_applicationLauncher()
|
||||
{
|
||||
connect(&m_applicationLauncher, SIGNAL(applicationError(const QString &)),
|
||||
this, SLOT(slotError(const QString &)));
|
||||
connect(&m_applicationLauncher, SIGNAL(appendOutput(const QString &)),
|
||||
this, SLOT(slotAddToOutputWindow(const QString &)));
|
||||
connect(&m_applicationLauncher, SIGNAL(applicationError(QString)),
|
||||
this, SLOT(slotError(QString)));
|
||||
connect(&m_applicationLauncher, SIGNAL(appendOutput(QString)),
|
||||
this, SLOT(slotAddToOutputWindow(QString)));
|
||||
connect(&m_applicationLauncher, SIGNAL(processExited(int)),
|
||||
this, SLOT(processExited(int)));
|
||||
connect(&m_applicationLauncher, SIGNAL(bringToForegroundRequested(qint64)),
|
||||
@@ -129,7 +130,7 @@ ApplicationRunControl::~ApplicationRunControl()
|
||||
void ApplicationRunControl::start()
|
||||
{
|
||||
QSharedPointer<ApplicationRunConfiguration> rc = qSharedPointerCast<ApplicationRunConfiguration>(runConfiguration());
|
||||
Q_ASSERT(rc);
|
||||
QTC_ASSERT(rc, return);
|
||||
|
||||
m_applicationLauncher.setEnvironment(rc->environment().toStringList());
|
||||
m_applicationLauncher.setWorkingDirectory(rc->workingDirectory());
|
||||
|
@@ -32,16 +32,18 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "buildmanager.h"
|
||||
|
||||
#include "buildprogress.h"
|
||||
#include "buildstep.h"
|
||||
#include "compileoutputwindow.h"
|
||||
#include "taskwindow.h"
|
||||
#include "projectexplorer.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "buildprogress.h"
|
||||
#include "projectexplorer.h"
|
||||
#include "taskwindow.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <coreplugin/progressmanager/progressmanagerinterface.h>
|
||||
#include <coreplugin/progressmanager/futureprogress.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QTimer>
|
||||
@@ -300,7 +302,7 @@ void BuildManager::buildQueueAppend(BuildStep * bs, const QString &configuration
|
||||
|
||||
void BuildManager::buildProjects(const QList<Project *> &projects, const QList<QString> &configurations)
|
||||
{
|
||||
Q_ASSERT(projects.count() == configurations.count());
|
||||
QTC_ASSERT(projects.count() == configurations.count(), /**/);
|
||||
QList<QString>::const_iterator cit = configurations.constBegin();
|
||||
QList<Project *>::const_iterator it, end;
|
||||
end = projects.constEnd();
|
||||
@@ -316,7 +318,7 @@ void BuildManager::buildProjects(const QList<Project *> &projects, const QList<Q
|
||||
|
||||
void BuildManager::cleanProjects(const QList<Project *> &projects, const QList<QString> &configurations)
|
||||
{
|
||||
Q_ASSERT(projects.count() == configurations.count());
|
||||
QTC_ASSERT(projects.count() == configurations.count(), /**/);
|
||||
QList<QString>::const_iterator cit = configurations.constBegin();
|
||||
QList<Project *>::const_iterator it, end;
|
||||
end = projects.constEnd();
|
||||
@@ -376,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) {
|
||||
Q_ASSERT(false && "BuildManager m_activeBuildSteps says project is not building, but apparently a build step was still in the queue.");
|
||||
QTC_ASSERT(false && "BuildManager m_activeBuildSteps says project is not building, but apparently a build step was still in the queue.", return);
|
||||
} else if (*it == 1) {
|
||||
--*it;
|
||||
emit buildStateChanged(pro);
|
||||
|
@@ -34,6 +34,8 @@
|
||||
#include "buildstep.h"
|
||||
#include "buildconfiguration.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
BuildStep::BuildStep(Project * pro)
|
||||
@@ -78,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);
|
||||
Q_ASSERT(bc);
|
||||
QTC_ASSERT(bc, return);
|
||||
bc->setValue(name, value);
|
||||
}
|
||||
|
||||
|
@@ -32,10 +32,12 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "buildstepspage.h"
|
||||
|
||||
#include "ui_buildstepspage.h"
|
||||
#include "project.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace ProjectExplorer::Internal;
|
||||
@@ -121,15 +123,14 @@ void BuildStepsPage::updateBuildStepWidget(QTreeWidgetItem *newItem, QTreeWidget
|
||||
{
|
||||
if (oldItem == newItem)
|
||||
return;
|
||||
Q_ASSERT(m_pro);
|
||||
QTC_ASSERT(m_pro, return);
|
||||
|
||||
if (newItem) {
|
||||
int row = m_ui->buildSettingsList->indexOfTopLevelItem(newItem);
|
||||
m_ui->buildSettingsWidget->setCurrentIndex(row);
|
||||
BuildStepConfigWidget *widget = qobject_cast<BuildStepConfigWidget *>(m_ui->buildSettingsWidget->currentWidget());
|
||||
Q_ASSERT(widget);
|
||||
if (widget)
|
||||
widget->init(m_configuration);
|
||||
QTC_ASSERT(widget, return);
|
||||
widget->init(m_configuration);
|
||||
}
|
||||
updateBuildStepButtonsState();
|
||||
}
|
||||
|
@@ -32,10 +32,13 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "currentprojectfind.h"
|
||||
|
||||
#include "projectexplorer.h"
|
||||
#include "project.h"
|
||||
|
||||
#include <QtDebug>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QRegExp>
|
||||
#include <QtGui/QGridLayout>
|
||||
|
||||
@@ -71,9 +74,7 @@ QKeySequence CurrentProjectFind::defaultShortcut() const
|
||||
QStringList CurrentProjectFind::files()
|
||||
{
|
||||
Project *project = m_plugin->currentProject();
|
||||
Q_ASSERT(project);
|
||||
if (!project)
|
||||
return QStringList();
|
||||
QTC_ASSERT(project, return QStringList());
|
||||
QList<QRegExp> filterRegs;
|
||||
QStringList nameFilters = fileNameFilters();
|
||||
foreach (const QString &filter, nameFilters) {
|
||||
|
@@ -40,9 +40,10 @@
|
||||
|
||||
#include <coreplugin/ifile.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QTextCodec>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QTextCodec>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using ExtensionSystem::PluginManager;
|
||||
@@ -410,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);
|
||||
Q_ASSERT(bc);
|
||||
QTC_ASSERT(bc, return);
|
||||
bc->setValue(name, value);
|
||||
}
|
||||
|
||||
@@ -444,13 +445,13 @@ QList<QSharedPointer<RunConfiguration> > Project::runConfigurations() const
|
||||
|
||||
void Project::addRunConfiguration(QSharedPointer<RunConfiguration> runConfiguration)
|
||||
{
|
||||
Q_ASSERT(!m_runConfigurations.contains(runConfiguration));
|
||||
QTC_ASSERT(!m_runConfigurations.contains(runConfiguration), return);
|
||||
m_runConfigurations.push_back(runConfiguration);
|
||||
}
|
||||
|
||||
void Project::removeRunConfiguration(QSharedPointer<RunConfiguration> runConfiguration)
|
||||
{
|
||||
Q_ASSERT(m_runConfigurations.contains(runConfiguration));
|
||||
QTC_ASSERT(m_runConfigurations.contains(runConfiguration), /**/);
|
||||
m_runConfigurations.removeOne(runConfiguration);
|
||||
if (m_activeRunConfiguration == runConfiguration) {
|
||||
if (m_runConfigurations.isEmpty())
|
||||
@@ -469,7 +470,7 @@ void Project::setActiveRunConfiguration(QSharedPointer<RunConfiguration> runConf
|
||||
{
|
||||
if (runConfiguration == m_activeRunConfiguration)
|
||||
return;
|
||||
Q_ASSERT(m_runConfigurations.contains(runConfiguration) || runConfiguration == 0);
|
||||
QTC_ASSERT(m_runConfigurations.contains(runConfiguration) || runConfiguration == 0, return);
|
||||
m_activeRunConfiguration = runConfiguration;
|
||||
emit activeRunConfigurationChanged();
|
||||
}
|
||||
|
@@ -78,23 +78,24 @@
|
||||
#include <coreplugin/iversioncontrol.h>
|
||||
#include <coreplugin/vcsmanager.h>
|
||||
#include <utils/listutils.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/qplugin.h>
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtGui/QFileSystemModel>
|
||||
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QContextMenuEvent>
|
||||
#include <QtGui/QToolBar>
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtGui/QFileSystemModel>
|
||||
#include <QtGui/QHeaderView>
|
||||
#include <QtGui/QInputDialog>
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QToolBar>
|
||||
|
||||
Q_DECLARE_METATYPE(QSharedPointer<ProjectExplorer::RunConfiguration>);
|
||||
Q_DECLARE_METATYPE(Core::IEditorFactory *);
|
||||
@@ -788,7 +789,7 @@ void ProjectExplorerPlugin::setStartupProject(Project *project)
|
||||
|
||||
if (!project)
|
||||
project = m_currentProject;
|
||||
Q_ASSERT(project);
|
||||
QTC_ASSERT(project, return);
|
||||
m_session->setStartupProject(project);
|
||||
// NPE: Visually mark startup project
|
||||
updateActions();
|
||||
@@ -1537,7 +1538,7 @@ void ProjectExplorerPlugin::updateContextMenuActions()
|
||||
|
||||
void ProjectExplorerPlugin::addNewFile()
|
||||
{
|
||||
Q_ASSERT(m_currentNode && m_currentNode->nodeType() == ProjectNodeType);
|
||||
QTC_ASSERT(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)
|
||||
@@ -1547,7 +1548,7 @@ void ProjectExplorerPlugin::addNewFile()
|
||||
|
||||
void ProjectExplorerPlugin::addExistingFiles()
|
||||
{
|
||||
Q_ASSERT(m_currentNode && m_currentNode->nodeType() == ProjectNodeType);
|
||||
QTC_ASSERT(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);
|
||||
@@ -1599,14 +1600,14 @@ void ProjectExplorerPlugin::addExistingFiles()
|
||||
|
||||
void ProjectExplorerPlugin::openFile()
|
||||
{
|
||||
Q_ASSERT(m_currentNode);
|
||||
QTC_ASSERT(m_currentNode, return);
|
||||
m_core->editorManager()->openEditor(m_currentNode->path());
|
||||
m_core->editorManager()->ensureEditorManagerVisible();
|
||||
}
|
||||
|
||||
void ProjectExplorerPlugin::removeFile()
|
||||
{
|
||||
Q_ASSERT(m_currentNode && m_currentNode->nodeType() == FileNodeType);
|
||||
QTC_ASSERT(m_currentNode && m_currentNode->nodeType() == FileNodeType, return);
|
||||
FileNode *fileNode = qobject_cast<FileNode*>(m_currentNode);
|
||||
|
||||
const QString filePath = m_currentNode->path();
|
||||
@@ -1618,7 +1619,7 @@ void ProjectExplorerPlugin::removeFile()
|
||||
|
||||
// remove from project
|
||||
ProjectNode *projectNode = fileNode->projectNode();
|
||||
Q_ASSERT(projectNode);
|
||||
QTC_ASSERT(projectNode, return);
|
||||
|
||||
if (!projectNode->removeFiles(fileNode->fileType(), QStringList(filePath))) {
|
||||
QMessageBox::warning(m_core->mainWindow(), tr("Remove file failed"),
|
||||
@@ -1770,11 +1771,11 @@ void ProjectExplorerPlugin::populateOpenWithMenu()
|
||||
|
||||
void ProjectExplorerPlugin::openWithMenuTriggered(QAction *action)
|
||||
{
|
||||
Q_ASSERT(action != NULL);
|
||||
QTC_ASSERT(action, return);
|
||||
Core::IEditorFactory * const editorFactory = qVariantValue<Core::IEditorFactory *>(action->data());
|
||||
Q_ASSERT(m_core != NULL);
|
||||
Q_ASSERT(m_core->editorManager() != NULL);
|
||||
Q_ASSERT(editorFactory != NULL);
|
||||
QTC_ASSERT(m_core, return);
|
||||
QTC_ASSERT(m_core->editorManager(), return);
|
||||
QTC_ASSERT(editorFactory, return);
|
||||
m_core->editorManager()->openEditor(currentNode()->path(), editorFactory->kind());
|
||||
m_core->editorManager()->ensureEditorManagerVisible();
|
||||
}
|
||||
|
@@ -31,19 +31,22 @@
|
||||
**
|
||||
***************************************************************************/
|
||||
|
||||
#include "project.h"
|
||||
#include "projectmodels.h"
|
||||
|
||||
#include "project.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
|
||||
#include <coreplugin/fileiconprovider.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QFileInfo>
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QIcon>
|
||||
#include <QtGui/QStyle>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QSortFilterProxyModel>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtGui/QStyle>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace ProjectExplorer::Internal;
|
||||
@@ -173,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));
|
||||
Q_ASSERT(parentNode);
|
||||
QTC_ASSERT(parentNode, return result);
|
||||
result = createIndex(row, 0, m_childNodes.value(parentNode).at(row));
|
||||
}
|
||||
return result;
|
||||
@@ -186,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()) {
|
||||
Q_ASSERT(m_childNodes.contains(grandParentFolderNode));
|
||||
QTC_ASSERT(m_childNodes.contains(grandParentFolderNode), return parentIndex);
|
||||
int row = m_childNodes.value(grandParentFolderNode).indexOf(parentFolderNode);
|
||||
parentIndex = createIndex(row, 0, parentFolderNode);
|
||||
} else {
|
||||
@@ -348,8 +351,8 @@ bool DetailedModel::canFetchMore(const QModelIndex & parent) const
|
||||
void DetailedModel::fetchMore(const QModelIndex & parent)
|
||||
{
|
||||
FolderNode *folderNode = qobject_cast<FolderNode*>(nodeForIndex(parent));
|
||||
Q_ASSERT(folderNode);
|
||||
Q_ASSERT(!m_childNodes.contains(folderNode));
|
||||
QTC_ASSERT(folderNode, return);
|
||||
QTC_ASSERT(!m_childNodes.contains(folderNode), return);
|
||||
|
||||
m_childNodes.insert(folderNode, childNodeList(folderNode));
|
||||
}
|
||||
@@ -365,7 +368,7 @@ void DetailedModel::foldersAboutToBeAdded(FolderNode *parentFolder,
|
||||
const QList<FolderNode*> &newFolders)
|
||||
{
|
||||
Q_UNUSED(newFolders);
|
||||
Q_ASSERT(parentFolder);
|
||||
QTC_ASSERT(parentFolder, return);
|
||||
|
||||
if (m_childNodes.contains(parentFolder))
|
||||
m_folderToAddTo = parentFolder;
|
||||
@@ -383,7 +386,7 @@ void DetailedModel::foldersAdded()
|
||||
void DetailedModel::foldersAboutToBeRemoved(FolderNode *parentFolder,
|
||||
const QList<FolderNode*> &staleFolders)
|
||||
{
|
||||
Q_ASSERT(parentFolder);
|
||||
QTC_ASSERT(parentFolder, return);
|
||||
|
||||
if (m_childNodes.contains(parentFolder)) {
|
||||
QList<Node*> newChildNodes = m_childNodes.value(parentFolder);
|
||||
@@ -413,7 +416,7 @@ void DetailedModel::filesAboutToBeAdded(FolderNode *parentFolder,
|
||||
const QList<FileNode*> &newFiles)
|
||||
{
|
||||
Q_UNUSED(newFiles);
|
||||
Q_ASSERT(parentFolder);
|
||||
QTC_ASSERT(parentFolder, return);
|
||||
|
||||
if (m_childNodes.contains(parentFolder))
|
||||
m_folderToAddTo = parentFolder;
|
||||
@@ -431,7 +434,7 @@ void DetailedModel::filesAdded()
|
||||
void DetailedModel::filesAboutToBeRemoved(FolderNode *parentFolder,
|
||||
const QList<FileNode*> &staleFiles)
|
||||
{
|
||||
Q_ASSERT(parentFolder);
|
||||
QTC_ASSERT(parentFolder, return);
|
||||
|
||||
if (m_childNodes.contains(parentFolder)) {
|
||||
QList<Node*> newChildNodes = m_childNodes.value(parentFolder);
|
||||
@@ -470,7 +473,7 @@ QModelIndex DetailedModel::indexForNode(const Node *node)
|
||||
// update internal cache
|
||||
if (canFetchMore(parentIndex))
|
||||
fetchMore(parentIndex);
|
||||
Q_ASSERT(m_childNodes.contains(parentFolder));
|
||||
QTC_ASSERT(m_childNodes.contains(parentFolder), return QModelIndex());
|
||||
|
||||
int row = m_childNodes.value(parentFolder).indexOf(const_cast<Node*>(node));
|
||||
if (row >= 0)
|
||||
@@ -503,7 +506,7 @@ void DetailedModel::addToChildNodes(FolderNode *parentFolder, QList<Node*> newCh
|
||||
{
|
||||
QList<Node*> childNodes = m_childNodes.value(parentFolder);
|
||||
QModelIndex parentIndex = indexForNode(parentFolder);
|
||||
Q_ASSERT(parentIndex.isValid());
|
||||
QTC_ASSERT(parentIndex.isValid(), return);
|
||||
|
||||
// position -> nodes, with positions in decreasing order
|
||||
QList<QPair<int, QList<Node*> > > insertions;
|
||||
@@ -547,14 +550,14 @@ void DetailedModel::addToChildNodes(FolderNode *parentFolder, QList<Node*> newCh
|
||||
endInsertRows();
|
||||
}
|
||||
|
||||
Q_ASSERT(childNodes == newChildNodes);
|
||||
QTC_ASSERT(childNodes == newChildNodes, /**/);
|
||||
}
|
||||
|
||||
void DetailedModel::removeFromChildNodes(FolderNode *parentFolder, QList<Node*> newChildNodes)
|
||||
{
|
||||
QList<Node*> childNodes = m_childNodes.value(parentFolder);
|
||||
QModelIndex parentIndex = indexForNode(parentFolder);
|
||||
Q_ASSERT(parentIndex.isValid());
|
||||
QTC_ASSERT(parentIndex.isValid(), return);
|
||||
|
||||
// position -> nodes, with positions in decreasing order
|
||||
QList<QPair<int, QList<Node*> > > deletions;
|
||||
@@ -597,7 +600,7 @@ void DetailedModel::removeFromChildNodes(FolderNode *parentFolder, QList<Node*>
|
||||
endRemoveRows();
|
||||
}
|
||||
|
||||
Q_ASSERT(childNodes == newChildNodes);
|
||||
QTC_ASSERT(childNodes == newChildNodes, /**/);
|
||||
}
|
||||
|
||||
QList<FolderNode*> DetailedModel::recursiveSubFolders(FolderNode *parentFolder)
|
||||
@@ -660,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));
|
||||
Q_ASSERT(parentNode);
|
||||
QTC_ASSERT(parentNode, return QModelIndex());
|
||||
QHash<FolderNode*, QList<Node*> >::const_iterator it = m_childNodes.constFind(parentNode);
|
||||
if (it == m_childNodes.constEnd()) {
|
||||
fetchMore(parentNode);
|
||||
@@ -687,9 +690,9 @@ QModelIndex FlatModel::parent(const QModelIndex &idx) const
|
||||
fetchMore(grandParentNode);
|
||||
it = m_childNodes.constFind(grandParentNode);
|
||||
}
|
||||
Q_ASSERT(it != m_childNodes.constEnd());
|
||||
QTC_ASSERT(it != m_childNodes.constEnd(), return QModelIndex());
|
||||
const int row = it.value().indexOf(parentNode);
|
||||
Q_ASSERT(row >= 0);
|
||||
QTC_ASSERT(row >= 0, return QModelIndex());
|
||||
parentIndex = createIndex(row, 0, parentNode);
|
||||
} else {
|
||||
// top level node, parent is session
|
||||
@@ -847,8 +850,8 @@ QList<Node*> FlatModel::childNodes(FolderNode *parentNode, const QSet<Node*> &bl
|
||||
|
||||
void FlatModel::fetchMore(FolderNode *folderNode) const
|
||||
{
|
||||
Q_ASSERT(folderNode);
|
||||
Q_ASSERT(!m_childNodes.contains(folderNode));
|
||||
QTC_ASSERT(folderNode, return);
|
||||
QTC_ASSERT(!m_childNodes.contains(folderNode), return);
|
||||
|
||||
QList<Node*> nodeList = childNodes(folderNode);
|
||||
m_childNodes.insert(folderNode, nodeList);
|
||||
@@ -857,7 +860,7 @@ void FlatModel::fetchMore(FolderNode *folderNode) const
|
||||
void FlatModel::fetchMore(const QModelIndex &parent)
|
||||
{
|
||||
FolderNode *folderNode = qobject_cast<FolderNode*>(nodeForIndex(parent));
|
||||
Q_ASSERT(folderNode);
|
||||
QTC_ASSERT(folderNode, return);
|
||||
|
||||
fetchMore(folderNode);
|
||||
}
|
||||
|
@@ -31,11 +31,13 @@
|
||||
**
|
||||
***************************************************************************/
|
||||
|
||||
#include "nodesvisitor.h"
|
||||
#include "projectnodes.h"
|
||||
|
||||
#include "nodesvisitor.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtGui/QApplication>
|
||||
@@ -374,7 +376,7 @@ void ProjectNode::removeProjectNodes(const QList<ProjectNode*> &subProjects)
|
||||
*/
|
||||
void ProjectNode::addFolderNodes(const QList<FolderNode*> &subFolders, FolderNode *parentFolder)
|
||||
{
|
||||
Q_ASSERT(parentFolder);
|
||||
QTC_ASSERT(parentFolder, return);
|
||||
|
||||
if (!subFolders.isEmpty()) {
|
||||
const bool emitSignals = (parentFolder->projectNode() == this);
|
||||
@@ -410,7 +412,7 @@ void ProjectNode::addFolderNodes(const QList<FolderNode*> &subFolders, FolderNod
|
||||
void ProjectNode::removeFolderNodes(const QList<FolderNode*> &subFolders,
|
||||
FolderNode *parentFolder)
|
||||
{
|
||||
Q_ASSERT(parentFolder);
|
||||
QTC_ASSERT(parentFolder, return);
|
||||
|
||||
if (!subFolders.isEmpty()) {
|
||||
const bool emitSignals = (parentFolder->projectNode() == this);
|
||||
@@ -448,7 +450,7 @@ void ProjectNode::removeFolderNodes(const QList<FolderNode*> &subFolders,
|
||||
*/
|
||||
void ProjectNode::addFileNodes(const QList<FileNode*> &files, FolderNode *folder)
|
||||
{
|
||||
Q_ASSERT(folder);
|
||||
QTC_ASSERT(folder, return);
|
||||
|
||||
if (!files.isEmpty()) {
|
||||
const bool emitSignals = (folder->projectNode() == this);
|
||||
@@ -480,7 +482,7 @@ void ProjectNode::addFileNodes(const QList<FileNode*> &files, FolderNode *folder
|
||||
*/
|
||||
void ProjectNode::removeFileNodes(const QList<FileNode*> &files, FolderNode *folder)
|
||||
{
|
||||
Q_ASSERT(folder);
|
||||
QTC_ASSERT(folder, return);
|
||||
|
||||
if (!files.isEmpty()) {
|
||||
const bool emitSignals = (folder->projectNode() == this);
|
||||
|
@@ -32,18 +32,21 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "projecttreewidget.h"
|
||||
|
||||
#include "projectexplorer.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "projectmodels.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
#include <QtGui/QHeaderView>
|
||||
#include <QtGui/QVBoxLayout>
|
||||
#include <QtGui/QToolButton>
|
||||
#include <QtGui/QFocusEvent>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace ProjectExplorer::Internal;
|
||||
@@ -208,7 +211,7 @@ void ProjectTreeWidget::setCurrentItem(Node *node, Project *project)
|
||||
void ProjectTreeWidget::handleCurrentItemChange(const QModelIndex ¤t)
|
||||
{
|
||||
Node *node = m_model->nodeForIndex(current);
|
||||
Q_ASSERT(node);
|
||||
QTC_ASSERT(node, return);
|
||||
|
||||
bool autoSync = autoSynchronization();
|
||||
setAutoSynchronization(false);
|
||||
|
@@ -37,19 +37,22 @@
|
||||
#include "ui_runsettingspropertiespage.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QPair>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
namespace Internal {
|
||||
|
||||
struct FactoryAndType
|
||||
{
|
||||
ProjectExplorer::IRunConfigurationFactory *factory;
|
||||
QString type;
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
Q_DECLARE_METATYPE(ProjectExplorer::Internal::FactoryAndType);
|
||||
|
||||
@@ -170,9 +173,9 @@ void RunConfigurationsModel::setRunConfigurations(const QList<QSharedPointer<Run
|
||||
///
|
||||
|
||||
RunSettingsWidget::RunSettingsWidget(Project *project)
|
||||
: m_project(project)
|
||||
, m_runConfigurationsModel(new RunConfigurationsModel(this))
|
||||
, m_runConfigurationWidget(0)
|
||||
: m_project(project),
|
||||
m_runConfigurationsModel(new RunConfigurationsModel(this)),
|
||||
m_runConfigurationWidget(0)
|
||||
{
|
||||
m_ui = new Ui::RunSettingsPropertiesPage;
|
||||
m_ui->setupUi(this);
|
||||
@@ -214,8 +217,9 @@ RunSettingsWidget::~RunSettingsWidget()
|
||||
void RunSettingsWidget::aboutToShowAddMenu()
|
||||
{
|
||||
m_addMenu->clear();
|
||||
QList<IRunConfigurationFactory *> factories = ExtensionSystem::PluginManager::instance()->getObjects<IRunConfigurationFactory>();
|
||||
foreach (IRunConfigurationFactory * factory, factories) {
|
||||
QList<IRunConfigurationFactory *> factories =
|
||||
ExtensionSystem::PluginManager::instance()->getObjects<IRunConfigurationFactory>();
|
||||
foreach (IRunConfigurationFactory *factory, factories) {
|
||||
QStringList types = factory->canCreate(m_project);
|
||||
foreach (const QString &type, types) {
|
||||
QAction *action = m_addMenu->addAction(factory->nameForType(type));;
|
||||
@@ -243,16 +247,14 @@ void RunSettingsWidget::addRunConfiguration()
|
||||
m_project->addRunConfiguration(newRC);
|
||||
m_project->setActiveRunConfiguration(newRC);
|
||||
initRunConfigurationComboBox();
|
||||
connect(newRC.data(), SIGNAL(nameChanged()),
|
||||
this, SLOT(nameChanged()));
|
||||
connect(newRC.data(), SIGNAL(nameChanged()), this, SLOT(nameChanged()));
|
||||
}
|
||||
|
||||
void RunSettingsWidget::removeRunConfiguration()
|
||||
{
|
||||
int index = m_ui->runConfigurationCombo->currentIndex();
|
||||
QSharedPointer<RunConfiguration> rc = m_project->runConfigurations().at(index);
|
||||
disconnect(rc.data(), SIGNAL(nameChanged()),
|
||||
this, SLOT(nameChanged()));
|
||||
disconnect(rc.data(), SIGNAL(nameChanged()), this, SLOT(nameChanged()));
|
||||
m_project->removeRunConfiguration(rc);
|
||||
initRunConfigurationComboBox();
|
||||
}
|
||||
@@ -272,9 +274,9 @@ void RunSettingsWidget::initRunConfigurationComboBox()
|
||||
|
||||
void RunSettingsWidget::activateRunConfiguration(int index)
|
||||
{
|
||||
Q_ASSERT(m_project);
|
||||
QTC_ASSERT(m_project, return);
|
||||
const QList<QSharedPointer<RunConfiguration> > runConfigurations = m_project->runConfigurations();
|
||||
Q_ASSERT(index < runConfigurations.size());
|
||||
QTC_ASSERT(index < runConfigurations.size(), return);
|
||||
QSharedPointer<RunConfiguration> selectedRunConfiguration = runConfigurations.at(index);
|
||||
|
||||
// Change the active run configuration of the project
|
||||
|
@@ -47,17 +47,20 @@
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
#include <coreplugin/progressmanager/progressmanagerinterface.h>
|
||||
#include <coreplugin/modemanager.h>
|
||||
#include <utils/listutils.h>
|
||||
|
||||
#include <texteditor/itexteditor.h>
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <utils/listutils.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QFuture>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtCore/QSettings>
|
||||
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
namespace {
|
||||
bool debug = false;
|
||||
@@ -138,21 +141,17 @@ QString SessionFile::mimeType() const
|
||||
|
||||
bool SessionFile::load(const QString &fileName)
|
||||
{
|
||||
Q_ASSERT(!fileName.isEmpty());
|
||||
QTC_ASSERT(!fileName.isEmpty(), return false);
|
||||
|
||||
if (debug)
|
||||
qDebug() << "SessionFile::load " << fileName;
|
||||
|
||||
|
||||
|
||||
m_fileName = fileName;
|
||||
|
||||
// NPE: Load the session in the background?
|
||||
// NPE: Let FileManager monitor filename
|
||||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
|
||||
|
||||
|
||||
PersistentSettingsReader reader;
|
||||
if (!reader.load(m_fileName)) {
|
||||
qWarning() << "SessionManager::load failed!" << fileName;
|
||||
@@ -161,8 +160,8 @@ bool SessionFile::load(const QString &fileName)
|
||||
}
|
||||
|
||||
m_core->progressManager()->addTask(future.future(), tr("Session"),
|
||||
QLatin1String("ProjectExplorer.SessionFile.Load"),
|
||||
Core::ProgressManagerInterface::CloseOnSuccess);
|
||||
QLatin1String("ProjectExplorer.SessionFile.Load"),
|
||||
Core::ProgressManagerInterface::CloseOnSuccess);
|
||||
|
||||
const QStringList &keys = reader.restoreValue(QLatin1String("valueKeys")).toStringList();
|
||||
foreach (const QString &key, keys) {
|
||||
@@ -184,7 +183,6 @@ bool SessionFile::load(const QString &fileName)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int openEditorsCount = reader.restoreValue(QLatin1String("OpenEditors")).toInt();
|
||||
|
||||
future.setProgressRange(0, fileList.count() + openEditorsCount + 2);
|
||||
@@ -248,7 +246,7 @@ bool SessionFile::save(const QString &fileName)
|
||||
if (!fileName.isEmpty())
|
||||
m_fileName = fileName;
|
||||
|
||||
Q_ASSERT(!m_fileName.isEmpty());
|
||||
QTC_ASSERT(!m_fileName.isEmpty(), return false);
|
||||
|
||||
if (debug)
|
||||
qDebug() << "SessionFile - saving " << m_fileName;
|
||||
@@ -495,7 +493,7 @@ void SessionManager::setStartupProject(Project *startupProject)
|
||||
qDebug() << Q_FUNC_INFO << (startupProject ? startupProject->name() : "0");
|
||||
|
||||
if (startupProject) {
|
||||
Q_ASSERT(m_file->m_projects.contains(startupProject));
|
||||
QTC_ASSERT(m_file->m_projects.contains(startupProject), return);
|
||||
}
|
||||
|
||||
m_file->m_startupProject = startupProject;
|
||||
@@ -568,7 +566,7 @@ void SessionManager::removeProject(Project *project)
|
||||
|
||||
bool SessionManager::createImpl(const QString &fileName)
|
||||
{
|
||||
Q_ASSERT(!fileName.isEmpty());
|
||||
QTC_ASSERT(!fileName.isEmpty(), return false);
|
||||
|
||||
if (debug)
|
||||
qDebug() << "SessionManager - creating new session " << fileName << " ...";
|
||||
@@ -576,9 +574,8 @@ bool SessionManager::createImpl(const QString &fileName)
|
||||
bool success = true;
|
||||
|
||||
if (!m_file->fileName().isEmpty()) {
|
||||
if (!save() || !clear()) {
|
||||
if (!save() || !clear())
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (success) {
|
||||
@@ -600,7 +597,7 @@ bool SessionManager::createImpl(const QString &fileName)
|
||||
|
||||
bool SessionManager::loadImpl(const QString &fileName)
|
||||
{
|
||||
Q_ASSERT(!fileName.isEmpty());
|
||||
QTC_ASSERT(!fileName.isEmpty(), return false);
|
||||
|
||||
if (debug)
|
||||
qDebug() << "SessionManager - loading session " << fileName << " ...";
|
||||
@@ -804,7 +801,7 @@ Project *SessionManager::projectForNode(Node *node) const
|
||||
while (rootProjectNode && rootProjectNode->parentFolderNode() != m_sessionNode)
|
||||
rootProjectNode = rootProjectNode->parentFolderNode();
|
||||
|
||||
Q_ASSERT(rootProjectNode);
|
||||
QTC_ASSERT(rootProjectNode, return 0);
|
||||
|
||||
QList<Project *> projectList = projects();
|
||||
foreach (Project *p, projectList) {
|
||||
|
@@ -33,10 +33,12 @@
|
||||
|
||||
#include "gdbmacrosbuildstep.h"
|
||||
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qt4project.h"
|
||||
#include "qmakestep.h"
|
||||
#include "makestep.h"
|
||||
#include "qmakestep.h"
|
||||
#include "qt4project.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace Qt4ProjectManager;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
@@ -160,9 +162,9 @@ bool GdbMacrosBuildStepFactory::canCreate(const QString &name) const
|
||||
|
||||
ProjectExplorer::BuildStep *GdbMacrosBuildStepFactory::create(ProjectExplorer::Project *pro, const QString &name) const
|
||||
{
|
||||
Q_ASSERT(name == Constants::GDBMACROSBUILDSTEP);
|
||||
QTC_ASSERT(name == Constants::GDBMACROSBUILDSTEP, return 0);
|
||||
Qt4Project *qt4project = qobject_cast<Qt4Project *>(pro);
|
||||
Q_ASSERT(qt4project);
|
||||
QTC_ASSERT(qt4project, return 0);
|
||||
return new GdbMacrosBuildStep(qt4project);
|
||||
}
|
||||
|
||||
|
@@ -37,9 +37,10 @@
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
|
||||
#include <extensionsystem/ExtensionSystemInterfaces>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QDir>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFileInfo>
|
||||
|
||||
using ProjectExplorer::IBuildParserFactory;
|
||||
using ProjectExplorer::BuildParserInterface;
|
||||
@@ -289,10 +290,11 @@ void MakeStepConfigWidget::init(const QString &buildConfiguration)
|
||||
{
|
||||
m_buildConfiguration = buildConfiguration;
|
||||
bool showPage0 = buildConfiguration.isNull();
|
||||
m_ui.stackedWidget->setCurrentIndex(showPage0? 0 : 1);
|
||||
m_ui.stackedWidget->setCurrentIndex(showPage0 ? 0 : 1);
|
||||
|
||||
if (!showPage0) {
|
||||
Qt4Project *pro = qobject_cast<Qt4Project *>(m_makeStep->project());
|
||||
QTC_ASSERT(pro, return);
|
||||
m_ui.makeLabel->setText(tr("Override %1:").arg(pro->qtVersion(buildConfiguration)->makeCommand()));
|
||||
|
||||
const QString &makeCmd = m_makeStep->value(buildConfiguration, "makeCmd").toString();
|
||||
@@ -307,12 +309,12 @@ void MakeStepConfigWidget::init(const QString &buildConfiguration)
|
||||
|
||||
void MakeStepConfigWidget::makeLineEditTextEdited()
|
||||
{
|
||||
Q_ASSERT(!m_buildConfiguration.isNull());
|
||||
QTC_ASSERT(!m_buildConfiguration.isNull(), return);
|
||||
m_makeStep->setValue(m_buildConfiguration, "makeCmd", m_ui.makeLineEdit->text());
|
||||
}
|
||||
|
||||
void MakeStepConfigWidget::makeArgumentsLineEditTextEdited()
|
||||
{
|
||||
Q_ASSERT(!m_buildConfiguration.isNull());
|
||||
QTC_ASSERT(!m_buildConfiguration.isNull(), return);
|
||||
m_makeStep->setValue(m_buildConfiguration, "makeargs", ProjectExplorer::Environment::parseCombinedArgString(m_ui.makeArgumentsLineEdit->text()));
|
||||
}
|
||||
|
@@ -40,6 +40,7 @@
|
||||
#include "qtversionmanager.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QDir>
|
||||
@@ -233,7 +234,7 @@ QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
|
||||
|
||||
void QMakeStepConfigWidget::qmakeArgumentsLineEditTextEdited()
|
||||
{
|
||||
Q_ASSERT(!m_buildConfiguration.isNull());
|
||||
QTC_ASSERT(!m_buildConfiguration.isNull(), return);
|
||||
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)));
|
||||
}
|
||||
|
@@ -33,12 +33,12 @@
|
||||
|
||||
#include "proeditormodel.h"
|
||||
|
||||
#include "directorywatcher.h"
|
||||
#include "profilereader.h"
|
||||
#include "prowriter.h"
|
||||
#include "qt4nodes.h"
|
||||
#include "qt4project.h"
|
||||
#include "qt4projectmanager.h"
|
||||
#include "directorywatcher.h"
|
||||
|
||||
#include <projectexplorer/nodesvisitor.h>
|
||||
|
||||
@@ -50,11 +50,14 @@
|
||||
|
||||
#include <cpptools/cppmodelmanagerinterface.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QPushButton>
|
||||
@@ -86,15 +89,15 @@ Qt4PriFileNode::Qt4PriFileNode(Qt4Project *project, Qt4ProFileNode* qt4ProFileNo
|
||||
m_projectFilePath(QDir::fromNativeSeparators(filePath)),
|
||||
m_projectDir(QFileInfo(filePath).absolutePath())
|
||||
{
|
||||
Q_ASSERT(project);
|
||||
QTC_ASSERT(project, return);
|
||||
setFolderName(QFileInfo(filePath).baseName());
|
||||
setIcon(QIcon(":/qt4projectmanager/images/qt_project.png"));
|
||||
}
|
||||
|
||||
void Qt4PriFileNode::update(ProFile *includeFile, ProFileReader *reader)
|
||||
{
|
||||
Q_ASSERT(includeFile);
|
||||
Q_ASSERT(reader);
|
||||
QTC_ASSERT(includeFile, return);
|
||||
QTC_ASSERT(reader, return);
|
||||
|
||||
// add project file node
|
||||
if (m_fileNodes.isEmpty())
|
||||
@@ -167,7 +170,7 @@ QList<ProjectNode::ProjectAction> Qt4PriFileNode::supportedActions() const
|
||||
const Qt4ProFileNode *proFileNode;
|
||||
while (!(proFileNode = qobject_cast<const Qt4ProFileNode*>(folderNode)))
|
||||
folderNode = folderNode->parentFolderNode();
|
||||
Q_ASSERT(proFileNode);
|
||||
QTC_ASSERT(proFileNode, return actions);
|
||||
|
||||
switch (proFileNode->projectType()) {
|
||||
case ApplicationTemplate:
|
||||
|
@@ -33,15 +33,16 @@
|
||||
|
||||
#include "qt4runconfiguration.h"
|
||||
|
||||
#include "qt4project.h"
|
||||
#include "makestep.h"
|
||||
#include "profilereader.h"
|
||||
#include "qt4nodes.h"
|
||||
#include "makestep.h"
|
||||
#include "qt4project.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/messagemanager.h>
|
||||
#include <coreplugin/variablemanager.h>
|
||||
#include <projectexplorer/buildstep.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtGui/QFormLayout>
|
||||
#include <QtGui/QInputDialog>
|
||||
@@ -148,7 +149,7 @@ QStringList Qt4RunConfiguration::commandLineArguments() const
|
||||
ProjectExplorer::Environment Qt4RunConfiguration::environment() const
|
||||
{
|
||||
Qt4Project *pro = qobject_cast<Qt4Project *>(project());
|
||||
Q_ASSERT(pro);
|
||||
QTC_ASSERT(pro, return ProjectExplorer::Environment());
|
||||
return pro->environment(pro->activeBuildConfiguration());
|
||||
}
|
||||
|
||||
@@ -369,11 +370,12 @@ bool Qt4RunConfigurationFactory::canCreate(const QString &type) const
|
||||
return type == "Qt4ProjectManager.Qt4RunConfiguration";
|
||||
}
|
||||
|
||||
QSharedPointer<ProjectExplorer::RunConfiguration> Qt4RunConfigurationFactory::create(ProjectExplorer::Project *project, const QString &type)
|
||||
QSharedPointer<ProjectExplorer::RunConfiguration> Qt4RunConfigurationFactory::create
|
||||
(ProjectExplorer::Project *project, const QString &type)
|
||||
{
|
||||
Qt4Project *p = qobject_cast<Qt4Project *>(project);
|
||||
Q_ASSERT(p);
|
||||
Q_ASSERT(type == "Qt4ProjectManager.Qt4RunConfiguration");
|
||||
QTC_ASSERT(p, /**/);
|
||||
QTC_ASSERT(type == "Qt4ProjectManager.Qt4RunConfiguration", /**/);
|
||||
// The right path is set in restoreSettings
|
||||
QSharedPointer<ProjectExplorer::RunConfiguration> rc(new Qt4RunConfiguration(p, QString::null));
|
||||
return rc;
|
||||
@@ -416,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);
|
||||
Q_ASSERT(p);
|
||||
QTC_ASSERT(p, /**/);
|
||||
|
||||
QString fileName = type.mid(QString("Qt4RunConfiguration.").size());
|
||||
return QSharedPointer<ProjectExplorer::RunConfiguration>(new Qt4RunConfiguration(p, fileName));
|
||||
|
@@ -39,14 +39,16 @@
|
||||
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <help/helpplugin.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QProcess>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QStringRef>
|
||||
#include <QtCore/QTime>
|
||||
#include <QtCore/QProcess>
|
||||
#include <QtGui/QHeaderView>
|
||||
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtGui/QHeaderView>
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
@@ -114,9 +116,7 @@ void QtVersionManager::addVersion(QtVersion *version)
|
||||
void QtVersionManager::updateDocumentation()
|
||||
{
|
||||
Help::HelpManager *helpManager = m_core->pluginManager()->getObject<Help::HelpManager>();
|
||||
Q_ASSERT(helpManager);
|
||||
if (!helpManager)
|
||||
return;
|
||||
QTC_ASSERT(helpManager, return);
|
||||
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();
|
||||
Q_ASSERT(currentItem);
|
||||
QTC_ASSERT(currentItem, return);
|
||||
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();
|
||||
Q_ASSERT(currentItem);
|
||||
QTC_ASSERT(currentItem, return);
|
||||
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();
|
||||
Q_ASSERT(currentItem);
|
||||
QTC_ASSERT(currentItem, return);
|
||||
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();
|
||||
Q_ASSERT(currentItem);
|
||||
QTC_ASSERT(currentItem, return);
|
||||
int currentItemIndex = m_ui.qtdirList->indexOfTopLevelItem(currentItem);
|
||||
m_versions[currentItemIndex]->setMsvcVersion(msvcVersion);
|
||||
|
||||
|
@@ -32,12 +32,14 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "librarywizarddialog.h"
|
||||
|
||||
#include "consoleappwizard.h"
|
||||
#include "modulespage.h"
|
||||
#include "filespage.h"
|
||||
#include "libraryparameters.h"
|
||||
#include "modulespage.h"
|
||||
|
||||
#include <utils/projectintropage.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtGui/QComboBox>
|
||||
#include <QtGui/QLabel>
|
||||
@@ -231,7 +233,7 @@ void LibraryWizardDialog::slotCurrentIdChanged(int id)
|
||||
qDebug("initializing for plugins");
|
||||
QStringList baseClasses;
|
||||
const int pluginBaseClassCount = sizeof(pluginBaseClasses)/sizeof(PluginBaseClasses);
|
||||
Q_ASSERT(defaultPluginBaseClass < pluginBaseClassCount);
|
||||
QTC_ASSERT(defaultPluginBaseClass < pluginBaseClassCount, return);
|
||||
for (int i = 0; i < pluginBaseClassCount; i++)
|
||||
baseClasses.push_back(QLatin1String(pluginBaseClasses[i].name));
|
||||
m_filesPage->setBaseClassChoices(baseClasses);
|
||||
|
@@ -32,15 +32,18 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "modulespage.h"
|
||||
|
||||
#include "speinfo.h"
|
||||
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QCheckBox>
|
||||
#include <QtGui/QWidget>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
#include <QtGui/QCheckBox>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
@@ -101,17 +104,15 @@ QString ModulesPage::deselectedModules() const
|
||||
void ModulesPage::setModuleSelected(const QString &module, bool selected) const
|
||||
{
|
||||
QCheckBox *checkBox = m_moduleCheckBoxMap[module];
|
||||
Q_ASSERT(checkBox);
|
||||
if (checkBox)
|
||||
checkBox->setCheckState(selected?Qt::Checked:Qt::Unchecked);
|
||||
QTC_ASSERT(checkBox, return);
|
||||
checkBox->setCheckState(selected?Qt::Checked:Qt::Unchecked);
|
||||
}
|
||||
|
||||
void ModulesPage::setModuleEnabled(const QString &module, bool enabled) const
|
||||
{
|
||||
QCheckBox *checkBox = m_moduleCheckBoxMap[module];
|
||||
Q_ASSERT(checkBox);
|
||||
if (checkBox)
|
||||
checkBox->setEnabled(enabled);
|
||||
QTC_ASSERT(checkBox, return);
|
||||
checkBox->setEnabled(enabled);
|
||||
}
|
||||
|
||||
QString ModulesPage::modules(bool selected) const
|
||||
|
@@ -32,10 +32,11 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "qtscripteditorplugin.h"
|
||||
|
||||
#include "qscripthighlighter.h"
|
||||
#include "qtscripteditor.h"
|
||||
#include "qtscripteditorconstants.h"
|
||||
#include "qtscripteditorfactory.h"
|
||||
#include "qtscripteditor.h"
|
||||
#include "qscripthighlighter.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
@@ -47,6 +48,7 @@
|
||||
#include <texteditor/texteditorconstants.h>
|
||||
#include <texteditor/texteditorsettings.h>
|
||||
#include <texteditor/textfilewizard.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/qplugin.h>
|
||||
#include <QtCore/QDebug>
|
||||
@@ -108,7 +110,7 @@ void QtScriptEditorPlugin::extensionsInitialized()
|
||||
|
||||
void QtScriptEditorPlugin::initializeEditor(QtScriptEditor::Internal::ScriptEditor *editor)
|
||||
{
|
||||
Q_ASSERT(m_instance);
|
||||
QTC_ASSERT(m_instance, /**/);
|
||||
|
||||
TextEditor::TextEditorSettings *settings = TextEditor::TextEditorSettings::instance();
|
||||
connect(settings, SIGNAL(fontSettingsChanged(TextEditor::FontSettings)),
|
||||
|
@@ -33,6 +33,8 @@
|
||||
|
||||
#include "qtscripthighlighter.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
namespace QtScriptEditor {
|
||||
namespace Internal {
|
||||
|
||||
@@ -94,7 +96,7 @@ void QtScriptHighlighter::onBlockEnd(int state, int firstNonSpace)
|
||||
blockData->setCollapseMode(TextEditor::TextBlockUserData::NoCollapse);
|
||||
}
|
||||
if (!m_currentBlockParentheses.isEmpty()) {
|
||||
Q_ASSERT(blockData);
|
||||
QTC_ASSERT(blockData, return);
|
||||
int collapse = Parenthesis::collapseAtPos(m_currentBlockParentheses);
|
||||
if (collapse >= 0) {
|
||||
if (collapse == firstNonSpace)
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#include "quickopentoolwindow.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace QuickOpen;
|
||||
using namespace QuickOpen::Internal;
|
||||
@@ -57,6 +58,6 @@ QuickOpenManager::~QuickOpenManager()
|
||||
void QuickOpenManager::show(const QString &text,
|
||||
int selectionStart, int selectionLength)
|
||||
{
|
||||
Q_ASSERT(m_toolWindow);
|
||||
QTC_ASSERT(m_toolWindow, return);
|
||||
m_toolWindow->show(text, selectionStart, selectionLength);
|
||||
}
|
||||
|
@@ -51,6 +51,7 @@ QT_END_NAMESPACE
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/fileiconprovider.h>
|
||||
#include <utils/fancylineedit.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QFile>
|
||||
@@ -452,9 +453,9 @@ void QuickOpenToolWindow::filterSelected()
|
||||
{
|
||||
const char * const TEXT = "<type here>";
|
||||
QAction *action = qobject_cast<QAction*>(sender());
|
||||
Q_ASSERT(action);
|
||||
QTC_ASSERT(action, return);
|
||||
IQuickOpenFilter *filter = action->data().value<IQuickOpenFilter*>();
|
||||
Q_ASSERT(filter);
|
||||
QTC_ASSERT(filter, return);
|
||||
show(filter->shortcutString() + " " + TEXT,
|
||||
filter->shortcutString().length() + 1,
|
||||
QString(TEXT).length());
|
||||
|
@@ -32,13 +32,15 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "settingspage.h"
|
||||
|
||||
#include "quickopenplugin.h"
|
||||
#include "iquickopenfilter.h"
|
||||
#include "directoryfilter.h"
|
||||
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
#include <qtconcurrent/QtConcurrentTools>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
Q_DECLARE_METATYPE(QuickOpen::IQuickOpenFilter*)
|
||||
|
||||
@@ -46,7 +48,7 @@ using namespace QuickOpen;
|
||||
using namespace QuickOpen::Internal;
|
||||
|
||||
SettingsPage::SettingsPage(Core::ICore *core, QuickOpenPlugin *plugin)
|
||||
: m_core(core), m_plugin(plugin), m_page(0)
|
||||
: m_core(core), m_plugin(plugin), m_page(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -144,9 +146,10 @@ void SettingsPage::configureFilter(QListWidgetItem *item)
|
||||
{
|
||||
if (!item)
|
||||
item = m_ui.filterList->currentItem();
|
||||
Q_ASSERT(item);
|
||||
QTC_ASSERT(item, return);
|
||||
IQuickOpenFilter *filter = item->data(Qt::UserRole).value<IQuickOpenFilter *>();
|
||||
Q_ASSERT(filter);
|
||||
QTC_ASSERT(filter, return);
|
||||
|
||||
if (!filter->isConfigurable())
|
||||
return;
|
||||
bool needsRefresh = false;
|
||||
@@ -172,9 +175,9 @@ void SettingsPage::addCustomFilter()
|
||||
void SettingsPage::removeCustomFilter()
|
||||
{
|
||||
QListWidgetItem *item = m_ui.filterList->currentItem();
|
||||
Q_ASSERT(item);
|
||||
QTC_ASSERT(item, return);
|
||||
IQuickOpenFilter *filter = item->data(Qt::UserRole).value<IQuickOpenFilter *>();
|
||||
Q_ASSERT(m_customFilters.contains(filter));
|
||||
QTC_ASSERT(m_customFilters.contains(filter), return);
|
||||
m_filters.removeAll(filter);
|
||||
m_customFilters.removeAll(filter);
|
||||
m_refreshFilters.removeAll(filter);
|
||||
|
@@ -32,6 +32,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "resourceeditorplugin.h"
|
||||
|
||||
#include "resourceeditorw.h"
|
||||
#include "resourceeditorconstants.h"
|
||||
#include "resourcewizard.h"
|
||||
@@ -44,6 +45,8 @@
|
||||
#include <coreplugin/actionmanager/actionmanagerinterface.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/qplugin.h>
|
||||
#include <QtGui/QAction>
|
||||
|
||||
@@ -122,10 +125,11 @@ void ResourceEditorPlugin::onUndoStackChanged(ResourceEditorW const *editor,
|
||||
}
|
||||
}
|
||||
|
||||
ResourceEditorW * ResourceEditorPlugin::currentEditor() const {
|
||||
ResourceEditorW * ResourceEditorPlugin::currentEditor() const
|
||||
{
|
||||
ResourceEditorW * const focusEditor = qobject_cast<ResourceEditorW *>(
|
||||
m_core->editorManager()->currentEditor());
|
||||
Q_ASSERT(focusEditor);
|
||||
QTC_ASSERT(focusEditor, return 0);
|
||||
return focusEditor;
|
||||
}
|
||||
|
||||
|
@@ -32,9 +32,11 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "subversioneditor.h"
|
||||
|
||||
#include "annotationhighlighter.h"
|
||||
#include "subversionconstants.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <vcsbase/diffhighlighter.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
@@ -49,8 +51,8 @@ SubversionEditor::SubversionEditor(const VCSBase::VCSBaseEditorParameters *type,
|
||||
m_changeNumberPattern(QLatin1String("^\\d+$")),
|
||||
m_revisionNumberPattern(QLatin1String("^r\\d+$"))
|
||||
{
|
||||
Q_ASSERT(m_changeNumberPattern.isValid());
|
||||
Q_ASSERT(m_revisionNumberPattern.isValid());
|
||||
QTC_ASSERT(m_changeNumberPattern.isValid(), return);
|
||||
QTC_ASSERT(m_revisionNumberPattern.isValid(), return);
|
||||
}
|
||||
|
||||
QSet<QString> SubversionEditor::annotationChanges() const
|
||||
@@ -61,11 +63,11 @@ QSet<QString> SubversionEditor::annotationChanges() const
|
||||
return changes;
|
||||
// Hunt for first change number in annotation: "<change>:"
|
||||
QRegExp r(QLatin1String("^(\\d+):"));
|
||||
Q_ASSERT(r.isValid());
|
||||
QTC_ASSERT(r.isValid(), return changes);
|
||||
if (r.indexIn(txt) != -1) {
|
||||
changes.insert(r.cap(1));
|
||||
r.setPattern(QLatin1String("\n(\\d+):"));
|
||||
Q_ASSERT(r.isValid());
|
||||
QTC_ASSERT(r.isValid(), return changes);
|
||||
int pos = 0;
|
||||
while ((pos = r.indexIn(txt, pos)) != -1) {
|
||||
pos += r.matchedLength();
|
||||
@@ -108,7 +110,7 @@ QString SubversionEditor::changeUnderCursor(const QTextCursor &c) const
|
||||
VCSBase::DiffHighlighter *SubversionEditor::createDiffHighlighter() const
|
||||
{
|
||||
const QRegExp filePattern(QLatin1String("^[-+][-+][-+] .*|^Index: .*|^==*$"));
|
||||
Q_ASSERT(filePattern.isValid());
|
||||
QTC_ASSERT(filePattern.isValid(), /**/);
|
||||
return new VCSBase::DiffHighlighter(filePattern);
|
||||
}
|
||||
|
||||
|
@@ -56,6 +56,7 @@
|
||||
#include <coreplugin/actionmanager/actionmanagerinterface.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <projectexplorer/ProjectExplorerInterfaces>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/qplugin.h>
|
||||
#include <QtCore/QDebug>
|
||||
@@ -504,7 +505,7 @@ SubversionSubmitEditor *SubversionPlugin::openSubversionSubmitEditor(const QStri
|
||||
{
|
||||
Core::IEditor *editor = m_coreInstance->editorManager()->openEditor(fileName, QLatin1String(Constants::SUBVERSIONCOMMITEDITOR_KIND));
|
||||
SubversionSubmitEditor *submitEditor = qobject_cast<SubversionSubmitEditor*>(editor);
|
||||
Q_ASSERT(submitEditor);
|
||||
QTC_ASSERT(submitEditor, /**/);
|
||||
// The actions are for some reason enabled by the context switching
|
||||
// mechanism. Disable them correctly.
|
||||
m_submitDiffAction->setEnabled(false);
|
||||
@@ -981,7 +982,7 @@ Core::IEditor * SubversionPlugin::showOutputInEditor(const QString& title, const
|
||||
QTextCodec *codec)
|
||||
{
|
||||
const VCSBase::VCSBaseEditorParameters *params = findType(editorType);
|
||||
Q_ASSERT(params);
|
||||
QTC_ASSERT(params, return 0);
|
||||
const QString kind = QLatin1String(params->kind);
|
||||
if (Subversion::Constants::debug)
|
||||
qDebug() << "SubversionPlugin::showOutputInEditor" << title << kind << "Size= " << output.size() << " Type=" << editorType << debugCodec(codec);
|
||||
@@ -1015,13 +1016,13 @@ void SubversionPlugin::setSettings(const SubversionSettings &s)
|
||||
|
||||
Core::ICore *SubversionPlugin::coreInstance()
|
||||
{
|
||||
Q_ASSERT(m_coreInstance);
|
||||
QTC_ASSERT(m_coreInstance, return 0);
|
||||
return m_coreInstance;
|
||||
}
|
||||
|
||||
SubversionPlugin *SubversionPlugin::subversionPluginInstance()
|
||||
{
|
||||
Q_ASSERT(m_subversionPluginInstance);
|
||||
QTC_ASSERT(m_subversionPluginInstance, m_subversionPluginInstance);
|
||||
return m_subversionPluginInstance;
|
||||
}
|
||||
|
||||
|
@@ -45,8 +45,9 @@
|
||||
|
||||
#ifndef TEXTEDITOR_STANDALONE
|
||||
#include <utils/reloadpromptutils.h>
|
||||
#include "coreplugin/icore.h"
|
||||
#include <coreplugin/icore.h>
|
||||
#endif
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace TextEditor;
|
||||
|
||||
@@ -236,7 +237,7 @@ bool BaseTextDocument::open(const QString &fileName)
|
||||
m_document->setPlainText(text);
|
||||
m_document->setUndoRedoEnabled(true);
|
||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(m_document->documentLayout());
|
||||
Q_ASSERT(documentLayout);
|
||||
QTC_ASSERT(documentLayout, return true);
|
||||
documentLayout->lastSaveRevision = 0;
|
||||
m_document->setModified(false);
|
||||
emit titleChanged(title);
|
||||
@@ -247,7 +248,7 @@ bool BaseTextDocument::open(const QString &fileName)
|
||||
|
||||
void BaseTextDocument::reload(QTextCodec *codec)
|
||||
{
|
||||
Q_ASSERT(codec);
|
||||
QTC_ASSERT(codec, return);
|
||||
m_codec = codec;
|
||||
reload();
|
||||
}
|
||||
@@ -255,9 +256,8 @@ void BaseTextDocument::reload(QTextCodec *codec)
|
||||
void BaseTextDocument::reload()
|
||||
{
|
||||
emit aboutToReload();
|
||||
if (open(m_fileName)) {
|
||||
if (open(m_fileName))
|
||||
emit reloaded();
|
||||
}
|
||||
}
|
||||
|
||||
void BaseTextDocument::modified(Core::IFile::ReloadBehavior *behavior)
|
||||
|
@@ -53,6 +53,7 @@
|
||||
#include <aggregation/aggregate.h>
|
||||
#endif
|
||||
#include <utils/linecolumnlabel.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QTextCodec>
|
||||
@@ -415,10 +416,10 @@ UserCanceled:
|
||||
|
||||
bool DocumentMarker::addMark(TextEditor::ITextMark *mark, int line)
|
||||
{
|
||||
Q_ASSERT(line >= 1);
|
||||
QTC_ASSERT(line >= 1, return false);
|
||||
int blockNumber = line - 1;
|
||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(document->documentLayout());
|
||||
Q_ASSERT(documentLayout);
|
||||
QTC_ASSERT(documentLayout, return false);
|
||||
QTextBlock block = document->findBlockByNumber(blockNumber);
|
||||
|
||||
if (block.isValid()) {
|
||||
@@ -436,7 +437,7 @@ bool DocumentMarker::addMark(TextEditor::ITextMark *mark, int line)
|
||||
|
||||
TextEditor::TextMarks DocumentMarker::marksAt(int line) const
|
||||
{
|
||||
Q_ASSERT(line >= 1);
|
||||
QTC_ASSERT(line >= 1, return TextMarks());
|
||||
int blockNumber = line - 1;
|
||||
QTextBlock block = document->findBlockByNumber(blockNumber);
|
||||
|
||||
@@ -531,9 +532,9 @@ void BaseTextEditor::selectEncoding()
|
||||
|
||||
void DocumentMarker::updateMark(ITextMark *mark)
|
||||
{
|
||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(document->documentLayout());
|
||||
Q_ASSERT(documentLayout);
|
||||
Q_UNUSED(mark);
|
||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(document->documentLayout());
|
||||
QTC_ASSERT(documentLayout, return);
|
||||
documentLayout->requestUpdate();
|
||||
}
|
||||
|
||||
@@ -857,7 +858,7 @@ void BaseTextEditor::keyPressEvent(QKeyEvent *e)
|
||||
}
|
||||
#if 0
|
||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(document()->documentLayout());
|
||||
Q_ASSERT(documentLayout);
|
||||
QTC_ASSERT(documentLayout, return);
|
||||
documentLayout->requestUpdate(); // a bit drastic
|
||||
e->accept();
|
||||
#endif
|
||||
@@ -1628,7 +1629,7 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
|
||||
QPainter painter(viewport());
|
||||
QTextDocument *doc = document();
|
||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout());
|
||||
Q_ASSERT(documentLayout);
|
||||
QTC_ASSERT(documentLayout, return);
|
||||
|
||||
QPointF offset(contentOffset());
|
||||
|
||||
@@ -2055,7 +2056,7 @@ void BaseTextEditor::slotModificationChanged(bool m)
|
||||
|
||||
QTextDocument *doc = document();
|
||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout());
|
||||
Q_ASSERT(documentLayout);
|
||||
QTC_ASSERT(documentLayout, return);
|
||||
int oldLastSaveRevision = documentLayout->lastSaveRevision;
|
||||
documentLayout->lastSaveRevision = doc->revision();
|
||||
|
||||
@@ -2113,7 +2114,7 @@ void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e)
|
||||
{
|
||||
QTextDocument *doc = document();
|
||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout());
|
||||
Q_ASSERT(documentLayout);
|
||||
QTC_ASSERT(documentLayout, return);
|
||||
|
||||
QPalette pal = d->m_extraArea->palette();
|
||||
pal.setCurrentColorGroup(QPalette::Active);
|
||||
@@ -2612,7 +2613,7 @@ void BaseTextEditor::ensureCursorVisible()
|
||||
void BaseTextEditor::toggleBlockVisible(const QTextBlock &block)
|
||||
{
|
||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(document()->documentLayout());
|
||||
Q_ASSERT(documentLayout);
|
||||
QTC_ASSERT(documentLayout, return);
|
||||
|
||||
bool visible = block.next().isVisible();
|
||||
TextBlockUserData::doCollapse(block, !visible);
|
||||
@@ -2711,7 +2712,7 @@ void BaseTextEditor::handleHomeKey(bool anchor)
|
||||
void BaseTextEditor::handleBackspaceKey()
|
||||
{
|
||||
QTextCursor cursor = textCursor();
|
||||
Q_ASSERT(!cursor.hasSelection());
|
||||
QTC_ASSERT(!cursor.hasSelection(), return);
|
||||
|
||||
const TextEditor::TabSettings &tabSettings = d->m_document->tabSettings();
|
||||
QTextBlock currentBlock = cursor.block();
|
||||
@@ -3271,7 +3272,7 @@ void BaseTextEditor::setIfdefedOutBlocks(const QList<BaseTextEditor::BlockRange>
|
||||
{
|
||||
QTextDocument *doc = document();
|
||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout());
|
||||
Q_ASSERT(documentLayout);
|
||||
QTC_ASSERT(documentLayout, return);
|
||||
|
||||
bool needUpdate = false;
|
||||
|
||||
@@ -3316,7 +3317,7 @@ void BaseTextEditor::collapse()
|
||||
{
|
||||
QTextDocument *doc = document();
|
||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout());
|
||||
Q_ASSERT(documentLayout);
|
||||
QTC_ASSERT(documentLayout, return);
|
||||
QTextBlock block = textCursor().block();
|
||||
qDebug() << "collapse at block" << block.blockNumber();
|
||||
while (block.isValid()) {
|
||||
@@ -3340,7 +3341,7 @@ void BaseTextEditor::expand()
|
||||
{
|
||||
QTextDocument *doc = document();
|
||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout());
|
||||
Q_ASSERT(documentLayout);
|
||||
QTC_ASSERT(documentLayout, return);
|
||||
QTextBlock block = textCursor().block();
|
||||
while (block.isValid() && !block.isVisible())
|
||||
block = block.previous();
|
||||
@@ -3354,7 +3355,7 @@ void BaseTextEditor::unCollapseAll()
|
||||
{
|
||||
QTextDocument *doc = document();
|
||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout());
|
||||
Q_ASSERT(documentLayout);
|
||||
QTC_ASSERT(documentLayout, return);
|
||||
|
||||
QTextBlock block = doc->firstBlock();
|
||||
bool makeVisible = true;
|
||||
|
@@ -37,6 +37,7 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <texteditor/itexteditable.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QString>
|
||||
#include <QList>
|
||||
@@ -103,7 +104,7 @@ void CompletionSupport::autoComplete(ITextEditable *editor, bool forced)
|
||||
m_startPosition = m_completionCollector->startCompletion(editor);
|
||||
completionItems = getCompletions();
|
||||
|
||||
Q_ASSERT(m_startPosition != -1 || completionItems.size() == 0);
|
||||
QTC_ASSERT(m_startPosition != -1 || completionItems.size() == 0, return);
|
||||
|
||||
if (completionItems.isEmpty()) {
|
||||
cleanupCompletions();
|
||||
|
@@ -36,6 +36,7 @@
|
||||
#include "icompletioncollector.h"
|
||||
|
||||
#include <texteditor/itexteditable.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QEvent>
|
||||
#include <QtGui/QKeyEvent>
|
||||
@@ -107,7 +108,7 @@ CompletionWidget::CompletionWidget(CompletionSupport *support, ITextEditable *ed
|
||||
m_model(0),
|
||||
m_support(support)
|
||||
{
|
||||
Q_ASSERT(m_editorWidget);
|
||||
QTC_ASSERT(m_editorWidget, return);
|
||||
|
||||
setUniformItemSizes(true);
|
||||
setSelectionBehavior(QAbstractItemView::SelectItems);
|
||||
|
@@ -34,6 +34,8 @@
|
||||
#include "fontsettings.h"
|
||||
#include "fontsettingspage.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtGui/QTextCharFormat>
|
||||
|
||||
@@ -133,11 +135,13 @@ bool Format::equals(const Format &f) const
|
||||
return m_foreground == f.m_foreground && m_background == f.m_background &&
|
||||
m_bold == f.m_bold && m_italic == f.m_italic;
|
||||
}
|
||||
|
||||
// -- FontSettings
|
||||
FontSettings::FontSettings(const FormatDescriptions & /* fd */) :
|
||||
FontSettings::FontSettings(const FormatDescriptions &fd) :
|
||||
m_family(defaultFixedFontFamily()),
|
||||
m_fontSize(DEFAULT_FONT_SIZE)
|
||||
{
|
||||
Q_UNUSED(fd);
|
||||
}
|
||||
|
||||
void FontSettings::clear()
|
||||
@@ -152,7 +156,7 @@ void FontSettings::toSettings(const QString &category,
|
||||
QSettings *s) const
|
||||
{
|
||||
const int numFormats = m_formats.size();
|
||||
Q_ASSERT(descriptions.size() == numFormats);
|
||||
QTC_ASSERT(descriptions.size() == numFormats, /**/);
|
||||
s->beginGroup(category);
|
||||
if (m_family != defaultFixedFontFamily() || s->contains(QLatin1String(fontFamilyKey)))
|
||||
s->setValue(QLatin1String(fontFamilyKey), m_family);
|
||||
|
@@ -42,6 +42,7 @@
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <coreplugin/actionmanager/actionmanagerinterface.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/QtDebug>
|
||||
@@ -355,7 +356,7 @@ void TextEditorActionHandler::selectAllAction()
|
||||
void TextEditorActionHandler::gotoAction()
|
||||
{
|
||||
QuickOpen::QuickOpenManager *quickopen = QuickOpen::QuickOpenManager::instance();
|
||||
Q_ASSERT(quickopen);
|
||||
QTC_ASSERT(quickopen, return);
|
||||
QString shortcut = TextEditorPlugin::instance()->lineNumberFilter()->shortcutString();
|
||||
quickopen->show(shortcut + " <line number>", 2, 13);
|
||||
}
|
||||
|
@@ -50,6 +50,7 @@
|
||||
#include <coreplugin/actionmanager/icommand.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <texteditor/texteditoractionhandler.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/qplugin.h>
|
||||
#include <QtGui/QShortcut>
|
||||
@@ -67,7 +68,7 @@ TextEditorPlugin::TextEditorPlugin() :
|
||||
m_editorFactory(0),
|
||||
m_lineNumberFilter(0)
|
||||
{
|
||||
Q_ASSERT(!m_instance);
|
||||
QTC_ASSERT(!m_instance, return);
|
||||
m_instance = this;
|
||||
}
|
||||
|
||||
|
@@ -41,6 +41,8 @@
|
||||
#include "texteditorconstants.h"
|
||||
#include "texteditorplugin.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
using namespace TextEditor;
|
||||
@@ -52,7 +54,7 @@ TextEditorSettings::TextEditorSettings(Internal::TextEditorPlugin *plugin,
|
||||
QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
Q_ASSERT(!m_instance);
|
||||
QTC_ASSERT(!m_instance, return);
|
||||
m_instance = this;
|
||||
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
|
@@ -33,6 +33,8 @@
|
||||
|
||||
#include "diffhighlighter.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QtAlgorithms>
|
||||
#include <QtCore/QRegExp>
|
||||
@@ -67,7 +69,7 @@ DiffHighlighterPrivate::DiffHighlighterPrivate(const QRegExp &filePattern) :
|
||||
m_diffInIndicator(QLatin1Char('+')),
|
||||
m_diffOutIndicator(QLatin1Char('-'))
|
||||
{
|
||||
Q_ASSERT(filePattern.isValid());
|
||||
QTC_ASSERT(filePattern.isValid(), /**/);
|
||||
}
|
||||
|
||||
DiffFormats DiffHighlighterPrivate::analyzeLine(const QString &text) const
|
||||
|
@@ -108,7 +108,6 @@ void MakeProcess::handleOutput()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MakeProcess::handleMakeLine(const QString &line)
|
||||
{
|
||||
int pos1 = line.indexOf('`');
|
||||
|
@@ -31,17 +31,17 @@
|
||||
**
|
||||
***************************************************************************/
|
||||
|
||||
#include <QFile>
|
||||
#include <AST.h>
|
||||
#include <Control.h>
|
||||
#include <Scope.h>
|
||||
#include <Semantic.h>
|
||||
#include <TranslationUnit.h>
|
||||
|
||||
#include <QtCore/QFile>
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
||||
#include <TranslationUnit.h>
|
||||
#include <Control.h>
|
||||
#include <AST.h>
|
||||
#include <Semantic.h>
|
||||
#include <Scope.h>
|
||||
|
||||
int main(int, char *[])
|
||||
{
|
||||
Control control;
|
||||
|
Reference in New Issue
Block a user