EditorFactory: Replace some virtual functions with data members

Change-Id: I014cb57460c4e3a36bf7403960908b5ffec867ff
Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
hjk
2013-05-31 19:35:37 +02:00
parent be112d853a
commit b772001c82
38 changed files with 132 additions and 545 deletions

View File

@@ -33,7 +33,6 @@
#include <projectexplorer/projectexplorer.h>
#include <coreplugin/icore.h>
#include <coreplugin/id.h>
#include <coreplugin/documentmanager.h>
#include <QMessageBox>
@@ -45,26 +44,11 @@ using namespace TaskList::Internal;
// --------------------------------------------------------------------------
TaskFileFactory::TaskFileFactory(QObject * parent) :
Core::IDocumentFactory(parent),
m_mimeTypes(QStringList() << QLatin1String("text/x-tasklist"))
{ }
TaskFileFactory::~TaskFileFactory()
{ }
QStringList TaskFileFactory::mimeTypes() const
Core::IDocumentFactory(parent)
{
return m_mimeTypes;
}
Core::Id TaskFileFactory::id() const
{
return Core::Id("ProjectExplorer.TaskFileFactory");
}
QString TaskFileFactory::displayName() const
{
return tr("Task file reader");
setId("ProjectExplorer.TaskFileFactory");
setDisplayName(tr("Task file reader"));
addMimeType(QLatin1String("text/x-tasklist"));
}
Core::IDocument *TaskFileFactory::open(const QString &fileName)

View File

@@ -33,11 +33,7 @@
#include <coreplugin/idocumentfactory.h>
#include <coreplugin/idocument.h>
#include <QStringList>
namespace ProjectExplorer {
class Project;
} // namespace ProjectExplorer
namespace ProjectExplorer { class Project; }
namespace TaskList {
namespace Internal {
@@ -45,14 +41,9 @@ namespace Internal {
class TaskFileFactory : public Core::IDocumentFactory
{
Q_OBJECT
public:
TaskFileFactory(QObject *parent = 0);
~TaskFileFactory();
QStringList mimeTypes() const;
Core::Id id() const;
QString displayName() const;
Core::IDocument *open(const QString &fileName);
Core::IDocument *open(ProjectExplorer::Project *context, const QString &fileName);
@@ -60,7 +51,6 @@ public:
void closeAllFiles();
private:
QStringList m_mimeTypes;
QList<Core::IDocument *> m_openFiles;
};