Editor: Disable adding UTF-8 BOM for qmake project files

Removes the "Add/Remove UTF-8 BOM" entry in the context menu
of the project file editor. Also ignores the setting
"Add If Encoding Is UTF-8" under
Options -> Text Editor -> Behavior -> File Encodings.

Task-number: QTCREATORBUG-8501

Change-Id: I368966b5235ee60011f2051ebdb82f9fe09bc4cc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
David Schulz
2013-01-24 08:47:31 +01:00
parent 8d4618e43d
commit 2f9574582d
4 changed files with 9 additions and 3 deletions

View File

@@ -6238,7 +6238,7 @@ void BaseTextEditorWidget::appendStandardContextMenuActions(QMenu *menu)
menu->addAction(a);
QSharedPointer<BaseTextDocument> doc = baseTextDocument();
if (doc->codec()->name() == QByteArray("UTF-8")) {
if (doc->codec()->name() == QByteArray("UTF-8") && doc->supportsUtf8Bom()) {
a = Core::ActionManager::command(Constants::SWITCH_UTF8BOM)->action();
if (a && a->isEnabled()) {
a->setText(doc->format().hasUtf8Bom ? tr("Delete UTF-8 BOM on Save")