Commit bfcce472 authored by Tobias Hunger's avatar Tobias Hunger

DiffEditor: Remove unnecessary instance() method from DiffEditorManager

The interface is static and the only slot that one can connect to is
private.

Change-Id: Iebd3747fecd24e0250d02e663de405e3f9217acb
Reviewed-by: default avatarJarek Kobus <jaroslaw.kobus@theqtcompany.com>
parent 0a402aec
......@@ -57,11 +57,6 @@ DiffEditorManager::~DiffEditorManager()
m_instance = 0;
}
DiffEditorManager *DiffEditorManager::instance()
{
return m_instance;
}
void DiffEditorManager::slotEditorsClosed(const QList<Core::IEditor *> &editors)
{
QMap<Core::IDocument *, int> editorsForDocument;
......@@ -89,7 +84,7 @@ void DiffEditorManager::slotEditorsClosed(const QList<Core::IEditor *> &editors)
DiffEditorDocument *DiffEditorManager::find(const QString &documentId)
{
return instance()->idToDocument.value(documentId);
return m_instance->idToDocument.value(documentId);
}
DiffEditorDocument *DiffEditorManager::findOrCreate(const QString &documentId, const QString &displayName)
......@@ -109,19 +104,19 @@ DiffEditorDocument *DiffEditorManager::findOrCreate(const QString &documentId, c
document->setDisplayName(displayName);
instance()->idToDocument.insert(documentId, document);
instance()->documentToId.insert(document, documentId);
m_instance->idToDocument.insert(documentId, document);
m_instance->documentToId.insert(document, documentId);
return document;
}
void DiffEditorManager::removeDocument(DiffEditorDocument *document)
{
if (!instance()->documentToId.contains(document))
if (!m_instance->documentToId.contains(document))
return;
const QString documentId = instance()->documentToId.value(document);
instance()->documentToId.remove(document);
instance()->idToDocument.remove(documentId);
const QString documentId = m_instance->documentToId.value(document);
m_instance->documentToId.remove(document);
m_instance->idToDocument.remove(documentId);
}
......
......@@ -49,8 +49,6 @@ public:
explicit DiffEditorManager(QObject *parent);
virtual ~DiffEditorManager();
static DiffEditorManager *instance();
static DiffEditorDocument *find(const QString &documentId);
static DiffEditorDocument *findOrCreate(const QString &documentId, const QString &displayName);
static void removeDocument(DiffEditorDocument *document);
......
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