aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/resourceeditor/resourceeditorfactory.cpp
blob: e75c1ab9606221dea2f0c0b6258829d1a6fe448b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// 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 "resourceeditorfactory.h"

#include "resourceeditorconstants.h"
#include "resourceeditorplugin.h"
#include "resourceeditorw.h"

#include <coreplugin/editormanager/editormanager.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <utils/fsengine/fileiconprovider.h>

#include <QCoreApplication>

using namespace ResourceEditor::Constants;

namespace ResourceEditor::Internal {

ResourceEditorFactory::ResourceEditorFactory(ResourceEditorPlugin *plugin)
{
    setId(RESOURCEEDITOR_ID);
    setMimeTypes(QStringList(QLatin1String(C_RESOURCE_MIMETYPE)));
    setDisplayName(QCoreApplication::translate("OpenWith::Editors", C_RESOURCEEDITOR_DISPLAY_NAME));

    Utils::FileIconProvider::registerIconOverlayForSuffix(
                ProjectExplorer::Constants::FILEOVERLAY_QRC, "qrc");

    setEditorCreator([plugin] {
        return new ResourceEditorW(Core::Context(C_RESOURCEEDITOR), plugin);
    });
}

} // ResourceEditor::Internal