2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2014-06-27 23:16:13 +02:00
|
|
|
|
|
|
|
|
#include "idocumentfactory.h"
|
|
|
|
|
|
|
|
|
|
#include <utils/qtcassert.h>
|
|
|
|
|
|
|
|
|
|
namespace Core {
|
|
|
|
|
|
2017-12-08 17:20:48 +01:00
|
|
|
static QList<IDocumentFactory *> g_documentFactories;
|
|
|
|
|
|
2021-01-12 11:53:58 +01:00
|
|
|
IDocumentFactory::IDocumentFactory()
|
2017-12-08 17:20:48 +01:00
|
|
|
{
|
|
|
|
|
g_documentFactories.append(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IDocumentFactory::~IDocumentFactory()
|
|
|
|
|
{
|
|
|
|
|
g_documentFactories.removeOne(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const QList<IDocumentFactory *> IDocumentFactory::allDocumentFactories()
|
|
|
|
|
{
|
|
|
|
|
return g_documentFactories;
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-23 11:15:18 +02:00
|
|
|
IDocument *IDocumentFactory::open(const Utils::FilePath &filePath)
|
2014-06-27 23:16:13 +02:00
|
|
|
{
|
2018-07-21 21:11:46 +02:00
|
|
|
QTC_ASSERT(m_opener, return nullptr);
|
2021-07-23 11:15:18 +02:00
|
|
|
return m_opener(filePath);
|
2014-06-27 23:16:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Core
|