[PATCH 03/17] Remove unused dummy widgets in filterwidget

Anton Lundin glance at acc.umu.se
Thu Dec 18 07:28:45 PST 2014


On 18 December, 2014 - Tomaz Canabrava wrote:

> On Thu, Dec 18, 2014 at 1:14 PM, Miika Turkia <miika.turkia at gmail.com>
> wrote:
> >
> > This makes the new filtering unusable so nack from me.
> >
> > miika
> >
> >
> > On Thu, Dec 18, 2014 at 9:47 AM, Anton Lundin <glance at acc.umu.se> wrote:
> >>
> >> Signed-off-by: Anton Lundin <glance at acc.umu.se>
> >> ---
> >>  qt-ui/simplewidgets.cpp | 6 +-----
> >>  1 file changed, 1 insertion(+), 5 deletions(-)
> >>
> >> diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp
> >> index 0ec03b4..b004664 100644
> >> --- a/qt-ui/simplewidgets.cpp
> >> +++ b/qt-ui/simplewidgets.cpp
> >> @@ -616,10 +616,6 @@ MultiFilter::MultiFilter(QWidget *parent) :
> >> QWidget(parent)
> >>         int minimumHeight = tagFilter->ui.filterInternalList->height() +
> >>                         tagFilter->ui.verticalLayout->spacing() *
> >> tagFilter->ui.verticalLayout->count();
> >>
> >> -       QListView *dummyList = new QListView();
> >> -       QStringListModel *dummy = new QStringListModel(QStringList() <<
> >> "Dummy Text");
> >> -       dummyList->setModel(dummy);
> >> -
> >>         connect(ui->close, SIGNAL(clicked(bool)), this,
> >> SLOT(closeFilter()));
> >>         connect(ui->clear, SIGNAL(clicked(bool)),
> >> MultiFilterSortModel::instance(), SLOT(clearFilter()));
> >>         connect(ui->maximize, SIGNAL(clicked(bool)), this,
> >> SLOT(adjustHeight()));
> >> @@ -633,7 +629,7 @@ MultiFilter::MultiFilter(QWidget *parent) :
> >> QWidget(parent)
> >>         expandedWidget->setLayout(l);
> >>
> >>         ui->scrollArea->setWidget(expandedWidget);
> >> -       expandedWidget->resize(expandedWidget->width(), minimumHeight +
> >> dummyList->sizeHintForRow(0) * 5 );
> >> +       expandedWidget->resize(expandedWidget->width(), minimumHeight );
> >>         ui->scrollArea->setMinimumHeight(expandedWidget->height() + 5);
> >>
> >
> Heh, I thinik it's a bad idea, since these dummys are to calculate a sane
> width for the dialog.
> this part, specially : + dummyList->sizeHintForRow(0) * 5 ), wich means
> "please, give me space for 5 rows of choices" :)
> We can't use that without use a dummyModel because we need to have a row to
> ask for it's size.
> 

I actually tested it and it didn't do anything for the layout for me, so
i thought it was some sort of leftover. That was atleast what i traced
it down to coming from in the history.


Anyhow, it started with it leaking widgets and strings and due to it not
making any difference for me i removed it.


I'll take a closer look why it still works as expected for me, later.


//Anton


-- 
Anton Lundin	+46702-161604


More information about the subsurface mailing list