forked from qt-creator/qt-creator
Move IEditor::createNew to IDocument::setContents
The method is for setting the contents, so it belongs to the document, and should be named correspondingly. Change-Id: I40363dc08f11268f530885b512e4a88e8b10d096 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -67,12 +67,6 @@ DiffEditor::~DiffEditor()
|
||||
delete m_widget;
|
||||
}
|
||||
|
||||
bool DiffEditor::createNew(const QString &contents)
|
||||
{
|
||||
Q_UNUSED(contents)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DiffEditor::open(QString *errorString, const QString &fileName, const QString &realFileName)
|
||||
{
|
||||
Q_UNUSED(errorString)
|
||||
|
||||
@@ -60,7 +60,6 @@ public:
|
||||
void clear(const QString &message);
|
||||
|
||||
// Core::IEditor
|
||||
bool createNew(const QString &contents);
|
||||
bool open(QString *errorString, const QString &fileName, const QString &realFileName);
|
||||
Core::IDocument *document();
|
||||
Core::Id id() const;
|
||||
|
||||
@@ -46,6 +46,12 @@ DiffEditorFile::DiffEditorFile(const QString &mimeType, QObject *parent) :
|
||||
setTemporary(true);
|
||||
}
|
||||
|
||||
bool DiffEditorFile::setContents(const QByteArray &contents)
|
||||
{
|
||||
Q_UNUSED(contents);
|
||||
return false;
|
||||
}
|
||||
|
||||
void DiffEditorFile::setModified(bool modified)
|
||||
{
|
||||
if (m_modified == modified)
|
||||
|
||||
@@ -48,6 +48,7 @@ public:
|
||||
explicit DiffEditorFile(const QString &mimeType,
|
||||
QObject *parent = 0);
|
||||
|
||||
bool setContents(const QByteArray &contents);
|
||||
QString defaultPath() const { return QString(); }
|
||||
QString suggestedFileName() const { return QString(); }
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ void DiffEditorPlugin::diff()
|
||||
//: Editor title
|
||||
QString title = tr("Diff \"%1\", \"%2\"").arg(fileName1).arg(fileName2);
|
||||
DiffEditor *editor = qobject_cast<DiffEditor *>
|
||||
(Core::EditorManager::openEditorWithContents(editorId, &title, QString()));
|
||||
(Core::EditorManager::openEditorWithContents(editorId, &title));
|
||||
|
||||
if (!editor)
|
||||
return;
|
||||
|
||||
@@ -42,10 +42,6 @@ QT_END_NAMESPACE
|
||||
|
||||
namespace DiffEditor {
|
||||
|
||||
namespace Internal {
|
||||
class DiffEditorFile;
|
||||
}
|
||||
|
||||
class DIFFEDITOR_EXPORT DiffShowEditor : public DiffEditor
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Reference in New Issue
Block a user