forked from qt-creator/qt-creator
Remove unused "suppressed" property from navigation widget
Change-Id: I7e94b258991b9211156c75a4475b468b585b00f5 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -212,15 +212,8 @@ NavigationWidget *MainWindow::navigationWidget(Side side) const
|
||||
|
||||
void MainWindow::setSidebarVisible(bool visible, Side side)
|
||||
{
|
||||
if (NavigationWidgetPlaceHolder::current(side)) {
|
||||
NavigationWidget *navWidget = navigationWidget(side);
|
||||
if (navWidget->isSuppressed() && visible) {
|
||||
navWidget->setShown(true);
|
||||
navWidget->setSuppressed(false);
|
||||
} else {
|
||||
navWidget->setShown(visible);
|
||||
}
|
||||
}
|
||||
if (NavigationWidgetPlaceHolder::current(side))
|
||||
navigationWidget(side)->setShown(visible);
|
||||
}
|
||||
|
||||
void MainWindow::setOverrideColor(const QColor &color)
|
||||
|
||||
@@ -166,7 +166,6 @@ struct NavigationWidgetPrivate
|
||||
QStandardItemModel *m_factoryModel;
|
||||
|
||||
bool m_shown;
|
||||
bool m_suppressed;
|
||||
int m_width;
|
||||
QAction *m_toggleSideBarAction; // does not take ownership
|
||||
Side m_side;
|
||||
@@ -183,7 +182,6 @@ struct NavigationWidgetPrivate
|
||||
NavigationWidgetPrivate::NavigationWidgetPrivate(QAction *toggleSideBarAction, Side side) :
|
||||
m_factoryModel(new QStandardItemModel),
|
||||
m_shown(true),
|
||||
m_suppressed(false),
|
||||
m_width(0),
|
||||
m_toggleSideBarAction(toggleSideBarAction),
|
||||
m_side(side)
|
||||
@@ -508,7 +506,7 @@ void NavigationWidget::setShown(bool b)
|
||||
d->m_shown = b;
|
||||
NavigationWidgetPlaceHolder *current = NavigationWidgetPlaceHolder::current(d->m_side);
|
||||
if (current) {
|
||||
bool visible = d->m_shown && !d->m_suppressed && haveData;
|
||||
bool visible = d->m_shown && haveData;
|
||||
current->setVisible(visible);
|
||||
d->m_toggleSideBarAction->setChecked(visible);
|
||||
} else {
|
||||
@@ -522,20 +520,6 @@ bool NavigationWidget::isShown() const
|
||||
return d->m_shown;
|
||||
}
|
||||
|
||||
bool NavigationWidget::isSuppressed() const
|
||||
{
|
||||
return d->m_suppressed;
|
||||
}
|
||||
|
||||
void NavigationWidget::setSuppressed(bool b)
|
||||
{
|
||||
if (d->m_suppressed == b)
|
||||
return;
|
||||
d->m_suppressed = b;
|
||||
if (NavigationWidgetPlaceHolder::current(d->m_side))
|
||||
NavigationWidgetPlaceHolder::current(d->m_side)->setVisible(d->m_shown && !d->m_suppressed);
|
||||
}
|
||||
|
||||
int NavigationWidget::factoryIndex(Id id)
|
||||
{
|
||||
for (int row = 0; row < d->m_factoryModel->rowCount(); ++row) {
|
||||
|
||||
@@ -95,9 +95,6 @@ public:
|
||||
bool isShown() const;
|
||||
void setShown(bool b);
|
||||
|
||||
bool isSuppressed() const;
|
||||
void setSuppressed(bool b);
|
||||
|
||||
static NavigationWidget *instance(Side side);
|
||||
static QWidget *activateSubWidget(Id factoryId, Side fallbackSide);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user