forked from qt-creator/qt-creator
Add whitespace after control keywords
find -name \*.cpp -o -name \*.h | \ xargs sed -Ei 's/ (for|foreach|if|switch|while)\(/ \1 (/g' Change-Id: I9efdff4bf0c8c01a52baaaeb75198483c77b0390 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
3747e941ad
commit
a44aa55502
@@ -473,7 +473,7 @@ int main(int argc, char **argv)
|
|||||||
if (app.isRunning(pid)) {
|
if (app.isRunning(pid)) {
|
||||||
// Nah app is still running, ask the user
|
// Nah app is still running, ask the user
|
||||||
int button = askMsgSendFailed();
|
int button = askMsgSendFailed();
|
||||||
while(button == QMessageBox::Retry) {
|
while (button == QMessageBox::Retry) {
|
||||||
if (app.sendMessage(PluginManager::serializedArguments(), 5000 /*timeout*/, pid))
|
if (app.sendMessage(PluginManager::serializedArguments(), 5000 /*timeout*/, pid))
|
||||||
return 0;
|
return 0;
|
||||||
if (!app.isRunning(pid)) // App quit while we were trying so start a new creator
|
if (!app.isRunning(pid)) // App quit while we were trying so start a new creator
|
||||||
|
2
src/libs/3rdparty/cplusplus/Parser.cpp
vendored
2
src/libs/3rdparty/cplusplus/Parser.cpp
vendored
@@ -1216,7 +1216,7 @@ bool Parser::parseCvQualifiers(SpecifierListAST *&node)
|
|||||||
spec->specifier_token = consumeToken();
|
spec->specifier_token = consumeToken();
|
||||||
*ast = new (_pool) SpecifierListAST(spec);
|
*ast = new (_pool) SpecifierListAST(spec);
|
||||||
ast = &(*ast)->next;
|
ast = &(*ast)->next;
|
||||||
} else if(LA() == T___ATTRIBUTE__) {
|
} else if (LA() == T___ATTRIBUTE__) {
|
||||||
parseAttributeSpecifier(*ast);
|
parseAttributeSpecifier(*ast);
|
||||||
ast = &(*ast)->next;
|
ast = &(*ast)->next;
|
||||||
} else {
|
} else {
|
||||||
|
@@ -137,7 +137,7 @@ Icons::IconType Icons::iconTypeForSymbol(const Symbol *symbol)
|
|||||||
|
|
||||||
QIcon Icons::iconForType(IconType type) const
|
QIcon Icons::iconForType(IconType type) const
|
||||||
{
|
{
|
||||||
switch(type) {
|
switch (type) {
|
||||||
case ClassIconType:
|
case ClassIconType:
|
||||||
return _classIcon;
|
return _classIcon;
|
||||||
case EnumIconType:
|
case EnumIconType:
|
||||||
|
@@ -106,7 +106,7 @@ bool OptionsParser::checkForTestOption()
|
|||||||
return false;
|
return false;
|
||||||
if (nextToken(RequiredToken)) {
|
if (nextToken(RequiredToken)) {
|
||||||
if (m_currentArg == QLatin1String("all")) {
|
if (m_currentArg == QLatin1String("all")) {
|
||||||
foreach(PluginSpec *spec, m_pmPrivate->pluginSpecs) {
|
foreach (PluginSpec *spec, m_pmPrivate->pluginSpecs) {
|
||||||
if (spec && !m_pmPrivate->testSpecs.contains(spec))
|
if (spec && !m_pmPrivate->testSpecs.contains(spec))
|
||||||
m_pmPrivate->testSpecs.append(spec);
|
m_pmPrivate->testSpecs.append(spec);
|
||||||
}
|
}
|
||||||
@@ -117,7 +117,7 @@ bool OptionsParser::checkForTestOption()
|
|||||||
*m_errorString = QCoreApplication::translate("PluginManager",
|
*m_errorString = QCoreApplication::translate("PluginManager",
|
||||||
"The plugin '%1' does not exist.").arg(m_currentArg);
|
"The plugin '%1' does not exist.").arg(m_currentArg);
|
||||||
m_hasError = true;
|
m_hasError = true;
|
||||||
} else if(!m_pmPrivate->testSpecs.contains(spec)) {
|
} else if (!m_pmPrivate->testSpecs.contains(spec)) {
|
||||||
m_pmPrivate->testSpecs.append(spec);
|
m_pmPrivate->testSpecs.append(spec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -840,7 +840,7 @@ void PluginManagerPrivate::writeSettings()
|
|||||||
return;
|
return;
|
||||||
QStringList tempDisabledPlugins;
|
QStringList tempDisabledPlugins;
|
||||||
QStringList tempForceEnabledPlugins;
|
QStringList tempForceEnabledPlugins;
|
||||||
foreach(PluginSpec *spec, pluginSpecs) {
|
foreach (PluginSpec *spec, pluginSpecs) {
|
||||||
if (!spec->isDisabledByDefault() && !spec->isEnabled())
|
if (!spec->isDisabledByDefault() && !spec->isEnabled())
|
||||||
tempDisabledPlugins.append(spec->name());
|
tempDisabledPlugins.append(spec->name());
|
||||||
if (spec->isDisabledByDefault() && spec->isEnabled())
|
if (spec->isDisabledByDefault() && spec->isEnabled())
|
||||||
|
@@ -423,7 +423,7 @@ static inline bool parseSciFile(const QString &fileName, QString &pixmapFileName
|
|||||||
data.open(QIODevice::ReadOnly);
|
data.open(QIODevice::ReadOnly);
|
||||||
|
|
||||||
QByteArray raw;
|
QByteArray raw;
|
||||||
while(raw = data.readLine(), !raw.isEmpty()) {
|
while (raw = data.readLine(), !raw.isEmpty()) {
|
||||||
QString line = QString::fromUtf8(raw.trimmed());
|
QString line = QString::fromUtf8(raw.trimmed());
|
||||||
if (line.isEmpty() || line.startsWith(QLatin1Char('#')))
|
if (line.isEmpty() || line.startsWith(QLatin1Char('#')))
|
||||||
continue;
|
continue;
|
||||||
|
@@ -211,7 +211,7 @@ QString QmlError::toString() const
|
|||||||
rv = QLatin1String("<Unknown File>");
|
rv = QLatin1String("<Unknown File>");
|
||||||
} else if (line() != -1) {
|
} else if (line() != -1) {
|
||||||
rv = url().toString() + QLatin1Char(':') + QString::number(line());
|
rv = url().toString() + QLatin1Char(':') + QString::number(line());
|
||||||
if(column() != -1)
|
if (column() != -1)
|
||||||
rv += QLatin1Char(':') + QString::number(column());
|
rv += QLatin1Char(':') + QString::number(column());
|
||||||
} else {
|
} else {
|
||||||
rv = url().toString();
|
rv = url().toString();
|
||||||
@@ -251,7 +251,7 @@ QDebug operator<<(QDebug debug, const QmlError &error)
|
|||||||
const QString &line = lines.at(error.line() - 1);
|
const QString &line = lines.at(error.line() - 1);
|
||||||
debug << "\n " << qPrintable(line);
|
debug << "\n " << qPrintable(line);
|
||||||
|
|
||||||
if(error.column() > 0) {
|
if (error.column() > 0) {
|
||||||
int column = qMax(0, error.column() - 1);
|
int column = qMax(0, error.column() - 1);
|
||||||
column = qMin(column, line.length());
|
column = qMin(column, line.length());
|
||||||
|
|
||||||
|
@@ -99,11 +99,11 @@ static QString label(UiObjectMember *member, Document::Ptr doc)
|
|||||||
|
|
||||||
if (UiObjectDefinition* foo = cast<UiObjectDefinition *>(member)) {
|
if (UiObjectDefinition* foo = cast<UiObjectDefinition *>(member)) {
|
||||||
str = label(foo->qualifiedTypeNameId);
|
str = label(foo->qualifiedTypeNameId);
|
||||||
} else if(UiObjectBinding *foo = cast<UiObjectBinding *>(member)) {
|
} else if (UiObjectBinding *foo = cast<UiObjectBinding *>(member)) {
|
||||||
str = label(foo->qualifiedId) + QLatin1Char(' ') + label(foo->qualifiedTypeNameId);
|
str = label(foo->qualifiedId) + QLatin1Char(' ') + label(foo->qualifiedTypeNameId);
|
||||||
} else if(UiArrayBinding *foo = cast<UiArrayBinding *>(member)) {
|
} else if (UiArrayBinding *foo = cast<UiArrayBinding *>(member)) {
|
||||||
str = label(foo->qualifiedId) + QLatin1String("[]");
|
str = label(foo->qualifiedId) + QLatin1String("[]");
|
||||||
} else if(UiScriptBinding *foo = cast<UiScriptBinding *>(member)) {
|
} else if (UiScriptBinding *foo = cast<UiScriptBinding *>(member)) {
|
||||||
str = label(foo->qualifiedId) + QLatin1Char(':');
|
str = label(foo->qualifiedId) + QLatin1Char(':');
|
||||||
if (foo->statement) {
|
if (foo->statement) {
|
||||||
quint32 start = foo->statement->firstSourceLocation().begin();
|
quint32 start = foo->statement->firstSourceLocation().begin();
|
||||||
@@ -172,7 +172,7 @@ static QList<UiObjectMember *> children(UiObjectMember *ast)
|
|||||||
ret.append(list->member);
|
ret.append(list->member);
|
||||||
list = list->next;
|
list = list->next;
|
||||||
}
|
}
|
||||||
} else if(UiArrayBinding *foo = cast<UiArrayBinding *>(ast)) {
|
} else if (UiArrayBinding *foo = cast<UiArrayBinding *>(ast)) {
|
||||||
UiArrayMemberList* list = foo->members;
|
UiArrayMemberList* list = foo->members;
|
||||||
while (list) {
|
while (list) {
|
||||||
ret.append(list->member);
|
ret.append(list->member);
|
||||||
@@ -189,7 +189,7 @@ static Map buildMapping_helper(UiObjectMember *x, UiObjectMember *y, const Map &
|
|||||||
return M2;
|
return M2;
|
||||||
if (M.way2.contains(y))
|
if (M.way2.contains(y))
|
||||||
return M2;
|
return M2;
|
||||||
if(label(x, doc1) != label(y, doc2))
|
if (label(x, doc1) != label(y, doc2))
|
||||||
return M2;
|
return M2;
|
||||||
M2.insert(x, y);
|
M2.insert(x, y);
|
||||||
QList<UiObjectMember *> list1 = children(x);
|
QList<UiObjectMember *> list1 = children(x);
|
||||||
@@ -222,7 +222,7 @@ static Map buildMapping(Document::Ptr doc1, Document::Ptr doc2)
|
|||||||
Map M;
|
Map M;
|
||||||
QList<UiObjectMember *> todo;
|
QList<UiObjectMember *> todo;
|
||||||
todo.append(doc1->qmlProgram()->members->member);
|
todo.append(doc1->qmlProgram()->members->member);
|
||||||
while(!todo.isEmpty()) {
|
while (!todo.isEmpty()) {
|
||||||
UiObjectMember *x = todo.takeFirst();
|
UiObjectMember *x = todo.takeFirst();
|
||||||
todo += children(x);
|
todo += children(x);
|
||||||
|
|
||||||
@@ -380,7 +380,7 @@ void Delta::insert(UiObjectMember *member, UiObjectMember *parentMember, const Q
|
|||||||
// Also, a relative URL is expected (no "file://" prepending!)
|
// Also, a relative URL is expected (no "file://" prepending!)
|
||||||
QString filename = doc->fileName() + QLatin1Char('_') + QString::number(doc->editorRevision())
|
QString filename = doc->fileName() + QLatin1Char('_') + QString::number(doc->editorRevision())
|
||||||
+ QLatin1Char(':') + QString::number(startLine-importList.count());
|
+ QLatin1Char(':') + QString::number(startLine-importList.count());
|
||||||
foreach(DebugId debugId, debugReferences) {
|
foreach (DebugId debugId, debugReferences) {
|
||||||
if (debugId != -1) {
|
if (debugId != -1) {
|
||||||
int order = 0;
|
int order = 0;
|
||||||
// skip children which are not objects
|
// skip children which are not objects
|
||||||
@@ -492,7 +492,7 @@ Delta::DebugIdMap Delta::operator()(const Document::Ptr &doc1, const Document::P
|
|||||||
QList<UiObjectMember *> todo;
|
QList<UiObjectMember *> todo;
|
||||||
todo.append(doc2->qmlProgram()->members->member);
|
todo.append(doc2->qmlProgram()->members->member);
|
||||||
//UiObjectMemberList *list = 0;
|
//UiObjectMemberList *list = 0;
|
||||||
while(!todo.isEmpty()) {
|
while (!todo.isEmpty()) {
|
||||||
UiObjectMember *y = todo.takeFirst();
|
UiObjectMember *y = todo.takeFirst();
|
||||||
todo += children(y);
|
todo += children(y);
|
||||||
|
|
||||||
@@ -539,7 +539,7 @@ Delta::DebugIdMap Delta::operator()(const Document::Ptr &doc1, const Document::P
|
|||||||
}
|
}
|
||||||
|
|
||||||
todo.append(doc1->qmlProgram()->members->member);
|
todo.append(doc1->qmlProgram()->members->member);
|
||||||
while(!todo.isEmpty()) {
|
while (!todo.isEmpty()) {
|
||||||
UiObjectMember *x = todo.takeFirst();
|
UiObjectMember *x = todo.takeFirst();
|
||||||
todo += children(x);
|
todo += children(x);
|
||||||
if (!cast<UiObjectDefinition *>(x))
|
if (!cast<UiObjectDefinition *>(x))
|
||||||
|
@@ -47,7 +47,7 @@ public:
|
|||||||
|
|
||||||
void updateSorting() {
|
void updateSorting() {
|
||||||
QDir::SortFlags flags = 0;
|
QDir::SortFlags flags = 0;
|
||||||
switch(sortField) {
|
switch (sortField) {
|
||||||
case QDeclarativeFolderListModel::Unsorted:
|
case QDeclarativeFolderListModel::Unsorted:
|
||||||
flags |= QDir::Unsorted;
|
flags |= QDir::Unsorted;
|
||||||
break;
|
break;
|
||||||
|
@@ -56,11 +56,11 @@ QWheelArea::QWheelArea(QDeclarativeItem *parent)
|
|||||||
QWheelArea::~QWheelArea() {}
|
QWheelArea::~QWheelArea() {}
|
||||||
|
|
||||||
bool QWheelArea::event (QEvent * e) {
|
bool QWheelArea::event (QEvent * e) {
|
||||||
switch(e->type()) {
|
switch (e->type()) {
|
||||||
case QEvent::GraphicsSceneWheel: {
|
case QEvent::GraphicsSceneWheel: {
|
||||||
QGraphicsSceneWheelEvent *we = static_cast<QGraphicsSceneWheelEvent*>(e);
|
QGraphicsSceneWheelEvent *we = static_cast<QGraphicsSceneWheelEvent*>(e);
|
||||||
if(we) {
|
if (we) {
|
||||||
switch(we->orientation()) {
|
switch (we->orientation()) {
|
||||||
case Qt::Horizontal:
|
case Qt::Horizontal:
|
||||||
setHorizontalDelta(we->delta());
|
setHorizontalDelta(we->delta());
|
||||||
break;
|
break;
|
||||||
@@ -72,8 +72,8 @@ bool QWheelArea::event (QEvent * e) {
|
|||||||
}
|
}
|
||||||
case QEvent::Wheel: {
|
case QEvent::Wheel: {
|
||||||
QWheelEvent *we = static_cast<QWheelEvent*>(e);
|
QWheelEvent *we = static_cast<QWheelEvent*>(e);
|
||||||
if(we) {
|
if (we) {
|
||||||
switch(we->orientation()) {
|
switch (we->orientation()) {
|
||||||
case Qt::Horizontal:
|
case Qt::Horizontal:
|
||||||
setHorizontalDelta(we->delta());
|
setHorizontalDelta(we->delta());
|
||||||
|
|
||||||
|
@@ -41,7 +41,7 @@ namespace {
|
|||||||
QByteArray listAsByteArray(const QList<QByteArray> &list)
|
QByteArray listAsByteArray(const QList<QByteArray> &list)
|
||||||
{
|
{
|
||||||
QByteArray array;
|
QByteArray array;
|
||||||
foreach(const QByteArray &elem, list)
|
foreach (const QByteArray &elem, list)
|
||||||
array += elem + ',';
|
array += elem + ',';
|
||||||
if (!array.isEmpty())
|
if (!array.isEmpty())
|
||||||
array.remove(array.count() - 1, 1);
|
array.remove(array.count() - 1, 1);
|
||||||
|
@@ -299,7 +299,7 @@ bool BuildableHelperLibrary::getHelperFileInfoFor(const QStringList &validBinary
|
|||||||
if (!info)
|
if (!info)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
foreach(const QString &binaryFilename, validBinaryFilenames) {
|
foreach (const QString &binaryFilename, validBinaryFilenames) {
|
||||||
info->setFile(directory + binaryFilename);
|
info->setFile(directory + binaryFilename);
|
||||||
if (info->exists())
|
if (info->exists())
|
||||||
return true;
|
return true;
|
||||||
@@ -335,7 +335,7 @@ QString BuildableHelperLibrary::byInstallDataHelper(const QString &sourcePath,
|
|||||||
QString newestHelper;
|
QString newestHelper;
|
||||||
QDateTime newestHelperModified = sourcesModified; // prevent using one that's older than the sources
|
QDateTime newestHelperModified = sourcesModified; // prevent using one that's older than the sources
|
||||||
QFileInfo fileInfo;
|
QFileInfo fileInfo;
|
||||||
foreach(const QString &installDirectory, installDirectories) {
|
foreach (const QString &installDirectory, installDirectories) {
|
||||||
if (getHelperFileInfoFor(validBinaryFilenames, installDirectory, &fileInfo)) {
|
if (getHelperFileInfoFor(validBinaryFilenames, installDirectory, &fileInfo)) {
|
||||||
if (!newestHelperModified.isValid()
|
if (!newestHelperModified.isValid()
|
||||||
|| (fileInfo.lastModified() > newestHelperModified)) {
|
|| (fileInfo.lastModified() > newestHelperModified)) {
|
||||||
|
@@ -90,7 +90,7 @@ QSize DetailsButton::sizeHint() const
|
|||||||
|
|
||||||
bool DetailsButton::event(QEvent *e)
|
bool DetailsButton::event(QEvent *e)
|
||||||
{
|
{
|
||||||
switch(e->type()) {
|
switch (e->type()) {
|
||||||
case QEvent::Enter:
|
case QEvent::Enter:
|
||||||
{
|
{
|
||||||
QPropertyAnimation *animation = new QPropertyAnimation(this, "fader");
|
QPropertyAnimation *animation = new QPropertyAnimation(this, "fader");
|
||||||
@@ -164,7 +164,7 @@ QPixmap DetailsButton::cacheRendering(const QSize &size, bool checked)
|
|||||||
p.drawRoundedRect(1, 1, size.width()-3, size.height()-3, 1, 1);
|
p.drawRoundedRect(1, 1, size.width()-3, size.height()-3, 1, 1);
|
||||||
p.setPen(QPen(QColor(0, 0, 0, 40)));
|
p.setPen(QPen(QColor(0, 0, 0, 40)));
|
||||||
p.drawLine(0, 1, 0, size.height() - 2);
|
p.drawLine(0, 1, 0, size.height() - 2);
|
||||||
if(checked)
|
if (checked)
|
||||||
p.drawLine(1, size.height() - 1, size.width() - 1, size.height() - 1);
|
p.drawLine(1, size.height() - 1, size.width() - 1, size.height() - 1);
|
||||||
|
|
||||||
p.setPen(palette().color(QPalette::Text));
|
p.setPen(palette().color(QPalette::Text));
|
||||||
|
@@ -427,7 +427,7 @@ bool SubDirFileIterator::hasNext() const
|
|||||||
{
|
{
|
||||||
if (!m_currentFiles.isEmpty())
|
if (!m_currentFiles.isEmpty())
|
||||||
return true;
|
return true;
|
||||||
while(!m_dirs.isEmpty() && m_currentFiles.isEmpty()) {
|
while (!m_dirs.isEmpty() && m_currentFiles.isEmpty()) {
|
||||||
QDir dir = m_dirs.pop();
|
QDir dir = m_dirs.pop();
|
||||||
const qreal dirProgressMax = m_progressValues.pop();
|
const qreal dirProgressMax = m_progressValues.pop();
|
||||||
const bool processed = m_processedValues.pop();
|
const bool processed = m_processedValues.pop();
|
||||||
|
@@ -332,7 +332,7 @@ QString SubmitEditorWidget::descriptionText() const
|
|||||||
QString rc = trimMessageText(lineWrap() ? wrappedText(d->m_ui.description) :
|
QString rc = trimMessageText(lineWrap() ? wrappedText(d->m_ui.description) :
|
||||||
d->m_ui.description->toPlainText());
|
d->m_ui.description->toPlainText());
|
||||||
// append field entries
|
// append field entries
|
||||||
foreach(const SubmitFieldWidget *fw, d->m_fieldWidgets)
|
foreach (const SubmitFieldWidget *fw, d->m_fieldWidgets)
|
||||||
rc += fw->fieldValues();
|
rc += fw->fieldValues();
|
||||||
return cleanupDescription(rc);
|
return cleanupDescription(rc);
|
||||||
}
|
}
|
||||||
|
@@ -227,7 +227,7 @@ void SubmitFieldWidget::setHasBrowseButton(bool on)
|
|||||||
if (d->hasBrowseButton == on)
|
if (d->hasBrowseButton == on)
|
||||||
return;
|
return;
|
||||||
d->hasBrowseButton = on;
|
d->hasBrowseButton = on;
|
||||||
foreach(const FieldEntry &fe, d->fieldEntries)
|
foreach (const FieldEntry &fe, d->fieldEntries)
|
||||||
fe.browseButton->setVisible(on);
|
fe.browseButton->setVisible(on);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,7 +251,7 @@ void SubmitFieldWidget::setCompleter(QCompleter *c)
|
|||||||
if (c == d->completer)
|
if (c == d->completer)
|
||||||
return;
|
return;
|
||||||
d->completer = c;
|
d->completer = c;
|
||||||
foreach(const FieldEntry &fe, d->fieldEntries)
|
foreach (const FieldEntry &fe, d->fieldEntries)
|
||||||
fe.lineEdit->setCompleter(c);
|
fe.lineEdit->setCompleter(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -271,7 +271,7 @@ QString SubmitFieldWidget::fieldValues() const
|
|||||||
const QChar newLine = QLatin1Char('\n');
|
const QChar newLine = QLatin1Char('\n');
|
||||||
// Format as "RevBy: value\nSigned-Off: value\n"
|
// Format as "RevBy: value\nSigned-Off: value\n"
|
||||||
QString rc;
|
QString rc;
|
||||||
foreach(const FieldEntry &fe, d->fieldEntries) {
|
foreach (const FieldEntry &fe, d->fieldEntries) {
|
||||||
const QString value = fe.lineEdit->text().trimmed();
|
const QString value = fe.lineEdit->text().trimmed();
|
||||||
if (!value.isEmpty()) {
|
if (!value.isEmpty()) {
|
||||||
rc += fe.combo->currentText();
|
rc += fe.combo->currentText();
|
||||||
|
@@ -258,7 +258,7 @@ void Utils::unCommentSelection(QPlainTextEdit *edit, const CommentDefinition &de
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
QString text = block.text();
|
QString text = block.text();
|
||||||
foreach(QChar c, text) {
|
foreach (QChar c, text) {
|
||||||
if (!c.isSpace()) {
|
if (!c.isSpace()) {
|
||||||
if (definition.isAfterWhiteSpaces())
|
if (definition.isAfterWhiteSpaces())
|
||||||
cursor.setPosition(block.position() + text.indexOf(c));
|
cursor.setPosition(block.position() + text.indexOf(c));
|
||||||
|
@@ -124,7 +124,7 @@ void BazaarClient::view(const QString &source, const QString &id, const QStringL
|
|||||||
|
|
||||||
QString BazaarClient::vcsEditorKind(VcsCommand cmd) const
|
QString BazaarClient::vcsEditorKind(VcsCommand cmd) const
|
||||||
{
|
{
|
||||||
switch(cmd) {
|
switch (cmd) {
|
||||||
case AnnotateCommand:
|
case AnnotateCommand:
|
||||||
return QLatin1String(Constants::ANNOTATELOG);
|
return QLatin1String(Constants::ANNOTATELOG);
|
||||||
case DiffCommand:
|
case DiffCommand:
|
||||||
|
@@ -188,7 +188,7 @@ ParserTreeItem::ConstPtr Parser::findItemByRoot(const QStandardItem *item, bool
|
|||||||
// go item by item to the root
|
// go item by item to the root
|
||||||
QList<const QStandardItem *> uiList;
|
QList<const QStandardItem *> uiList;
|
||||||
const QStandardItem *cur = item;
|
const QStandardItem *cur = item;
|
||||||
while(cur) {
|
while (cur) {
|
||||||
uiList.append(cur);
|
uiList.append(cur);
|
||||||
cur = cur->parent();
|
cur = cur->parent();
|
||||||
}
|
}
|
||||||
@@ -201,7 +201,7 @@ ParserTreeItem::ConstPtr Parser::findItemByRoot(const QStandardItem *item, bool
|
|||||||
// using internal root - search correct item
|
// using internal root - search correct item
|
||||||
ParserTreeItem::ConstPtr internal = d->rootItem;
|
ParserTreeItem::ConstPtr internal = d->rootItem;
|
||||||
|
|
||||||
while(uiList.count() > 0) {
|
while (uiList.count() > 0) {
|
||||||
cur = uiList.last();
|
cur = uiList.last();
|
||||||
uiList.removeLast();
|
uiList.removeLast();
|
||||||
const SymbolInformation &inf = Utils::symbolInformationFromItem(cur);
|
const SymbolInformation &inf = Utils::symbolInformationFromItem(cur);
|
||||||
@@ -223,7 +223,7 @@ ParserTreeItem::ConstPtr Parser::parse()
|
|||||||
|
|
||||||
// check all projects
|
// check all projects
|
||||||
QList<ProjectExplorer::Project *> projects = getProjectList();
|
QList<ProjectExplorer::Project *> projects = getProjectList();
|
||||||
foreach(const ProjectExplorer::Project *prj, projects) {
|
foreach (const ProjectExplorer::Project *prj, projects) {
|
||||||
if (!prj)
|
if (!prj)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -355,7 +355,7 @@ ParserTreeItem::Ptr Parser::createFlatTree(const QStringList &projectList)
|
|||||||
QReadLocker locker(&d->prjLocker);
|
QReadLocker locker(&d->prjLocker);
|
||||||
|
|
||||||
ParserTreeItem::Ptr item(new ParserTreeItem());
|
ParserTreeItem::Ptr item(new ParserTreeItem());
|
||||||
foreach(const QString &project, projectList) {
|
foreach (const QString &project, projectList) {
|
||||||
if (!d->cachedPrjTrees.contains(project))
|
if (!d->cachedPrjTrees.contains(project))
|
||||||
continue;
|
continue;
|
||||||
ParserTreeItem::ConstPtr list = d->cachedPrjTrees[project];
|
ParserTreeItem::ConstPtr list = d->cachedPrjTrees[project];
|
||||||
@@ -371,7 +371,7 @@ ParserTreeItem::Ptr Parser::getParseProjectTree(const QStringList &fileList,
|
|||||||
//! changed files only (old edition), and add curent editions
|
//! changed files only (old edition), and add curent editions
|
||||||
ParserTreeItem::Ptr item(new ParserTreeItem());
|
ParserTreeItem::Ptr item(new ParserTreeItem());
|
||||||
unsigned revision = 0;
|
unsigned revision = 0;
|
||||||
foreach(const QString &file, fileList) {
|
foreach (const QString &file, fileList) {
|
||||||
// ? locker for document?..
|
// ? locker for document?..
|
||||||
const CPlusPlus::Document::Ptr &doc = d->document(file);
|
const CPlusPlus::Document::Ptr &doc = d->document(file);
|
||||||
if (doc.isNull())
|
if (doc.isNull())
|
||||||
@@ -406,7 +406,7 @@ ParserTreeItem::Ptr Parser::getCachedOrParseProjectTree(const QStringList &fileL
|
|||||||
if (!projectId.isEmpty() && d->cachedPrjTrees.contains(projectId)) {
|
if (!projectId.isEmpty() && d->cachedPrjTrees.contains(projectId)) {
|
||||||
// calculate project's revision
|
// calculate project's revision
|
||||||
unsigned revision = 0;
|
unsigned revision = 0;
|
||||||
foreach(const QString &file, fileList) {
|
foreach (const QString &file, fileList) {
|
||||||
const CPlusPlus::Document::Ptr &doc = d->document(file);
|
const CPlusPlus::Document::Ptr &doc = d->document(file);
|
||||||
if (doc.isNull())
|
if (doc.isNull())
|
||||||
continue;
|
continue;
|
||||||
@@ -610,14 +610,14 @@ QStringList Parser::projectNodeFileList(const ProjectExplorer::FolderNode *node)
|
|||||||
QList<ProjectExplorer::FileNode *> fileNodes = node->fileNodes();
|
QList<ProjectExplorer::FileNode *> fileNodes = node->fileNodes();
|
||||||
QList<ProjectExplorer::FolderNode *> subFolderNodes = node->subFolderNodes();
|
QList<ProjectExplorer::FolderNode *> subFolderNodes = node->subFolderNodes();
|
||||||
|
|
||||||
foreach(const ProjectExplorer::FileNode *file, fileNodes) {
|
foreach (const ProjectExplorer::FileNode *file, fileNodes) {
|
||||||
if (file->isGenerated())
|
if (file->isGenerated())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
list << file->path();
|
list << file->path();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(const ProjectExplorer::FolderNode *folder, subFolderNodes) {
|
foreach (const ProjectExplorer::FolderNode *folder, subFolderNodes) {
|
||||||
if (folder->nodeType() != ProjectExplorer::FolderNodeType
|
if (folder->nodeType() != ProjectExplorer::FolderNodeType
|
||||||
&& folder->nodeType() != ProjectExplorer::VirtualFolderNodeType)
|
&& folder->nodeType() != ProjectExplorer::VirtualFolderNodeType)
|
||||||
continue;
|
continue;
|
||||||
@@ -654,7 +654,7 @@ QStringList Parser::addProjectNode(const ParserTreeItem::Ptr &item,
|
|||||||
// subnodes
|
// subnodes
|
||||||
QList<ProjectExplorer::ProjectNode *> projectNodes = node->subProjectNodes();
|
QList<ProjectExplorer::ProjectNode *> projectNodes = node->subProjectNodes();
|
||||||
|
|
||||||
foreach(const ProjectExplorer::ProjectNode *project, projectNodes) {
|
foreach (const ProjectExplorer::ProjectNode *project, projectNodes) {
|
||||||
ParserTreeItem::Ptr itemPrj(new ParserTreeItem());
|
ParserTreeItem::Ptr itemPrj(new ParserTreeItem());
|
||||||
SymbolInformation information(project->displayName(), project->path());
|
SymbolInformation information(project->displayName(), project->path());
|
||||||
|
|
||||||
|
@@ -198,7 +198,7 @@ void ParserTreeItem::add(const ParserTreeItem::ConstPtr &target)
|
|||||||
target->d->symbolInformations.constBegin();
|
target->d->symbolInformations.constBegin();
|
||||||
QHash<SymbolInformation, ParserTreeItem::Ptr>::const_iterator end =
|
QHash<SymbolInformation, ParserTreeItem::Ptr>::const_iterator end =
|
||||||
target->d->symbolInformations.constEnd();
|
target->d->symbolInformations.constEnd();
|
||||||
while(cur != end) {
|
while (cur != end) {
|
||||||
const SymbolInformation &inf = cur.key();
|
const SymbolInformation &inf = cur.key();
|
||||||
const ParserTreeItem::Ptr &targetChild = cur.value();
|
const ParserTreeItem::Ptr &targetChild = cur.value();
|
||||||
if (d->symbolInformations.contains(inf)) {
|
if (d->symbolInformations.contains(inf)) {
|
||||||
@@ -231,7 +231,7 @@ void ParserTreeItem::subtract(const ParserTreeItem::ConstPtr &target)
|
|||||||
target->d->symbolInformations.constBegin();
|
target->d->symbolInformations.constBegin();
|
||||||
QHash<SymbolInformation, ParserTreeItem::Ptr>::const_iterator end =
|
QHash<SymbolInformation, ParserTreeItem::Ptr>::const_iterator end =
|
||||||
target->d->symbolInformations.constEnd();
|
target->d->symbolInformations.constEnd();
|
||||||
while(cur != end) {
|
while (cur != end) {
|
||||||
const SymbolInformation &inf = cur.key();
|
const SymbolInformation &inf = cur.key();
|
||||||
if (d->symbolInformations.contains(inf)) {
|
if (d->symbolInformations.contains(inf)) {
|
||||||
// this item has the same child node
|
// this item has the same child node
|
||||||
@@ -258,7 +258,7 @@ void ParserTreeItem::convertTo(QStandardItem *item, bool recursive) const
|
|||||||
d->symbolInformations.constBegin();
|
d->symbolInformations.constBegin();
|
||||||
QHash<SymbolInformation, ParserTreeItem::Ptr>::const_iterator endHash =
|
QHash<SymbolInformation, ParserTreeItem::Ptr>::const_iterator endHash =
|
||||||
d->symbolInformations.constEnd();
|
d->symbolInformations.constEnd();
|
||||||
while(curHash != endHash) {
|
while (curHash != endHash) {
|
||||||
map.insert(curHash.key(), curHash.value());
|
map.insert(curHash.key(), curHash.value());
|
||||||
++curHash;
|
++curHash;
|
||||||
}
|
}
|
||||||
@@ -266,7 +266,7 @@ void ParserTreeItem::convertTo(QStandardItem *item, bool recursive) const
|
|||||||
// add to item
|
// add to item
|
||||||
QMap<SymbolInformation, ParserTreeItem::Ptr>::const_iterator cur = map.constBegin();
|
QMap<SymbolInformation, ParserTreeItem::Ptr>::const_iterator cur = map.constBegin();
|
||||||
QMap<SymbolInformation, ParserTreeItem::Ptr>::const_iterator end = map.constEnd();
|
QMap<SymbolInformation, ParserTreeItem::Ptr>::const_iterator end = map.constEnd();
|
||||||
while(cur != end) {
|
while (cur != end) {
|
||||||
const SymbolInformation &inf = cur.key();
|
const SymbolInformation &inf = cur.key();
|
||||||
ParserTreeItem::Ptr ptr = cur.value();
|
ParserTreeItem::Ptr ptr = cur.value();
|
||||||
|
|
||||||
@@ -310,7 +310,7 @@ bool ParserTreeItem::canFetchMore(QStandardItem *item) const
|
|||||||
d->symbolInformations.constBegin();
|
d->symbolInformations.constBegin();
|
||||||
QHash<SymbolInformation, ParserTreeItem::Ptr>::const_iterator endHash =
|
QHash<SymbolInformation, ParserTreeItem::Ptr>::const_iterator endHash =
|
||||||
d->symbolInformations.constEnd();
|
d->symbolInformations.constEnd();
|
||||||
while(curHash != endHash) {
|
while (curHash != endHash) {
|
||||||
const ParserTreeItem::Ptr &child = curHash.value();
|
const ParserTreeItem::Ptr &child = curHash.value();
|
||||||
if (!child.isNull()) {
|
if (!child.isNull()) {
|
||||||
internalChildren += child->childCount();
|
internalChildren += child->childCount();
|
||||||
@@ -321,7 +321,7 @@ bool ParserTreeItem::canFetchMore(QStandardItem *item) const
|
|||||||
++curHash;
|
++curHash;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(storedChildren < internalChildren)
|
if (storedChildren < internalChildren)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -359,7 +359,7 @@ void ParserTreeItem::debugDump(int ident) const
|
|||||||
d->symbolInformations.constBegin();
|
d->symbolInformations.constBegin();
|
||||||
QHash<SymbolInformation, ParserTreeItem::Ptr>::const_iterator endHash =
|
QHash<SymbolInformation, ParserTreeItem::Ptr>::const_iterator endHash =
|
||||||
d->symbolInformations.constEnd();
|
d->symbolInformations.constEnd();
|
||||||
while(curHash != endHash) {
|
while (curHash != endHash) {
|
||||||
const SymbolInformation &inf = curHash.key();
|
const SymbolInformation &inf = curHash.key();
|
||||||
qDebug() << QString(2*ident, QLatin1Char(' ')) << inf.iconType() << inf.name() << inf.type()
|
qDebug() << QString(2*ident, QLatin1Char(' ')) << inf.iconType() << inf.name() << inf.type()
|
||||||
<< curHash.value().isNull();
|
<< curHash.value().isNull();
|
||||||
|
@@ -72,7 +72,7 @@ Utils::Utils()
|
|||||||
QList<QVariant> Utils::locationsToRole(const QSet<SymbolLocation> &locations)
|
QList<QVariant> Utils::locationsToRole(const QSet<SymbolLocation> &locations)
|
||||||
{
|
{
|
||||||
QList<QVariant> locationsVar;
|
QList<QVariant> locationsVar;
|
||||||
foreach(const SymbolLocation &loc, locations)
|
foreach (const SymbolLocation &loc, locations)
|
||||||
locationsVar.append(QVariant::fromValue(loc));
|
locationsVar.append(QVariant::fromValue(loc));
|
||||||
|
|
||||||
return locationsVar;
|
return locationsVar;
|
||||||
@@ -81,7 +81,7 @@ QList<QVariant> Utils::locationsToRole(const QSet<SymbolLocation> &locations)
|
|||||||
QSet<SymbolLocation> Utils::roleToLocations(const QList<QVariant> &locationsVar)
|
QSet<SymbolLocation> Utils::roleToLocations(const QList<QVariant> &locationsVar)
|
||||||
{
|
{
|
||||||
QSet<SymbolLocation> locations;
|
QSet<SymbolLocation> locations;
|
||||||
foreach(const QVariant &loc, locationsVar) {
|
foreach (const QVariant &loc, locationsVar) {
|
||||||
if (loc.canConvert<SymbolLocation>()) {
|
if (loc.canConvert<SymbolLocation>()) {
|
||||||
locations.insert(loc.value<SymbolLocation>());
|
locations.insert(loc.value<SymbolLocation>());
|
||||||
}
|
}
|
||||||
|
@@ -653,7 +653,7 @@ bool BaseFileWizard::postGenerateFiles(const QWizard *, const GeneratedFiles &l,
|
|||||||
|
|
||||||
bool BaseFileWizard::postGenerateOpenEditors(const GeneratedFiles &l, QString *errorMessage)
|
bool BaseFileWizard::postGenerateOpenEditors(const GeneratedFiles &l, QString *errorMessage)
|
||||||
{
|
{
|
||||||
foreach(const Core::GeneratedFile &file, l) {
|
foreach (const Core::GeneratedFile &file, l) {
|
||||||
if (file.attributes() & Core::GeneratedFile::OpenEditorAttribute) {
|
if (file.attributes() & Core::GeneratedFile::OpenEditorAttribute) {
|
||||||
if (!Core::EditorManager::openEditor(file.path(), file.editorId(), Core::EditorManager::ModeSwitch )) {
|
if (!Core::EditorManager::openEditor(file.path(), file.editorId(), Core::EditorManager::ModeSwitch )) {
|
||||||
if (errorMessage)
|
if (errorMessage)
|
||||||
|
@@ -167,7 +167,7 @@ bool DesignMode::designModeIsRequired() const
|
|||||||
QStringList DesignMode::registeredMimeTypes() const
|
QStringList DesignMode::registeredMimeTypes() const
|
||||||
{
|
{
|
||||||
QStringList rc;
|
QStringList rc;
|
||||||
foreach(const DesignEditorInfo *i, d->m_editors)
|
foreach (const DesignEditorInfo *i, d->m_editors)
|
||||||
rc += i->mimeTypes;
|
rc += i->mimeTypes;
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@@ -195,7 +195,7 @@ void DesignMode::registerDesignWidget(QWidget *widget,
|
|||||||
void DesignMode::unregisterDesignWidget(QWidget *widget)
|
void DesignMode::unregisterDesignWidget(QWidget *widget)
|
||||||
{
|
{
|
||||||
d->m_stackWidget->removeWidget(widget);
|
d->m_stackWidget->removeWidget(widget);
|
||||||
foreach(DesignEditorInfo *info, d->m_editors) {
|
foreach (DesignEditorInfo *info, d->m_editors) {
|
||||||
if (info->widget == widget) {
|
if (info->widget == widget) {
|
||||||
d->m_editors.removeAll(info);
|
d->m_editors.removeAll(info);
|
||||||
break;
|
break;
|
||||||
|
@@ -311,7 +311,7 @@ Core::IWizard *NewDialog::showDialog()
|
|||||||
QModelIndex idx;
|
QModelIndex idx;
|
||||||
|
|
||||||
if (!lastCategory.isEmpty())
|
if (!lastCategory.isEmpty())
|
||||||
foreach(QStandardItem* item, m_categoryItems) {
|
foreach (QStandardItem* item, m_categoryItems) {
|
||||||
if (item->data(Qt::UserRole) == lastCategory) {
|
if (item->data(Qt::UserRole) == lastCategory) {
|
||||||
idx = m_twoLevelProxyModel->mapToSource(m_model->indexFromItem(item));
|
idx = m_twoLevelProxyModel->mapToSource(m_model->indexFromItem(item));
|
||||||
}
|
}
|
||||||
|
@@ -833,7 +833,7 @@ bool EditorManager::closeEditors(const QList<IEditor*> &editorsToClose, bool ask
|
|||||||
|
|
||||||
// add duplicates
|
// add duplicates
|
||||||
QList<IEditor *> duplicates;
|
QList<IEditor *> duplicates;
|
||||||
foreach(IEditor *editor, acceptedEditors)
|
foreach (IEditor *editor, acceptedEditors)
|
||||||
duplicates += d->m_editorModel->duplicatesFor(editor);
|
duplicates += d->m_editorModel->duplicatesFor(editor);
|
||||||
acceptedEditors += duplicates;
|
acceptedEditors += duplicates;
|
||||||
|
|
||||||
@@ -915,7 +915,7 @@ void EditorManager::closeDuplicate(Core::IEditor *editor)
|
|||||||
|
|
||||||
emit editorAboutToClose(editor);
|
emit editorAboutToClose(editor);
|
||||||
|
|
||||||
if(d->m_splitter->findView(editor)) {
|
if (d->m_splitter->findView(editor)) {
|
||||||
EditorView *view = d->m_splitter->findView(editor)->view();
|
EditorView *view = d->m_splitter->findView(editor)->view();
|
||||||
removeEditor(editor);
|
removeEditor(editor);
|
||||||
view->removeEditor(editor);
|
view->removeEditor(editor);
|
||||||
@@ -1107,7 +1107,7 @@ template <class EditorFactoryLike>
|
|||||||
EditorFactoryLike *findById(const Core::Id &id)
|
EditorFactoryLike *findById(const Core::Id &id)
|
||||||
{
|
{
|
||||||
const QList<EditorFactoryLike *> factories = ExtensionSystem::PluginManager::getObjects<EditorFactoryLike>();
|
const QList<EditorFactoryLike *> factories = ExtensionSystem::PluginManager::getObjects<EditorFactoryLike>();
|
||||||
foreach(EditorFactoryLike *efl, factories)
|
foreach (EditorFactoryLike *efl, factories)
|
||||||
if (id == efl->id())
|
if (id == efl->id())
|
||||||
return efl;
|
return efl;
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -305,7 +305,7 @@ void EditorView::updateEditorHistory(IEditor *editor)
|
|||||||
location.id = editor->id();
|
location.id = editor->id();
|
||||||
location.state = QVariant(state);
|
location.state = QVariant(state);
|
||||||
|
|
||||||
for(int i = 0; i < m_editorHistory.size(); ++i) {
|
for (int i = 0; i < m_editorHistory.size(); ++i) {
|
||||||
if (m_editorHistory.at(i).document == 0
|
if (m_editorHistory.at(i).document == 0
|
||||||
|| m_editorHistory.at(i).document == document
|
|| m_editorHistory.at(i).document == document
|
||||||
){
|
){
|
||||||
@@ -668,7 +668,7 @@ void SplitterOrView::split(Qt::Orientation orientation)
|
|||||||
SplitterOrView *otherView = 0;
|
SplitterOrView *otherView = 0;
|
||||||
if (e) {
|
if (e) {
|
||||||
|
|
||||||
foreach(IEditor *editor, m_view->editors())
|
foreach (IEditor *editor, m_view->editors())
|
||||||
m_view->removeEditor(editor);
|
m_view->removeEditor(editor);
|
||||||
|
|
||||||
m_splitter->addWidget((view = new SplitterOrView(e)));
|
m_splitter->addWidget((view = new SplitterOrView(e)));
|
||||||
|
@@ -250,7 +250,7 @@ bool OpenEditorsModel::isDuplicate(IEditor *editor) const
|
|||||||
IEditor *OpenEditorsModel::originalForDuplicate(IEditor *duplicate) const
|
IEditor *OpenEditorsModel::originalForDuplicate(IEditor *duplicate) const
|
||||||
{
|
{
|
||||||
IDocument *document = duplicate->document();
|
IDocument *document = duplicate->document();
|
||||||
foreach(const Entry &e, d->m_editors)
|
foreach (const Entry &e, d->m_editors)
|
||||||
if (e.editor && e.editor->document() == document)
|
if (e.editor && e.editor->document() == document)
|
||||||
return e.editor;
|
return e.editor;
|
||||||
return 0;
|
return 0;
|
||||||
@@ -260,7 +260,7 @@ QList<IEditor *> OpenEditorsModel::duplicatesFor(IEditor *editor) const
|
|||||||
{
|
{
|
||||||
QList<IEditor *> result;
|
QList<IEditor *> result;
|
||||||
IDocument *document = editor->document();
|
IDocument *document = editor->document();
|
||||||
foreach(IEditor *e, d->m_duplicateEditors)
|
foreach (IEditor *e, d->m_duplicateEditors)
|
||||||
if (e->document() == document)
|
if (e->document() == document)
|
||||||
result += e;
|
result += e;
|
||||||
return result;
|
return result;
|
||||||
|
@@ -70,7 +70,7 @@ void FancyToolButton::forceVisible(bool visible)
|
|||||||
|
|
||||||
bool FancyToolButton::event(QEvent *e)
|
bool FancyToolButton::event(QEvent *e)
|
||||||
{
|
{
|
||||||
switch(e->type()) {
|
switch (e->type()) {
|
||||||
case QEvent::Enter:
|
case QEvent::Enter:
|
||||||
{
|
{
|
||||||
QPropertyAnimation *animation = new QPropertyAnimation(this, "fader");
|
QPropertyAnimation *animation = new QPropertyAnimation(this, "fader");
|
||||||
|
@@ -113,7 +113,7 @@ void OutputPanePlaceHolder::maximizeOrMinimize(bool maximize)
|
|||||||
if (maximize) {
|
if (maximize) {
|
||||||
d->m_lastNonMaxSize = sizes[idx];
|
d->m_lastNonMaxSize = sizes[idx];
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
foreach(int s, sizes)
|
foreach (int s, sizes)
|
||||||
sum += s;
|
sum += s;
|
||||||
for (int i = 0; i < sizes.count(); ++i) {
|
for (int i = 0; i < sizes.count(); ++i) {
|
||||||
sizes[i] = 32;
|
sizes[i] = 32;
|
||||||
|
@@ -57,7 +57,7 @@ ProgressBar::~ProgressBar()
|
|||||||
|
|
||||||
bool ProgressBar::event(QEvent *e)
|
bool ProgressBar::event(QEvent *e)
|
||||||
{
|
{
|
||||||
switch(e->type()) {
|
switch (e->type()) {
|
||||||
case QEvent::Enter:
|
case QEvent::Enter:
|
||||||
{
|
{
|
||||||
QPropertyAnimation *animation = new QPropertyAnimation(this, "cancelButtonFader");
|
QPropertyAnimation *animation = new QPropertyAnimation(this, "cancelButtonFader");
|
||||||
|
@@ -118,7 +118,7 @@ SideBar::~SideBar()
|
|||||||
QString SideBar::idForTitle(const QString &title) const
|
QString SideBar::idForTitle(const QString &title) const
|
||||||
{
|
{
|
||||||
QMapIterator<QString, QPointer<SideBarItem> > iter(d->m_itemMap);
|
QMapIterator<QString, QPointer<SideBarItem> > iter(d->m_itemMap);
|
||||||
while(iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
iter.next();
|
iter.next();
|
||||||
if (iter.value().data()->title() == title)
|
if (iter.value().data()->title() == title)
|
||||||
return iter.key();
|
return iter.key();
|
||||||
@@ -173,7 +173,7 @@ void SideBar::makeItemAvailable(SideBarItem *item)
|
|||||||
void SideBar::setUnavailableItemIds(const QStringList &itemIds)
|
void SideBar::setUnavailableItemIds(const QStringList &itemIds)
|
||||||
{
|
{
|
||||||
// re-enable previous items
|
// re-enable previous items
|
||||||
foreach(const QString &id, d->m_unavailableItemIds) {
|
foreach (const QString &id, d->m_unavailableItemIds) {
|
||||||
d->m_availableItemIds.append(id);
|
d->m_availableItemIds.append(id);
|
||||||
d->m_availableItemTitles.append(d->m_itemMap.value(id).data()->title());
|
d->m_availableItemTitles.append(d->m_itemMap.value(id).data()->title());
|
||||||
}
|
}
|
||||||
|
@@ -94,7 +94,7 @@ SideBarWidget::SideBarWidget(SideBar *sideBar, const QString &id)
|
|||||||
qSort(titleList);
|
qSort(titleList);
|
||||||
QString t = id;
|
QString t = id;
|
||||||
if (titleList.count()) {
|
if (titleList.count()) {
|
||||||
foreach(const QString &itemTitle, titleList)
|
foreach (const QString &itemTitle, titleList)
|
||||||
m_comboBox->addItem(itemTitle, m_sideBar->idForTitle(itemTitle));
|
m_comboBox->addItem(itemTitle, m_sideBar->idForTitle(itemTitle));
|
||||||
|
|
||||||
m_comboBox->setCurrentIndex(0);
|
m_comboBox->setCurrentIndex(0);
|
||||||
@@ -160,7 +160,7 @@ void SideBarWidget::updateAvailableItems()
|
|||||||
titleList.append(currentTitle);
|
titleList.append(currentTitle);
|
||||||
qSort(titleList);
|
qSort(titleList);
|
||||||
|
|
||||||
foreach(const QString &itemTitle, titleList)
|
foreach (const QString &itemTitle, titleList)
|
||||||
m_comboBox->addItem(itemTitle, m_sideBar->idForTitle(itemTitle));
|
m_comboBox->addItem(itemTitle, m_sideBar->idForTitle(itemTitle));
|
||||||
|
|
||||||
int idx = m_comboBox->findText(currentTitle);
|
int idx = m_comboBox->findText(currentTitle);
|
||||||
|
@@ -132,7 +132,7 @@ public:
|
|||||||
VcsInfo *newInfo = new VcsInfo(vc, topLevel);
|
VcsInfo *newInfo = new VcsInfo(vc, topLevel);
|
||||||
bool createdNewInfo(true);
|
bool createdNewInfo(true);
|
||||||
// Do we have a matching VcsInfo already?
|
// Do we have a matching VcsInfo already?
|
||||||
foreach(VcsInfo *i, m_vcsInfoList) {
|
foreach (VcsInfo *i, m_vcsInfoList) {
|
||||||
if (*i == *newInfo) {
|
if (*i == *newInfo) {
|
||||||
delete newInfo;
|
delete newInfo;
|
||||||
newInfo = i;
|
newInfo = i;
|
||||||
|
@@ -142,7 +142,7 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *errorMe
|
|||||||
new FileShareProtocol
|
new FileShareProtocol
|
||||||
};
|
};
|
||||||
const int count = sizeof(protos) / sizeof(Protocol *);
|
const int count = sizeof(protos) / sizeof(Protocol *);
|
||||||
for(int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
connect(protos[i], SIGNAL(pasteDone(QString)), this, SLOT(finishPost(QString)));
|
connect(protos[i], SIGNAL(pasteDone(QString)), this, SLOT(finishPost(QString)));
|
||||||
connect(protos[i], SIGNAL(fetchDone(QString,QString,bool)),
|
connect(protos[i], SIGNAL(fetchDone(QString,QString,bool)),
|
||||||
this, SLOT(finishFetch(QString,QString,bool)));
|
this, SLOT(finishFetch(QString,QString,bool)));
|
||||||
@@ -202,7 +202,7 @@ void CodepasterPlugin::extensionsInitialized()
|
|||||||
ExtensionSystem::IPlugin::ShutdownFlag CodepasterPlugin::aboutToShutdown()
|
ExtensionSystem::IPlugin::ShutdownFlag CodepasterPlugin::aboutToShutdown()
|
||||||
{
|
{
|
||||||
// Delete temporary, fetched files
|
// Delete temporary, fetched files
|
||||||
foreach(const QString &fetchedSnippet, m_fetchedSnippets) {
|
foreach (const QString &fetchedSnippet, m_fetchedSnippets) {
|
||||||
QFile file(fetchedSnippet);
|
QFile file(fetchedSnippet);
|
||||||
if (file.exists())
|
if (file.exists())
|
||||||
file.remove();
|
file.remove();
|
||||||
|
@@ -193,7 +193,7 @@ static inline QStringList parseLists(QIODevice *io)
|
|||||||
QXmlStreamReader reader(data);
|
QXmlStreamReader reader(data);
|
||||||
State state = OutsideRecentLink;
|
State state = OutsideRecentLink;
|
||||||
while (!reader.atEnd()) {
|
while (!reader.atEnd()) {
|
||||||
switch(reader.readNext()) {
|
switch (reader.readNext()) {
|
||||||
case QXmlStreamReader::StartElement:
|
case QXmlStreamReader::StartElement:
|
||||||
// Inside a <div> of an entry: Anchor or description
|
// Inside a <div> of an entry: Anchor or description
|
||||||
if (state == InsideRecentLink && reader.name() == anchorElement) { // Anchor
|
if (state == InsideRecentLink && reader.name() == anchorElement) { // Anchor
|
||||||
|
@@ -324,7 +324,7 @@ static inline QStringList parseLists(QIODevice *io)
|
|||||||
QString age;
|
QString age;
|
||||||
|
|
||||||
while (!reader.atEnd()) {
|
while (!reader.atEnd()) {
|
||||||
switch(reader.readNext()) {
|
switch (reader.readNext()) {
|
||||||
case QXmlStreamReader::StartElement:
|
case QXmlStreamReader::StartElement:
|
||||||
state = nextOpeningState(state, reader);
|
state = nextOpeningState(state, reader);
|
||||||
switch (state) {
|
switch (state) {
|
||||||
|
@@ -44,7 +44,7 @@ PasteSelectDialog::PasteSelectDialog(const QList<Protocol*> &protocols,
|
|||||||
m_protocols(protocols)
|
m_protocols(protocols)
|
||||||
{
|
{
|
||||||
m_ui.setupUi(this);
|
m_ui.setupUi(this);
|
||||||
foreach(const Protocol *protocol, protocols) {
|
foreach (const Protocol *protocol, protocols) {
|
||||||
m_ui.protocolBox->addItem(protocol->name());
|
m_ui.protocolBox->addItem(protocol->name());
|
||||||
connect(protocol, SIGNAL(listDone(QString,QStringList)),
|
connect(protocol, SIGNAL(listDone(QString,QStringList)),
|
||||||
this, SLOT(listDone(QString,QStringList)));
|
this, SLOT(listDone(QString,QStringList)));
|
||||||
|
@@ -59,7 +59,7 @@ PasteView::PasteView(const QList<Protocol *> protocols,
|
|||||||
m_ui.buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Paste"));
|
m_ui.buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Paste"));
|
||||||
connect(m_ui.uiPatchList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(contentChanged()));
|
connect(m_ui.uiPatchList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(contentChanged()));
|
||||||
|
|
||||||
foreach(const Protocol *p, protocols)
|
foreach (const Protocol *p, protocols)
|
||||||
m_ui.protocolBox->addItem(p->name());
|
m_ui.protocolBox->addItem(p->name());
|
||||||
connect(m_ui.protocolBox, SIGNAL(currentIndexChanged(int)),
|
connect(m_ui.protocolBox, SIGNAL(currentIndexChanged(int)),
|
||||||
this, SLOT(protocolChanged(int)));
|
this, SLOT(protocolChanged(int)));
|
||||||
|
@@ -237,7 +237,7 @@ bool CppClassWizard::generateHeaderAndSource(const CppClassWizardParameters &par
|
|||||||
// class in case the user did not specify one.
|
// class in case the user did not specify one.
|
||||||
QString parentQObjectClass;
|
QString parentQObjectClass;
|
||||||
bool defineQObjectMacro = false;
|
bool defineQObjectMacro = false;
|
||||||
switch(params.classType) {
|
switch (params.classType) {
|
||||||
case Utils::NewClassWidget::ClassInheritsQObject:
|
case Utils::NewClassWidget::ClassInheritsQObject:
|
||||||
parentQObjectClass = QLatin1String("QObject");
|
parentQObjectClass = QLatin1String("QObject");
|
||||||
defineQObjectMacro = true;
|
defineQObjectMacro = true;
|
||||||
|
@@ -1240,7 +1240,7 @@ public:
|
|||||||
ClassOrNamespace *b = interface->context().lookupType(function);
|
ClassOrNamespace *b = interface->context().lookupType(function);
|
||||||
if (b) {
|
if (b) {
|
||||||
// Do we have a tr method?
|
// Do we have a tr method?
|
||||||
foreach(const LookupItem &r, b->find(trName)) {
|
foreach (const LookupItem &r, b->find(trName)) {
|
||||||
Symbol *s = r.declaration();
|
Symbol *s = r.declaration();
|
||||||
if (s->type()->isFunctionType()) {
|
if (s->type()->isFunctionType()) {
|
||||||
// no context required for tr
|
// no context required for tr
|
||||||
|
@@ -477,7 +477,7 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
|
|||||||
case block_open:
|
case block_open:
|
||||||
if (tryStatement())
|
if (tryStatement())
|
||||||
break;
|
break;
|
||||||
switch(kind) {
|
switch (kind) {
|
||||||
case T_RBRACE: leave(true); break;
|
case T_RBRACE: leave(true); break;
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
@@ -50,7 +50,7 @@ QDebug operator<<(QDebug d, const CvsLogEntry &e)
|
|||||||
{
|
{
|
||||||
QDebug nospace = d.nospace();
|
QDebug nospace = d.nospace();
|
||||||
nospace << "File: " << e.file << e.revisions.size() << '\n';
|
nospace << "File: " << e.file << e.revisions.size() << '\n';
|
||||||
foreach(const CvsRevision &r, e.revisions)
|
foreach (const CvsRevision &r, e.revisions)
|
||||||
nospace << " " << r.revision << ' ' << r.date << ' ' << r.commitId << '\n';
|
nospace << " " << r.revision << ' ' << r.date << ' ' << r.commitId << '\n';
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
@@ -93,7 +93,7 @@ QList<CvsLogEntry> parseLogEntries(const QString &o,
|
|||||||
|
|
||||||
// Parse using a state enumeration and regular expressions as not to fall for weird
|
// Parse using a state enumeration and regular expressions as not to fall for weird
|
||||||
// commit messages in state 'RevisionState'
|
// commit messages in state 'RevisionState'
|
||||||
foreach(const QString &line, lines) {
|
foreach (const QString &line, lines) {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case FileState:
|
case FileState:
|
||||||
if (line.startsWith(workingFilePrefix)) {
|
if (line.startsWith(workingFilePrefix)) {
|
||||||
|
@@ -523,7 +523,7 @@ void BreakpointDialog::typeChanged(int)
|
|||||||
const BreakpointType newType = type();
|
const BreakpointType newType = type();
|
||||||
m_previousType = newType;
|
m_previousType = newType;
|
||||||
// Save current state.
|
// Save current state.
|
||||||
switch(previousType) {
|
switch (previousType) {
|
||||||
case UnknownType:
|
case UnknownType:
|
||||||
break;
|
break;
|
||||||
case BreakpointByFileAndLine:
|
case BreakpointByFileAndLine:
|
||||||
|
@@ -1472,7 +1472,7 @@ void CdbEngine::updateLocals(bool forNewStackFrame)
|
|||||||
if (!expanded.isEmpty()) {
|
if (!expanded.isEmpty()) {
|
||||||
str << blankSeparator << "-e ";
|
str << blankSeparator << "-e ";
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach(const QByteArray &e, expanded) {
|
foreach (const QByteArray &e, expanded) {
|
||||||
if (i++)
|
if (i++)
|
||||||
str << ',';
|
str << ',';
|
||||||
str << e;
|
str << e;
|
||||||
@@ -1488,7 +1488,7 @@ void CdbEngine::updateLocals(bool forNewStackFrame)
|
|||||||
if (!uninitializedVariables.isEmpty()) {
|
if (!uninitializedVariables.isEmpty()) {
|
||||||
str << blankSeparator << "-u \"";
|
str << blankSeparator << "-u \"";
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach(const QString &u, uninitializedVariables) {
|
foreach (const QString &u, uninitializedVariables) {
|
||||||
if (i++)
|
if (i++)
|
||||||
str << ',';
|
str << ',';
|
||||||
str << localsPrefixC << u;
|
str << localsPrefixC << u;
|
||||||
@@ -2135,7 +2135,7 @@ void CdbEngine::handleSessionIdle(const QByteArray &messageBA)
|
|||||||
|
|
||||||
m_specialStopMode = NoSpecialStop;
|
m_specialStopMode = NoSpecialStop;
|
||||||
|
|
||||||
switch(specialStopMode) {
|
switch (specialStopMode) {
|
||||||
case SpecialStopSynchronizeBreakpoints:
|
case SpecialStopSynchronizeBreakpoints:
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug("attemptBreakpointSynchronization in special stop");
|
qDebug("attemptBreakpointSynchronization in special stop");
|
||||||
@@ -2259,7 +2259,7 @@ void CdbEngine::handleSessionAccessible(unsigned long cdbExState)
|
|||||||
qDebug("CdbEngine::handleSessionAccessible %dms in state '%s'/'%s', special mode %d",
|
qDebug("CdbEngine::handleSessionAccessible %dms in state '%s'/'%s', special mode %d",
|
||||||
elapsedLogTime(), cdbStatusName(cdbExState), stateName(state()), m_specialStopMode);
|
elapsedLogTime(), cdbStatusName(cdbExState), stateName(state()), m_specialStopMode);
|
||||||
|
|
||||||
switch(s) {
|
switch (s) {
|
||||||
case EngineShutdownRequested:
|
case EngineShutdownRequested:
|
||||||
shutdownEngine();
|
shutdownEngine();
|
||||||
break;
|
break;
|
||||||
@@ -2563,7 +2563,7 @@ static QByteArray multiBreakpointCommand(const char *cmdC, const Breakpoints &bp
|
|||||||
{
|
{
|
||||||
QByteArray cmd(cmdC);
|
QByteArray cmd(cmdC);
|
||||||
ByteArrayInputStream str(cmd);
|
ByteArrayInputStream str(cmd);
|
||||||
foreach(const BreakpointData *bp, bps)
|
foreach (const BreakpointData *bp, bps)
|
||||||
str << ' ' << bp->bpNumber;
|
str << ' ' << bp->bpNumber;
|
||||||
return cmd;
|
return cmd;
|
||||||
}
|
}
|
||||||
|
@@ -159,7 +159,7 @@
|
|||||||
//# define STATE_DEBUG(s)
|
//# define STATE_DEBUG(s)
|
||||||
// do { QString msg; QTextStream ts(&msg); ts << s;
|
// do { QString msg; QTextStream ts(&msg); ts << s;
|
||||||
// showMessage(msg, LogDebug); } while (0)
|
// showMessage(msg, LogDebug); } while (0)
|
||||||
# define STATE_DEBUG(s) do { qDebug() << s; } while(0)
|
# define STATE_DEBUG(s) do { qDebug() << s; } while (0)
|
||||||
#else
|
#else
|
||||||
# define STATE_DEBUG(s)
|
# define STATE_DEBUG(s)
|
||||||
#endif
|
#endif
|
||||||
|
@@ -430,7 +430,7 @@ void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload)
|
|||||||
gotoLocation(Location(sh->currentFrame(), true));
|
gotoLocation(Location(sh->currentFrame(), true));
|
||||||
else if (!m_sourceAgents.contains(sh->currentFrame().file))
|
else if (!m_sourceAgents.contains(sh->currentFrame().file))
|
||||||
fetchFrameSource(token);
|
fetchFrameSource(token);
|
||||||
foreach(SourceAgent *agent, m_sourceAgents.values())
|
foreach (SourceAgent *agent, m_sourceAgents.values())
|
||||||
agent->updateLocationMarker();
|
agent->updateLocationMarker();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -160,7 +160,7 @@ LldbEngineHost::LldbEngineHost(const DebuggerStartParameters &startParameters)
|
|||||||
|
|
||||||
|
|
||||||
QString a = Core::ICore::resourcePath() + QLatin1String("/qtcreator-lldb");
|
QString a = Core::ICore::resourcePath() + QLatin1String("/qtcreator-lldb");
|
||||||
if(getenv("QTC_LLDB_GUEST") != 0)
|
if (getenv("QTC_LLDB_GUEST") != 0)
|
||||||
a = QString::fromLocal8Bit(getenv("QTC_LLDB_GUEST"));
|
a = QString::fromLocal8Bit(getenv("QTC_LLDB_GUEST"));
|
||||||
|
|
||||||
showStatusMessage(QString(QLatin1String("starting %1")).arg(a));
|
showStatusMessage(QString(QLatin1String("starting %1")).arg(a));
|
||||||
|
@@ -705,7 +705,7 @@ static inline QString msgDebugInsert(const WatchData &d0, const QList<WatchData>
|
|||||||
QString rc;
|
QString rc;
|
||||||
QTextStream str(&rc);
|
QTextStream str(&rc);
|
||||||
str << "INSERTING " << d0.toString() << '\n';
|
str << "INSERTING " << d0.toString() << '\n';
|
||||||
foreach(const WatchData &c, children)
|
foreach (const WatchData &c, children)
|
||||||
str << " " << c.toString() << '\n';
|
str << " " << c.toString() << '\n';
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@@ -261,7 +261,7 @@ bool getPDBFiles(const QString &peExecutableFileName, QStringList *rc, QString *
|
|||||||
if (debugSectionCount)
|
if (debugSectionCount)
|
||||||
collectPDBfiles(fileMemory, debugDir, debugSectionCount, rc);
|
collectPDBfiles(fileMemory, debugDir, debugSectionCount, rc);
|
||||||
success = true;
|
success = true;
|
||||||
} while(false);
|
} while (false);
|
||||||
|
|
||||||
if (fileMemory)
|
if (fileMemory)
|
||||||
UnmapViewOfFile(fileMemory);
|
UnmapViewOfFile(fileMemory);
|
||||||
|
@@ -95,7 +95,7 @@ void FormEditorStack::add(const EditorData &data)
|
|||||||
int FormEditorStack::indexOfFormWindow(const QDesignerFormWindowInterface *fw) const
|
int FormEditorStack::indexOfFormWindow(const QDesignerFormWindowInterface *fw) const
|
||||||
{
|
{
|
||||||
const int count = m_formEditors.size();
|
const int count = m_formEditors.size();
|
||||||
for(int i = 0; i < count; ++i)
|
for (int i = 0; i < count; ++i)
|
||||||
if (m_formEditors[i].widgetHost->formWindow() == fw)
|
if (m_formEditors[i].widgetHost->formWindow() == fw)
|
||||||
return i;
|
return i;
|
||||||
return -1;
|
return -1;
|
||||||
@@ -104,7 +104,7 @@ int FormEditorStack::indexOfFormWindow(const QDesignerFormWindowInterface *fw) c
|
|||||||
int FormEditorStack::indexOfFormEditor(const QObject *xmlEditor) const
|
int FormEditorStack::indexOfFormEditor(const QObject *xmlEditor) const
|
||||||
{
|
{
|
||||||
const int count = m_formEditors.size();
|
const int count = m_formEditors.size();
|
||||||
for(int i = 0; i < count; ++i)
|
for (int i = 0; i < count; ++i)
|
||||||
if (m_formEditors[i].formWindowEditor == xmlEditor)
|
if (m_formEditors[i].formWindowEditor == xmlEditor)
|
||||||
return i;
|
return i;
|
||||||
return -1;
|
return -1;
|
||||||
@@ -158,7 +158,7 @@ void FormEditorStack::updateFormWindowSelectionHandles()
|
|||||||
if (Designer::Constants::Internal::debug)
|
if (Designer::Constants::Internal::debug)
|
||||||
qDebug() << "updateFormWindowSelectionHandles";
|
qDebug() << "updateFormWindowSelectionHandles";
|
||||||
QDesignerFormWindowInterface *activeFormWindow = m_designerCore->formWindowManager()->activeFormWindow();
|
QDesignerFormWindowInterface *activeFormWindow = m_designerCore->formWindowManager()->activeFormWindow();
|
||||||
foreach(const EditorData &fdm, m_formEditors) {
|
foreach (const EditorData &fdm, m_formEditors) {
|
||||||
const bool active = activeFormWindow == fdm.widgetHost->formWindow();
|
const bool active = activeFormWindow == fdm.widgetHost->formWindow();
|
||||||
fdm.widgetHost->updateFormWindowSelectionHandles(active);
|
fdm.widgetHost->updateFormWindowSelectionHandles(active);
|
||||||
}
|
}
|
||||||
@@ -189,7 +189,7 @@ void FormEditorStack::modeAboutToChange(Core::IMode *m)
|
|||||||
|
|
||||||
// Sync the editor when entering edit mode
|
// Sync the editor when entering edit mode
|
||||||
if (m && m->id() == Core::Constants::MODE_EDIT)
|
if (m && m->id() == Core::Constants::MODE_EDIT)
|
||||||
foreach(const EditorData &data, m_formEditors)
|
foreach (const EditorData &data, m_formEditors)
|
||||||
data.formWindowEditor->syncXmlEditor();
|
data.formWindowEditor->syncXmlEditor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -803,7 +803,7 @@ void FormEditorW::toolChanged(int t)
|
|||||||
|
|
||||||
void FormEditorW::closeFormEditorsForXmlEditors(QList<Core::IEditor*> editors)
|
void FormEditorW::closeFormEditorsForXmlEditors(QList<Core::IEditor*> editors)
|
||||||
{
|
{
|
||||||
foreach(Core::IEditor *editor, editors) {
|
foreach (Core::IEditor *editor, editors) {
|
||||||
m_editorWidget->removeFormWindowEditor(editor);
|
m_editorWidget->removeFormWindowEditor(editor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -223,7 +223,7 @@ void GenericMakeStep::setBuildTarget(const QString &target, bool on)
|
|||||||
QStringList old = m_buildTargets;
|
QStringList old = m_buildTargets;
|
||||||
if (on && !old.contains(target))
|
if (on && !old.contains(target))
|
||||||
old << target;
|
old << target;
|
||||||
else if(!on && old.contains(target))
|
else if (!on && old.contains(target))
|
||||||
old.removeOne(target);
|
old.removeOne(target);
|
||||||
|
|
||||||
m_buildTargets = old;
|
m_buildTargets = old;
|
||||||
|
@@ -1358,7 +1358,7 @@ bool GitClient::cleanList(const QString &workingDirectory, const QString &flag,
|
|||||||
}
|
}
|
||||||
// Filter files that git would remove
|
// Filter files that git would remove
|
||||||
const QString prefix = QLatin1String("Would remove ");
|
const QString prefix = QLatin1String("Would remove ");
|
||||||
foreach(const QString &line, commandOutputLinesFromLocal8Bit(outputText))
|
foreach (const QString &line, commandOutputLinesFromLocal8Bit(outputText))
|
||||||
if (line.startsWith(prefix))
|
if (line.startsWith(prefix))
|
||||||
files->push_back(line.mid(prefix.size()));
|
files->push_back(line.mid(prefix.size()));
|
||||||
return true;
|
return true;
|
||||||
@@ -1605,7 +1605,7 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR
|
|||||||
QString headSha;
|
QString headSha;
|
||||||
if (resp.result == Utils::SynchronousProcessResponse::Finished) {
|
if (resp.result == Utils::SynchronousProcessResponse::Finished) {
|
||||||
// split "82bfad2f51d34e98b18982211c82220b8db049b<tab>refs/heads/master"
|
// split "82bfad2f51d34e98b18982211c82220b8db049b<tab>refs/heads/master"
|
||||||
foreach(const QString &line, resp.stdOut.split(QLatin1Char('\n'))) {
|
foreach (const QString &line, resp.stdOut.split(QLatin1Char('\n'))) {
|
||||||
if (line.endsWith(QLatin1String("\tHEAD"))) {
|
if (line.endsWith(QLatin1String("\tHEAD"))) {
|
||||||
QTC_CHECK(headSha.isNull());
|
QTC_CHECK(headSha.isNull());
|
||||||
headSha = line.left(line.indexOf(QLatin1Char('\t')));
|
headSha = line.left(line.indexOf(QLatin1Char('\t')));
|
||||||
@@ -2252,7 +2252,7 @@ bool GitClient::synchronousStashList(const QString &workingDirectory,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Stash stash;
|
Stash stash;
|
||||||
foreach(const QString &line, commandOutputLinesFromLocal8Bit(outputText))
|
foreach (const QString &line, commandOutputLinesFromLocal8Bit(outputText))
|
||||||
if (stash.parseStashLine(line))
|
if (stash.parseStashLine(line))
|
||||||
stashes->push_back(stash);
|
stashes->push_back(stash);
|
||||||
return true;
|
return true;
|
||||||
|
@@ -121,7 +121,7 @@ QDebug operator<<(QDebug d, const GitoriousProject &p)
|
|||||||
{
|
{
|
||||||
QDebug nospace = d.nospace();
|
QDebug nospace = d.nospace();
|
||||||
nospace << " project=" << p.name << " description=" << p.description << '\n';
|
nospace << " project=" << p.name << " description=" << p.description << '\n';
|
||||||
foreach(const GitoriousRepository &r, p.repositories)
|
foreach (const GitoriousRepository &r, p.repositories)
|
||||||
nospace << " " << r << '\n';
|
nospace << " " << r << '\n';
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
@@ -136,9 +136,9 @@ QDebug operator<<(QDebug d, const GitoriousHost &h)
|
|||||||
{
|
{
|
||||||
QDebug nospace = d.nospace();
|
QDebug nospace = d.nospace();
|
||||||
nospace << " Host=" << h.hostName << " description=" << h.description << '\n';
|
nospace << " Host=" << h.hostName << " description=" << h.description << '\n';
|
||||||
foreach(const QSharedPointer<GitoriousCategory> &c, h.categories)
|
foreach (const QSharedPointer<GitoriousCategory> &c, h.categories)
|
||||||
nospace << *c;
|
nospace << *c;
|
||||||
foreach(const QSharedPointer<GitoriousProject> &p, h.projects)
|
foreach (const QSharedPointer<GitoriousProject> &p, h.projects)
|
||||||
nospace << *p;
|
nospace << *p;
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
@@ -568,7 +568,7 @@ void Gitorious::saveSettings(const QString &group, QSettings *s)
|
|||||||
{
|
{
|
||||||
const QChar separator = QLatin1Char('|');
|
const QChar separator = QLatin1Char('|');
|
||||||
QStringList hosts;
|
QStringList hosts;
|
||||||
foreach(const GitoriousHost &h, m_hosts) {
|
foreach (const GitoriousHost &h, m_hosts) {
|
||||||
QString entry = h.hostName;
|
QString entry = h.hostName;
|
||||||
if (!h.description.isEmpty()) {
|
if (!h.description.isEmpty()) {
|
||||||
entry += separator;
|
entry += separator;
|
||||||
|
@@ -105,7 +105,7 @@ GitoriousHostWidget::GitoriousHostWidget(QWidget *parent) :
|
|||||||
m_model->setHorizontalHeaderLabels(headers);
|
m_model->setHorizontalHeaderLabels(headers);
|
||||||
|
|
||||||
Gitorious &gitorious = Gitorious::instance();
|
Gitorious &gitorious = Gitorious::instance();
|
||||||
foreach( const GitoriousHost &gh, gitorious.hosts())
|
foreach (const GitoriousHost &gh, gitorious.hosts())
|
||||||
m_model->appendRow(hostEntry(gh));
|
m_model->appendRow(hostEntry(gh));
|
||||||
appendNewDummyEntry();
|
appendNewDummyEntry();
|
||||||
connect(m_model, SIGNAL(itemChanged(QStandardItem*)), this, SLOT(slotItemEdited(QStandardItem*)));
|
connect(m_model, SIGNAL(itemChanged(QStandardItem*)), this, SLOT(slotItemEdited(QStandardItem*)));
|
||||||
|
@@ -125,7 +125,7 @@ GitoriousProjectWidget *GitoriousProjectWizardPage::currentProjectWidget() const
|
|||||||
int GitoriousProjectWizardPage::stackIndexOf(const QString &hostName) const
|
int GitoriousProjectWizardPage::stackIndexOf(const QString &hostName) const
|
||||||
{
|
{
|
||||||
const int count = m_stackedWidget->count();
|
const int count = m_stackedWidget->count();
|
||||||
for(int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
if (projectWidgetAt(i)->hostName() == hostName)
|
if (projectWidgetAt(i)->hostName() == hostName)
|
||||||
return i;
|
return i;
|
||||||
return -1;
|
return -1;
|
||||||
|
@@ -163,7 +163,7 @@ void GitoriousRepositoryWizardPage::initializePage()
|
|||||||
qStableSort(repositories.begin(), repositories.end(), gitRepoLessThanByType);
|
qStableSort(repositories.begin(), repositories.end(), gitRepoLessThanByType);
|
||||||
const QString types[GitoriousRepository::PersonalRepository + 1] =
|
const QString types[GitoriousRepository::PersonalRepository + 1] =
|
||||||
{ tr("Mainline Repositories"), tr("Clones"), tr("Baseline Repositories"), tr("Shared Project Repositories"), tr("Personal Repositories") };
|
{ tr("Mainline Repositories"), tr("Clones"), tr("Baseline Repositories"), tr("Shared Project Repositories"), tr("Personal Repositories") };
|
||||||
foreach(const GitoriousRepository &r, repositories) {
|
foreach (const GitoriousRepository &r, repositories) {
|
||||||
// New Header?
|
// New Header?
|
||||||
if (r.type != lastRepoType || !header) {
|
if (r.type != lastRepoType || !header) {
|
||||||
lastRepoType = r.type;
|
lastRepoType = r.type;
|
||||||
|
@@ -188,7 +188,7 @@ QStringList GitVersionControl::vcsSnapshots(const QString &topLevel)
|
|||||||
return QStringList();
|
return QStringList();
|
||||||
// Return the git stash 'message' as identifier, ignoring empty ones
|
// Return the git stash 'message' as identifier, ignoring empty ones
|
||||||
QStringList rc;
|
QStringList rc;
|
||||||
foreach(const Stash &s, stashes)
|
foreach (const Stash &s, stashes)
|
||||||
if (!s.message.isEmpty())
|
if (!s.message.isEmpty())
|
||||||
rc.push_back(s.message);
|
rc.push_back(s.message);
|
||||||
return rc;
|
return rc;
|
||||||
|
@@ -95,7 +95,7 @@ void StashModel::setStashes(const QList<Stash> &stashes)
|
|||||||
m_stashes = stashes;
|
m_stashes = stashes;
|
||||||
if (const int rows = rowCount())
|
if (const int rows = rowCount())
|
||||||
removeRows(0, rows);
|
removeRows(0, rows);
|
||||||
foreach(const Stash &s, stashes)
|
foreach (const Stash &s, stashes)
|
||||||
appendRow(stashModelRowItems(s));
|
appendRow(stashModelRowItems(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ void StashDialog::refresh(const QString &repository, bool force)
|
|||||||
gitClient()->synchronousStashList(m_repository, &stashes);
|
gitClient()->synchronousStashList(m_repository, &stashes);
|
||||||
m_model->setStashes(stashes);
|
m_model->setStashes(stashes);
|
||||||
if (!stashes.isEmpty()) {
|
if (!stashes.isEmpty()) {
|
||||||
for(int c = 0; c < ColumnCount; c++)
|
for (int c = 0; c < ColumnCount; c++)
|
||||||
ui->stashView->resizeColumnToContents(c);
|
ui->stashView->resizeColumnToContents(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -379,7 +379,7 @@ int StashDialog::currentRow() const
|
|||||||
QList<int> StashDialog::selectedRows() const
|
QList<int> StashDialog::selectedRows() const
|
||||||
{
|
{
|
||||||
QList<int> rc;
|
QList<int> rc;
|
||||||
foreach(const QModelIndex &proxyIndex, ui->stashView->selectionModel()->selectedRows()) {
|
foreach (const QModelIndex &proxyIndex, ui->stashView->selectionModel()->selectedRows()) {
|
||||||
const QModelIndex index = m_proxyModel->mapToSource(proxyIndex);
|
const QModelIndex index = m_proxyModel->mapToSource(proxyIndex);
|
||||||
if (index.isValid())
|
if (index.isValid())
|
||||||
rc.push_back(index.row());
|
rc.push_back(index.row());
|
||||||
|
@@ -69,7 +69,7 @@ public:
|
|||||||
|
|
||||||
void openLink(bool newPage)
|
void openLink(bool newPage)
|
||||||
{
|
{
|
||||||
if(lastAnchor.isEmpty())
|
if (lastAnchor.isEmpty())
|
||||||
return;
|
return;
|
||||||
if (newPage)
|
if (newPage)
|
||||||
OpenPagesManager::instance().createPage(lastAnchor);
|
OpenPagesManager::instance().createPage(lastAnchor);
|
||||||
|
@@ -69,7 +69,7 @@ void ImageViewerActionHandler::actionTriggered(int supportedAction)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
SupportedActions action = static_cast<SupportedActions>(supportedAction);
|
SupportedActions action = static_cast<SupportedActions>(supportedAction);
|
||||||
switch(action) {
|
switch (action) {
|
||||||
case ZoomIn:
|
case ZoomIn:
|
||||||
viewer->zoomIn();
|
viewer->zoomIn();
|
||||||
break;
|
break;
|
||||||
|
@@ -561,7 +561,7 @@ void PerforcePlugin::updateCheckout(const QString &workingDir, const QStringList
|
|||||||
perforceVersionControl()->emitRepositoryChanged(workingDir);
|
perforceVersionControl()->emitRepositoryChanged(workingDir);
|
||||||
} else {
|
} else {
|
||||||
const QChar slash = QLatin1Char('/');
|
const QChar slash = QLatin1Char('/');
|
||||||
foreach(const QString &dir, dirs)
|
foreach (const QString &dir, dirs)
|
||||||
perforceVersionControl()->emitRepositoryChanged(workingDir + slash + dir);
|
perforceVersionControl()->emitRepositoryChanged(workingDir + slash + dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -864,7 +864,7 @@ bool PerforcePlugin::managesDirectoryFstat(const QString &directory)
|
|||||||
RunFullySynchronous);
|
RunFullySynchronous);
|
||||||
managed = result.stdOut.contains(QLatin1String("depotFile"))
|
managed = result.stdOut.contains(QLatin1String("depotFile"))
|
||||||
|| result.stdErr.contains(QLatin1String("... - no such file(s)"));
|
|| result.stdErr.contains(QLatin1String("... - no such file(s)"));
|
||||||
} while(false);
|
} while (false);
|
||||||
|
|
||||||
m_managedDirectoryCache.insert(directory, managed);
|
m_managedDirectoryCache.insert(directory, managed);
|
||||||
return managed;
|
return managed;
|
||||||
|
@@ -389,7 +389,7 @@ void AbstractProcessStep::taskAdded(const ProjectExplorer::Task &task)
|
|||||||
filePath.remove(0, 3);
|
filePath.remove(0, 3);
|
||||||
int count = 0;
|
int count = 0;
|
||||||
QString possibleFilePath;
|
QString possibleFilePath;
|
||||||
foreach(const QFileInfo &fi, possibleFiles) {
|
foreach (const QFileInfo &fi, possibleFiles) {
|
||||||
if (fi.filePath().endsWith(filePath)) {
|
if (fi.filePath().endsWith(filePath)) {
|
||||||
possibleFilePath = fi.filePath();
|
possibleFilePath = fi.filePath();
|
||||||
++count;
|
++count;
|
||||||
|
@@ -530,7 +530,7 @@ bool BuildManager::buildList(BuildStepList *bsl, const QString &stepListName)
|
|||||||
bool BuildManager::buildLists(QList<BuildStepList *> bsls, const QStringList &stepListNames, const QStringList &preambelMessage)
|
bool BuildManager::buildLists(QList<BuildStepList *> bsls, const QStringList &stepListNames, const QStringList &preambelMessage)
|
||||||
{
|
{
|
||||||
QList<BuildStep *> steps;
|
QList<BuildStep *> steps;
|
||||||
foreach(BuildStepList *list, bsls)
|
foreach (BuildStepList *list, bsls)
|
||||||
steps.append(list->steps());
|
steps.append(list->steps());
|
||||||
|
|
||||||
QStringList names;
|
QStringList names;
|
||||||
|
@@ -45,7 +45,7 @@ namespace {
|
|||||||
IBuildStepFactory *findCloneFactory(BuildStepList *parent, BuildStep *source)
|
IBuildStepFactory *findCloneFactory(BuildStepList *parent, BuildStep *source)
|
||||||
{
|
{
|
||||||
QList<IBuildStepFactory *> factories = ExtensionSystem::PluginManager::getObjects<IBuildStepFactory>();
|
QList<IBuildStepFactory *> factories = ExtensionSystem::PluginManager::getObjects<IBuildStepFactory>();
|
||||||
foreach(IBuildStepFactory *factory, factories)
|
foreach (IBuildStepFactory *factory, factories)
|
||||||
if (factory->canClone(parent, source))
|
if (factory->canClone(parent, source))
|
||||||
return factory;
|
return factory;
|
||||||
return 0;
|
return 0;
|
||||||
@@ -54,7 +54,7 @@ IBuildStepFactory *findCloneFactory(BuildStepList *parent, BuildStep *source)
|
|||||||
IBuildStepFactory *findRestoreFactory(BuildStepList *parent, const QVariantMap &map)
|
IBuildStepFactory *findRestoreFactory(BuildStepList *parent, const QVariantMap &map)
|
||||||
{
|
{
|
||||||
QList<IBuildStepFactory *> factories = ExtensionSystem::PluginManager::getObjects<IBuildStepFactory>();
|
QList<IBuildStepFactory *> factories = ExtensionSystem::PluginManager::getObjects<IBuildStepFactory>();
|
||||||
foreach(IBuildStepFactory *factory, factories)
|
foreach (IBuildStepFactory *factory, factories)
|
||||||
if (factory->canRestore(parent, map))
|
if (factory->canRestore(parent, map))
|
||||||
return factory;
|
return factory;
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -144,7 +144,7 @@ void CustomWizard::initWizardDialog(Utils::Wizard *wizard, const QString &defaul
|
|||||||
addWizardPage(wizard, customPage, parameters()->firstPageId);
|
addWizardPage(wizard, customPage, parameters()->firstPageId);
|
||||||
if (!parameters()->fieldPageTitle.isEmpty())
|
if (!parameters()->fieldPageTitle.isEmpty())
|
||||||
customPage->setTitle(parameters()->fieldPageTitle);
|
customPage->setTitle(parameters()->fieldPageTitle);
|
||||||
foreach(QWizardPage *ep, extensionPages)
|
foreach (QWizardPage *ep, extensionPages)
|
||||||
BaseFileWizard::applyExtensionPageShortTitle(wizard, wizard->addPage(ep));
|
BaseFileWizard::applyExtensionPageShortTitle(wizard, wizard->addPage(ep));
|
||||||
Core::BaseFileWizard::setupWizard(wizard);
|
Core::BaseFileWizard::setupWizard(wizard);
|
||||||
if (CustomWizardPrivate::verbose)
|
if (CustomWizardPrivate::verbose)
|
||||||
@@ -314,7 +314,7 @@ Core::GeneratedFiles CustomWizard::generateWizardFiles(QString *errorMessage) co
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
// Add the template files specified by the <file> elements.
|
// Add the template files specified by the <file> elements.
|
||||||
foreach(const Internal::CustomWizardFile &file, d->m_parameters->files)
|
foreach (const Internal::CustomWizardFile &file, d->m_parameters->files)
|
||||||
if (!createFile(file, d->m_parameters->directory, ctx->targetPath, context()->replacements, &rc, errorMessage))
|
if (!createFile(file, d->m_parameters->directory, ctx->targetPath, context()->replacements, &rc, errorMessage))
|
||||||
return Core::GeneratedFiles();
|
return Core::GeneratedFiles();
|
||||||
return rc;
|
return rc;
|
||||||
@@ -449,7 +449,7 @@ QList<CustomWizard*> CustomWizard::createWizards()
|
|||||||
const QString configFile = QLatin1String(configFileC);
|
const QString configFile = QLatin1String(configFileC);
|
||||||
// Check and parse config file in each directory.
|
// Check and parse config file in each directory.
|
||||||
|
|
||||||
foreach(const QFileInfo &dirFi, dirs) {
|
foreach (const QFileInfo &dirFi, dirs) {
|
||||||
const QDir dir(dirFi.absoluteFilePath());
|
const QDir dir(dirFi.absoluteFilePath());
|
||||||
if (CustomWizardPrivate::verbose)
|
if (CustomWizardPrivate::verbose)
|
||||||
verboseLog += QString::fromLatin1("CustomWizard: Scanning %1\n").arg(dirFi.absoluteFilePath());
|
verboseLog += QString::fromLatin1("CustomWizard: Scanning %1\n").arg(dirFi.absoluteFilePath());
|
||||||
@@ -548,7 +548,7 @@ void CustomProjectWizard::initProjectWizardDialog(BaseProjectWizardDialog *w,
|
|||||||
if (!pa->fieldPageTitle.isEmpty())
|
if (!pa->fieldPageTitle.isEmpty())
|
||||||
cp->setTitle(pa->fieldPageTitle);
|
cp->setTitle(pa->fieldPageTitle);
|
||||||
}
|
}
|
||||||
foreach(QWizardPage *ep, extensionPages)
|
foreach (QWizardPage *ep, extensionPages)
|
||||||
BaseFileWizard::applyExtensionPageShortTitle(w, w->addPage(ep));
|
BaseFileWizard::applyExtensionPageShortTitle(w, w->addPage(ep));
|
||||||
w->setPath(defaultPath);
|
w->setPath(defaultPath);
|
||||||
w->setProjectName(BaseProjectWizardDialog::uniqueProjectName(defaultPath));
|
w->setProjectName(BaseProjectWizardDialog::uniqueProjectName(defaultPath));
|
||||||
@@ -584,7 +584,7 @@ Core::GeneratedFiles CustomProjectWizard::generateFiles(const QWizard *w, QStrin
|
|||||||
bool CustomProjectWizard::postGenerateOpen(const Core::GeneratedFiles &l, QString *errorMessage)
|
bool CustomProjectWizard::postGenerateOpen(const Core::GeneratedFiles &l, QString *errorMessage)
|
||||||
{
|
{
|
||||||
// Post-Generate: Open the project and the editors as desired
|
// Post-Generate: Open the project and the editors as desired
|
||||||
foreach(const Core::GeneratedFile &file, l) {
|
foreach (const Core::GeneratedFile &file, l) {
|
||||||
if (file.attributes() & Core::GeneratedFile::OpenProjectAttribute) {
|
if (file.attributes() & Core::GeneratedFile::OpenProjectAttribute) {
|
||||||
if (!ProjectExplorer::ProjectExplorerPlugin::instance()->openProject(file.path(), errorMessage)) {
|
if (!ProjectExplorer::ProjectExplorerPlugin::instance()->openProject(file.path(), errorMessage)) {
|
||||||
return false;
|
return false;
|
||||||
|
@@ -181,7 +181,7 @@ CustomWizardFieldPage::CustomWizardFieldPage(const QSharedPointer<CustomWizardCo
|
|||||||
m_formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
m_formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << Q_FUNC_INFO << parameters->fields.size();
|
qDebug() << Q_FUNC_INFO << parameters->fields.size();
|
||||||
foreach(const CustomWizardField &f, parameters->fields)
|
foreach (const CustomWizardField &f, parameters->fields)
|
||||||
addField(f);
|
addField(f);
|
||||||
vLayout->addLayout(m_formLayout);
|
vLayout->addLayout(m_formLayout);
|
||||||
m_errorLabel->setVisible(false);
|
m_errorLabel->setVisible(false);
|
||||||
@@ -362,7 +362,7 @@ void CustomWizardFieldPage::initializePage()
|
|||||||
{
|
{
|
||||||
QWizardPage::initializePage();
|
QWizardPage::initializePage();
|
||||||
clearError();
|
clearError();
|
||||||
foreach(const LineEditData &led, m_lineEdits) {
|
foreach (const LineEditData &led, m_lineEdits) {
|
||||||
if (!led.userChange.isNull()) {
|
if (!led.userChange.isNull()) {
|
||||||
led.lineEdit->setText(led.userChange);
|
led.lineEdit->setText(led.userChange);
|
||||||
} else if (!led.defaultText.isEmpty()) {
|
} else if (!led.defaultText.isEmpty()) {
|
||||||
@@ -371,7 +371,7 @@ void CustomWizardFieldPage::initializePage()
|
|||||||
led.lineEdit->setText(defaultText);
|
led.lineEdit->setText(defaultText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach(const TextEditData &ted, m_textEdits) {
|
foreach (const TextEditData &ted, m_textEdits) {
|
||||||
if (!ted.userChange.isNull()) {
|
if (!ted.userChange.isNull()) {
|
||||||
ted.textEdit->setText(ted.userChange);
|
ted.textEdit->setText(ted.userChange);
|
||||||
} else if (!ted.defaultText.isEmpty()) {
|
} else if (!ted.defaultText.isEmpty()) {
|
||||||
@@ -428,7 +428,7 @@ bool CustomWizardFieldPage::validatePage()
|
|||||||
{
|
{
|
||||||
clearError();
|
clearError();
|
||||||
// Check line edits with validators
|
// Check line edits with validators
|
||||||
foreach(const LineEditData &led, m_lineEdits) {
|
foreach (const LineEditData &led, m_lineEdits) {
|
||||||
if (const QValidator *val = led.lineEdit->validator()) {
|
if (const QValidator *val = led.lineEdit->validator()) {
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
QString text = led.lineEdit->text();
|
QString text = led.lineEdit->text();
|
||||||
@@ -456,7 +456,7 @@ QMap<QString, QString> CustomWizardFieldPage::replacementMap(const QWizard *w,
|
|||||||
const FieldList &f)
|
const FieldList &f)
|
||||||
{
|
{
|
||||||
QMap<QString, QString> fieldReplacementMap = ctx->baseReplacements;
|
QMap<QString, QString> fieldReplacementMap = ctx->baseReplacements;
|
||||||
foreach(const Internal::CustomWizardField &field, f) {
|
foreach (const Internal::CustomWizardField &field, f) {
|
||||||
const QString value = w->field(field.name).toString();
|
const QString value = w->field(field.name).toString();
|
||||||
fieldReplacementMap.insert(field.name, value);
|
fieldReplacementMap.insert(field.name, value);
|
||||||
}
|
}
|
||||||
|
@@ -175,7 +175,7 @@ bool CustomWizardValidationRule::validateRules(const QList<CustomWizardValidatio
|
|||||||
if (rules.isEmpty())
|
if (rules.isEmpty())
|
||||||
return true;
|
return true;
|
||||||
QScriptEngine engine;
|
QScriptEngine engine;
|
||||||
foreach(const CustomWizardValidationRule &rule, rules)
|
foreach (const CustomWizardValidationRule &rule, rules)
|
||||||
if (!rule.validate(engine, replacementMap)) {
|
if (!rule.validate(engine, replacementMap)) {
|
||||||
*errorMessage = rule.message;
|
*errorMessage = rule.message;
|
||||||
CustomWizardContext::replaceFields(replacementMap, errorMessage);
|
CustomWizardContext::replaceFields(replacementMap, errorMessage);
|
||||||
@@ -334,7 +334,7 @@ static bool parseCustomProjectElement(QXmlStreamReader &reader,
|
|||||||
static inline QMap<QString, QString> attributesToStringMap(const QXmlStreamAttributes &attributes)
|
static inline QMap<QString, QString> attributesToStringMap(const QXmlStreamAttributes &attributes)
|
||||||
{
|
{
|
||||||
QMap<QString, QString> rc;
|
QMap<QString, QString> rc;
|
||||||
foreach(const QXmlStreamAttribute &attribute, attributes)
|
foreach (const QXmlStreamAttribute &attribute, attributes)
|
||||||
rc.insert(attribute.name().toString(), attribute.value().toString());
|
rc.insert(attribute.name().toString(), attribute.value().toString());
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@@ -748,12 +748,12 @@ QString CustomWizardParameters::toString() const
|
|||||||
str << "Directory: " << directory << " Klass: '" << klass << "'\n";
|
str << "Directory: " << directory << " Klass: '" << klass << "'\n";
|
||||||
if (!filesGeneratorScriptArguments.isEmpty()) {
|
if (!filesGeneratorScriptArguments.isEmpty()) {
|
||||||
str << "Script:";
|
str << "Script:";
|
||||||
foreach(const QString &a, filesGeneratorScript)
|
foreach (const QString &a, filesGeneratorScript)
|
||||||
str << " '" << a << '\'';
|
str << " '" << a << '\'';
|
||||||
if (!filesGeneratorScriptWorkingDirectory.isEmpty())
|
if (!filesGeneratorScriptWorkingDirectory.isEmpty())
|
||||||
str << "\nrun in '" << filesGeneratorScriptWorkingDirectory << '\'';
|
str << "\nrun in '" << filesGeneratorScriptWorkingDirectory << '\'';
|
||||||
str << "\nArguments: ";
|
str << "\nArguments: ";
|
||||||
foreach(const GeneratorScriptArgument &a, filesGeneratorScriptArguments) {
|
foreach (const GeneratorScriptArgument &a, filesGeneratorScriptArguments) {
|
||||||
str << " '" << a.value << '\'';
|
str << " '" << a.value << '\'';
|
||||||
if (a.flags & GeneratorScriptArgument::OmitEmpty)
|
if (a.flags & GeneratorScriptArgument::OmitEmpty)
|
||||||
str << " [omit empty]";
|
str << " [omit empty]";
|
||||||
@@ -763,7 +763,7 @@ QString CustomWizardParameters::toString() const
|
|||||||
}
|
}
|
||||||
str << '\n';
|
str << '\n';
|
||||||
}
|
}
|
||||||
foreach(const CustomWizardFile &f, files) {
|
foreach (const CustomWizardFile &f, files) {
|
||||||
str << " File source: " << f.source << " Target: " << f.target;
|
str << " File source: " << f.source << " Target: " << f.target;
|
||||||
if (f.openEditor)
|
if (f.openEditor)
|
||||||
str << " [editor]";
|
str << " [editor]";
|
||||||
@@ -773,7 +773,7 @@ QString CustomWizardParameters::toString() const
|
|||||||
str << " [binary]";
|
str << " [binary]";
|
||||||
str << '\n';
|
str << '\n';
|
||||||
}
|
}
|
||||||
foreach(const CustomWizardField &f, fields) {
|
foreach (const CustomWizardField &f, fields) {
|
||||||
str << " Field name: " << f.name;
|
str << " Field name: " << f.name;
|
||||||
if (f.mandatory)
|
if (f.mandatory)
|
||||||
str << '*';
|
str << '*';
|
||||||
@@ -787,7 +787,7 @@ QString CustomWizardParameters::toString() const
|
|||||||
}
|
}
|
||||||
str << '\n';
|
str << '\n';
|
||||||
}
|
}
|
||||||
foreach(const CustomWizardValidationRule &r, rules)
|
foreach (const CustomWizardValidationRule &r, rules)
|
||||||
str << " Rule: '" << r.condition << "'->'" << r.message << '\n';
|
str << " Rule: '" << r.condition << "'->'" << r.message << '\n';
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@@ -202,7 +202,7 @@ Core::GeneratedFiles
|
|||||||
if (CustomWizard::verbose()) {
|
if (CustomWizard::verbose()) {
|
||||||
QDebug nospace = qDebug().nospace();
|
QDebug nospace = qDebug().nospace();
|
||||||
nospace << script << " generated:\n";
|
nospace << script << " generated:\n";
|
||||||
foreach(const Core::GeneratedFile &f, files)
|
foreach (const Core::GeneratedFile &f, files)
|
||||||
nospace << ' ' << f.path() << f.attributes() << '\n';
|
nospace << ' ' << f.path() << f.attributes() << '\n';
|
||||||
}
|
}
|
||||||
return files;
|
return files;
|
||||||
|
@@ -368,7 +368,7 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing()
|
|||||||
QStringList searchDirs = childParser->searchDirectories();
|
QStringList searchDirs = childParser->searchDirectories();
|
||||||
|
|
||||||
// add extra directories:
|
// add extra directories:
|
||||||
foreach(const QString &dir, extraSearchDirs)
|
foreach (const QString &dir, extraSearchDirs)
|
||||||
childParser->addDirectory(dir);
|
childParser->addDirectory(dir);
|
||||||
|
|
||||||
testbench.testParsing(input, inputChannel,
|
testbench.testParsing(input, inputChannel,
|
||||||
|
@@ -84,7 +84,7 @@ void OutputParserTester::testParsing(const QString &lines,
|
|||||||
QCOMPARE(m_receivedStdOutChildLine, childStdOutLines);
|
QCOMPARE(m_receivedStdOutChildLine, childStdOutLines);
|
||||||
QCOMPARE(m_receivedTasks.size(), tasks.size());
|
QCOMPARE(m_receivedTasks.size(), tasks.size());
|
||||||
if (m_receivedTasks.size() == tasks.size()) {
|
if (m_receivedTasks.size() == tasks.size()) {
|
||||||
for(int i = 0; i < tasks.size(); ++i) {
|
for (int i = 0; i < tasks.size(); ++i) {
|
||||||
QCOMPARE(m_receivedTasks.at(i).category, tasks.at(i).category);
|
QCOMPARE(m_receivedTasks.at(i).category, tasks.at(i).category);
|
||||||
QCOMPARE(m_receivedTasks.at(i).description, tasks.at(i).description);
|
QCOMPARE(m_receivedTasks.at(i).description, tasks.at(i).description);
|
||||||
QCOMPARE(m_receivedTasks.at(i).file, tasks.at(i).file);
|
QCOMPARE(m_receivedTasks.at(i).file, tasks.at(i).file);
|
||||||
|
@@ -1125,7 +1125,7 @@ void ProjectExplorerPlugin::loadCustomWizards()
|
|||||||
static bool firstTime = true;
|
static bool firstTime = true;
|
||||||
if (firstTime) {
|
if (firstTime) {
|
||||||
firstTime = false;
|
firstTime = false;
|
||||||
foreach(Core::IWizard *cpw, ProjectExplorer::CustomWizard::createWizards())
|
foreach (Core::IWizard *cpw, ProjectExplorer::CustomWizard::createWizards())
|
||||||
addAutoReleasedObject(cpw);
|
addAutoReleasedObject(cpw);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2114,7 +2114,7 @@ void ProjectExplorerPlugin::runProjectContextMenu()
|
|||||||
bool ProjectExplorerPlugin::hasBuildSettings(Project *pro)
|
bool ProjectExplorerPlugin::hasBuildSettings(Project *pro)
|
||||||
{
|
{
|
||||||
const QList<Project *> & projects = d->m_session->projectOrder(pro);
|
const QList<Project *> & projects = d->m_session->projectOrder(pro);
|
||||||
foreach(Project *project, projects)
|
foreach (Project *project, projects)
|
||||||
if (project
|
if (project
|
||||||
&& project->activeTarget()
|
&& project->activeTarget()
|
||||||
&& project->activeTarget()->activeBuildConfiguration())
|
&& project->activeTarget()->activeBuildConfiguration())
|
||||||
@@ -2140,7 +2140,7 @@ QPair<bool, QString> ProjectExplorerPlugin::buildSettingsEnabled(Project *pro)
|
|||||||
result.second = tr("Project has no build settings.");
|
result.second = tr("Project has no build settings.");
|
||||||
} else {
|
} else {
|
||||||
const QList<Project *> & projects = d->m_session->projectOrder(pro);
|
const QList<Project *> & projects = d->m_session->projectOrder(pro);
|
||||||
foreach(Project *project, projects) {
|
foreach (Project *project, projects) {
|
||||||
if (project
|
if (project
|
||||||
&& project->activeTarget()
|
&& project->activeTarget()
|
||||||
&& project->activeTarget()->activeBuildConfiguration()
|
&& project->activeTarget()->activeBuildConfiguration()
|
||||||
@@ -2170,7 +2170,7 @@ QPair<bool, QString> ProjectExplorerPlugin::buildSettingsEnabledForSession()
|
|||||||
result.second = tr("Project has no build settings");
|
result.second = tr("Project has no build settings");
|
||||||
} else {
|
} else {
|
||||||
const QList<Project *> & projects = d->m_session->projectOrder(0);
|
const QList<Project *> & projects = d->m_session->projectOrder(0);
|
||||||
foreach(Project *project, projects) {
|
foreach (Project *project, projects) {
|
||||||
if (project
|
if (project
|
||||||
&& project->activeTarget()
|
&& project->activeTarget()
|
||||||
&& project->activeTarget()->activeBuildConfiguration()
|
&& project->activeTarget()->activeBuildConfiguration()
|
||||||
@@ -2207,7 +2207,7 @@ bool ProjectExplorerPlugin::coreAboutToClose()
|
|||||||
bool ProjectExplorerPlugin::hasDeploySettings(Project *pro)
|
bool ProjectExplorerPlugin::hasDeploySettings(Project *pro)
|
||||||
{
|
{
|
||||||
const QList<Project *> & projects = d->m_session->projectOrder(pro);
|
const QList<Project *> & projects = d->m_session->projectOrder(pro);
|
||||||
foreach(Project *project, projects)
|
foreach (Project *project, projects)
|
||||||
if (project->activeTarget()
|
if (project->activeTarget()
|
||||||
&& project->activeTarget()->activeDeployConfiguration()
|
&& project->activeTarget()->activeDeployConfiguration()
|
||||||
&& !project->activeTarget()->activeDeployConfiguration()->stepList()->isEmpty())
|
&& !project->activeTarget()->activeDeployConfiguration()->stepList()->isEmpty())
|
||||||
@@ -2508,7 +2508,7 @@ void ProjectExplorerPlugin::addToRecentProjects(const QString &fileName, const Q
|
|||||||
QString prettyFileName(QDir::toNativeSeparators(fileName));
|
QString prettyFileName(QDir::toNativeSeparators(fileName));
|
||||||
|
|
||||||
QList<QPair<QString, QString> >::iterator it;
|
QList<QPair<QString, QString> >::iterator it;
|
||||||
for(it = d->m_recentProjects.begin(); it != d->m_recentProjects.end();)
|
for (it = d->m_recentProjects.begin(); it != d->m_recentProjects.end();)
|
||||||
if ((*it).first == prettyFileName)
|
if ((*it).first == prettyFileName)
|
||||||
it = d->m_recentProjects.erase(it);
|
it = d->m_recentProjects.erase(it);
|
||||||
else
|
else
|
||||||
@@ -2973,9 +2973,9 @@ QStringList ProjectExplorerPlugin::projectFilePatterns()
|
|||||||
{
|
{
|
||||||
QStringList patterns;
|
QStringList patterns;
|
||||||
const Core::MimeDatabase *mdb = Core::ICore::mimeDatabase();
|
const Core::MimeDatabase *mdb = Core::ICore::mimeDatabase();
|
||||||
foreach(const IProjectManager *pm, allProjectManagers())
|
foreach (const IProjectManager *pm, allProjectManagers())
|
||||||
if (const Core::MimeType mt = mdb->findByType(pm->mimeType()))
|
if (const Core::MimeType mt = mdb->findByType(pm->mimeType()))
|
||||||
foreach(const Core::MimeGlobPattern &gp, mt.globPatterns())
|
foreach (const Core::MimeGlobPattern &gp, mt.globPatterns())
|
||||||
patterns += gp.regExp().pattern();
|
patterns += gp.regExp().pattern();
|
||||||
return patterns;
|
return patterns;
|
||||||
}
|
}
|
||||||
|
@@ -410,7 +410,7 @@ static inline void getProjectChoicesAndToolTips(QStringList *projectChoicesParam
|
|||||||
ProjectNode::ProjectAction projectAction =
|
ProjectNode::ProjectAction projectAction =
|
||||||
context->wizard->kind() == Core::IWizard::ProjectWizard
|
context->wizard->kind() == Core::IWizard::ProjectWizard
|
||||||
? ProjectNode::AddSubProject : ProjectNode::AddNewFile;
|
? ProjectNode::AddSubProject : ProjectNode::AddNewFile;
|
||||||
foreach(ProjectNode *n, AllProjectNodesVisitor::allProjects(projectAction)) {
|
foreach (ProjectNode *n, AllProjectNodesVisitor::allProjects(projectAction)) {
|
||||||
if (projectAction == ProjectNode::AddNewFile
|
if (projectAction == ProjectNode::AddNewFile
|
||||||
|| (projectAction == ProjectNode::AddSubProject
|
|| (projectAction == ProjectNode::AddSubProject
|
||||||
&& (generatedProjectFilePath.isEmpty() ? true : n->canAddSubProject(generatedProjectFilePath))))
|
&& (generatedProjectFilePath.isEmpty() ? true : n->canAddSubProject(generatedProjectFilePath))))
|
||||||
|
@@ -836,7 +836,7 @@ void FlatModel::filesAboutToBeRemoved(FolderNode *folder, const QList<FileNode*>
|
|||||||
FolderNode *folderNode = visibleFolderNode(folder);
|
FolderNode *folderNode = visibleFolderNode(folder);
|
||||||
|
|
||||||
QSet<Node *> blackList;
|
QSet<Node *> blackList;
|
||||||
foreach(Node *node, staleFiles)
|
foreach (Node *node, staleFiles)
|
||||||
blackList.insert(node);
|
blackList.insert(node);
|
||||||
|
|
||||||
// Now get the new List for that folder
|
// Now get the new List for that folder
|
||||||
|
@@ -208,7 +208,7 @@ void ProjectTreeWidget::recursiveSaveExpandData(const QModelIndex &index, QStrin
|
|||||||
void ProjectTreeWidget::foldersAboutToBeRemoved(FolderNode *, const QList<FolderNode*> &list)
|
void ProjectTreeWidget::foldersAboutToBeRemoved(FolderNode *, const QList<FolderNode*> &list)
|
||||||
{
|
{
|
||||||
Node *n = m_explorer->currentNode();
|
Node *n = m_explorer->currentNode();
|
||||||
while(n) {
|
while (n) {
|
||||||
if (FolderNode *fn = qobject_cast<FolderNode *>(n)) {
|
if (FolderNode *fn = qobject_cast<FolderNode *>(n)) {
|
||||||
if (list.contains(fn)) {
|
if (list.contains(fn)) {
|
||||||
ProjectNode *pn = n->projectNode();
|
ProjectNode *pn = n->projectNode();
|
||||||
|
@@ -170,7 +170,7 @@ void SessionDialog::addItems(bool setDefaultSession)
|
|||||||
}
|
}
|
||||||
void SessionDialog::markItems()
|
void SessionDialog::markItems()
|
||||||
{
|
{
|
||||||
for(int i = 0; i < m_ui.sessionList->count(); ++i) {
|
for (int i = 0; i < m_ui.sessionList->count(); ++i) {
|
||||||
QListWidgetItem *item = m_ui.sessionList->item(i);
|
QListWidgetItem *item = m_ui.sessionList->item(i);
|
||||||
QFont f = item->font();
|
QFont f = item->font();
|
||||||
QString session = item->data(Qt::DisplayRole).toString();
|
QString session = item->data(Qt::DisplayRole).toString();
|
||||||
|
@@ -1628,7 +1628,7 @@ QVariantMap Version4Handler::update(Project *, const QVariantMap &map)
|
|||||||
const QVariantMap &originalBc = targetIt.value().toMap();
|
const QVariantMap &originalBc = targetIt.value().toMap();
|
||||||
QVariantMap newBc;
|
QVariantMap newBc;
|
||||||
QMapIterator<QString, QVariant> bcIt(originalBc);
|
QMapIterator<QString, QVariant> bcIt(originalBc);
|
||||||
while(bcIt.hasNext()) {
|
while (bcIt.hasNext()) {
|
||||||
bcIt.next();
|
bcIt.next();
|
||||||
const QString &bcKey = bcIt.key();
|
const QString &bcKey = bcIt.key();
|
||||||
if (!bcKey.startsWith(QLatin1String("ProjectExplorer.BuildConfiguration.BuildStep."))) {
|
if (!bcKey.startsWith(QLatin1String("ProjectExplorer.BuildConfiguration.BuildStep."))) {
|
||||||
|
@@ -86,7 +86,7 @@ void FormEditorScene::setupScene()
|
|||||||
|
|
||||||
void FormEditorScene::resetScene()
|
void FormEditorScene::resetScene()
|
||||||
{
|
{
|
||||||
foreach(QGraphicsItem *item, m_manipulatorLayerItem->childItems())
|
foreach (QGraphicsItem *item, m_manipulatorLayerItem->childItems())
|
||||||
removeItem(item);
|
removeItem(item);
|
||||||
|
|
||||||
setSceneRect(-canvasWidth()/2., -canvasHeight()/2., canvasWidth(), canvasHeight());
|
setSceneRect(-canvasWidth()/2., -canvasHeight()/2., canvasWidth(), canvasHeight());
|
||||||
@@ -340,7 +340,7 @@ LayerItem* FormEditorScene::formLayerItem() const
|
|||||||
|
|
||||||
bool FormEditorScene::event(QEvent * event)
|
bool FormEditorScene::event(QEvent * event)
|
||||||
{
|
{
|
||||||
switch(event->type())
|
switch (event->type())
|
||||||
{
|
{
|
||||||
case QEvent::GraphicsSceneHoverEnter :
|
case QEvent::GraphicsSceneHoverEnter :
|
||||||
hoverEnterEvent(static_cast<QGraphicsSceneHoverEvent *>(event));
|
hoverEnterEvent(static_cast<QGraphicsSceneHoverEvent *>(event));
|
||||||
@@ -414,7 +414,7 @@ void FormEditorScene::clearFormEditorItems()
|
|||||||
|
|
||||||
void FormEditorScene::highlightBoundingRect(FormEditorItem *highlighItem)
|
void FormEditorScene::highlightBoundingRect(FormEditorItem *highlighItem)
|
||||||
{
|
{
|
||||||
foreach(FormEditorItem *item, allFormEditorItems()) {
|
foreach (FormEditorItem *item, allFormEditorItems()) {
|
||||||
if (item == highlighItem)
|
if (item == highlighItem)
|
||||||
item->setHighlightBoundingRect(true);
|
item->setHighlightBoundingRect(true);
|
||||||
else
|
else
|
||||||
|
@@ -215,12 +215,12 @@ void FormEditorView::nodeAboutToBeRemoved(const ModelNode &removedNode)
|
|||||||
|
|
||||||
void FormEditorView::propertiesAboutToBeRemoved(const QList<AbstractProperty>& propertyList)
|
void FormEditorView::propertiesAboutToBeRemoved(const QList<AbstractProperty>& propertyList)
|
||||||
{
|
{
|
||||||
foreach(const AbstractProperty &property, propertyList) {
|
foreach (const AbstractProperty &property, propertyList) {
|
||||||
if (property.isNodeAbstractProperty()) {
|
if (property.isNodeAbstractProperty()) {
|
||||||
NodeAbstractProperty nodeAbstractProperty = property.toNodeAbstractProperty();
|
NodeAbstractProperty nodeAbstractProperty = property.toNodeAbstractProperty();
|
||||||
QList<FormEditorItem*> removedItemList;
|
QList<FormEditorItem*> removedItemList;
|
||||||
|
|
||||||
foreach(const ModelNode &modelNode, nodeAbstractProperty.allSubNodes()) {
|
foreach (const ModelNode &modelNode, nodeAbstractProperty.allSubNodes()) {
|
||||||
QmlItemNode qmlItemNode(modelNode);
|
QmlItemNode qmlItemNode(modelNode);
|
||||||
|
|
||||||
if (qmlItemNode.isValid() && m_scene->hasItemForQmlItemNode(qmlItemNode)) {
|
if (qmlItemNode.isValid() && m_scene->hasItemForQmlItemNode(qmlItemNode)) {
|
||||||
@@ -405,7 +405,7 @@ void FormEditorView::changeToTransformTools()
|
|||||||
void FormEditorView::nodeSlidedToIndex(const NodeListProperty &listProperty, int /*newIndex*/, int /*oldIndex*/)
|
void FormEditorView::nodeSlidedToIndex(const NodeListProperty &listProperty, int /*newIndex*/, int /*oldIndex*/)
|
||||||
{
|
{
|
||||||
QList<ModelNode> newOrderModelNodeList = listProperty.toModelNodeList();
|
QList<ModelNode> newOrderModelNodeList = listProperty.toModelNodeList();
|
||||||
foreach(const ModelNode &node, newOrderModelNodeList) {
|
foreach (const ModelNode &node, newOrderModelNodeList) {
|
||||||
FormEditorItem *item = m_scene->itemForQmlItemNode(QmlItemNode(node));
|
FormEditorItem *item = m_scene->itemForQmlItemNode(QmlItemNode(node));
|
||||||
if (item) {
|
if (item) {
|
||||||
FormEditorItem *oldParentItem = item->parentItem();
|
FormEditorItem *oldParentItem = item->parentItem();
|
||||||
|
@@ -194,7 +194,7 @@ QPointF MoveManipulator::findSnappingOffset(const QHash<FormEditorItem*, QRectF>
|
|||||||
QMap<double, double> horizontalOffsetMap;
|
QMap<double, double> horizontalOffsetMap;
|
||||||
|
|
||||||
QHashIterator<FormEditorItem*, QRectF> hashIterator(boundingRectHash);
|
QHashIterator<FormEditorItem*, QRectF> hashIterator(boundingRectHash);
|
||||||
while(hashIterator.hasNext()) {
|
while (hashIterator.hasNext()) {
|
||||||
hashIterator.next();
|
hashIterator.next();
|
||||||
FormEditorItem *formEditorItem = hashIterator.key();
|
FormEditorItem *formEditorItem = hashIterator.key();
|
||||||
QRectF boundingRect = hashIterator.value();
|
QRectF boundingRect = hashIterator.value();
|
||||||
@@ -241,7 +241,7 @@ QHash<FormEditorItem*, QRectF> MoveManipulator::tanslatedBoundingRects(const QHa
|
|||||||
QHash<FormEditorItem*, QRectF> translatedBoundingRectHash;
|
QHash<FormEditorItem*, QRectF> translatedBoundingRectHash;
|
||||||
|
|
||||||
QHashIterator<FormEditorItem*, QRectF> hashIterator(boundingRectHash);
|
QHashIterator<FormEditorItem*, QRectF> hashIterator(boundingRectHash);
|
||||||
while(hashIterator.hasNext()) {
|
while (hashIterator.hasNext()) {
|
||||||
QPointF alignedOffset(offsetVector);
|
QPointF alignedOffset(offsetVector);
|
||||||
hashIterator.next();
|
hashIterator.next();
|
||||||
FormEditorItem *formEditorItem = hashIterator.key();
|
FormEditorItem *formEditorItem = hashIterator.key();
|
||||||
|
@@ -143,7 +143,7 @@ void MoveTool::hoverMoveEvent(const QList<QGraphicsItem*> &itemList,
|
|||||||
|
|
||||||
void MoveTool::keyPressEvent(QKeyEvent *event)
|
void MoveTool::keyPressEvent(QKeyEvent *event)
|
||||||
{
|
{
|
||||||
switch(event->key()) {
|
switch (event->key()) {
|
||||||
case Qt::Key_Shift:
|
case Qt::Key_Shift:
|
||||||
case Qt::Key_Alt:
|
case Qt::Key_Alt:
|
||||||
case Qt::Key_Control:
|
case Qt::Key_Control:
|
||||||
@@ -168,7 +168,7 @@ void MoveTool::keyPressEvent(QKeyEvent *event)
|
|||||||
m_moveManipulator.beginRewriterTransaction();
|
m_moveManipulator.beginRewriterTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(event->key()) {
|
switch (event->key()) {
|
||||||
case Qt::Key_Left: m_moveManipulator.moveBy(-moveStep, 0.0); break;
|
case Qt::Key_Left: m_moveManipulator.moveBy(-moveStep, 0.0); break;
|
||||||
case Qt::Key_Right: m_moveManipulator.moveBy(moveStep, 0.0); break;
|
case Qt::Key_Right: m_moveManipulator.moveBy(moveStep, 0.0); break;
|
||||||
case Qt::Key_Up: m_moveManipulator.moveBy(0.0, -moveStep); break;
|
case Qt::Key_Up: m_moveManipulator.moveBy(0.0, -moveStep); break;
|
||||||
@@ -183,7 +183,7 @@ void MoveTool::keyPressEvent(QKeyEvent *event)
|
|||||||
|
|
||||||
void MoveTool::keyReleaseEvent(QKeyEvent *keyEvent)
|
void MoveTool::keyReleaseEvent(QKeyEvent *keyEvent)
|
||||||
{
|
{
|
||||||
switch(keyEvent->key()) {
|
switch (keyEvent->key()) {
|
||||||
case Qt::Key_Shift:
|
case Qt::Key_Shift:
|
||||||
case Qt::Key_Alt:
|
case Qt::Key_Alt:
|
||||||
case Qt::Key_Control:
|
case Qt::Key_Control:
|
||||||
|
@@ -36,7 +36,7 @@ namespace QmlDesigner {
|
|||||||
double sum(const QList<double> & list)
|
double sum(const QList<double> & list)
|
||||||
{
|
{
|
||||||
double sum = 0.0;
|
double sum = 0.0;
|
||||||
for(QList<double>::const_iterator iterator = list.constBegin(); iterator != list.constEnd(); ++iterator)
|
for (QList<double>::const_iterator iterator = list.constBegin(); iterator != list.constEnd(); ++iterator)
|
||||||
{
|
{
|
||||||
sum += *iterator;
|
sum += *iterator;
|
||||||
}
|
}
|
||||||
|
@@ -142,7 +142,7 @@ void ResizeTool::mouseDoubleClickEvent(const QList<QGraphicsItem*> & /*itemList*
|
|||||||
|
|
||||||
void ResizeTool::keyPressEvent(QKeyEvent * event)
|
void ResizeTool::keyPressEvent(QKeyEvent * event)
|
||||||
{
|
{
|
||||||
switch(event->key()) {
|
switch (event->key()) {
|
||||||
case Qt::Key_Shift:
|
case Qt::Key_Shift:
|
||||||
case Qt::Key_Alt:
|
case Qt::Key_Alt:
|
||||||
case Qt::Key_Control:
|
case Qt::Key_Control:
|
||||||
@@ -156,7 +156,7 @@ void ResizeTool::keyPressEvent(QKeyEvent * event)
|
|||||||
if (event->modifiers().testFlag(Qt::ShiftModifier))
|
if (event->modifiers().testFlag(Qt::ShiftModifier))
|
||||||
moveStep = 10.0;
|
moveStep = 10.0;
|
||||||
|
|
||||||
switch(event->key()) {
|
switch (event->key()) {
|
||||||
case Qt::Key_Left: m_resizeManipulator.moveBy(-moveStep, 0.0); break;
|
case Qt::Key_Left: m_resizeManipulator.moveBy(-moveStep, 0.0); break;
|
||||||
case Qt::Key_Right: m_resizeManipulator.moveBy(moveStep, 0.0); break;
|
case Qt::Key_Right: m_resizeManipulator.moveBy(moveStep, 0.0); break;
|
||||||
case Qt::Key_Up: m_resizeManipulator.moveBy(0.0, -moveStep); break;
|
case Qt::Key_Up: m_resizeManipulator.moveBy(0.0, -moveStep); break;
|
||||||
@@ -167,7 +167,7 @@ void ResizeTool::keyPressEvent(QKeyEvent * event)
|
|||||||
|
|
||||||
void ResizeTool::keyReleaseEvent(QKeyEvent * keyEvent)
|
void ResizeTool::keyReleaseEvent(QKeyEvent * keyEvent)
|
||||||
{
|
{
|
||||||
switch(keyEvent->key()) {
|
switch (keyEvent->key()) {
|
||||||
case Qt::Key_Shift:
|
case Qt::Key_Shift:
|
||||||
case Qt::Key_Alt:
|
case Qt::Key_Alt:
|
||||||
case Qt::Key_Control:
|
case Qt::Key_Control:
|
||||||
|
@@ -118,7 +118,7 @@ void RubberBandSelectionManipulator::select(SelectionType selectionType)
|
|||||||
|
|
||||||
QList<QmlItemNode> nodeList;
|
QList<QmlItemNode> nodeList;
|
||||||
|
|
||||||
switch(selectionType) {
|
switch (selectionType) {
|
||||||
case AddToSelection: {
|
case AddToSelection: {
|
||||||
nodeList.append(m_oldSelectionList);
|
nodeList.append(m_oldSelectionList);
|
||||||
nodeList.append(newNodeList);
|
nodeList.append(newNodeList);
|
||||||
|
@@ -144,7 +144,7 @@ void SelectionTool::hoverMoveEvent(const QList<QGraphicsItem*> &itemList,
|
|||||||
|
|
||||||
FormEditorItem *topSelectableItem = 0;
|
FormEditorItem *topSelectableItem = 0;
|
||||||
|
|
||||||
foreach(QGraphicsItem* item, itemList)
|
foreach (QGraphicsItem* item, itemList)
|
||||||
{
|
{
|
||||||
FormEditorItem *formEditorItem = FormEditorItem::fromQGraphicsItem(item);
|
FormEditorItem *formEditorItem = FormEditorItem::fromQGraphicsItem(item);
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ void SelectionTool::mouseDoubleClickEvent(const QList<QGraphicsItem*> &itemList,
|
|||||||
|
|
||||||
void SelectionTool::keyPressEvent(QKeyEvent *event)
|
void SelectionTool::keyPressEvent(QKeyEvent *event)
|
||||||
{
|
{
|
||||||
switch(event->key()) {
|
switch (event->key()) {
|
||||||
case Qt::Key_Left:
|
case Qt::Key_Left:
|
||||||
case Qt::Key_Right:
|
case Qt::Key_Right:
|
||||||
case Qt::Key_Up:
|
case Qt::Key_Up:
|
||||||
|
@@ -75,7 +75,7 @@ void SingleSelectionManipulator::select(SelectionType selectionType, bool select
|
|||||||
|
|
||||||
QmlItemNode selectedNode;
|
QmlItemNode selectedNode;
|
||||||
|
|
||||||
foreach(QGraphicsItem* item, itemList)
|
foreach (QGraphicsItem* item, itemList)
|
||||||
{
|
{
|
||||||
FormEditorItem *formEditorItem = FormEditorItem::fromQGraphicsItem(item);
|
FormEditorItem *formEditorItem = FormEditorItem::fromQGraphicsItem(item);
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ void SingleSelectionManipulator::select(SelectionType selectionType, bool select
|
|||||||
|
|
||||||
QList<QmlItemNode> nodeList;
|
QList<QmlItemNode> nodeList;
|
||||||
|
|
||||||
switch(selectionType) {
|
switch (selectionType) {
|
||||||
case AddToSelection: {
|
case AddToSelection: {
|
||||||
nodeList.append(m_oldSelectionList);
|
nodeList.append(m_oldSelectionList);
|
||||||
if (selectedNode.isValid())
|
if (selectedNode.isValid())
|
||||||
|
@@ -473,7 +473,7 @@ static QLineF mergedHorizontalLine(const QList<QLineF> &lineList)
|
|||||||
|
|
||||||
double minimumX = std::numeric_limits<double>::max();
|
double minimumX = std::numeric_limits<double>::max();
|
||||||
double maximumX = std::numeric_limits<double>::min();
|
double maximumX = std::numeric_limits<double>::min();
|
||||||
foreach(const QLineF &line, lineList) {
|
foreach (const QLineF &line, lineList) {
|
||||||
minimumX = qMin(minimumX, double(line.x1()));
|
minimumX = qMin(minimumX, double(line.x1()));
|
||||||
minimumX = qMin(minimumX, double(line.x2()));
|
minimumX = qMin(minimumX, double(line.x2()));
|
||||||
maximumX = qMax(maximumX, double(line.x1()));
|
maximumX = qMax(maximumX, double(line.x1()));
|
||||||
@@ -491,7 +491,7 @@ static QLineF mergedVerticalLine(const QList<QLineF> &lineList)
|
|||||||
|
|
||||||
double minimumY = std::numeric_limits<double>::max();
|
double minimumY = std::numeric_limits<double>::max();
|
||||||
double maximumY = std::numeric_limits<double>::min();
|
double maximumY = std::numeric_limits<double>::min();
|
||||||
foreach(const QLineF &line, lineList) {
|
foreach (const QLineF &line, lineList) {
|
||||||
minimumY = qMin(minimumY, double(line.y1()));
|
minimumY = qMin(minimumY, double(line.y1()));
|
||||||
minimumY = qMin(minimumY, double(line.y2()));
|
minimumY = qMin(minimumY, double(line.y2()));
|
||||||
maximumY = qMax(maximumY, double(line.y1()));
|
maximumY = qMax(maximumY, double(line.y1()));
|
||||||
@@ -585,13 +585,13 @@ QList<QGraphicsItem*> Snapper::generateSnappingLines(const QList<QRectF> &boundi
|
|||||||
{
|
{
|
||||||
QList<QGraphicsItem*> graphicsItemList;
|
QList<QGraphicsItem*> graphicsItemList;
|
||||||
QList<QLineF> lineList;
|
QList<QLineF> lineList;
|
||||||
foreach(const QRectF &boundingRect, boundingRectList) {
|
foreach (const QRectF &boundingRect, boundingRectList) {
|
||||||
QList<QRectF> snappedBoundingRectList;
|
QList<QRectF> snappedBoundingRectList;
|
||||||
lineList += mergedHorizontalLines(horizontalSnappedLines(boundingRect, &snappedBoundingRectList));
|
lineList += mergedHorizontalLines(horizontalSnappedLines(boundingRect, &snappedBoundingRectList));
|
||||||
lineList += mergedVerticalLines(verticalSnappedLines(boundingRect, &snappedBoundingRectList));
|
lineList += mergedVerticalLines(verticalSnappedLines(boundingRect, &snappedBoundingRectList));
|
||||||
|
|
||||||
// snappedBoundingRectList.append(boundingRect);
|
// snappedBoundingRectList.append(boundingRect);
|
||||||
// foreach(const QRectF &snappedBoundingRect, snappedBoundingRectList) {
|
// foreach (const QRectF &snappedBoundingRect, snappedBoundingRectList) {
|
||||||
// QPolygonF rect = transform.map(snappedBoundingRect);
|
// QPolygonF rect = transform.map(snappedBoundingRect);
|
||||||
// alignVertices(rect);
|
// alignVertices(rect);
|
||||||
// QGraphicsPolygonItem * item = new QGraphicsPolygonItem(rect, layerItem);
|
// QGraphicsPolygonItem * item = new QGraphicsPolygonItem(rect, layerItem);
|
||||||
@@ -607,7 +607,7 @@ QList<QGraphicsItem*> Snapper::generateSnappingLines(const QList<QRectF> &boundi
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(const QLineF &line, lineList) {
|
foreach (const QLineF &line, lineList) {
|
||||||
QLineF lineInTransformationSpace = transform.map(line);
|
QLineF lineInTransformationSpace = transform.map(line);
|
||||||
// alignLine(lineInTransformationSpace);
|
// alignLine(lineInTransformationSpace);
|
||||||
QGraphicsLineItem * lineItem = new QGraphicsLineItem(lineInTransformationSpace, layerItem);
|
QGraphicsLineItem * lineItem = new QGraphicsLineItem(lineInTransformationSpace, layerItem);
|
||||||
|
@@ -401,7 +401,7 @@ void NavigatorView::updateItemSelection()
|
|||||||
treeWidget()->scrollTo(m_treeModel->indexForNode(selectedModelNodes().first()));
|
treeWidget()->scrollTo(m_treeModel->indexForNode(selectedModelNodes().first()));
|
||||||
|
|
||||||
// make sure selected nodes a visible
|
// make sure selected nodes a visible
|
||||||
foreach(const QModelIndex &selectedIndex, itemSelection.indexes()) {
|
foreach (const QModelIndex &selectedIndex, itemSelection.indexes()) {
|
||||||
if (selectedIndex.column() == 0)
|
if (selectedIndex.column() == 0)
|
||||||
expandRecursively(selectedIndex);
|
expandRecursively(selectedIndex);
|
||||||
}
|
}
|
||||||
|
@@ -80,7 +80,7 @@ WindowsStyleSingleton* WindowsStyleSingleton::m_instance = 0;
|
|||||||
WindowsStyleSingleton* WindowsStyleSingleton::instance()
|
WindowsStyleSingleton* WindowsStyleSingleton::instance()
|
||||||
{
|
{
|
||||||
static WindowsWatcher w;
|
static WindowsWatcher w;
|
||||||
if( m_instance == 0 )
|
if ( m_instance == 0 )
|
||||||
m_instance = new WindowsStyleSingleton();
|
m_instance = new WindowsStyleSingleton();
|
||||||
return m_instance;
|
return m_instance;
|
||||||
}
|
}
|
||||||
|
@@ -337,7 +337,7 @@ void StatesEditorView::instancesPreviewImageChanged(const QVector<ModelNode> &no
|
|||||||
{
|
{
|
||||||
int minimumIndex = 10000;
|
int minimumIndex = 10000;
|
||||||
int maximumIndex = -1;
|
int maximumIndex = -1;
|
||||||
foreach(const ModelNode &node, nodeList) {
|
foreach (const ModelNode &node, nodeList) {
|
||||||
if (node.isRootNode()) {
|
if (node.isRootNode()) {
|
||||||
minimumIndex = qMin(minimumIndex, 0);
|
minimumIndex = qMin(minimumIndex, 0);
|
||||||
maximumIndex = qMax(maximumIndex, 0);
|
maximumIndex = qMax(maximumIndex, 0);
|
||||||
|
@@ -104,7 +104,7 @@ bool QmlRefactoring::addToObjectMemberList(int parentLocation, const QString &co
|
|||||||
|
|
||||||
bool QmlRefactoring::addProperty(int parentLocation, const QString &name, const QString &value, PropertyType propertyType)
|
bool QmlRefactoring::addProperty(int parentLocation, const QString &name, const QString &value, PropertyType propertyType)
|
||||||
{
|
{
|
||||||
if(parentLocation < 0)
|
if (parentLocation < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
AddPropertyVisitor visit(*textModifier, (quint32) parentLocation, name, value, propertyType, m_propertyOrder);
|
AddPropertyVisitor visit(*textModifier, (quint32) parentLocation, name, value, propertyType, m_propertyOrder);
|
||||||
|
@@ -242,7 +242,7 @@ NodeInstanceServerProxy::~NodeInstanceServerProxy()
|
|||||||
if (m_secondSocket)
|
if (m_secondSocket)
|
||||||
m_secondSocket->close();
|
m_secondSocket->close();
|
||||||
|
|
||||||
if(m_thirdSocket)
|
if (m_thirdSocket)
|
||||||
m_thirdSocket->close();
|
m_thirdSocket->close();
|
||||||
|
|
||||||
|
|
||||||
@@ -298,7 +298,7 @@ NodeInstanceClientInterface *NodeInstanceServerProxy::nodeInstanceClient() const
|
|||||||
|
|
||||||
static void writeCommandToSocket(const QVariant &command, QLocalSocket *socket, unsigned int commandCounter)
|
static void writeCommandToSocket(const QVariant &command, QLocalSocket *socket, unsigned int commandCounter)
|
||||||
{
|
{
|
||||||
if(socket) {
|
if (socket) {
|
||||||
QByteArray block;
|
QByteArray block;
|
||||||
QDataStream out(&block, QIODevice::WriteOnly);
|
QDataStream out(&block, QIODevice::WriteOnly);
|
||||||
out.setVersion(QDataStream::Qt_4_8);
|
out.setVersion(QDataStream::Qt_4_8);
|
||||||
|
@@ -347,7 +347,7 @@ void NodeInstanceView::propertiesRemoved(const QList<AbstractProperty>& /*proper
|
|||||||
|
|
||||||
void NodeInstanceView::removeInstanceAndSubInstances(const ModelNode &node)
|
void NodeInstanceView::removeInstanceAndSubInstances(const ModelNode &node)
|
||||||
{
|
{
|
||||||
foreach(const ModelNode &subNode, node.allSubModelNodes()) {
|
foreach (const ModelNode &subNode, node.allSubModelNodes()) {
|
||||||
if (hasInstanceForNode(subNode))
|
if (hasInstanceForNode(subNode))
|
||||||
removeInstanceNodeRelationship(subNode);
|
removeInstanceNodeRelationship(subNode);
|
||||||
}
|
}
|
||||||
@@ -427,7 +427,7 @@ void NodeInstanceView::nodeOrderChanged(const NodeListProperty & listProperty,
|
|||||||
if (hasInstanceForNode(containerNode))
|
if (hasInstanceForNode(containerNode))
|
||||||
containerInstanceId = instanceForNode(containerNode).instanceId();
|
containerInstanceId = instanceForNode(containerNode).instanceId();
|
||||||
|
|
||||||
foreach(const ModelNode &node, listProperty.toModelNodeList()) {
|
foreach (const ModelNode &node, listProperty.toModelNodeList()) {
|
||||||
qint32 instanceId = -1;
|
qint32 instanceId = -1;
|
||||||
if (hasInstanceForNode(node)) {
|
if (hasInstanceForNode(node)) {
|
||||||
instanceId = instanceForNode(node).instanceId();
|
instanceId = instanceForNode(node).instanceId();
|
||||||
@@ -657,7 +657,7 @@ NodeInstance NodeInstanceView::rootNodeInstance() const
|
|||||||
void NodeInstanceView::insertInstanceRelationships(const NodeInstance &instance)
|
void NodeInstanceView::insertInstanceRelationships(const NodeInstance &instance)
|
||||||
{
|
{
|
||||||
Q_ASSERT(instance.instanceId() >=0);
|
Q_ASSERT(instance.instanceId() >=0);
|
||||||
if(m_nodeInstanceHash.contains(instance.modelNode()))
|
if (m_nodeInstanceHash.contains(instance.modelNode()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_nodeInstanceHash.insert(instance.modelNode(), instance);
|
m_nodeInstanceHash.insert(instance.modelNode(), instance);
|
||||||
@@ -738,7 +738,7 @@ QRectF NodeInstanceView::sceneRect() const
|
|||||||
QList<ModelNode> filterNodesForSkipItems(const QList<ModelNode> &nodeList)
|
QList<ModelNode> filterNodesForSkipItems(const QList<ModelNode> &nodeList)
|
||||||
{
|
{
|
||||||
QList<ModelNode> filteredNodeList;
|
QList<ModelNode> filteredNodeList;
|
||||||
foreach(const ModelNode &node, nodeList) {
|
foreach (const ModelNode &node, nodeList) {
|
||||||
if (isSkippedNode(node))
|
if (isSkippedNode(node))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -781,7 +781,7 @@ CreateSceneCommand NodeInstanceView::createCreateSceneCommand()
|
|||||||
|
|
||||||
|
|
||||||
QVector<InstanceContainer> instanceContainerList;
|
QVector<InstanceContainer> instanceContainerList;
|
||||||
foreach(const NodeInstance &instance, instanceList) {
|
foreach (const NodeInstance &instance, instanceList) {
|
||||||
InstanceContainer::NodeSourceType nodeSourceType = static_cast<InstanceContainer::NodeSourceType>(instance.modelNode().nodeSourceType());
|
InstanceContainer::NodeSourceType nodeSourceType = static_cast<InstanceContainer::NodeSourceType>(instance.modelNode().nodeSourceType());
|
||||||
|
|
||||||
InstanceContainer::NodeMetaType nodeMetaType = InstanceContainer::ObjectMetaType;
|
InstanceContainer::NodeMetaType nodeMetaType = InstanceContainer::ObjectMetaType;
|
||||||
@@ -802,7 +802,7 @@ CreateSceneCommand NodeInstanceView::createCreateSceneCommand()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QVector<ReparentContainer> reparentContainerList;
|
QVector<ReparentContainer> reparentContainerList;
|
||||||
foreach(const NodeInstance &instance, instanceList) {
|
foreach (const NodeInstance &instance, instanceList) {
|
||||||
if (instance.modelNode().hasParentProperty()) {
|
if (instance.modelNode().hasParentProperty()) {
|
||||||
NodeAbstractProperty parentProperty = instance.modelNode().parentProperty();
|
NodeAbstractProperty parentProperty = instance.modelNode().parentProperty();
|
||||||
ReparentContainer container(instance.instanceId(), -1, QString(), instanceForNode(parentProperty.parentModelNode()).instanceId(), parentProperty.name());
|
ReparentContainer container(instance.instanceId(), -1, QString(), instanceForNode(parentProperty.parentModelNode()).instanceId(), parentProperty.name());
|
||||||
@@ -811,7 +811,7 @@ CreateSceneCommand NodeInstanceView::createCreateSceneCommand()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QVector<IdContainer> idContainerList;
|
QVector<IdContainer> idContainerList;
|
||||||
foreach(const NodeInstance &instance, instanceList) {
|
foreach (const NodeInstance &instance, instanceList) {
|
||||||
QString id = instance.modelNode().id();
|
QString id = instance.modelNode().id();
|
||||||
if (!id.isEmpty()) {
|
if (!id.isEmpty()) {
|
||||||
IdContainer container(instance.instanceId(), id);
|
IdContainer container(instance.instanceId(), id);
|
||||||
@@ -820,7 +820,7 @@ CreateSceneCommand NodeInstanceView::createCreateSceneCommand()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QVector<PropertyValueContainer> valueContainerList;
|
QVector<PropertyValueContainer> valueContainerList;
|
||||||
foreach(const VariantProperty &property, variantPropertyList) {
|
foreach (const VariantProperty &property, variantPropertyList) {
|
||||||
ModelNode node = property.parentModelNode();
|
ModelNode node = property.parentModelNode();
|
||||||
if (node.isValid() && hasInstanceForNode(node)) {
|
if (node.isValid() && hasInstanceForNode(node)) {
|
||||||
NodeInstance instance = instanceForNode(node);
|
NodeInstance instance = instanceForNode(node);
|
||||||
@@ -830,7 +830,7 @@ CreateSceneCommand NodeInstanceView::createCreateSceneCommand()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QVector<PropertyBindingContainer> bindingContainerList;
|
QVector<PropertyBindingContainer> bindingContainerList;
|
||||||
foreach(const BindingProperty &property, bindingPropertyList) {
|
foreach (const BindingProperty &property, bindingPropertyList) {
|
||||||
ModelNode node = property.parentModelNode();
|
ModelNode node = property.parentModelNode();
|
||||||
if (node.isValid() && hasInstanceForNode(node)) {
|
if (node.isValid() && hasInstanceForNode(node)) {
|
||||||
NodeInstance instance = instanceForNode(node);
|
NodeInstance instance = instanceForNode(node);
|
||||||
@@ -840,7 +840,7 @@ CreateSceneCommand NodeInstanceView::createCreateSceneCommand()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QVector<AddImportContainer> importVector;
|
QVector<AddImportContainer> importVector;
|
||||||
foreach(const Import &import, model()->imports())
|
foreach (const Import &import, model()->imports())
|
||||||
importVector.append(AddImportContainer(import.url(), import.file(), import.version(), import.alias(), import.importPaths()));
|
importVector.append(AddImportContainer(import.url(), import.file(), import.version(), import.alias(), import.importPaths()));
|
||||||
|
|
||||||
return CreateSceneCommand(instanceContainerList,
|
return CreateSceneCommand(instanceContainerList,
|
||||||
@@ -861,7 +861,7 @@ ClearSceneCommand NodeInstanceView::createClearSceneCommand() const
|
|||||||
CompleteComponentCommand NodeInstanceView::createComponentCompleteCommand(const QList<NodeInstance> &instanceList) const
|
CompleteComponentCommand NodeInstanceView::createComponentCompleteCommand(const QList<NodeInstance> &instanceList) const
|
||||||
{
|
{
|
||||||
QVector<qint32> containerList;
|
QVector<qint32> containerList;
|
||||||
foreach(const NodeInstance &instance, instanceList) {
|
foreach (const NodeInstance &instance, instanceList) {
|
||||||
if (instance.instanceId() >= 0)
|
if (instance.instanceId() >= 0)
|
||||||
containerList.append(instance.instanceId());
|
containerList.append(instance.instanceId());
|
||||||
}
|
}
|
||||||
@@ -872,7 +872,7 @@ CompleteComponentCommand NodeInstanceView::createComponentCompleteCommand(const
|
|||||||
ComponentCompletedCommand NodeInstanceView::createComponentCompletedCommand(const QList<NodeInstance> &instanceList) const
|
ComponentCompletedCommand NodeInstanceView::createComponentCompletedCommand(const QList<NodeInstance> &instanceList) const
|
||||||
{
|
{
|
||||||
QVector<qint32> containerList;
|
QVector<qint32> containerList;
|
||||||
foreach(const NodeInstance &instance, instanceList) {
|
foreach (const NodeInstance &instance, instanceList) {
|
||||||
if (instance.instanceId() >= 0)
|
if (instance.instanceId() >= 0)
|
||||||
containerList.append(instance.instanceId());
|
containerList.append(instance.instanceId());
|
||||||
}
|
}
|
||||||
@@ -883,7 +883,7 @@ ComponentCompletedCommand NodeInstanceView::createComponentCompletedCommand(cons
|
|||||||
CreateInstancesCommand NodeInstanceView::createCreateInstancesCommand(const QList<NodeInstance> &instanceList) const
|
CreateInstancesCommand NodeInstanceView::createCreateInstancesCommand(const QList<NodeInstance> &instanceList) const
|
||||||
{
|
{
|
||||||
QVector<InstanceContainer> containerList;
|
QVector<InstanceContainer> containerList;
|
||||||
foreach(const NodeInstance &instance, instanceList) {
|
foreach (const NodeInstance &instance, instanceList) {
|
||||||
InstanceContainer::NodeSourceType nodeSourceType = static_cast<InstanceContainer::NodeSourceType>(instance.modelNode().nodeSourceType());
|
InstanceContainer::NodeSourceType nodeSourceType = static_cast<InstanceContainer::NodeSourceType>(instance.modelNode().nodeSourceType());
|
||||||
|
|
||||||
InstanceContainer::NodeMetaType nodeMetaType = InstanceContainer::ObjectMetaType;
|
InstanceContainer::NodeMetaType nodeMetaType = InstanceContainer::ObjectMetaType;
|
||||||
@@ -901,7 +901,7 @@ CreateInstancesCommand NodeInstanceView::createCreateInstancesCommand(const QLis
|
|||||||
ReparentInstancesCommand NodeInstanceView::createReparentInstancesCommand(const QList<NodeInstance> &instanceList) const
|
ReparentInstancesCommand NodeInstanceView::createReparentInstancesCommand(const QList<NodeInstance> &instanceList) const
|
||||||
{
|
{
|
||||||
QVector<ReparentContainer> containerList;
|
QVector<ReparentContainer> containerList;
|
||||||
foreach(const NodeInstance &instance, instanceList) {
|
foreach (const NodeInstance &instance, instanceList) {
|
||||||
if (instance.modelNode().hasParentProperty()) {
|
if (instance.modelNode().hasParentProperty()) {
|
||||||
NodeAbstractProperty parentProperty = instance.modelNode().parentProperty();
|
NodeAbstractProperty parentProperty = instance.modelNode().parentProperty();
|
||||||
ReparentContainer container(instance.instanceId(), -1, QString(), instanceForNode(parentProperty.parentModelNode()).instanceId(), parentProperty.name());
|
ReparentContainer container(instance.instanceId(), -1, QString(), instanceForNode(parentProperty.parentModelNode()).instanceId(), parentProperty.name());
|
||||||
@@ -943,7 +943,7 @@ ChangeValuesCommand NodeInstanceView::createChangeValueCommand(const QList<Varia
|
|||||||
{
|
{
|
||||||
QVector<PropertyValueContainer> containerList;
|
QVector<PropertyValueContainer> containerList;
|
||||||
|
|
||||||
foreach(const VariantProperty &property, propertyList) {
|
foreach (const VariantProperty &property, propertyList) {
|
||||||
ModelNode node = property.parentModelNode();
|
ModelNode node = property.parentModelNode();
|
||||||
if (node.isValid() && hasInstanceForNode(node)) {
|
if (node.isValid() && hasInstanceForNode(node)) {
|
||||||
NodeInstance instance = instanceForNode(node);
|
NodeInstance instance = instanceForNode(node);
|
||||||
@@ -960,7 +960,7 @@ ChangeBindingsCommand NodeInstanceView::createChangeBindingCommand(const QList<B
|
|||||||
{
|
{
|
||||||
QVector<PropertyBindingContainer> containerList;
|
QVector<PropertyBindingContainer> containerList;
|
||||||
|
|
||||||
foreach(const BindingProperty &property, propertyList) {
|
foreach (const BindingProperty &property, propertyList) {
|
||||||
ModelNode node = property.parentModelNode();
|
ModelNode node = property.parentModelNode();
|
||||||
if (node.isValid() && hasInstanceForNode(node)) {
|
if (node.isValid() && hasInstanceForNode(node)) {
|
||||||
NodeInstance instance = instanceForNode(node);
|
NodeInstance instance = instanceForNode(node);
|
||||||
@@ -976,7 +976,7 @@ ChangeBindingsCommand NodeInstanceView::createChangeBindingCommand(const QList<B
|
|||||||
ChangeIdsCommand NodeInstanceView::createChangeIdsCommand(const QList<NodeInstance> &instanceList) const
|
ChangeIdsCommand NodeInstanceView::createChangeIdsCommand(const QList<NodeInstance> &instanceList) const
|
||||||
{
|
{
|
||||||
QVector<IdContainer> containerList;
|
QVector<IdContainer> containerList;
|
||||||
foreach(const NodeInstance &instance, instanceList) {
|
foreach (const NodeInstance &instance, instanceList) {
|
||||||
QString id = instance.modelNode().id();
|
QString id = instance.modelNode().id();
|
||||||
if (!id.isEmpty()) {
|
if (!id.isEmpty()) {
|
||||||
IdContainer container(instance.instanceId(), id);
|
IdContainer container(instance.instanceId(), id);
|
||||||
@@ -992,7 +992,7 @@ ChangeIdsCommand NodeInstanceView::createChangeIdsCommand(const QList<NodeInstan
|
|||||||
RemoveInstancesCommand NodeInstanceView::createRemoveInstancesCommand(const QList<ModelNode> &nodeList) const
|
RemoveInstancesCommand NodeInstanceView::createRemoveInstancesCommand(const QList<ModelNode> &nodeList) const
|
||||||
{
|
{
|
||||||
QVector<qint32> idList;
|
QVector<qint32> idList;
|
||||||
foreach(const ModelNode &node, nodeList) {
|
foreach (const ModelNode &node, nodeList) {
|
||||||
if (node.isValid() && hasInstanceForNode(node)) {
|
if (node.isValid() && hasInstanceForNode(node)) {
|
||||||
NodeInstance instance = instanceForNode(node);
|
NodeInstance instance = instanceForNode(node);
|
||||||
|
|
||||||
@@ -1019,7 +1019,7 @@ RemovePropertiesCommand NodeInstanceView::createRemovePropertiesCommand(const QL
|
|||||||
{
|
{
|
||||||
QVector<PropertyAbstractContainer> containerList;
|
QVector<PropertyAbstractContainer> containerList;
|
||||||
|
|
||||||
foreach(const AbstractProperty &property, propertyList) {
|
foreach (const AbstractProperty &property, propertyList) {
|
||||||
ModelNode node = property.parentModelNode();
|
ModelNode node = property.parentModelNode();
|
||||||
if (node.isValid() && hasInstanceForNode(node)) {
|
if (node.isValid() && hasInstanceForNode(node)) {
|
||||||
NodeInstance instance = instanceForNode(node);
|
NodeInstance instance = instanceForNode(node);
|
||||||
@@ -1054,7 +1054,7 @@ void NodeInstanceView::valuesChanged(const ValuesChangedCommand &command)
|
|||||||
|
|
||||||
QList<QPair<ModelNode, QString> > valuePropertyChangeList;
|
QList<QPair<ModelNode, QString> > valuePropertyChangeList;
|
||||||
|
|
||||||
foreach(const PropertyValueContainer &container, command.valueChanges()) {
|
foreach (const PropertyValueContainer &container, command.valueChanges()) {
|
||||||
if (hasInstanceForId(container.instanceId())) {
|
if (hasInstanceForId(container.instanceId())) {
|
||||||
NodeInstance instance = instanceForId(container.instanceId());
|
NodeInstance instance = instanceForId(container.instanceId());
|
||||||
if (instance.isValid()) {
|
if (instance.isValid()) {
|
||||||
@@ -1165,7 +1165,7 @@ void NodeInstanceView::componentCompleted(const ComponentCompletedCommand &comma
|
|||||||
|
|
||||||
QVector<ModelNode> nodeVector;
|
QVector<ModelNode> nodeVector;
|
||||||
|
|
||||||
foreach(const qint32 &instanceId, command.instances()) {
|
foreach (const qint32 &instanceId, command.instances()) {
|
||||||
if (hasModelNodeForInternalId(instanceId)) {
|
if (hasModelNodeForInternalId(instanceId)) {
|
||||||
nodeVector.append(modelNodeForInternalId(instanceId));
|
nodeVector.append(modelNodeForInternalId(instanceId));
|
||||||
}
|
}
|
||||||
@@ -1183,7 +1183,7 @@ void NodeInstanceView::childrenChanged(const ChildrenChangedCommand &command)
|
|||||||
|
|
||||||
QVector<ModelNode> childNodeVector;
|
QVector<ModelNode> childNodeVector;
|
||||||
|
|
||||||
foreach(qint32 instanceId, command.childrenInstances()) {
|
foreach (qint32 instanceId, command.childrenInstances()) {
|
||||||
if (hasInstanceForId(instanceId)) {
|
if (hasInstanceForId(instanceId)) {
|
||||||
NodeInstance instance = instanceForId(instanceId);
|
NodeInstance instance = instanceForId(instanceId);
|
||||||
instance.setParentId(command.parentInstanceId());
|
instance.setParentId(command.parentInstanceId());
|
||||||
|
@@ -252,7 +252,7 @@ QList<ModelNode> AbstractView::toModelNodeList(const QList<Internal::InternalNod
|
|||||||
QList<ModelNode> toModelNodeList(const QList<Internal::InternalNode::Pointer> &nodeList, AbstractView *view)
|
QList<ModelNode> toModelNodeList(const QList<Internal::InternalNode::Pointer> &nodeList, AbstractView *view)
|
||||||
{
|
{
|
||||||
QList<ModelNode> newNodeList;
|
QList<ModelNode> newNodeList;
|
||||||
foreach(const Internal::InternalNode::Pointer &node, nodeList)
|
foreach (const Internal::InternalNode::Pointer &node, nodeList)
|
||||||
newNodeList.append(ModelNode(node, view->model(), view));
|
newNodeList.append(ModelNode(node, view->model(), view));
|
||||||
|
|
||||||
return newNodeList;
|
return newNodeList;
|
||||||
@@ -261,7 +261,7 @@ QList<ModelNode> toModelNodeList(const QList<Internal::InternalNode::Pointer> &n
|
|||||||
QList<Internal::InternalNode::Pointer> toInternalNodeList(const QList<ModelNode> &nodeList)
|
QList<Internal::InternalNode::Pointer> toInternalNodeList(const QList<ModelNode> &nodeList)
|
||||||
{
|
{
|
||||||
QList<Internal::InternalNode::Pointer> newNodeList;
|
QList<Internal::InternalNode::Pointer> newNodeList;
|
||||||
foreach(const ModelNode &node, nodeList)
|
foreach (const ModelNode &node, nodeList)
|
||||||
newNodeList.append(node.internalNode());
|
newNodeList.append(node.internalNode());
|
||||||
|
|
||||||
return newNodeList;
|
return newNodeList;
|
||||||
|
@@ -289,7 +289,7 @@ QList<InternalProperty::Pointer> InternalNode::propertyList() const
|
|||||||
QList<InternalNodeAbstractProperty::Pointer> InternalNode::nodeAbstractPropertyList() const
|
QList<InternalNodeAbstractProperty::Pointer> InternalNode::nodeAbstractPropertyList() const
|
||||||
{
|
{
|
||||||
QList<InternalNodeAbstractProperty::Pointer> abstractPropertyList;
|
QList<InternalNodeAbstractProperty::Pointer> abstractPropertyList;
|
||||||
foreach(const InternalProperty::Pointer &property, propertyList()) {
|
foreach (const InternalProperty::Pointer &property, propertyList()) {
|
||||||
if (property->isNodeAbstractProperty())
|
if (property->isNodeAbstractProperty())
|
||||||
abstractPropertyList.append(property->toNodeAbstractProperty());
|
abstractPropertyList.append(property->toNodeAbstractProperty());
|
||||||
}
|
}
|
||||||
@@ -301,7 +301,7 @@ QList<InternalNodeAbstractProperty::Pointer> InternalNode::nodeAbstractPropertyL
|
|||||||
QList<InternalNode::Pointer> InternalNode::allSubNodes() const
|
QList<InternalNode::Pointer> InternalNode::allSubNodes() const
|
||||||
{
|
{
|
||||||
QList<InternalNode::Pointer> nodeList;
|
QList<InternalNode::Pointer> nodeList;
|
||||||
foreach(const InternalNodeAbstractProperty::Pointer &property, nodeAbstractPropertyList()) {
|
foreach (const InternalNodeAbstractProperty::Pointer &property, nodeAbstractPropertyList()) {
|
||||||
nodeList.append(property->allSubNodes());
|
nodeList.append(property->allSubNodes());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -311,7 +311,7 @@ QList<InternalNode::Pointer> InternalNode::allSubNodes() const
|
|||||||
QList<InternalNode::Pointer> InternalNode::allDirectSubNodes() const
|
QList<InternalNode::Pointer> InternalNode::allDirectSubNodes() const
|
||||||
{
|
{
|
||||||
QList<InternalNode::Pointer> nodeList;
|
QList<InternalNode::Pointer> nodeList;
|
||||||
foreach(const InternalNodeAbstractProperty::Pointer &property, nodeAbstractPropertyList()) {
|
foreach (const InternalNodeAbstractProperty::Pointer &property, nodeAbstractPropertyList()) {
|
||||||
nodeList.append(property->allDirectSubNodes());
|
nodeList.append(property->allDirectSubNodes());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -109,7 +109,7 @@ void InternalNodeListProperty::slide(int from, int to)
|
|||||||
QList<InternalNode::Pointer> InternalNodeListProperty::allSubNodes() const
|
QList<InternalNode::Pointer> InternalNodeListProperty::allSubNodes() const
|
||||||
{
|
{
|
||||||
QList<InternalNode::Pointer> nodeList;
|
QList<InternalNode::Pointer> nodeList;
|
||||||
foreach(const InternalNode::Pointer &childNode, m_nodeList) {
|
foreach (const InternalNode::Pointer &childNode, m_nodeList) {
|
||||||
nodeList.append(childNode->allSubNodes());
|
nodeList.append(childNode->allSubNodes());
|
||||||
nodeList.append(childNode);
|
nodeList.append(childNode);
|
||||||
}
|
}
|
||||||
|
@@ -85,7 +85,7 @@ static void splitIdInBaseNameAndNumber(const QString &id, QString *baseId, int *
|
|||||||
{
|
{
|
||||||
|
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
while(counter < id.count()) {
|
while (counter < id.count()) {
|
||||||
bool canConvertToInteger = false;
|
bool canConvertToInteger = false;
|
||||||
int newNumber = id.right(counter +1).toInt(&canConvertToInteger);
|
int newNumber = id.right(counter +1).toInt(&canConvertToInteger);
|
||||||
if (canConvertToInteger)
|
if (canConvertToInteger)
|
||||||
|
@@ -134,7 +134,7 @@ QString ModelNode::generateNewId() const
|
|||||||
int counter = 1;
|
int counter = 1;
|
||||||
QString newId = QString("%1%2").arg(simplifiedTypeName().toLower()).arg(counter);
|
QString newId = QString("%1%2").arg(simplifiedTypeName().toLower()).arg(counter);
|
||||||
|
|
||||||
while(view()->hasId(newId)) {
|
while (view()->hasId(newId)) {
|
||||||
counter += 1;
|
counter += 1;
|
||||||
newId = QString("%1%2").arg(simplifiedTypeName().toLower()).arg(counter);
|
newId = QString("%1%2").arg(simplifiedTypeName().toLower()).arg(counter);
|
||||||
}
|
}
|
||||||
|
@@ -46,7 +46,7 @@ PaintEventFilter::PaintEventFilter(QObject *parent)
|
|||||||
|
|
||||||
bool PaintEventFilter::eventFilter(QObject *object, QEvent *event)
|
bool PaintEventFilter::eventFilter(QObject *object, QEvent *event)
|
||||||
{
|
{
|
||||||
switch(event->type())
|
switch (event->type())
|
||||||
{
|
{
|
||||||
case QEvent::Paint :
|
case QEvent::Paint :
|
||||||
{
|
{
|
||||||
|
@@ -138,7 +138,7 @@ QDataStream &operator>>(QDataStream &stream, QList<PropertyContainer> &propertyC
|
|||||||
int count;
|
int count;
|
||||||
stream >> count;
|
stream >> count;
|
||||||
Q_ASSERT(count >= 0);
|
Q_ASSERT(count >= 0);
|
||||||
for( int i = 0; i < count; i++) {
|
for ( int i = 0; i < count; i++) {
|
||||||
PropertyContainer propertyContainer;
|
PropertyContainer propertyContainer;
|
||||||
stream >> propertyContainer;
|
stream >> propertyContainer;
|
||||||
propertyContainerList.append(propertyContainer);
|
propertyContainerList.append(propertyContainer);
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user