forked from qt-creator/qt-creator
Braces cleanup
Change-Id: I8413252c90a1487d291f15d92837c30ab697b245 Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -344,9 +344,8 @@ ClassOrNamespace *LookupContext::lookupType(const Name *name, Scope *scope,
|
||||
if (name->isNameId()) {
|
||||
if (const Name *usingDeclarationName = ud->name()) {
|
||||
if (const QualifiedNameId *q = usingDeclarationName->asQualifiedNameId()) {
|
||||
if (q->name() && q->name()->isEqualTo(name)) {
|
||||
if (q->name() && q->name()->isEqualTo(name))
|
||||
return bindings()->globalNamespace()->lookupType(q);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -802,9 +801,8 @@ ClassOrNamespace *ClassOrNamespace::findBlock(Block *block)
|
||||
flush();
|
||||
|
||||
QHash<Block *, ClassOrNamespace *>::const_iterator citBlock = _blocks.find(block);
|
||||
if (citBlock != _blocks.end()) {
|
||||
if (citBlock != _blocks.end())
|
||||
return citBlock.value();
|
||||
}
|
||||
|
||||
for (citBlock = _blocks.begin(); citBlock != _blocks.end(); ++citBlock) {
|
||||
if (ClassOrNamespace *foundNestedBlock = citBlock.value()->findBlock(block))
|
||||
@@ -1110,9 +1108,8 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
|
||||
for (unsigned i = 0; i < klassMemberCount; ++i){
|
||||
Symbol *klassMemberAsSymbol = klass->memberAt(i);
|
||||
if (klassMemberAsSymbol->isTypedef()) {
|
||||
if (Declaration *declaration = klassMemberAsSymbol->asDeclaration()) {
|
||||
if (Declaration *declaration = klassMemberAsSymbol->asDeclaration())
|
||||
qDebug() << "Member: " << oo(declaration->type(), declaration->name());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1121,9 +1121,8 @@ ClassOrNamespace *ResolveExpression::baseExpression(const QList<LookupItem> &bas
|
||||
if (! isTypeTypedefed(originalType, ty)
|
||||
|| ! areOriginalAndTypedefedTypePointer(originalType, ty)) {
|
||||
*replacedDotOperator = originalType->isPointerType() || ty->isPointerType();
|
||||
if (PointerType *ptrTy = ty->asPointerType()) {
|
||||
if (PointerType *ptrTy = ty->asPointerType())
|
||||
ty = ptrTy->elementType();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -311,9 +311,8 @@ Import LinkPrivate::importFileOrDirectory(Document::Ptr doc, const ImportInfo &i
|
||||
QLocale locale;
|
||||
QStringList filePaths = ModelManagerInterface::instance()
|
||||
->filesAtQrcPath(path, &locale, 0, ModelManagerInterface::ActiveQrcResources);
|
||||
if (filePaths.isEmpty()) {
|
||||
if (filePaths.isEmpty())
|
||||
filePaths = ModelManagerInterface::instance()->filesAtQrcPath(path);
|
||||
}
|
||||
if (!filePaths.isEmpty()) {
|
||||
Document::Ptr importedDoc = snapshot.document(filePaths.at(0));
|
||||
if (importedDoc)
|
||||
|
@@ -111,11 +111,10 @@ private:
|
||||
QString QrcParser::normalizedQrcFilePath(const QString &path) {
|
||||
QString normPath = path;
|
||||
int endPrefix = 0;
|
||||
if (path.startsWith(QLatin1String("qrc:/"))) {
|
||||
if (path.startsWith(QLatin1String("qrc:/")))
|
||||
endPrefix = 4;
|
||||
} else if (path.startsWith(QLatin1String(":/"))) {
|
||||
else if (path.startsWith(QLatin1String(":/")))
|
||||
endPrefix = 1;
|
||||
}
|
||||
if (endPrefix < path.size() && path.at(endPrefix) == QLatin1Char('/'))
|
||||
while (endPrefix + 1 < path.size() && path.at(endPrefix+1) == QLatin1Char('/'))
|
||||
++endPrefix;
|
||||
@@ -377,9 +376,8 @@ void QrcParserPrivate::collectFilesInPath(const QString &path, QMap<QString,QStr
|
||||
QString fileName = res.key().right(res.key().size()-key.size());
|
||||
QStringList &els = (*contents)[fileName];
|
||||
foreach (const QString &val, res.value())
|
||||
if (!els.contains(val)){
|
||||
if (!els.contains(val))
|
||||
els << val;
|
||||
}
|
||||
++res;
|
||||
} else {
|
||||
QString dirName = res.key().mid(key.size(), endDir - key.size() + 1);
|
||||
|
@@ -632,8 +632,7 @@ void TypeDescriptionReader::readEnumValues(AST::UiScriptBinding *ast, LanguageUt
|
||||
continue;
|
||||
}
|
||||
PropertyGetterSetter *getterSetter = AST::cast<PropertyGetterSetter *>(it->assignment);
|
||||
if (getterSetter) {
|
||||
if (getterSetter)
|
||||
addError(objectLit->firstSourceLocation(), tr("Enum should not contain getter and setters, but only 'string: number' elements."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1011,11 +1011,10 @@ extern "C" HRESULT CALLBACK stack(CIDebugClient *Client, PCSTR argsIn)
|
||||
tokens.pop_front();
|
||||
}
|
||||
if (!tokens.empty()) {
|
||||
if (tokens.front() == "unlimited") {
|
||||
if (tokens.front() == "unlimited")
|
||||
maxFrames = 1000;
|
||||
} else {
|
||||
else
|
||||
integerFromString(tokens.front(), &maxFrames);
|
||||
}
|
||||
}
|
||||
|
||||
const std::string stack = gdbmiStack(exc.control(), exc.symbols(),
|
||||
|
@@ -117,9 +117,8 @@ void AndroidDeployStepWidget::setQASIPackagePath()
|
||||
QString packagePath =
|
||||
QFileDialog::getOpenFileName(this, tr("Qt Android Smart Installer"),
|
||||
QDir::homePath(), tr("Android package (*.apk)"));
|
||||
if (!packagePath.isEmpty()) {
|
||||
if (!packagePath.isEmpty())
|
||||
AndroidManager::installQASIPackage(m_step->target(), packagePath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -367,15 +367,13 @@ bool AndroidManager::bundleQt(ProjectExplorer::Target *target)
|
||||
{
|
||||
AndroidDeployStep *androidDeployStep
|
||||
= AndroidGlobal::buildStep<AndroidDeployStep>(target->activeDeployConfiguration());
|
||||
if (androidDeployStep) {
|
||||
if (androidDeployStep)
|
||||
return androidDeployStep->deployAction() == AndroidDeployStep::BundleLibraries;
|
||||
}
|
||||
|
||||
AndroidDeployQtStep *androidDeployQtStep
|
||||
= AndroidGlobal::buildStep<AndroidDeployQtStep>(target->activeDeployConfiguration());
|
||||
if (androidDeployQtStep) {
|
||||
if (androidDeployQtStep)
|
||||
return androidDeployQtStep->deployAction() == AndroidDeployQtStep::BundleLibrariesDeployment;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -819,9 +817,8 @@ QVector<AndroidManager::Library> AndroidManager::availableQtLibsWithDependencies
|
||||
if (!qmakeProject || !version)
|
||||
return QVector<AndroidManager::Library>();
|
||||
QString qtLibsPath = version->qmakeProperty("QT_INSTALL_LIBS");
|
||||
if (!readelfPath.toFileInfo().exists()) {
|
||||
if (!readelfPath.toFileInfo().exists())
|
||||
return QVector<AndroidManager::Library>();
|
||||
}
|
||||
LibrariesMap mapLibs;
|
||||
QDir libPath;
|
||||
QDirIterator it(qtLibsPath, QStringList() << QLatin1String("*.so"), QDir::Files, QDirIterator::Subdirectories);
|
||||
@@ -997,9 +994,8 @@ QString AndroidManager::loadLocal(ProjectExplorer::Target *target, int apiLevel,
|
||||
dependencyLib = dependencyLib.arg(apiLevel);
|
||||
if (libElement.hasAttribute(QLatin1String("extends"))) {
|
||||
const QString extends = libElement.attribute(QLatin1String("extends"));
|
||||
if (libs.contains(extends)) {
|
||||
if (libs.contains(extends))
|
||||
dependencyLibs << dependencyLib;
|
||||
}
|
||||
} else if (!dependencyLibs.contains(dependencyLib)) {
|
||||
dependencyLibs << dependencyLib;
|
||||
}
|
||||
|
@@ -455,9 +455,8 @@ void AndroidManifestEditorWidget::initializePage()
|
||||
bool AndroidManifestEditorWidget::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
if (obj == m_targetLineEdit) {
|
||||
if (event->type() == QEvent::FocusIn) {
|
||||
if (event->type() == QEvent::FocusIn)
|
||||
QTimer::singleShot(0, this, SLOT(updateTargetComboBox()));
|
||||
}
|
||||
}
|
||||
|
||||
if (obj == m_overlayWidget)
|
||||
@@ -561,9 +560,8 @@ bool AndroidManifestEditorWidget::setActivePage(EditorPage page)
|
||||
syncToEditor();
|
||||
setFocus();
|
||||
} else {
|
||||
if (!syncToWidgets()) {
|
||||
if (!syncToWidgets())
|
||||
return false;
|
||||
}
|
||||
|
||||
QWidget *fw = m_overlayWidget->focusWidget();
|
||||
if (fw && fw != m_overlayWidget)
|
||||
|
@@ -44,9 +44,8 @@ BareMetalGdbCommandsDeployStepWidget::BareMetalGdbCommandsDeployStepWidget(BareM
|
||||
m_commands = new QPlainTextEdit(this);
|
||||
fl->addRow(tr("GDB commands:"),m_commands);
|
||||
m_commands->setPlainText(m_step.gdbCommands());
|
||||
if (!connect(m_commands,SIGNAL(textChanged()),SLOT(update()))) {
|
||||
if (!connect(m_commands,SIGNAL(textChanged()),SLOT(update())))
|
||||
qDebug()<<"BareMetalGdbCommandsDeployStepWidget connect failed.";
|
||||
}
|
||||
}
|
||||
|
||||
void BareMetalGdbCommandsDeployStepWidget::update()
|
||||
|
@@ -58,11 +58,10 @@ void CMakeParser::stdError(const QString &line)
|
||||
{
|
||||
QString trimmedLine = rightTrimmed(line);
|
||||
if (trimmedLine.isEmpty() && !m_lastTask.isNull()) {
|
||||
if (m_skippedFirstEmptyLine) {
|
||||
if (m_skippedFirstEmptyLine)
|
||||
doFlush();
|
||||
} else {
|
||||
else
|
||||
m_skippedFirstEmptyLine = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (m_skippedFirstEmptyLine)
|
||||
|
@@ -728,9 +728,8 @@ void EditorManager::closeView(Core::Internal::EditorView *view)
|
||||
bool EditorManager::closeAllEditors(bool askAboutModifiedEditors)
|
||||
{
|
||||
d->m_documentModel->removeAllRestoredDocuments();
|
||||
if (closeDocuments(d->m_documentModel->openedDocuments(), askAboutModifiedEditors)) {
|
||||
if (closeDocuments(d->m_documentModel->openedDocuments(), askAboutModifiedEditors))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -270,8 +270,7 @@ void OpenEditorsWindow::addHistoryItems(const QList<EditLocation> &history, Edit
|
||||
|
||||
m_editorList->addTopLevelItem(item);
|
||||
|
||||
if (m_editorList->topLevelItemCount() == 1){
|
||||
if (m_editorList->topLevelItemCount() == 1)
|
||||
m_editorList->setCurrentItem(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -468,9 +468,8 @@ BaseTextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor &
|
||||
// token[.....] == ....
|
||||
// token[i + n] == T_RPAREN
|
||||
|
||||
if (i + 1 < tokens.size() && tokens.at(i + 1).is(T_LPAREN)) {
|
||||
if (i + 1 < tokens.size() && tokens.at(i + 1).is(T_LPAREN))
|
||||
closingParenthesisPos = skipMatchingParentheses(tokens, i - 1, 0);
|
||||
}
|
||||
} else if ((i > 3 && tk.is(T_LPAREN) && tokens.at(i - 1).is(T_IDENTIFIER)
|
||||
&& tokens.at(i - 2).is(T_LPAREN)
|
||||
&& (tokens.at(i - 3).is(T_SIGNAL) || tokens.at(i - 3).is(T_SLOT)))) {
|
||||
|
@@ -242,11 +242,10 @@ int LineForNewIncludeDirective::operator()(const QString &newIncludeFileName,
|
||||
if (group.commonIncludeDir() == IncludeGroup::includeDir(pureIncludeFileName))
|
||||
localBestIncludeGroup = group;
|
||||
}
|
||||
if (!localBestIncludeGroup.isEmpty()) {
|
||||
if (!localBestIncludeGroup.isEmpty())
|
||||
bestGroup = localBestIncludeGroup;
|
||||
} else {
|
||||
else
|
||||
bestGroup = groupsMixedIncludeDirs.last();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -141,9 +141,8 @@ bool SearchSymbols::visit(Class *symbol)
|
||||
QString name = symbolName(symbol);
|
||||
QString scopedName = scopedSymbolName(name);
|
||||
QString previousScope = switchScope(scopedName);
|
||||
if (symbolsToSearchFor & SymbolSearcher::Classes) {
|
||||
if (symbolsToSearchFor & SymbolSearcher::Classes)
|
||||
appendItem(name, QString(), previousScope, ModelItemInfo::Class, symbol);
|
||||
}
|
||||
for (unsigned i = 0; i < symbol->memberCount(); ++i) {
|
||||
accept(symbol->memberAt(i));
|
||||
}
|
||||
|
@@ -155,11 +155,10 @@ void ImageViewer::contextMenuEvent(QContextMenuEvent *ev)
|
||||
copyAction->setEnabled(hasImage);
|
||||
imageViewerAction->setEnabled(hasImage);
|
||||
QAction *action = menu.exec(ev->globalPos());
|
||||
if (action == copyAction) {
|
||||
if (action == copyAction)
|
||||
QApplication::clipboard()->setImage(image);
|
||||
} else if (action == imageViewerAction) {
|
||||
else if (action == imageViewerAction)
|
||||
openImageViewer(image);
|
||||
}
|
||||
}
|
||||
|
||||
#include "imageviewer.moc"
|
||||
|
@@ -148,11 +148,10 @@ void LldbEngine::abortDebugger()
|
||||
void LldbEngine::setupEngine()
|
||||
{
|
||||
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
||||
if (startParameters().remoteSetupNeeded) {
|
||||
if (startParameters().remoteSetupNeeded)
|
||||
notifyEngineRequestRemoteSetup();
|
||||
} else {
|
||||
else
|
||||
startLldb();
|
||||
}
|
||||
}
|
||||
|
||||
void LldbEngine::startLldb()
|
||||
|
@@ -128,9 +128,8 @@ void DiffEditorPlugin::diff()
|
||||
QString DiffEditorPlugin::getFileContents(const QString &fileName, QTextCodec *codec) const
|
||||
{
|
||||
QFile file(fileName);
|
||||
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
if (file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
return codec->toUnicode(file.readAll());
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
@@ -1051,11 +1051,10 @@ ChunkData DiffEditorWidget::calculateOriginalData(const QList<Diff> &diffList) c
|
||||
const QStringList lines = diff.text.split(QLatin1Char('\n'));
|
||||
|
||||
const bool equal = isEqual(diffList, i);
|
||||
if (diff.command == Diff::Insert) {
|
||||
if (diff.command == Diff::Insert)
|
||||
lastRightLineEqual = lastRightLineEqual && equal;
|
||||
} else if (diff.command == Diff::Delete) {
|
||||
else if (diff.command == Diff::Delete)
|
||||
lastLeftLineEqual = lastLeftLineEqual && equal;
|
||||
}
|
||||
|
||||
const int lastLeftPos = currentLeftPos;
|
||||
const int lastRightPos = currentRightPos;
|
||||
|
@@ -405,11 +405,10 @@ QList<Diff> Differ::diffMyers(const QString &text1, const QString &text2)
|
||||
k <= qMin(d, kMaxForward - qAbs(d + kMaxForward) % 2);
|
||||
k = k + 2) {
|
||||
int x;
|
||||
if (k == -d || (k < d && forwardV[k + vShift - 1] < forwardV[k + vShift + 1])) {
|
||||
if (k == -d || (k < d && forwardV[k + vShift - 1] < forwardV[k + vShift + 1]))
|
||||
x = forwardV[k + vShift + 1]; // copy vertically from diagonal k + 1, y increases, y may exceed the graph
|
||||
} else {
|
||||
else
|
||||
x = forwardV[k + vShift - 1] + 1; // copy horizontally from diagonal k - 1, x increases, x may exceed the graph
|
||||
}
|
||||
int y = x - k;
|
||||
|
||||
if (x > n) {
|
||||
@@ -441,11 +440,10 @@ QList<Diff> Differ::diffMyers(const QString &text1, const QString &text2)
|
||||
k <= qMin(d, kMaxReverse - qAbs(d + kMaxReverse) % 2);
|
||||
k = k + 2) {
|
||||
int x;
|
||||
if (k == -d || (k < d && reverseV[k + vShift - 1] < reverseV[k + vShift + 1])) {
|
||||
if (k == -d || (k < d && reverseV[k + vShift - 1] < reverseV[k + vShift + 1]))
|
||||
x = reverseV[k + vShift + 1];
|
||||
} else {
|
||||
else
|
||||
x = reverseV[k + vShift - 1] + 1;
|
||||
}
|
||||
int y = x - k;
|
||||
|
||||
if (x > n) {
|
||||
@@ -559,9 +557,8 @@ int Differ::findSubtextEnd(const QString &text,
|
||||
{
|
||||
if (m_currentDiffMode == Differ::LineMode) {
|
||||
int subtextEnd = text.indexOf(QLatin1Char('\n'), subtextStart);
|
||||
if (subtextEnd == -1) {
|
||||
if (subtextEnd == -1)
|
||||
subtextEnd = text.count() - 1;
|
||||
}
|
||||
return ++subtextEnd;
|
||||
} else if (m_currentDiffMode == Differ::WordMode) {
|
||||
if (!text.at(subtextStart).isLetter())
|
||||
@@ -732,9 +729,8 @@ QList<Diff> Differ::cleanupSemantics(const QList<Diff> &diffList)
|
||||
}
|
||||
equalitiesToBeSplit.insert(data.equalityIndex, true);
|
||||
equalities.removeAt(i);
|
||||
if (i > 0) {
|
||||
if (i > 0)
|
||||
i--; // reexamine previous equality
|
||||
}
|
||||
} else {
|
||||
i++;
|
||||
}
|
||||
@@ -807,9 +803,8 @@ QList<Diff> Differ::cleanupSemanticsLossless(const QList<Diff> &diffList)
|
||||
thisDiff.text = bestEdit;
|
||||
nextDiff.text = bestEquality2;
|
||||
|
||||
if (!bestEquality1.isEmpty()) {
|
||||
if (!bestEquality1.isEmpty())
|
||||
newDiffList.append(prevDiff); // append modified equality1
|
||||
}
|
||||
if (bestEquality2.isEmpty()) {
|
||||
i++;
|
||||
if (i < diffList.count())
|
||||
|
@@ -163,11 +163,10 @@ QWidget *DiffShowEditor::toolBar()
|
||||
|
||||
void DiffShowEditor::setDescriptionVisible(bool visible)
|
||||
{
|
||||
if (visible) {
|
||||
if (visible)
|
||||
m_toggleDescriptionButton->setToolTip(tr("Hide Change Description"));
|
||||
} else {
|
||||
else
|
||||
m_toggleDescriptionButton->setToolTip(tr("Show Change Description"));
|
||||
}
|
||||
m_diffShowWidget->setVisible(visible);
|
||||
}
|
||||
|
||||
|
@@ -207,9 +207,8 @@ QModelIndex TreeViewFind::nextIndex(const QModelIndex &idx, bool *wrapped) const
|
||||
QModelIndex current = model->index(idx.row(), 0, idx.parent());
|
||||
|
||||
// check for children
|
||||
if (model->rowCount(current) > 0) {
|
||||
if (model->rowCount(current) > 0)
|
||||
return current.child(0, 0);
|
||||
}
|
||||
|
||||
// no more children, go up and look for parent with more children
|
||||
QModelIndex nextIndex;
|
||||
|
@@ -380,9 +380,8 @@ void BranchModel::setCurrentBranch()
|
||||
BranchNode *local = m_rootNode->children.at(LocalBranches);
|
||||
int pos = 0;
|
||||
for (pos = 0; pos < local->count(); ++pos) {
|
||||
if (local->children.at(pos)->name == currentBranch) {
|
||||
if (local->children.at(pos)->name == currentBranch)
|
||||
m_currentBranch = local->children[pos];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -537,9 +537,8 @@ QString GitDiffHandler::workingTreeContents(const QString &fileName) const
|
||||
QString absoluteFileName = workingDir.absoluteFilePath(fileName);
|
||||
|
||||
QFile file(absoluteFileName);
|
||||
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
if (file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
return m_editor->editorWidget()->codec()->toUnicode(file.readAll());
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
@@ -145,9 +145,8 @@ QString IosRunConfiguration::appName() const
|
||||
const QmakeProFileNode *node = pro->rootQmakeProjectNode()->findProFileFor(profilePath());
|
||||
if (node) {
|
||||
TargetInformation ti = node->targetInformation();
|
||||
if (ti.valid) {
|
||||
if (ti.valid)
|
||||
return ti.target;
|
||||
}
|
||||
}
|
||||
}
|
||||
qDebug() << "IosRunConfiguration::appName failed";
|
||||
|
@@ -342,19 +342,16 @@ void AbstractMsvcToolChain::inferWarningsForLevel(int warningLevel, WarningFlags
|
||||
// reset all except unrelated flag
|
||||
flags = flags & WarningsAsErrors;
|
||||
|
||||
if (warningLevel >= 1) {
|
||||
if (warningLevel >= 1)
|
||||
flags |= WarningFlags(WarningsDefault | WarnIgnoredQualfiers | WarnHiddenLocals | WarnUnknownPragma);
|
||||
}
|
||||
if (warningLevel >= 2) {
|
||||
if (warningLevel >= 2)
|
||||
flags |= WarningsAll;
|
||||
}
|
||||
if (warningLevel >= 3) {
|
||||
flags |= WarningFlags(WarningsExtra | WarnNonVirtualDestructor | WarnSignedComparison
|
||||
| WarnUnusedLocals | WarnDeprecated);
|
||||
}
|
||||
if (warningLevel >= 4) {
|
||||
if (warningLevel >= 4)
|
||||
flags |= WarnUnusedParams;
|
||||
}
|
||||
}
|
||||
|
||||
bool AbstractMsvcToolChain::operator ==(const ToolChain &other) const
|
||||
|
@@ -89,11 +89,10 @@ protected:
|
||||
void mouseDoubleClickEvent(QMouseEvent *ev)
|
||||
{
|
||||
int line = cursorForPosition(ev->pos()).block().blockNumber();
|
||||
if (unsigned taskid = m_taskids.value(line, 0)) {
|
||||
if (unsigned taskid = m_taskids.value(line, 0))
|
||||
TaskHub::showTaskInEditor(taskid);
|
||||
} else {
|
||||
else
|
||||
QPlainTextEdit::mouseDoubleClickEvent(ev);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
@@ -1176,9 +1176,8 @@ void ProjectExplorerPlugin::updateVariable(const QByteArray &variable)
|
||||
projectFilePath = doc->filePath();
|
||||
if (Target *target = project->activeTarget()) {
|
||||
kit = target->kit();
|
||||
if (BuildConfiguration *buildConfiguration = target->activeBuildConfiguration()) {
|
||||
if (BuildConfiguration *buildConfiguration = target->activeBuildConfiguration())
|
||||
buildConfigurationName = buildConfiguration->displayName();
|
||||
}
|
||||
}
|
||||
}
|
||||
ProjectMacroExpander expander(projectFilePath, projectName, kit, buildConfigurationName);
|
||||
|
@@ -591,9 +591,8 @@ QPair<QString, QString> DesktopQmakeRunConfiguration::extractWorkingDirAndExecut
|
||||
QString workingDir;
|
||||
if (!destDir.isEmpty()) {
|
||||
bool workingDirIsBaseDir = false;
|
||||
if (destDir == ti.buildTarget) {
|
||||
if (destDir == ti.buildTarget)
|
||||
workingDirIsBaseDir = true;
|
||||
}
|
||||
if (QDir::isRelativePath(destDir))
|
||||
destDir = QDir::cleanPath(ti.buildDir + QLatin1Char('/') + destDir);
|
||||
|
||||
|
@@ -156,11 +156,10 @@ QByteArray AbstractMobileApp::generateMainCpp(QString *errorMessage) const
|
||||
QString line;
|
||||
while (!(line = in.readLine()).isNull()) {
|
||||
bool adaptLine = true;
|
||||
if (line.contains(QLatin1String("// DELETE_LINE"))) {
|
||||
if (line.contains(QLatin1String("// DELETE_LINE")))
|
||||
continue; // omit this line in the output
|
||||
} else {
|
||||
else
|
||||
adaptLine = adaptCurrentMainCppTemplateLine(line);
|
||||
}
|
||||
if (adaptLine) {
|
||||
const int commentIndex = line.indexOf(QLatin1String(" //"));
|
||||
if (commentIndex != -1)
|
||||
|
@@ -146,9 +146,8 @@ LibraryWizardDialog::LibraryWizardDialog(const QString &templateName,
|
||||
// Use the intro page instead, set up initially
|
||||
setIntroDescription(tr("This wizard generates a C++ library project."));
|
||||
|
||||
if (!parameters.extraValues().contains(QLatin1String(ProjectExplorer::Constants::PROJECT_KIT_IDS))) {
|
||||
if (!parameters.extraValues().contains(QLatin1String(ProjectExplorer::Constants::PROJECT_KIT_IDS)))
|
||||
m_targetPageId = addTargetSetupPage();
|
||||
}
|
||||
|
||||
m_modulesPageId = addModulesPage();
|
||||
|
||||
|
@@ -75,11 +75,10 @@ const Import ImportLabel::import() const
|
||||
void ImportLabel::setReadOnly(bool readOnly) const
|
||||
{
|
||||
m_removeButton->setDisabled(readOnly);
|
||||
if (readOnly) {
|
||||
if (readOnly)
|
||||
m_removeButton->setIcon(QIcon());
|
||||
} else {
|
||||
else
|
||||
m_removeButton->setIcon(QIcon(Core::Constants::ICON_CLOSE_DOCUMENT));
|
||||
}
|
||||
}
|
||||
|
||||
void ImportLabel::emitRemoveImport()
|
||||
|
@@ -194,11 +194,10 @@ QString DesignDocument::displayName() const
|
||||
|
||||
QString DesignDocument::simplfiedDisplayName() const
|
||||
{
|
||||
if (rootModelNode().id().isEmpty()) {
|
||||
if (rootModelNode().id().isEmpty())
|
||||
return rootModelNode().id();
|
||||
} else {
|
||||
else
|
||||
return rootModelNode().simplifiedTypeName();
|
||||
}
|
||||
|
||||
QStringList list = displayName().split(QLatin1Char('/'));
|
||||
return list.last();
|
||||
@@ -637,9 +636,8 @@ void DesignDocument::redo()
|
||||
static bool isFileInProject(DesignDocument *designDocument, ProjectExplorer::Project *project)
|
||||
{
|
||||
foreach (const QString &fileNameInProject, project->files(ProjectExplorer::Project::ExcludeGeneratedFiles)) {
|
||||
if (designDocument->fileName() == fileNameInProject) {
|
||||
if (designDocument->fileName() == fileNameInProject)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@@ -75,9 +75,8 @@ QVariant ItemLibrarySortedModel::data(const QModelIndex &index, int role) const
|
||||
if (m_roleNames.contains(role)) {
|
||||
QVariant value = m_privList.at(index.row())->property(m_roleNames.value(role));
|
||||
|
||||
if (ItemLibrarySortedModel* model = qobject_cast<ItemLibrarySortedModel *>(value.value<QObject*>())) {
|
||||
if (ItemLibrarySortedModel* model = qobject_cast<ItemLibrarySortedModel *>(value.value<QObject*>()))
|
||||
return QVariant::fromValue(model);
|
||||
}
|
||||
|
||||
return m_privList.at(index.row())->property(m_roleNames.value(role));
|
||||
}
|
||||
@@ -145,11 +144,10 @@ bool ItemLibrarySortedModel::setElementVisible(int libId, bool visible)
|
||||
return false;
|
||||
|
||||
int visiblePos = visibleElementPosition(libId);
|
||||
if (visible) {
|
||||
if (visible)
|
||||
privateInsert(visiblePos, (m_elementModels.value(libId)));
|
||||
} else {
|
||||
else
|
||||
privateRemove(visiblePos);
|
||||
}
|
||||
|
||||
m_elementOrder[pos].visible = visible;
|
||||
return true;
|
||||
@@ -240,9 +238,8 @@ void ItemLibrarySortedModel::resetModel()
|
||||
|
||||
void ItemLibrarySortedModel::addRoleName(const QByteArray &roleName)
|
||||
{
|
||||
if (m_roleNames.values().contains(roleName)) {
|
||||
if (m_roleNames.values().contains(roleName))
|
||||
return;
|
||||
}
|
||||
|
||||
int key = m_roleNames.count();
|
||||
m_roleNames.insert(key, roleName);
|
||||
|
@@ -81,11 +81,10 @@ QVariant GradientModel::data(const QModelIndex &index, int role) const
|
||||
return index.row();
|
||||
}
|
||||
|
||||
if (role == Qt::UserRole + 1) {
|
||||
if (role == Qt::UserRole + 1)
|
||||
return getPosition(index.row());
|
||||
} else if (role == Qt::UserRole + 2) {
|
||||
else if (role == Qt::UserRole + 2)
|
||||
return getColor(index.row());
|
||||
}
|
||||
|
||||
qWarning() << Q_FUNC_INFO << "invalid role";
|
||||
} else {
|
||||
@@ -181,9 +180,8 @@ void GradientModel::setColor(int index, const QColor &color)
|
||||
if (index < rowCount()) {
|
||||
QmlDesigner::ModelNode gradientNode = m_itemNode.modelNode().nodeProperty(gradientPropertyName().toUtf8()).modelNode();
|
||||
QmlDesigner::QmlObjectNode stop = gradientNode.nodeListProperty("stops").toModelNodeList().at(index);
|
||||
if (stop.isValid()) {
|
||||
if (stop.isValid())
|
||||
stop.setVariantProperty("color", color);
|
||||
}
|
||||
setupModel();
|
||||
}
|
||||
}
|
||||
@@ -196,9 +194,8 @@ void GradientModel::setPosition(int index, qreal positition)
|
||||
if (index < rowCount()) {
|
||||
QmlDesigner::ModelNode gradientNode = m_itemNode.modelNode().nodeProperty(gradientPropertyName().toUtf8()).modelNode();
|
||||
QmlDesigner::QmlObjectNode stop = gradientNode.nodeListProperty("stops").toModelNodeList().at(index);
|
||||
if (stop.isValid()) {
|
||||
if (stop.isValid())
|
||||
stop.setVariantProperty("position", positition);
|
||||
}
|
||||
setupModel();
|
||||
}
|
||||
}
|
||||
@@ -208,9 +205,8 @@ QColor GradientModel::getColor(int index) const
|
||||
if (index < rowCount()) {
|
||||
QmlDesigner::ModelNode gradientNode = m_itemNode.modelNode().nodeProperty(gradientPropertyName().toUtf8()).modelNode();
|
||||
QmlDesigner::QmlObjectNode stop = gradientNode.nodeListProperty("stops").toModelNodeList().at(index);
|
||||
if (stop.isValid()) {
|
||||
if (stop.isValid())
|
||||
return stop.modelValue("color").value<QColor>();
|
||||
}
|
||||
}
|
||||
qWarning() << Q_FUNC_INFO << "invalid color index";
|
||||
return QColor();
|
||||
@@ -221,9 +217,8 @@ qreal GradientModel::getPosition(int index) const
|
||||
if (index < rowCount()) {
|
||||
QmlDesigner::ModelNode gradientNode = m_itemNode.modelNode().nodeProperty(gradientPropertyName().toUtf8()).modelNode();
|
||||
QmlDesigner::QmlObjectNode stop = gradientNode.nodeListProperty("stops").toModelNodeList().at(index);
|
||||
if (stop.isValid()) {
|
||||
if (stop.isValid())
|
||||
return stop.modelValue("position").toReal();
|
||||
}
|
||||
}
|
||||
qWarning() << Q_FUNC_INFO << "invalid position index";
|
||||
return 0.0;
|
||||
|
@@ -396,9 +396,8 @@ void PropertyEditorView::setupQmlBackend()
|
||||
|
||||
QString specificQmlData;
|
||||
|
||||
if (m_selectedNode.isValid() && m_selectedNode.metaInfo().isValid() && diffClassName != m_selectedNode.type()) {
|
||||
if (m_selectedNode.isValid() && m_selectedNode.metaInfo().isValid() && diffClassName != m_selectedNode.type())
|
||||
specificQmlData = PropertyEditorQmlBackend::templateGeneration(m_selectedNode.metaInfo(), model()->metaInfo(diffClassName), m_selectedNode);
|
||||
}
|
||||
|
||||
PropertyEditorQmlBackend *currentQmlBackend = m_qmlBackendHash.value(qmlFile.toString());
|
||||
|
||||
|
@@ -78,11 +78,10 @@ void QmlAnchorBindingProxy::setup(const QmlItemNode &fxItemNode)
|
||||
|
||||
m_ignoreQml = true;
|
||||
|
||||
if (m_qmlItemNode.modelNode().hasParentProperty()) {
|
||||
if (m_qmlItemNode.modelNode().hasParentProperty())
|
||||
setDefaultAnchorTarget(m_qmlItemNode.modelNode().parentProperty().parentModelNode());
|
||||
} else {
|
||||
else
|
||||
setDefaultAnchorTarget(ModelNode());
|
||||
}
|
||||
|
||||
if (topAnchored()) {
|
||||
ModelNode targetNode = m_qmlItemNode.anchors().instanceAnchor(AnchorLine::Top).qmlItemNode();
|
||||
@@ -404,16 +403,14 @@ QStringList QmlAnchorBindingProxy::possibleTargetItems() const
|
||||
itemList.removeAll(node);
|
||||
|
||||
foreach (const QmlItemNode &itemNode, itemList) {
|
||||
if (itemNode.isValid() && !itemNode.id().isEmpty()) {
|
||||
if (itemNode.isValid() && !itemNode.id().isEmpty())
|
||||
stringList.append(itemNode.id());
|
||||
}
|
||||
}
|
||||
|
||||
QmlItemNode parent(m_qmlItemNode.instanceParent().toQmlItemNode());
|
||||
|
||||
if (parent.isValid()) {
|
||||
if (parent.isValid())
|
||||
stringList.append(QLatin1String("parent"));
|
||||
}
|
||||
|
||||
return stringList;
|
||||
}
|
||||
|
@@ -192,11 +192,10 @@ static QString getSourceForUrl(const QString &fileURl)
|
||||
{
|
||||
Utils::FileReader fileReader;
|
||||
|
||||
if (fileReader.fetch(fileURl)) {
|
||||
if (fileReader.fetch(fileURl))
|
||||
return fileReader.data();
|
||||
} else {
|
||||
else
|
||||
return Utils::FileReader::fetchQrc(fileURl);
|
||||
}
|
||||
}
|
||||
|
||||
void ItemLibraryEntry::setQmlPath(const QString &qml)
|
||||
|
@@ -956,9 +956,8 @@ QString NodeMetaInfoPrivate::importDirectoryPath() const
|
||||
if (modelManager) {
|
||||
foreach (const QString &importPath, modelManager->importPaths()) {
|
||||
const QString targetPath = QDir(importPath).filePath(importInfo.path());
|
||||
if (QDir(targetPath).exists()) {
|
||||
if (QDir(targetPath).exists())
|
||||
return targetPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1938,14 +1938,12 @@ void Model::attachView(AbstractView *view)
|
||||
{
|
||||
// Internal::WriteLocker locker(d);
|
||||
RewriterView *rewriterView = qobject_cast<RewriterView*>(view);
|
||||
if (rewriterView) {
|
||||
if (rewriterView)
|
||||
return;
|
||||
}
|
||||
|
||||
NodeInstanceView *nodeInstanceView = qobject_cast<NodeInstanceView*>(view);
|
||||
if (nodeInstanceView) {
|
||||
if (nodeInstanceView)
|
||||
return;
|
||||
}
|
||||
|
||||
d->attachView(view);
|
||||
}
|
||||
@@ -1964,14 +1962,12 @@ void Model::detachView(AbstractView *view, ViewNotification emitDetachNotify)
|
||||
bool emitNotify = (emitDetachNotify == NotifyView);
|
||||
|
||||
RewriterView *rewriterView = qobject_cast<RewriterView*>(view);
|
||||
if (rewriterView) {
|
||||
if (rewriterView)
|
||||
return;
|
||||
}
|
||||
|
||||
NodeInstanceView *nodeInstanceView = qobject_cast<NodeInstanceView*>(view);
|
||||
if (nodeInstanceView) {
|
||||
if (nodeInstanceView)
|
||||
return;
|
||||
}
|
||||
|
||||
d->detachView(view, emitNotify);
|
||||
}
|
||||
|
@@ -1235,9 +1235,8 @@ void TextToModelMerger::syncSignalHandler(AbstractProperty &modelProperty,
|
||||
{
|
||||
if (modelProperty.isSignalHandlerProperty()) {
|
||||
SignalHandlerProperty signalHandlerProperty = modelProperty.toSignalHandlerProperty();
|
||||
if (signalHandlerProperty.source() != javascript) {
|
||||
if (signalHandlerProperty.source() != javascript)
|
||||
differenceHandler.signalHandlerSourceDiffer(signalHandlerProperty, javascript);
|
||||
}
|
||||
} else {
|
||||
differenceHandler.shouldBeSignalHandlerProperty(modelProperty, javascript);
|
||||
}
|
||||
|
@@ -264,17 +264,15 @@ void QmlDesignerPlugin::selectModelNodeUnderTextCursor()
|
||||
{
|
||||
const int cursorPos = currentDesignDocument()->plainTextEdit()->textCursor().position();
|
||||
ModelNode node = currentDesignDocument()->rewriterView()->nodeAtTextCursorPosition(cursorPos);
|
||||
if (currentDesignDocument()->rewriterView() && node.isValid()) {
|
||||
if (currentDesignDocument()->rewriterView() && node.isValid())
|
||||
currentDesignDocument()->rewriterView()->setSelectedModelNodes(QList<ModelNode>() << node);
|
||||
}
|
||||
}
|
||||
|
||||
void QmlDesignerPlugin::activateAutoSynchronization()
|
||||
{
|
||||
// text editor -> visual editor
|
||||
if (!currentDesignDocument()->isDocumentLoaded()) {
|
||||
if (!currentDesignDocument()->isDocumentLoaded())
|
||||
currentDesignDocument()->loadDocument(currentDesignDocument()->plainTextEdit());
|
||||
}
|
||||
|
||||
currentDesignDocument()->attachRewriterToModel();
|
||||
|
||||
|
@@ -138,9 +138,8 @@ ModelManagerInterface::ProjectInfo QmlJSTools::defaultProjectInfoForProject(
|
||||
void QmlJSTools::setupProjectInfoQmlBundles(ModelManagerInterface::ProjectInfo &projectInfo)
|
||||
{
|
||||
ProjectExplorer::Target *activeTarget = 0;
|
||||
if (projectInfo.project) {
|
||||
if (projectInfo.project)
|
||||
activeTarget = projectInfo.project->activeTarget();
|
||||
}
|
||||
ProjectExplorer::Kit *activeKit = activeTarget
|
||||
? activeTarget->kit() : ProjectExplorer::KitManager::defaultKit();
|
||||
QHash<QString, QString> replacements;
|
||||
@@ -377,9 +376,8 @@ QFuture<void> ModelManager::refreshSourceFiles(const QStringList &sourceFiles,
|
||||
|
||||
m_synchronizer.addFuture(result);
|
||||
|
||||
if (sourceFiles.count() > 1) {
|
||||
if (sourceFiles.count() > 1)
|
||||
ProgressManager::addTask(result, tr("Indexing"), Constants::TASK_INDEX);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@@ -104,13 +104,11 @@ QmlProfilerClientManager::~QmlProfilerClientManager()
|
||||
|
||||
void QmlProfilerClientManager::setModelManager(QmlProfilerModelManager *m)
|
||||
{
|
||||
if (d->modelManager) {
|
||||
if (d->modelManager)
|
||||
disconnect(this,SIGNAL(dataReadyForProcessing()), d->modelManager, SLOT(complete()));
|
||||
}
|
||||
d->modelManager = m;
|
||||
if (d->modelManager) {
|
||||
if (d->modelManager)
|
||||
connect(this,SIGNAL(dataReadyForProcessing()), d->modelManager, SLOT(complete()));
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
@@ -113,11 +113,10 @@ bool QmlProfilerRunControl::startEngine()
|
||||
|
||||
d->m_profilerState->setCurrentState(QmlProfilerStateManager::AppStarting);
|
||||
|
||||
if (startParameters().startMode == StartLocal) {
|
||||
if (startParameters().startMode == StartLocal)
|
||||
d->m_noDebugOutputTimer.start();
|
||||
} else {
|
||||
else
|
||||
emit processRunning(startParameters().analyzerPort);
|
||||
}
|
||||
|
||||
d->m_profilerState->setCurrentState(QmlProfilerStateManager::AppRunning);
|
||||
engineStarted();
|
||||
|
@@ -548,9 +548,8 @@ void QmlProfilerFileWriter::calculateMeasuredTime(const QVector<QmlProfilerSimpl
|
||||
level--;
|
||||
}
|
||||
endtimesPerLevel[level] = event.startTime + event.duration;
|
||||
if (level == QmlDebug::Constants::QML_MIN_LEVEL) {
|
||||
if (level == QmlDebug::Constants::QML_MIN_LEVEL)
|
||||
duration += event.duration;
|
||||
}
|
||||
}
|
||||
|
||||
m_measuredTime = duration;
|
||||
|
@@ -482,9 +482,8 @@ void QmlProfilerTraceView::contextMenuEvent(QContextMenuEvent *ev)
|
||||
d->m_viewContainer->selectionStart(),
|
||||
d->m_viewContainer->selectionEnd());
|
||||
}
|
||||
if (selectedAction == getGlobalStatsAction) {
|
||||
if (selectedAction == getGlobalStatsAction)
|
||||
d->m_viewContainer->getStatisticsInRange(-1, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -207,11 +207,10 @@ int TimelineModelAggregator::modelIndexForCategory(int absoluteCategoryIndex) co
|
||||
{
|
||||
int categoryIndex = absoluteCategoryIndex;
|
||||
for (int modelIndex = 0; modelIndex < d->modelList.count(); modelIndex++)
|
||||
if (categoryIndex < d->modelList[modelIndex]->categoryCount()) {
|
||||
if (categoryIndex < d->modelList[modelIndex]->categoryCount())
|
||||
return modelIndex;
|
||||
} else {
|
||||
else
|
||||
categoryIndex -= d->modelList[modelIndex]->categoryCount();
|
||||
}
|
||||
|
||||
return modelCount()-1;
|
||||
}
|
||||
|
@@ -55,14 +55,12 @@ TimelineRenderer::TimelineRenderer(QQuickPaintedItem *parent) :
|
||||
|
||||
void TimelineRenderer::setProfilerModelProxy(QObject *profilerModelProxy)
|
||||
{
|
||||
if (m_profilerModelProxy) {
|
||||
if (m_profilerModelProxy)
|
||||
disconnect(m_profilerModelProxy, SIGNAL(expandedChanged()), this, SLOT(requestPaint()));
|
||||
}
|
||||
m_profilerModelProxy = qobject_cast<TimelineModelAggregator *>(profilerModelProxy);
|
||||
|
||||
if (m_profilerModelProxy) {
|
||||
if (m_profilerModelProxy)
|
||||
connect(m_profilerModelProxy, SIGNAL(expandedChanged()), this, SLOT(requestPaint()));
|
||||
}
|
||||
emit profilerModelProxyChanged(m_profilerModelProxy);
|
||||
}
|
||||
|
||||
|
@@ -88,9 +88,8 @@ QmlProjectItem *QmlProjectFileFormat::parseProjectFile(const QString &fileName,
|
||||
if (importPathsProperty.isValid())
|
||||
projectItem->setImportPaths(importPathsProperty.toStringList());
|
||||
|
||||
if (debug) {
|
||||
if (debug)
|
||||
qDebug() << "importPath:" << importPathsProperty << "mainFile:" << mainFileProperty;
|
||||
}
|
||||
|
||||
foreach (const QmlJS::SimpleReaderNode::Ptr &childNode, rootNode->children()) {
|
||||
if (childNode->name() == QLatin1String("QmlFiles")) {
|
||||
|
@@ -418,13 +418,12 @@ Core::GeneratedFiles QmlApp::generateFiles(QString *errorMessage)
|
||||
if (!canAddTemplate)
|
||||
return Core::GeneratedFiles();
|
||||
|
||||
if (templateFile.fileName() == QLatin1String("main.pro")) {
|
||||
if (templateFile.fileName() == QLatin1String("main.pro"))
|
||||
files.last().setAttributes(Core::GeneratedFile::OpenProjectAttribute);
|
||||
} else if (templateFile.fileName() == QLatin1String("main.qmlproject")) {
|
||||
else if (templateFile.fileName() == QLatin1String("main.qmlproject"))
|
||||
files.last().setAttributes(Core::GeneratedFile::OpenProjectAttribute);
|
||||
} else if (templateFile.fileName() == m_templateInfo.openFile) {
|
||||
else if (templateFile.fileName() == m_templateInfo.openFile)
|
||||
files.last().setAttributes(Core::GeneratedFile::OpenEditorAttribute);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -395,11 +395,10 @@ bool QmlProject::fromMap(const QVariantMap &map)
|
||||
|
||||
if (!kits.isEmpty()) {
|
||||
Kit *kit = 0;
|
||||
if (kits.contains(KitManager::defaultKit())) {
|
||||
if (kits.contains(KitManager::defaultKit()))
|
||||
kit = KitManager::defaultKit();
|
||||
} else {
|
||||
else
|
||||
kit = kits.first();
|
||||
}
|
||||
addTarget(createTarget(kit));
|
||||
}
|
||||
}
|
||||
|
@@ -193,9 +193,8 @@ QListWidgetItem *BlackBerryDeviceConfigurationWizardSetupPage::findDeviceListIte
|
||||
int count = m_ui->deviceListWidget->count();
|
||||
for (int i = 0; i < count; ++i) {
|
||||
QListWidgetItem *item = m_ui->deviceListWidget->item(i);
|
||||
if (item->data(ItemKindRole).value<ItemKind>() == itemKind) {
|
||||
if (item->data(ItemKindRole).value<ItemKind>() == itemKind)
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@@ -86,9 +86,8 @@ void BlackBerryDeviceListDetector::processData(const QString &line)
|
||||
{
|
||||
// line format is: deviceName,deviceHostNameOrIP,deviceType,versionIfSimulator
|
||||
QStringList list = line.split(QLatin1String(","));
|
||||
if (list.count() == 4) {
|
||||
if (list.count() == 4)
|
||||
emit deviceDetected (list[0], list[1], QLatin1String("Simulator") == list[2]);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -108,9 +108,8 @@ QDomElement BarDescriptorConverter::ensureElement(QDomDocument &doc, const QStri
|
||||
ret = rootElement.appendChild(doc.createElement(tagName)).toElement();
|
||||
QTC_ASSERT(!ret.isNull(), return ret);
|
||||
}
|
||||
if (!attributeName.isEmpty()) {
|
||||
if (!attributeName.isEmpty())
|
||||
ret.setAttribute(attributeName, attributeValue);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -210,11 +210,10 @@ QString QnxUtils::dataDirPath()
|
||||
|
||||
QString QnxUtils::qConfigPath()
|
||||
{
|
||||
if (Utils::HostOsInfo::isMacHost() || Utils::HostOsInfo::isWindowsHost()) {
|
||||
if (Utils::HostOsInfo::isMacHost() || Utils::HostOsInfo::isWindowsHost())
|
||||
return dataDirPath() + QLatin1String("/BlackBerry Native SDK/qconfig");
|
||||
} else {
|
||||
else
|
||||
return dataDirPath() + QLatin1String("/bbndk/qconfig");
|
||||
}
|
||||
}
|
||||
|
||||
QString QnxUtils::defaultTargetVersion(const QString &ndkPath)
|
||||
|
@@ -125,19 +125,16 @@ public:
|
||||
if (qtVersionSetting != noQtVersionsId) {
|
||||
//ensure that the unique Qt id is valid
|
||||
foreach (BaseQtVersion *version, qtVersions) {
|
||||
if (version->uniqueId() == qtVersionSetting) {
|
||||
if (version->uniqueId() == qtVersionSetting)
|
||||
newQtVersionSetting = qtVersionSetting;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (newQtVersionSetting == noQtVersionsId) {
|
||||
if (newQtVersionSetting == noQtVersionsId)
|
||||
newQtVersionSetting = findHighestQtVersion();
|
||||
}
|
||||
|
||||
if (newQtVersionSetting != qtVersionSetting) {
|
||||
if (newQtVersionSetting != qtVersionSetting)
|
||||
setUniqueQtVersionIdSetting(newQtVersionSetting);
|
||||
}
|
||||
|
||||
|
||||
foreach (BaseQtVersion *version, qtVersions) {
|
||||
|
@@ -1905,9 +1905,8 @@ void BaseTextEditorWidget::keyPressEvent(QKeyEvent *e)
|
||||
}
|
||||
if (!electricChar.isNull() && d->m_autoCompleter->contextAllowsElectricCharacters(cursor))
|
||||
indent(document(), cursor, electricChar);
|
||||
if (!autoText.isEmpty()) {
|
||||
if (!autoText.isEmpty())
|
||||
cursor.setPosition(autoText.length() == 1 ? cursor.position() : cursor.anchor());
|
||||
}
|
||||
|
||||
if (doEditBlock) {
|
||||
cursor.endEditBlock();
|
||||
@@ -6321,9 +6320,8 @@ void BaseTextEditor::openGotoLocator()
|
||||
{
|
||||
Core::EditorManager::activateEditor(this, Core::EditorManager::IgnoreNavigationHistory);
|
||||
if (Core::Command *cmd = Core::ActionManager::command(Core::Constants::GOTO)) {
|
||||
if (QAction *act = cmd->action()) {
|
||||
if (QAction *act = cmd->action())
|
||||
act->trigger();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -62,9 +62,8 @@ void TextEditor::setMimeTypeForHighlighter(Highlighter *highlighter, const Core:
|
||||
if (!definitionId.isEmpty()) {
|
||||
const QSharedPointer<HighlightDefinition> &definition =
|
||||
Manager::instance()->definition(definitionId);
|
||||
if (!definition.isNull() && definition->isValid()) {
|
||||
if (!definition.isNull() && definition->isValid())
|
||||
highlighter->setDefaultContext(definition->initialContext());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -496,13 +496,12 @@ Utils::SynchronousProcessResponse Command::runSynchronous(const QStringList &arg
|
||||
Utils::ExitCodeInterpreter defaultInterpreter(this);
|
||||
Utils::ExitCodeInterpreter *currentInterpreter = interpreter ? interpreter : &defaultInterpreter;
|
||||
// Result
|
||||
if (timedOut) {
|
||||
if (timedOut)
|
||||
response.result = Utils::SynchronousProcessResponse::Hang;
|
||||
} else if (process->exitStatus() != QProcess::NormalExit) {
|
||||
else if (process->exitStatus() != QProcess::NormalExit)
|
||||
response.result = Utils::SynchronousProcessResponse::TerminatedAbnormally;
|
||||
} else {
|
||||
else
|
||||
response.result = currentInterpreter->interpretExitCode(process->exitCode());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user