forked from qt-creator/qt-creator
Editors: Provide a base implementation for {save,restore}State
Change-Id: Iedfc0d59ecfe257ad5823cff39977bce82ada3a5 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -364,9 +364,6 @@ public:
|
||||
QString displayName() const { return m_displayName; }
|
||||
void setDisplayName(const QString &title) { m_displayName = title; emit changed(); }
|
||||
|
||||
QByteArray saveState() const { return QByteArray(); } // not supported
|
||||
bool restoreState(const QByteArray & /* state */) { return false; } // not supported
|
||||
|
||||
QWidget *toolBar() { return m_toolBar; }
|
||||
|
||||
bool isTemporary() const { return m_editor->isMemoryView(); }
|
||||
|
||||
@@ -42,8 +42,8 @@ class IDocument;
|
||||
class CORE_EXPORT IEditor : public IContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
public:
|
||||
IEditor(QObject *parent = 0) : IContext(parent) {}
|
||||
virtual ~IEditor() {}
|
||||
|
||||
@@ -57,8 +57,8 @@ public:
|
||||
virtual bool duplicateSupported() const { return false; }
|
||||
virtual IEditor *duplicate(QWidget */*parent*/) { return 0; }
|
||||
|
||||
virtual QByteArray saveState() const = 0;
|
||||
virtual bool restoreState(const QByteArray &state) = 0;
|
||||
virtual QByteArray saveState() const { return QByteArray(); }
|
||||
virtual bool restoreState(const QByteArray &/*state*/) { return true; }
|
||||
|
||||
virtual int currentLine() const { return 0; }
|
||||
virtual int currentColumn() const { return 0; }
|
||||
|
||||
@@ -225,15 +225,4 @@ void DiffEditorEditable::activateEntry(int index)
|
||||
updateEntryToolTip();
|
||||
}
|
||||
|
||||
QByteArray DiffEditorEditable::saveState() const
|
||||
{
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
bool DiffEditorEditable::restoreState(const QByteArray &state)
|
||||
{
|
||||
Q_UNUSED(state)
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace DiffEditor
|
||||
|
||||
@@ -71,8 +71,6 @@ public:
|
||||
|
||||
QWidget *toolBar();
|
||||
|
||||
QByteArray saveState() const;
|
||||
bool restoreState(const QByteArray &state);
|
||||
public slots:
|
||||
void activateEntry(int index);
|
||||
|
||||
|
||||
@@ -163,27 +163,6 @@ void ImageViewer::setDisplayName(const QString &title)
|
||||
emit changed();
|
||||
}
|
||||
|
||||
QByteArray ImageViewer::saveState() const
|
||||
{
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
bool ImageViewer::restoreState(const QByteArray &state)
|
||||
{
|
||||
Q_UNUSED(state);
|
||||
return true;
|
||||
}
|
||||
|
||||
int ImageViewer::currentLine() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ImageViewer::currentColumn() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool ImageViewer::isTemporary() const
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -60,15 +60,7 @@ public:
|
||||
Core::Id id() const;
|
||||
QString displayName() const;
|
||||
void setDisplayName(const QString &title);
|
||||
|
||||
QByteArray saveState() const;
|
||||
bool restoreState(const QByteArray &state);
|
||||
|
||||
int currentLine() const;
|
||||
int currentColumn() const;
|
||||
|
||||
bool isTemporary() const;
|
||||
|
||||
QWidget *toolBar();
|
||||
|
||||
public slots:
|
||||
|
||||
@@ -118,17 +118,6 @@ void BarDescriptorEditor::setDisplayName(const QString &title)
|
||||
emit changed();
|
||||
}
|
||||
|
||||
QByteArray BarDescriptorEditor::saveState() const
|
||||
{
|
||||
return QByteArray(); // Not supported
|
||||
}
|
||||
|
||||
bool BarDescriptorEditor::restoreState(const QByteArray &state)
|
||||
{
|
||||
Q_UNUSED(state);
|
||||
return false; // Not supported
|
||||
}
|
||||
|
||||
bool BarDescriptorEditor::isTemporary() const
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -69,12 +69,7 @@ public:
|
||||
Core::Id id() const;
|
||||
QString displayName() const;
|
||||
void setDisplayName(const QString &title);
|
||||
|
||||
QByteArray saveState() const;
|
||||
bool restoreState(const QByteArray &state);
|
||||
|
||||
bool isTemporary() const;
|
||||
|
||||
QWidget *toolBar();
|
||||
|
||||
EditorPage activePage() const;
|
||||
|
||||
@@ -88,8 +88,6 @@ public:
|
||||
QString displayName() const { return m_displayName; }
|
||||
void setDisplayName(const QString &title) { m_displayName = title; emit changed(); }
|
||||
QWidget *toolBar();
|
||||
QByteArray saveState() const { return QByteArray(); }
|
||||
bool restoreState(const QByteArray &/*state*/) { return true; }
|
||||
|
||||
void setSuggestedFileName(const QString &fileName);
|
||||
bool isTemporary() const { return false; }
|
||||
|
||||
@@ -437,16 +437,6 @@ QWidget *VcsBaseSubmitEditor::toolBar()
|
||||
return d->m_toolWidget;
|
||||
}
|
||||
|
||||
QByteArray VcsBaseSubmitEditor::saveState() const
|
||||
{
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
bool VcsBaseSubmitEditor::restoreState(const QByteArray &/*state*/)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
QStringList VcsBaseSubmitEditor::checkedFiles() const
|
||||
{
|
||||
return d->m_widget->checkedFiles();
|
||||
|
||||
@@ -121,9 +121,6 @@ public:
|
||||
|
||||
QWidget *toolBar();
|
||||
|
||||
QByteArray saveState() const;
|
||||
bool restoreState(const QByteArray &state);
|
||||
|
||||
QStringList checkedFiles() const;
|
||||
|
||||
void setFileModel(SubmitFileModel *m, const QString &repositoryDirectory = QString());
|
||||
|
||||
Reference in New Issue
Block a user