diff options
author | hjk <hjk121@nokiamail.com> | 2013-08-30 16:38:57 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@digia.com> | 2013-09-03 11:41:45 +0200 |
commit | a37589d431844a64031d3044787c15f8dddace45 (patch) | |
tree | 4e4d2e07f31278b5606e779707697e65185cbc64 /src/plugins/pythoneditor/pythoneditorplugin.cpp | |
parent | 1226400af3da68f355f298935bc13807f257d224 (diff) | |
download | qt-creator-a37589d431844a64031d3044787c15f8dddace45.tar.gz |
Apply 'static' pattern to MimeDatabase
Also adjust and streamline using and surrounding code.
Change-Id: I6a8b05126bdcbb74ff611b21c7cb3c5902a2d5ca
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/pythoneditor/pythoneditorplugin.cpp')
-rw-r--r-- | src/plugins/pythoneditor/pythoneditorplugin.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp index 1f8ec02163..6e77c2fba9 100644 --- a/src/plugins/pythoneditor/pythoneditorplugin.cpp +++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp @@ -212,17 +212,12 @@ PythonEditorPlugin::~PythonEditorPlugin() m_instance = 0; } -bool PythonEditorPlugin::initialize( - const QStringList &arguments, QString *errorMessage) +bool PythonEditorPlugin::initialize(const QStringList &arguments, QString *errorMessage) { Q_UNUSED(arguments) - if (! Core::ICore::mimeDatabase()->addMimeTypes( - QLatin1String(RC_PY_MIME_XML), - errorMessage)) - { + if (!Core::MimeDatabase::addMimeTypes(QLatin1String(RC_PY_MIME_XML), errorMessage)) return false; - } m_factory = new EditorFactory(this); addObject(m_factory); @@ -243,9 +238,8 @@ bool PythonEditorPlugin::initialize( const QIcon icon = QIcon::fromTheme(QLatin1String(C_PY_MIME_ICON)); if (!icon.isNull()) { Core::FileIconProvider *iconProv = Core::FileIconProvider::instance(); - Core::MimeDatabase *mimeDB = Core::ICore::instance()->mimeDatabase(); iconProv->registerIconOverlayForMimeType( - icon, mimeDB->findByType(QLatin1String(C_PY_MIMETYPE))); + icon, Core::MimeDatabase::findByType(QLatin1String(C_PY_MIMETYPE))); } //////////////////////////////////////////////////////////////////////////// |