Commit e520c38f authored by hjk's avatar hjk
Browse files

Core: Remove deprecated accessors



Also adjust user code.

Change-Id: I60935942a7012e6a0d6091ffbc89d69289366e35
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent eb724f37
......@@ -610,7 +610,7 @@ void ExternalToolRunner::run()
if (!m_resolvedWorkingDirectory.isEmpty())
m_process->setWorkingDirectory(m_resolvedWorkingDirectory);
m_process->setCommand(m_resolvedExecutable, m_resolvedArguments);
ICore::messageManager()->printToOutputPane(
MessageManager::instance()->printToOutputPane(
tr("Starting external tool '%1' %2").arg(m_resolvedExecutable, m_resolvedArguments), MessageManager::Silent);
m_process->start();
}
......@@ -632,7 +632,7 @@ void ExternalToolRunner::finished(int exitCode, QProcess::ExitStatus status)
if (m_tool->modifiesCurrentDocument())
DocumentManager::unexpectFileChange(m_expectedFileName);
}
ICore::messageManager()->printToOutputPane(
MessageManager::instance()->printToOutputPane(
tr("'%1' finished").arg(m_resolvedExecutable), MessageManager::Silent);
deleteLater();
}
......@@ -653,7 +653,7 @@ void ExternalToolRunner::readStandardOutput()
QByteArray data = m_process->readAllStandardOutput();
QString output = m_outputCodec->toUnicode(data.constData(), data.length(), &m_outputCodecState);
if (m_tool->outputHandling() == ExternalTool::ShowInPane)
ICore::messageManager()->printToOutputPane(output, MessageManager::NoModeSwitch);
MessageManager::instance()->printToOutputPane(output, MessageManager::NoModeSwitch);
else if (m_tool->outputHandling() == ExternalTool::ReplaceSelection)
m_processOutput.append(output);
}
......@@ -665,7 +665,7 @@ void ExternalToolRunner::readStandardError()
QByteArray data = m_process->readAllStandardError();
QString output = m_outputCodec->toUnicode(data.constData(), data.length(), &m_errorCodecState);
if (m_tool->errorHandling() == ExternalTool::ShowInPane)
ICore::messageManager()->printToOutputPane(output, MessageManager::NoModeSwitch);
MessageManager::instance()->printToOutputPane(output, MessageManager::NoModeSwitch);
else if (m_tool->errorHandling() == ExternalTool::ReplaceSelection)
m_processOutput.append(output);
}
......@@ -767,7 +767,7 @@ void ExternalToolManager::menuActivated()
QTC_ASSERT(tool, return);
ExternalToolRunner *runner = new ExternalToolRunner(tool);
if (runner->hasError())
ICore::messageManager()->printToOutputPane(runner->errorString(), MessageManager::NoModeSwitch);
MessageManager::instance()->printToOutputPane(runner->errorString(), MessageManager::NoModeSwitch);
}
QMap<QString, QList<Internal::ExternalTool *> > ExternalToolManager::toolsByCategory() const
......
......@@ -407,41 +407,16 @@ bool ICore::showWarningWithOptions(const QString &title, const QString &text,
settingsId, parent);
}
ActionManager *ICore::actionManager()
{
return m_mainwindow->actionManager();
}
DocumentManager *ICore::documentManager()
{
return DocumentManager::instance();
}
MessageManager *ICore::messageManager()
{
return m_mainwindow->messageManager();
}
ProgressManager *ICore::progressManager()
{
return m_mainwindow->progressManager();
}
VariableManager *ICore::variableManager()
{
return m_mainwindow->variableManager();
}
VcsManager *ICore::vcsManager()
{
return m_mainwindow->vcsManager();
}
ModeManager *ICore::modeManager()
{
return m_mainwindow->modeManager();
}
MimeDatabase *ICore::mimeDatabase()
{
return m_mainwindow->mimeDatabase();
......
......@@ -93,13 +93,8 @@ public:
Id settingsId = Id(),
QWidget *parent = 0);
static QT_DEPRECATED ActionManager *actionManager(); // Use Actionmanager::... directly.
static QT_DEPRECATED DocumentManager *documentManager(); // Use DocumentManager::... directly.
static QT_DEPRECATED MessageManager *messageManager(); // Use MessageManager::... directly.
static ProgressManager *progressManager();
static QT_DEPRECATED VariableManager *variableManager(); // Use VariableManager::... directly.
static VcsManager *vcsManager();
static QT_DEPRECATED ModeManager *modeManager(); // Use ModeManager::... directly.
static MimeDatabase *mimeDatabase();
static HelpManager *helpManager();
......
......@@ -306,7 +306,7 @@ void CodepasterPlugin::finishPost(const QString &link)
{
if (m_settings->copyToClipboard)
QApplication::clipboard()->setText(link);
ICore::messageManager()->printToOutputPane(link, m_settings->displayOutput ? Core::MessageManager::ModeSwitch : Core::MessageManager::Silent);
MessageManager::instance()->printToOutputPane(link, m_settings->displayOutput ? Core::MessageManager::ModeSwitch : Core::MessageManager::Silent);
}
// Extract the characters that can be used for a file name from a title
......@@ -346,7 +346,7 @@ void CodepasterPlugin::finishFetch(const QString &titleDescription,
const QString &content,
bool error)
{
Core::MessageManager *messageManager = ICore::messageManager();
Core::MessageManager *messageManager = MessageManager::instance();
// Failure?
if (error) {
messageManager->printToOutputPane(content, Core::MessageManager::NoModeSwitch);
......
......@@ -205,11 +205,11 @@ void FileShareProtocol::paste(const QString &text,
saver.setResult(&writer);
}
if (!saver.finalize()) {
Core::ICore::messageManager()->printToOutputPane(saver.errorString(), Core::MessageManager::NoModeSwitch);
Core::MessageManager::instance()->printToOutputPane(saver.errorString(), Core::MessageManager::NoModeSwitch);
return;
}
const QString msg = tr("Pasted: %1").arg(saver.fileName());
Core::ICore::messageManager()->printToOutputPane(msg, Core::MessageManager::NoModeSwitch);
Core::MessageManager::instance()->printToOutputPane(msg, Core::MessageManager::NoModeSwitch);
}
} // namespace CodePaster
......@@ -126,9 +126,9 @@ void ExecuteFilter::finished(int exitCode, QProcess::ExitStatus status)
{
QString log = QLatin1Char('\'') + headCommand() + QLatin1String("' ");
if (status == QProcess::NormalExit && exitCode == 0)
ICore::messageManager()->printToOutputPane(log + tr("finished"), MessageManager::NoModeSwitch);
MessageManager::instance()->printToOutputPane(log + tr("finished"), MessageManager::NoModeSwitch);
else
ICore::messageManager()->printToOutputPane(log + tr("failed"), MessageManager::NoModeSwitch);
MessageManager::instance()->printToOutputPane(log + tr("failed"), MessageManager::NoModeSwitch);
m_taskQueue.dequeue();
if (!m_taskQueue.isEmpty())
......@@ -138,13 +138,13 @@ void ExecuteFilter::finished(int exitCode, QProcess::ExitStatus status)
void ExecuteFilter::readStandardOutput()
{
QByteArray data = m_process->readAllStandardOutput();
ICore::messageManager()->printToOutputPane(QString::fromLocal8Bit(data), MessageManager::NoModeSwitch);
MessageManager::instance()->printToOutputPane(QString::fromLocal8Bit(data), MessageManager::NoModeSwitch);
}
void ExecuteFilter::readStandardError()
{
QByteArray data = m_process->readAllStandardError();
ICore::messageManager()->printToOutputPane(QString::fromLocal8Bit(data), MessageManager::NoModeSwitch);
MessageManager::instance()->printToOutputPane(QString::fromLocal8Bit(data), MessageManager::NoModeSwitch);
}
void ExecuteFilter::runHeadCommand()
......@@ -154,13 +154,13 @@ void ExecuteFilter::runHeadCommand()
const QString fullPath = Utils::Environment::systemEnvironment().searchInPath(d.executable);
if (fullPath.isEmpty()) {
const QString log = tr("Could not find executable for '%1'").arg(d.executable);
ICore::messageManager()->printToOutputPane(log, MessageManager::NoModeSwitch);
MessageManager::instance()->printToOutputPane(log, MessageManager::NoModeSwitch);
m_taskQueue.dequeue();
runHeadCommand();
return;
}
QString log(tr("Starting command '%1'").arg(headCommand()));
ICore::messageManager()->printToOutputPane(log, MessageManager::NoModeSwitch);
MessageManager::instance()->printToOutputPane(log, MessageManager::NoModeSwitch);
m_process->setWorkingDirectory(d.workingDirectory);
m_process->setCommand(fullPath, d.arguments);
m_process->start();
......
......@@ -495,7 +495,7 @@ QList<CustomWizard*> CustomWizard::createWizards()
if (CustomWizardPrivate::verbose) { // Print to output pane for Windows.
verboseLog += listWizards();
qWarning("%s", qPrintable(verboseLog));
Core::ICore::messageManager()->printToOutputPane(verboseLog, Core::MessageManager::ModeSwitch);
Core::MessageManager::instance()->printToOutputPane(verboseLog, Core::MessageManager::ModeSwitch);
}
return rc;
}
......
......@@ -1495,6 +1495,6 @@ void MiniProjectTargetSelector::paintEvent(QPaintEvent *)
void MiniProjectTargetSelector::switchToProjectsMode()
{
Core::ICore::instance()->modeManager()->activateMode(Constants::MODE_SESSION);
Core::ModeManager::instance()->activateMode(Constants::MODE_SESSION);
hide();
}
......@@ -179,7 +179,7 @@ static QmlProject::QmlImport detectImport(const QString &qml) {
void QmlProject::parseProject(RefreshOptions options)
{
Core::MessageManager *messageManager = Core::ICore::messageManager();
Core::MessageManager *messageManager = Core::MessageManager::instance();
if (options & Files) {
if (options & ProjectFile)
delete m_projectItem.data();
......
......@@ -969,7 +969,7 @@ QString Qt4Project::generatedUiHeader(const QString &formFile) const
void Qt4Project::proFileParseError(const QString &errorMessage)
{
Core::ICore::messageManager()->printToOutputPane(errorMessage, Core::MessageManager::NoModeSwitch);
Core::MessageManager::instance()->printToOutputPane(errorMessage, Core::MessageManager::NoModeSwitch);
}
QtSupport::ProFileReader *Qt4Project::createProFileReader(const Qt4ProFileNode *qt4ProFileNode, Qt4BuildConfiguration *bc)
......
......@@ -196,14 +196,14 @@ void TargetSetupPageWrapper::cancel()
{
ProjectExplorer::ProjectExplorerPlugin::instance()->unloadProject(m_project);
if (ProjectExplorer::ProjectExplorerPlugin::instance()->session()->projects().isEmpty())
Core::ICore::instance()->modeManager()->activateMode(Core::Constants::MODE_WELCOME);
Core::ModeManager::instance()->activateMode(Core::Constants::MODE_WELCOME);
}
void TargetSetupPageWrapper::done()
{
m_targetSetupPage->setupProject(m_project);
ProjectExplorer::ProjectExplorerPlugin::instance()->requestProjectModeUpdate(m_project);
Core::ICore::instance()->modeManager()->activateMode(Core::Constants::MODE_EDIT);
Core::ModeManager::instance()->activateMode(Core::Constants::MODE_EDIT);
}
void TargetSetupPageWrapper::completeChanged()
......
......@@ -49,7 +49,7 @@ ProMessageHandler::ProMessageHandler(bool verbose)
: m_verbose(verbose)
{
QObject::connect(this, SIGNAL(errorFound(QString,Core::MessageManager::PrintToOutputPaneFlags)),
Core::ICore::messageManager(), SLOT(printToOutputPane(QString,Core::MessageManager::PrintToOutputPaneFlags)),
Core::MessageManager::instance(), SLOT(printToOutputPane(QString,Core::MessageManager::PrintToOutputPaneFlags)),
Qt::QueuedConnection);
}
......
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