Commit 373d51a1 authored by hjk's avatar hjk Committed by Eike Ziller
Browse files

IOutputPane: constify some member functions

Change-Id: I023b7f5976b30fc950d2dd5a76f749ef4720ac2f
Reviewed-on: http://codereview.qt-project.org/5618

Reviewed-by: default avatarEike Ziller <eike.ziller@nokia.com>
parent 7d96ba70
......@@ -48,12 +48,12 @@ namespace Core {
class CORE_EXPORT IOutputPane : public QObject
{
Q_OBJECT
public:
IOutputPane(QObject *parent = 0) : QObject(parent) {}
virtual ~IOutputPane() {}
virtual QWidget *outputWidget(QWidget *parent) = 0;
virtual QList<QWidget*> toolBarWidgets() const = 0;
virtual QList<QWidget *> toolBarWidgets() const = 0;
virtual QString displayName() const = 0;
// -1 don't show in statusBar
......@@ -66,45 +66,24 @@ public:
// This function is called to give the outputwindow focus
virtual void setFocus() = 0;
// Whether the outputpane has focus
virtual bool hasFocus() = 0;
virtual bool hasFocus() const = 0;
// Whether the outputpane can be focused at the moment.
// (E.g. the search result window does not want to be focused if the are no results.)
virtual bool canFocus() = 0;
virtual bool canFocus() const = 0;
virtual bool canNavigate() = 0;
virtual bool canNext() = 0;
virtual bool canPrevious() = 0;
virtual bool canNavigate() const = 0;
virtual bool canNext() const = 0;
virtual bool canPrevious() const = 0;
virtual void goToNext() = 0;
virtual void goToPrev() = 0;
public slots:
void popup()
{
popup(true);
}
void popup(bool withFocus)
{
emit showPage(withFocus);
}
void hide()
{
emit hidePage();
}
void toggle()
{
toggle(true);
}
void toggle(bool withFocusIfShown)
{
emit togglePage(withFocusIfShown);
}
void navigateStateChanged()
{
emit navigateStateUpdate();
}
void popup() { popup(true); }
void popup(bool withFocus) { emit showPage(withFocus); }
void hide() { emit hidePage(); }
void toggle() { toggle(true); }
void toggle(bool withFocusIfShown) { emit togglePage(withFocusIfShown); }
void navigateStateChanged() { emit navigateStateUpdate(); }
signals:
void showPage(bool withFocus);
......
......@@ -50,12 +50,12 @@ MessageOutputWindow::~MessageOutputWindow()
delete m_widget;
}
bool MessageOutputWindow::hasFocus()
bool MessageOutputWindow::hasFocus() const
{
return m_widget->hasFocus();
}
bool MessageOutputWindow::canFocus()
bool MessageOutputWindow::canFocus() const
{
return true;
}
......@@ -95,12 +95,12 @@ int MessageOutputWindow::priorityInStatusBar() const
return -1;
}
bool MessageOutputWindow::canNext()
bool MessageOutputWindow::canNext() const
{
return false;
}
bool MessageOutputWindow::canPrevious()
bool MessageOutputWindow::canPrevious() const
{
return false;
}
......@@ -115,7 +115,7 @@ void MessageOutputWindow::goToPrev()
}
bool MessageOutputWindow::canNavigate()
bool MessageOutputWindow::canNavigate() const
{
return false;
}
......@@ -57,15 +57,15 @@ public:
void visibilityChanged(bool visible);
void append(const QString &text);
bool canFocus();
bool hasFocus();
bool canFocus() const;
bool hasFocus() const;
void setFocus();
virtual bool canNext();
virtual bool canPrevious();
virtual bool canNext() const;
virtual bool canPrevious() const;
virtual void goToNext();
virtual void goToPrev();
bool canNavigate();
bool canNavigate() const;
private:
OutputWindow *m_widget;
......
......@@ -356,7 +356,7 @@ void SearchResultWindow::clearContents()
\fn bool SearchResultWindow::hasFocus()
\internal
*/
bool SearchResultWindow::hasFocus()
bool SearchResultWindow::hasFocus() const
{
return d->m_widget->focusWidget() && d->m_widget->focusWidget()->hasFocus();
}
......@@ -365,7 +365,7 @@ bool SearchResultWindow::hasFocus()
\fn bool SearchResultWindow::canFocus()
\internal
*/
bool SearchResultWindow::canFocus()
bool SearchResultWindow::canFocus() const
{
if (d->isSearchVisible())
return d->m_searchResultWidgets.at(d->visibleSearchIndex())->canFocusInternally();
......@@ -459,7 +459,7 @@ int SearchResultWindow::priorityInStatusBar() const
\fn bool SearchResultWindow::canNext()
\internal
*/
bool SearchResultWindow::canNext()
bool SearchResultWindow::canNext() const
{
if (d->isSearchVisible())
return d->m_searchResultWidgets.at(d->visibleSearchIndex())->count() > 0;
......@@ -470,7 +470,7 @@ bool SearchResultWindow::canNext()
\fn bool SearchResultWindow::canPrevious()
\internal
*/
bool SearchResultWindow::canPrevious()
bool SearchResultWindow::canPrevious() const
{
return canNext();
}
......@@ -501,7 +501,7 @@ void SearchResultWindow::goToPrev()
\fn bool SearchResultWindow::canNavigate()
\internal
*/
bool SearchResultWindow::canNavigate()
bool SearchResultWindow::canNavigate() const
{
return true;
}
......
......@@ -142,15 +142,15 @@ public:
QString displayName() const { return tr("Search Results"); }
int priorityInStatusBar() const;
void visibilityChanged(bool visible);
bool hasFocus();
bool canFocus();
bool hasFocus() const;
bool canFocus() const;
void setFocus();
bool canNext();
bool canPrevious();
bool canNext() const;
bool canPrevious() const;
void goToNext();
void goToPrev();
bool canNavigate();
bool canNavigate() const;
void setTextEditorFont(const QFont &font);
void openNewSearchPanel();
......
......@@ -280,12 +280,12 @@ void AppOutputPane::visibilityChanged(bool /* b */)
{
}
bool AppOutputPane::hasFocus()
bool AppOutputPane::hasFocus() const
{
return m_tabWidget->currentWidget() && m_tabWidget->currentWidget()->hasFocus();
}
bool AppOutputPane::canFocus()
bool AppOutputPane::canFocus() const
{
return m_tabWidget->currentWidget();
}
......@@ -571,12 +571,12 @@ bool AppOutputPane::isRunning() const
return false;
}
bool AppOutputPane::canNext()
bool AppOutputPane::canNext() const
{
return false;
}
bool AppOutputPane::canPrevious()
bool AppOutputPane::canPrevious() const
{
return false;
}
......@@ -591,7 +591,7 @@ void AppOutputPane::goToPrev()
}
bool AppOutputPane::canNavigate()
bool AppOutputPane::canNavigate() const
{
return false;
}
......
......@@ -63,20 +63,20 @@ public:
virtual ~AppOutputPane();
QWidget *outputWidget(QWidget *);
QList<QWidget*> toolBarWidgets() const;
QList<QWidget *> toolBarWidgets() const;
QString displayName() const;
int priorityInStatusBar() const;
void clearContents();
void visibilityChanged(bool);
bool canFocus();
bool hasFocus();
bool canFocus() const;
bool hasFocus() const;
void setFocus();
bool canNext();
bool canPrevious();
bool canNext() const;
bool canPrevious() const;
void goToNext();
void goToPrev();
bool canNavigate();
bool canNavigate() const;
void createNewOutputWindow(RunControl *rc);
void showTabFor(RunControl *rc);
......
......@@ -93,12 +93,12 @@ void CompileOutputWindow::updateWordWrapMode()
m_outputWindow->setWordWrapEnabled(ProjectExplorerPlugin::instance()->projectExplorerSettings().wrapAppOutput);
}
bool CompileOutputWindow::hasFocus()
bool CompileOutputWindow::hasFocus() const
{
return m_outputWindow->hasFocus();
}
bool CompileOutputWindow::canFocus()
bool CompileOutputWindow::canFocus() const
{
return true;
}
......@@ -161,12 +161,12 @@ int CompileOutputWindow::priorityInStatusBar() const
return 50;
}
bool CompileOutputWindow::canNext()
bool CompileOutputWindow::canNext() const
{
return false;
}
bool CompileOutputWindow::canPrevious()
bool CompileOutputWindow::canPrevious() const
{
return false;
}
......@@ -181,7 +181,7 @@ void CompileOutputWindow::goToPrev()
}
bool CompileOutputWindow::canNavigate()
bool CompileOutputWindow::canNavigate() const
{
return false;
}
......
......@@ -62,21 +62,21 @@ public:
~CompileOutputWindow();
QWidget *outputWidget(QWidget *);
QList<QWidget*> toolBarWidgets() const { return QList<QWidget *>(); }
QList<QWidget *> toolBarWidgets() const { return QList<QWidget *>(); }
QString displayName() const { return tr("Compile Output"); }
int priorityInStatusBar() const;
void clearContents();
void visibilityChanged(bool visible);
void appendText(const QString &text, ProjectExplorer::BuildStep::OutputFormat format);
bool canFocus();
bool hasFocus();
bool canFocus() const;
bool hasFocus() const;
void setFocus();
bool canNext();
bool canPrevious();
bool canNext() const;
bool canPrevious() const;
void goToNext();
void goToPrev();
bool canNavigate();
bool canNavigate() const;
void registerPositionOf(const Task &task);
bool knowsPositionOf(const Task &task);
......
......@@ -922,12 +922,12 @@ void TaskWindow::clearContents()
d->m_taskHub->clearTasks(QString());
}
bool TaskWindow::hasFocus()
bool TaskWindow::hasFocus() const
{
return d->m_listview->hasFocus();
}
bool TaskWindow::canFocus()
bool TaskWindow::canFocus() const
{
return d->m_filter->rowCount();
}
......@@ -942,12 +942,12 @@ void TaskWindow::setFocus()
}
}
bool TaskWindow::canNext()
bool TaskWindow::canNext() const
{
return d->m_filter->rowCount();
}
bool TaskWindow::canPrevious()
bool TaskWindow::canPrevious() const
{
return d->m_filter->rowCount();
}
......@@ -998,7 +998,7 @@ void TaskWindow::goToPrev()
triggerDefaultHandler(currentIndex);
}
bool TaskWindow::canNavigate()
bool TaskWindow::canNavigate() const
{
return true;
}
......
......@@ -63,20 +63,20 @@ public:
// IOutputPane
QWidget *outputWidget(QWidget *);
QList<QWidget*> toolBarWidgets() const;
QList<QWidget *> toolBarWidgets() const;
QString displayName() const { return tr("Build Issues"); }
int priorityInStatusBar() const;
void clearContents();
void visibilityChanged(bool visible);
bool canFocus();
bool hasFocus();
bool canFocus() const;
bool hasFocus() const;
void setFocus();
bool canNavigate();
bool canNext();
bool canPrevious();
bool canNavigate() const;
bool canNext() const;
bool canPrevious() const;
void goToNext();
void goToPrev();
......
......@@ -540,12 +540,12 @@ TestResultsWindow::~TestResultsWindow()
_testResultsInstance = 0;
}
bool TestResultsWindow::hasFocus()
bool TestResultsWindow::hasFocus() const
{
return m_resultsView->hasFocus();
}
bool TestResultsWindow::canFocus()
bool TestResultsWindow::canFocus() const
{
return true;
}
......@@ -583,7 +583,7 @@ int TestResultsWindow::priorityInStatusBar() const
return 50;
}
bool TestResultsWindow::canNext()
bool TestResultsWindow::canNext() const
{
for (int i = m_resultsView->currentRow() + 1; i < m_resultsView->rowCount(); ++i) {
if (!m_resultsView->isRowHidden(i))
......@@ -592,7 +592,7 @@ bool TestResultsWindow::canNext()
return false;
}
bool TestResultsWindow::canPrevious()
bool TestResultsWindow::canPrevious() const
{
for (int i = m_resultsView->currentRow() - 1; i >= 0; --i) {
if (!m_resultsView->isRowHidden(i))
......@@ -621,7 +621,7 @@ void TestResultsWindow::goToPrev()
}
}
bool TestResultsWindow::canNavigate()
bool TestResultsWindow::canNavigate() const
{
return true;
}
......
......@@ -132,25 +132,25 @@ public:
static TestResultsWindow *instance();
virtual QString displayName() const { return "Test Results"; }
virtual QString displayName() const { return tr("Test Results"); }
QWidget *outputWidget(QWidget *parent);
QList<QWidget*> toolBarWidgets() const;
QList<QWidget *> toolBarWidgets() const;
QString name() const;
int priorityInStatusBar() const;
void clearContents();
void visibilityChanged(bool visible);
bool canFocus();
bool hasFocus();
bool canFocus() const;
bool hasFocus() const;
void setFocus();
virtual bool canNext();
virtual bool canPrevious();
virtual bool canNext() const;
virtual bool canPrevious() const;
virtual void goToNext();
virtual void goToPrev();
bool canNavigate();
bool canNavigate() const;
ResultsView *resultsView() { return m_resultsView; }
void addResult(const QString &result, const QString &test, const QString &reason,
......
......@@ -57,12 +57,12 @@ TestOutputWindow::~TestOutputWindow()
m_instance = 0;
}
bool TestOutputWindow::hasFocus()
bool TestOutputWindow::hasFocus() const
{
return m_widget->hasFocus();
}
bool TestOutputWindow::canFocus()
bool TestOutputWindow::canFocus() const
{
return true;
}
......@@ -97,12 +97,12 @@ int TestOutputWindow::priorityInStatusBar() const
return 50;
}
bool TestOutputWindow::canNext()
bool TestOutputWindow::canNext() const
{
return false;
}
bool TestOutputWindow::canPrevious()
bool TestOutputWindow::canPrevious() const
{
return false;
}
......@@ -117,7 +117,7 @@ void TestOutputWindow::goToPrev()
}
bool TestOutputWindow::canNavigate()
bool TestOutputWindow::canNavigate() const
{
return false;
}
......
......@@ -50,22 +50,22 @@ public:
virtual QString displayName() const { return "Test Output"; }
QWidget *outputWidget(QWidget *parent);
QList<QWidget*> toolBarWidgets() const { return QList<QWidget *>(); }
QList<QWidget *> toolBarWidgets() const { return QList<QWidget *>(); }
QString name() const;
int priorityInStatusBar() const;
void clearContents();
void visibilityChanged(bool visible);
bool canFocus();
bool hasFocus();
bool canFocus() const;
bool hasFocus() const;
void setFocus();
virtual bool canNext();
virtual bool canPrevious();
virtual bool canNext() const;
virtual bool canPrevious() const;
virtual void goToNext();
virtual void goToPrev();
bool canNavigate();
bool canNavigate() const;
QTextEdit *m_widget;
};
......
......@@ -318,27 +318,27 @@ void VCSBaseOutputWindow::setFocus()
{
}
bool VCSBaseOutputWindow::hasFocus()
bool VCSBaseOutputWindow::hasFocus() const
{
return false;
}
bool VCSBaseOutputWindow::canFocus()
bool VCSBaseOutputWindow::canFocus() const
{
return false;
}
bool VCSBaseOutputWindow::canNavigate()
bool VCSBaseOutputWindow::canNavigate() const
{
return false;
}
bool VCSBaseOutputWindow::canNext()
bool VCSBaseOutputWindow::canNext() const
{
return false;
}
bool VCSBaseOutputWindow::canPrevious()
bool VCSBaseOutputWindow::canPrevious() const
{
return false;
}
......
......@@ -49,7 +49,7 @@ public:
virtual ~VCSBaseOutputWindow();
virtual QWidget *outputWidget(QWidget *parent);
virtual QList<QWidget*> toolBarWidgets() const;
virtual QList<QWidget *> toolBarWidgets() const;
virtual QString displayName() const;
virtual int priorityInStatusBar() const;
......@@ -58,12 +58,12 @@ public:
virtual void visibilityChanged(bool visible);
virtual void setFocus();
virtual bool hasFocus();
virtual bool canFocus();
virtual bool hasFocus() const;
virtual bool canFocus() const;
virtual bool canNavigate();
virtual bool canNext();
virtual bool canPrevious();
virtual bool canNavigate() const;
virtual bool canNext() const;
virtual bool canPrevious() const;
virtual void goToNext();
virtual void goToPrev();
......
Markdown is supported
0% or .