Commit e568d14b authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

Git: Use commit encoding for interactive rebase and commit editors



Task-number: QTCREATORBUG-11115

Change-Id: Ie922d94d66bed2882d3fc2b8b2de1bdc328d4d1c
Reviewed-by: default avatarAndré Hartmann <aha_1980@gmx.de>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 86d7916b
......@@ -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()->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);
const QString commitEncoding = GitPlugin::instance()->gitClient()->commitEncoding(gitPath);
baseTextDocument()->setCodec(QTextCodec::codecForName(commitEncoding.toLocal8Bit()));
}
return res;
return VcsBaseEditorWidget::open(errorString, fileName, realFileName);
}
QString GitEditor::decorateVersion(const QString &revision) const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment