summaryrefslogtreecommitdiff
path: root/src/plugins/git/giteditor.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2014-03-18 14:46:29 +0100
committerOswald Buddenhagen <oswald.buddenhagen@digia.com>2014-03-18 14:46:29 +0100
commit868428cc634f0e2c6d5ace84555675cb80363d3f (patch)
tree98d321520f31107067ca45e5b5806d92551b2f3d /src/plugins/git/giteditor.cpp
parent0d303db8c2e79c772cd216bfc07b42637c37e1bd (diff)
parent93184f7959bd18ba6f77e8d8b312f0e3be95d70c (diff)
downloadqt-creator-868428cc634f0e2c6d5ace84555675cb80363d3f.tar.gz
Merge remote-tracking branch 'origin/3.1'
Conflicts: qbs/imports/QtcTool.qbs src/plugins/git/giteditor.cpp src/plugins/qmldesigner/qmldesignerplugin.cpp Change-Id: Icafd32f713effb1479480a0d1f61a01e429fbec0
Diffstat (limited to 'src/plugins/git/giteditor.cpp')
-rw-r--r--src/plugins/git/giteditor.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp
index 07328f34a7..d281ad9e48 100644
--- a/src/plugins/git/giteditor.cpp
+++ b/src/plugins/git/giteditor.cpp
@@ -46,6 +46,7 @@
#include <QRegExp>
#include <QSet>
#include <QTemporaryFile>
+#include <QTextCodec>
#include <QDir>
#include <QTextCursor>
@@ -325,14 +326,16 @@ void GitEditor::addDiffActions(QMenu *menu, const VcsBase::DiffChunk &chunk)
bool GitEditor::open(QString *errorString, const QString &fileName, const QString &realFileName)
{
- bool res = VcsBaseEditorWidget::open(errorString, fileName, realFileName);
Core::Id editorId = editor()->document()->id();
if (editorId == Git::Constants::GIT_COMMIT_TEXT_EDITOR_ID
|| editorId == Git::Constants::GIT_REBASE_EDITOR_ID) {
QFileInfo fi(fileName);
- setSource(fi.absolutePath());
+ const QString gitPath = fi.absolutePath();
+ setSource(gitPath);
+ baseTextDocument()->setCodec(
+ GitPlugin::instance()->gitClient()->encoding(gitPath, "i18n.commitEncoding"));
}
- return res;
+ return VcsBaseEditorWidget::open(errorString, fileName, realFileName);
}
QString GitEditor::decorateVersion(const QString &revision) const