forked from qt-creator/qt-creator
Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
45 lines
1.3 KiB
C++
45 lines
1.3 KiB
C++
// Copyright (C) 2016 The Qt Company Ltd.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
|
|
|
#include "androidmanifestdocument.h"
|
|
#include "androidmanifesteditorwidget.h"
|
|
#include "androidconstants.h"
|
|
|
|
#include <coreplugin/editormanager/ieditor.h>
|
|
#include <coreplugin/idocument.h>
|
|
|
|
#include <utils/fileutils.h>
|
|
|
|
#include <QFileInfo>
|
|
|
|
using namespace Android;
|
|
using namespace Android::Internal;
|
|
|
|
AndroidManifestDocument::AndroidManifestDocument(AndroidManifestEditorWidget *editorWidget)
|
|
: m_editorWidget(editorWidget)
|
|
{
|
|
setId(Constants::ANDROID_MANIFEST_EDITOR_ID);
|
|
setMimeType(QLatin1String(Constants::ANDROID_MANIFEST_MIME_TYPE));
|
|
setSuspendAllowed(false);
|
|
connect(editorWidget, &AndroidManifestEditorWidget::guiChanged,
|
|
this, &Core::IDocument::changed);
|
|
}
|
|
|
|
bool AndroidManifestDocument::save(QString *errorString, const Utils::FilePath &filePath, bool autoSave)
|
|
{
|
|
m_editorWidget->preSave();
|
|
bool result = TextDocument::save(errorString, filePath, autoSave);
|
|
m_editorWidget->postSave();
|
|
return result;
|
|
}
|
|
|
|
bool AndroidManifestDocument::isModified() const
|
|
{
|
|
return TextDocument::isModified() || m_editorWidget->isModified();
|
|
}
|
|
|
|
bool AndroidManifestDocument::isSaveAsAllowed() const
|
|
{
|
|
return false;
|
|
}
|