forked from qt-creator/qt-creator
Remove bool return value from IEditor::restoreState()
It's never used, and actually there wouldn't be any sensible thing to do with it. Change-Id: Id8a8df18c7db4b98e5abbc034240bb90dc1dcaa9 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -49,7 +49,7 @@ public:
|
||||
virtual IEditor *duplicate() { return nullptr; }
|
||||
|
||||
virtual QByteArray saveState() const { return QByteArray(); }
|
||||
virtual bool restoreState(const QByteArray &/*state*/) { return true; }
|
||||
virtual void restoreState(const QByteArray & /*state*/) {}
|
||||
|
||||
virtual int currentLine() const { return 0; }
|
||||
virtual int currentColumn() const { return 0; }
|
||||
|
@@ -174,7 +174,7 @@ QByteArray ModelEditor::saveState() const
|
||||
return saveState(currentDiagram());
|
||||
}
|
||||
|
||||
bool ModelEditor::restoreState(const QByteArray &state)
|
||||
void ModelEditor::restoreState(const QByteArray &state)
|
||||
{
|
||||
QDataStream stream(state);
|
||||
int version = 0;
|
||||
@@ -198,11 +198,9 @@ bool ModelEditor::restoreState(const QByteArray &state)
|
||||
qmt::MDiagram *diagram = d->document->documentController()->modelController()->findObject<qmt::MDiagram>(uid);
|
||||
if (diagram) {
|
||||
openDiagram(diagram, false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void ModelEditor::init()
|
||||
|
@@ -69,7 +69,7 @@ public:
|
||||
Core::IDocument *document() const override;
|
||||
QWidget *toolBar() override;
|
||||
QByteArray saveState() const override;
|
||||
bool restoreState(const QByteArray &state) override;
|
||||
void restoreState(const QByteArray &state) override;
|
||||
|
||||
qmt::MDiagram *currentDiagram() const;
|
||||
void showDiagram(qmt::MDiagram *diagram);
|
||||
|
@@ -159,7 +159,7 @@ void QmlJSEditorWidget::finalizeInitialization()
|
||||
createToolBar();
|
||||
}
|
||||
|
||||
bool QmlJSEditorWidget::restoreState(const QByteArray &state)
|
||||
void QmlJSEditorWidget::restoreState(const QByteArray &state)
|
||||
{
|
||||
QStringList qmlTypes { QmlJSTools::Constants::QML_MIMETYPE,
|
||||
QmlJSTools::Constants::QBS_MIMETYPE,
|
||||
@@ -174,7 +174,7 @@ bool QmlJSEditorWidget::restoreState(const QByteArray &state)
|
||||
foldAuxiliaryData();
|
||||
}
|
||||
|
||||
return TextEditorWidget::restoreState(state);
|
||||
TextEditorWidget::restoreState(state);
|
||||
}
|
||||
|
||||
QModelIndex QmlJSEditorWidget::outlineModelIndex()
|
||||
|
@@ -58,7 +58,7 @@ public:
|
||||
QmlJSEditorWidget();
|
||||
|
||||
void finalizeInitialization() override;
|
||||
bool restoreState(const QByteArray &state) override;
|
||||
void restoreState(const QByteArray &state) override;
|
||||
|
||||
QmlJSEditorDocument *qmlJsEditorDocument() const;
|
||||
|
||||
|
@@ -238,14 +238,12 @@ QByteArray ResourceEditorW::saveState() const
|
||||
return bytes;
|
||||
}
|
||||
|
||||
bool ResourceEditorW::restoreState(const QByteArray &state)
|
||||
void ResourceEditorW::restoreState(const QByteArray &state)
|
||||
{
|
||||
QDataStream stream(state);
|
||||
QByteArray splitterState;
|
||||
stream >> splitterState;
|
||||
if (!m_resourceEditor->restoreState(splitterState))
|
||||
return false;
|
||||
return true;
|
||||
m_resourceEditor->restoreState(splitterState);
|
||||
}
|
||||
|
||||
QWidget *ResourceEditorW::toolBar()
|
||||
|
@@ -91,7 +91,7 @@ public:
|
||||
// IEditor
|
||||
Core::IDocument *document() const override { return m_resourceDocument; }
|
||||
QByteArray saveState() const override;
|
||||
bool restoreState(const QByteArray &state) override;
|
||||
void restoreState(const QByteArray &state) override;
|
||||
QWidget *toolBar() override;
|
||||
|
||||
private:
|
||||
|
@@ -3003,12 +3003,12 @@ QByteArray TextEditorWidget::saveState() const
|
||||
return state;
|
||||
}
|
||||
|
||||
bool TextEditorWidget::restoreState(const QByteArray &state)
|
||||
void TextEditorWidget::restoreState(const QByteArray &state)
|
||||
{
|
||||
if (state.isEmpty()) {
|
||||
if (d->m_displaySettings.m_autoFoldFirstComment)
|
||||
d->foldLicenseHeader();
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
int version;
|
||||
int vval;
|
||||
@@ -3036,7 +3036,7 @@ bool TextEditorWidget::restoreState(const QByteArray &state)
|
||||
}
|
||||
if (layoutChanged) {
|
||||
auto documentLayout = qobject_cast<TextDocumentLayout*>(doc->documentLayout());
|
||||
QTC_ASSERT(documentLayout, return false);
|
||||
QTC_ASSERT(documentLayout, return );
|
||||
documentLayout->requestUpdate();
|
||||
documentLayout->emitDocumentSizeChanged();
|
||||
}
|
||||
@@ -3068,7 +3068,6 @@ bool TextEditorWidget::restoreState(const QByteArray &state)
|
||||
}
|
||||
|
||||
d->saveCurrentCursorPositionForNavigation();
|
||||
return true;
|
||||
}
|
||||
|
||||
void TextEditorWidget::setParenthesesMatchingEnabled(bool b)
|
||||
@@ -8446,9 +8445,9 @@ QByteArray BaseTextEditor::saveState() const
|
||||
return editorWidget()->saveState();
|
||||
}
|
||||
|
||||
bool BaseTextEditor::restoreState(const QByteArray &state)
|
||||
void BaseTextEditor::restoreState(const QByteArray &state)
|
||||
{
|
||||
return editorWidget()->restoreState(state);
|
||||
editorWidget()->restoreState(state);
|
||||
}
|
||||
|
||||
BaseTextEditor *BaseTextEditor::currentTextEditor()
|
||||
|
@@ -130,7 +130,7 @@ public:
|
||||
IEditor *duplicate() override;
|
||||
|
||||
QByteArray saveState() const override;
|
||||
bool restoreState(const QByteArray &state) override;
|
||||
void restoreState(const QByteArray &state) override;
|
||||
QWidget *toolBar() override;
|
||||
|
||||
void contextHelp(const HelpCallback &callback) const override; // from IContext
|
||||
@@ -190,7 +190,7 @@ public:
|
||||
virtual void openFinishedSuccessfully();
|
||||
// IEditor
|
||||
QByteArray saveState() const;
|
||||
virtual bool restoreState(const QByteArray &state);
|
||||
virtual void restoreState(const QByteArray &state);
|
||||
void gotoLine(int line, int column = 0, bool centerLine = true, bool animate = false);
|
||||
int position(TextPositionOperation posOp = CurrentPosition,
|
||||
int at = -1) const;
|
||||
|
Reference in New Issue
Block a user