forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.4'
Conflicts: src/libs/qmljs/qmljsinterpreter.cpp src/libs/qmljs/qmljsinterpreter.h src/plugins/debugger/qml/scriptconsole.cpp src/plugins/git/gitplugin.cpp src/plugins/qmlprofiler/canvas/qdeclarativetiledcanvas.cpp src/plugins/qmlprofiler/canvas/qdeclarativetiledcanvas_p.h Change-Id: Iad59c8d87c72a21c79c047e374c0ab689998af39
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (info@qt.nokia.com)
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
@@ -26,7 +26,7 @@
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
** Nokia at qt-info@nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
@@ -707,19 +707,23 @@ void VCSBaseEditorWidget::slotActivateAnnotation()
|
||||
}
|
||||
}
|
||||
|
||||
// Check for a change chunk "@@ -91,7 +95,7 @@" and return
|
||||
// the modified line number (95).
|
||||
// Note that git appends stuff after " @@" (function names, etc.).
|
||||
static inline bool checkChunkLine(const QString &line, int *modifiedLineNumber)
|
||||
// Check for a chunk of
|
||||
// - changes : "@@ -91,7 +95,7 @@"
|
||||
// - merged conflicts : "@@@ -91,7 +95,7 @@@"
|
||||
// and return the modified line number (here 95).
|
||||
// Note that git appends stuff after " @@"/" @@@" (function names, etc.).
|
||||
static inline bool checkChunkLine(const QString &line, int *modifiedLineNumber, int numberOfAts)
|
||||
{
|
||||
if (!line.startsWith(QLatin1String("@@ ")))
|
||||
const QString ats(numberOfAts, QLatin1Char('@'));
|
||||
if (!line.startsWith(ats + QLatin1Char(' ')))
|
||||
return false;
|
||||
const int endPos = line.indexOf(QLatin1String(" @@"), 3);
|
||||
const int len = ats.size() + 1;
|
||||
const int endPos = line.indexOf(QLatin1Char(' ') + ats, len);
|
||||
if (endPos == -1)
|
||||
return false;
|
||||
// the first chunk range applies to the original file, the second one to
|
||||
// the modified file, the one we're interested int
|
||||
const int plusPos = line.indexOf(QLatin1Char('+'), 3);
|
||||
const int plusPos = line.indexOf(QLatin1Char('+'), len);
|
||||
if (plusPos == -1 || plusPos > endPos)
|
||||
return false;
|
||||
const int lineNumberPos = plusPos + 1;
|
||||
@@ -732,6 +736,13 @@ static inline bool checkChunkLine(const QString &line, int *modifiedLineNumber)
|
||||
return ok;
|
||||
}
|
||||
|
||||
static inline bool checkChunkLine(const QString &line, int *modifiedLineNumber)
|
||||
{
|
||||
if (checkChunkLine(line, modifiedLineNumber, 2))
|
||||
return true;
|
||||
return checkChunkLine(line, modifiedLineNumber, 3);
|
||||
}
|
||||
|
||||
void VCSBaseEditorWidget::jumpToChangeFromDiff(QTextCursor cursor)
|
||||
{
|
||||
int chunkStart = 0;
|
||||
|
||||
Reference in New Issue
Block a user