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 IEditor *duplicate() { return nullptr; }
|
||||||
|
|
||||||
virtual QByteArray saveState() const { return QByteArray(); }
|
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 currentLine() const { return 0; }
|
||||||
virtual int currentColumn() const { return 0; }
|
virtual int currentColumn() const { return 0; }
|
||||||
|
@@ -174,7 +174,7 @@ QByteArray ModelEditor::saveState() const
|
|||||||
return saveState(currentDiagram());
|
return saveState(currentDiagram());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ModelEditor::restoreState(const QByteArray &state)
|
void ModelEditor::restoreState(const QByteArray &state)
|
||||||
{
|
{
|
||||||
QDataStream stream(state);
|
QDataStream stream(state);
|
||||||
int version = 0;
|
int version = 0;
|
||||||
@@ -198,11 +198,9 @@ bool ModelEditor::restoreState(const QByteArray &state)
|
|||||||
qmt::MDiagram *diagram = d->document->documentController()->modelController()->findObject<qmt::MDiagram>(uid);
|
qmt::MDiagram *diagram = d->document->documentController()->modelController()->findObject<qmt::MDiagram>(uid);
|
||||||
if (diagram) {
|
if (diagram) {
|
||||||
openDiagram(diagram, false);
|
openDiagram(diagram, false);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelEditor::init()
|
void ModelEditor::init()
|
||||||
|
@@ -69,7 +69,7 @@ public:
|
|||||||
Core::IDocument *document() const override;
|
Core::IDocument *document() const override;
|
||||||
QWidget *toolBar() override;
|
QWidget *toolBar() override;
|
||||||
QByteArray saveState() const override;
|
QByteArray saveState() const override;
|
||||||
bool restoreState(const QByteArray &state) override;
|
void restoreState(const QByteArray &state) override;
|
||||||
|
|
||||||
qmt::MDiagram *currentDiagram() const;
|
qmt::MDiagram *currentDiagram() const;
|
||||||
void showDiagram(qmt::MDiagram *diagram);
|
void showDiagram(qmt::MDiagram *diagram);
|
||||||
|
@@ -159,7 +159,7 @@ void QmlJSEditorWidget::finalizeInitialization()
|
|||||||
createToolBar();
|
createToolBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmlJSEditorWidget::restoreState(const QByteArray &state)
|
void QmlJSEditorWidget::restoreState(const QByteArray &state)
|
||||||
{
|
{
|
||||||
QStringList qmlTypes { QmlJSTools::Constants::QML_MIMETYPE,
|
QStringList qmlTypes { QmlJSTools::Constants::QML_MIMETYPE,
|
||||||
QmlJSTools::Constants::QBS_MIMETYPE,
|
QmlJSTools::Constants::QBS_MIMETYPE,
|
||||||
@@ -174,7 +174,7 @@ bool QmlJSEditorWidget::restoreState(const QByteArray &state)
|
|||||||
foldAuxiliaryData();
|
foldAuxiliaryData();
|
||||||
}
|
}
|
||||||
|
|
||||||
return TextEditorWidget::restoreState(state);
|
TextEditorWidget::restoreState(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
QModelIndex QmlJSEditorWidget::outlineModelIndex()
|
QModelIndex QmlJSEditorWidget::outlineModelIndex()
|
||||||
|
@@ -58,7 +58,7 @@ public:
|
|||||||
QmlJSEditorWidget();
|
QmlJSEditorWidget();
|
||||||
|
|
||||||
void finalizeInitialization() override;
|
void finalizeInitialization() override;
|
||||||
bool restoreState(const QByteArray &state) override;
|
void restoreState(const QByteArray &state) override;
|
||||||
|
|
||||||
QmlJSEditorDocument *qmlJsEditorDocument() const;
|
QmlJSEditorDocument *qmlJsEditorDocument() const;
|
||||||
|
|
||||||
|
@@ -238,14 +238,12 @@ QByteArray ResourceEditorW::saveState() const
|
|||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ResourceEditorW::restoreState(const QByteArray &state)
|
void ResourceEditorW::restoreState(const QByteArray &state)
|
||||||
{
|
{
|
||||||
QDataStream stream(state);
|
QDataStream stream(state);
|
||||||
QByteArray splitterState;
|
QByteArray splitterState;
|
||||||
stream >> splitterState;
|
stream >> splitterState;
|
||||||
if (!m_resourceEditor->restoreState(splitterState))
|
m_resourceEditor->restoreState(splitterState);
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *ResourceEditorW::toolBar()
|
QWidget *ResourceEditorW::toolBar()
|
||||||
|
@@ -91,7 +91,7 @@ public:
|
|||||||
// IEditor
|
// IEditor
|
||||||
Core::IDocument *document() const override { return m_resourceDocument; }
|
Core::IDocument *document() const override { return m_resourceDocument; }
|
||||||
QByteArray saveState() const override;
|
QByteArray saveState() const override;
|
||||||
bool restoreState(const QByteArray &state) override;
|
void restoreState(const QByteArray &state) override;
|
||||||
QWidget *toolBar() override;
|
QWidget *toolBar() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -3003,12 +3003,12 @@ QByteArray TextEditorWidget::saveState() const
|
|||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TextEditorWidget::restoreState(const QByteArray &state)
|
void TextEditorWidget::restoreState(const QByteArray &state)
|
||||||
{
|
{
|
||||||
if (state.isEmpty()) {
|
if (state.isEmpty()) {
|
||||||
if (d->m_displaySettings.m_autoFoldFirstComment)
|
if (d->m_displaySettings.m_autoFoldFirstComment)
|
||||||
d->foldLicenseHeader();
|
d->foldLicenseHeader();
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
int version;
|
int version;
|
||||||
int vval;
|
int vval;
|
||||||
@@ -3036,7 +3036,7 @@ bool TextEditorWidget::restoreState(const QByteArray &state)
|
|||||||
}
|
}
|
||||||
if (layoutChanged) {
|
if (layoutChanged) {
|
||||||
auto documentLayout = qobject_cast<TextDocumentLayout*>(doc->documentLayout());
|
auto documentLayout = qobject_cast<TextDocumentLayout*>(doc->documentLayout());
|
||||||
QTC_ASSERT(documentLayout, return false);
|
QTC_ASSERT(documentLayout, return );
|
||||||
documentLayout->requestUpdate();
|
documentLayout->requestUpdate();
|
||||||
documentLayout->emitDocumentSizeChanged();
|
documentLayout->emitDocumentSizeChanged();
|
||||||
}
|
}
|
||||||
@@ -3068,7 +3068,6 @@ bool TextEditorWidget::restoreState(const QByteArray &state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
d->saveCurrentCursorPositionForNavigation();
|
d->saveCurrentCursorPositionForNavigation();
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEditorWidget::setParenthesesMatchingEnabled(bool b)
|
void TextEditorWidget::setParenthesesMatchingEnabled(bool b)
|
||||||
@@ -8446,9 +8445,9 @@ QByteArray BaseTextEditor::saveState() const
|
|||||||
return editorWidget()->saveState();
|
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()
|
BaseTextEditor *BaseTextEditor::currentTextEditor()
|
||||||
|
@@ -130,7 +130,7 @@ public:
|
|||||||
IEditor *duplicate() override;
|
IEditor *duplicate() override;
|
||||||
|
|
||||||
QByteArray saveState() const override;
|
QByteArray saveState() const override;
|
||||||
bool restoreState(const QByteArray &state) override;
|
void restoreState(const QByteArray &state) override;
|
||||||
QWidget *toolBar() override;
|
QWidget *toolBar() override;
|
||||||
|
|
||||||
void contextHelp(const HelpCallback &callback) const override; // from IContext
|
void contextHelp(const HelpCallback &callback) const override; // from IContext
|
||||||
@@ -190,7 +190,7 @@ public:
|
|||||||
virtual void openFinishedSuccessfully();
|
virtual void openFinishedSuccessfully();
|
||||||
// IEditor
|
// IEditor
|
||||||
QByteArray saveState() const;
|
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);
|
void gotoLine(int line, int column = 0, bool centerLine = true, bool animate = false);
|
||||||
int position(TextPositionOperation posOp = CurrentPosition,
|
int position(TextPositionOperation posOp = CurrentPosition,
|
||||||
int at = -1) const;
|
int at = -1) const;
|
||||||
|
Reference in New Issue
Block a user