forked from qt-creator/qt-creator
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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user