Commit c4d1d7f2 authored by hjk's avatar hjk

Core: Clean up some ICore::instance() uses

Change-Id: I888b30094ed75818ee3af58c94ebf8468afa5eb9
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 10e458d5
......@@ -855,7 +855,7 @@ AndroidConfigurations &AndroidConfigurations::instance(QObject *parent)
void AndroidConfigurations::save()
{
QSettings *settings = Core::ICore::instance()->settings();
QSettings *settings = Core::ICore::settings();
settings->beginGroup(SettingsGroup);
m_config.save(*settings);
settings->endGroup();
......@@ -874,7 +874,7 @@ AndroidConfigurations::AndroidConfigurations(QObject *parent)
void AndroidConfigurations::load()
{
bool saveSettings = false;
QSettings *settings = Core::ICore::instance()->settings();
QSettings *settings = Core::ICore::settings();
settings->beginGroup(SettingsGroup);
m_config = AndroidConfig(*settings);
......
......@@ -908,7 +908,7 @@ void AndroidPackageCreationStep::certificatePassword()
void AndroidPackageCreationStep::showInGraphicalShell()
{
Core::FileUtils::showInGraphicalShell(Core::ICore::instance()->mainWindow(), m_apkPathSigned.toString());
Core::FileUtils::showInGraphicalShell(Core::ICore::mainWindow(), m_apkPathSigned.toString());
}
void AndroidPackageCreationStep::raiseError(const QString &shortMsg,
......
......@@ -287,23 +287,18 @@
#include <utils/hostosinfo.h>
#include <QDir>
#include <QCoreApplication>
#include <QDebug>
#include <QDir>
#include <QStatusBar>
using namespace Core::Internal;
namespace Core {
// The Core Singleton
static ICore *m_instance = 0;
namespace Internal {
static MainWindow *m_mainwindow;
} // namespace Internal
using namespace Core::Internal;
ICore *ICore::instance()
{
......
......@@ -233,7 +233,7 @@ void GerritDialog::updateCompletions(const QString &query)
queries.removeAll(query);
queries.prepend(query);
m_queryModel->setStringList(queries);
m_parameters->saveQueries(Core::ICore::instance()->settings());
m_parameters->saveQueries(Core::ICore::settings());
}
GerritDialog::~GerritDialog()
......
......@@ -73,7 +73,7 @@ void GerritOptionsPage::apply()
else
newParameters.setPortFlagBySshType();
*m_parameters = newParameters;
m_parameters->toSettings(Core::ICore::instance()->settings());
m_parameters->toSettings(Core::ICore::settings());
}
}
}
......
......@@ -273,7 +273,7 @@ GerritPlugin::~GerritPlugin()
bool GerritPlugin::initialize(ActionContainer *ac)
{
m_parameters->fromSettings(ICore::instance()->settings());
m_parameters->fromSettings(ICore::settings());
QAction *openViewAction = new QAction(tr("Gerrit..."), this);
......@@ -364,7 +364,7 @@ void GerritPlugin::openView()
QMessageBox::warning(0, tr("Error"),
tr("Invalid Gerrit configuration. Host, user and ssh binary are mandatory."));
const Id group = VcsBase::Constants::VCS_SETTINGS_CATEGORY;
if (!ICore::instance()->showOptionsDialog(group, "Gerrit"))
if (!ICore::showOptionsDialog(group, "Gerrit"))
return;
}
GerritDialog *gd = new GerritDialog(m_parameters, ICore::mainWindow());
......
......@@ -100,8 +100,8 @@ QmlJSEditorPlugin::QmlJSEditorPlugin() :
m_reformatFileAction(0),
m_currentEditor(0),
m_jsonManager(new Utils::JsonSchemaManager(
QStringList() << Core::ICore::instance()->userResourcePath() + QLatin1String("/json/")
<< Core::ICore::instance()->resourcePath() + QLatin1String("/json/")))
QStringList() << Core::ICore::userResourcePath() + QLatin1String("/json/")
<< Core::ICore::resourcePath() + QLatin1String("/json/")))
{
m_instance = this;
}
......
......@@ -52,7 +52,7 @@ static QStringList binaryFiles()
QString QmlApp::templateRootDirectory()
{
return Core::ICore::instance()->resourcePath() + QLatin1String("/templates/qml/");
return Core::ICore::resourcePath() + QLatin1String("/templates/qml/");
}
TemplateInfo::TemplateInfo()
......
......@@ -619,7 +619,7 @@ void TargetSetupPage::updateVisibility()
void TargetSetupPage::openOptions()
{
Core::ICore::instance()->showOptionsDialog(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY,
Core::ICore::showOptionsDialog(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY,
ProjectExplorer::Constants::KITS_SETTINGS_PAGE_ID,
this);
}
......
......@@ -376,8 +376,7 @@ QStringList BaseFileFind::replaceAll(const QString &text,
// Query the user for permissions
if (!roFiles.isEmpty()) {
Core::Internal::ReadOnlyFilesDialog roDialog(roFiles.toList(),
ICore::instance()->mainWindow());
Core::Internal::ReadOnlyFilesDialog roDialog(roFiles.toList(), ICore::mainWindow());
roDialog.setShowFailWarning(true, tr("Aborting replace."));
if (roDialog.exec() == Core::Internal::ReadOnlyFilesDialog::RO_Cancel)
return QStringList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment