Make method naming more consistent.

* Use id() for methods returning a string used to represent
    some type of object.
  * Use displayName() for strings that are meant to be user
    visible.
  * Quieten some warnings while touching the files anyway.
  * Move Factories to their products in the plugins where that
    was not done before.

Reviewed-by: dt
This commit is contained in:
Tobias Hunger
2010-01-07 18:17:24 +01:00
parent 8bb87fcda4
commit a6ad773722
332 changed files with 1666 additions and 1543 deletions

View File

@@ -46,7 +46,6 @@ using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
ProFileEditorFactory::ProFileEditorFactory(Qt4Manager *manager, TextEditor::TextEditorActionHandler *handler) :
m_kind(QLatin1String(Qt4ProjectManager::Constants::PROFILE_EDITOR)),
m_mimeTypes(QStringList() << QLatin1String(Qt4ProjectManager::Constants::PROFILE_MIMETYPE)
<< QLatin1String(Qt4ProjectManager::Constants::PROINCLUDEFILE_MIMETYPE)),
m_manager(manager),
@@ -63,14 +62,19 @@ ProFileEditorFactory::~ProFileEditorFactory()
{
}
QString ProFileEditorFactory::kind() const
QString ProFileEditorFactory::id() const
{
return m_kind;
return QLatin1String(Qt4ProjectManager::Constants::PROFILE_EDITOR_ID);
}
QString ProFileEditorFactory::displayName() const
{
return tr(Qt4ProjectManager::Constants::PROFILE_EDITOR_DISPLAY_NAME);
}
Core::IFile *ProFileEditorFactory::open(const QString &fileName)
{
Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, kind());
Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, id());
return iface ? iface->file() : 0;
}