summaryrefslogtreecommitdiff
path: root/src/plugins/git/giteditor.cpp
diff options
context:
space:
mode:
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