forked from qt-creator/qt-creator
Core: Static pattern for ProgressManager, clean up all users
Change-Id: I4af8793ca69a3af9e99baeb7c31dad3864266f91 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -51,6 +51,8 @@
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace Core;
|
||||
|
||||
namespace TextEditor {
|
||||
class BaseTextDocumentPrivate
|
||||
{
|
||||
@@ -222,7 +224,7 @@ bool BaseTextDocument::save(QString *errorString, const QString &saveFileName, b
|
||||
|
||||
// When saving the current editor, make sure to maintain the cursor and scroll bar
|
||||
// positions for undo
|
||||
Core::IEditor *currentEditor = Core::EditorManager::currentEditor();
|
||||
IEditor *currentEditor = EditorManager::currentEditor();
|
||||
if (BaseTextEditor *editable = qobject_cast<BaseTextEditor*>(currentEditor)) {
|
||||
if (editable->document() == this) {
|
||||
editorWidget = editable->editorWidget();
|
||||
@@ -296,7 +298,7 @@ bool BaseTextDocument::save(QString *errorString, const QString &saveFileName, b
|
||||
|
||||
bool BaseTextDocument::setContents(const QByteArray &contents)
|
||||
{
|
||||
if (contents.size() > Core::EditorManager::maxTextFileSize()) {
|
||||
if (contents.size() > EditorManager::maxTextFileSize()) {
|
||||
document()->setPlainText(BaseTextEditorWidget::msgTextTooLarge(contents.size()));
|
||||
document()->setModified(false);
|
||||
return false;
|
||||
@@ -365,8 +367,8 @@ bool BaseTextDocument::open(QString *errorString, const QString &fileName, const
|
||||
} else {
|
||||
QFutureInterface<void> interface;
|
||||
interface.setProgressRange(0, chunks);
|
||||
Core::ICore::progressManager()->addTask(
|
||||
interface.future(), tr("Opening file"), QLatin1String(Constants::TASK_OPEN_FILE));
|
||||
ProgressManager::addTask(interface.future(),
|
||||
tr("Opening file"), QLatin1String(Constants::TASK_OPEN_FILE));
|
||||
interface.reportStarted();
|
||||
d->m_document->setUndoRedoEnabled(false);
|
||||
QTextCursor c(d->m_document);
|
||||
|
||||
Reference in New Issue
Block a user