[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    Re: [Kde-pim] Akregator column widths
From:       Frank Osterfeld <frank.osterfeld () gmx ! de>
Date:       2009-01-29 10:20:39
Message-ID: 200901291120.40207.frank.osterfeld () gmx ! de
[Download RAW message or body]

Hi,

On Wednesday 28 January 2009 17:55:48 Jonathan Marten wrote:
> Some people have reported (bug 152702) that the problem with
> remembering column widths and configuration is not fixed in 4.2
> released today, and I've noticed the same with current trunk.

So you say it still forgets its settings in trunk, for you? Does that only 
apply to the feed list or also the article list?

> Part of
> the problem may be there there are possibly three separate bugs here:
> (1) feed list columns not being set up on startup; (2) the article
> list's last ("Date") column expanding itself when switching feeds; (3)
> article list columns resizing themselves when new articles arrive, bug
> 181742.  There were some commits made to address (2) last week, but
> they don't seem to have completely fixed things.

I tried to fix (1) for article and feed list. I haven't looked into (2) (which 
is annoying but not that critical) and not into (3) yet (looks indeed like a 
Qt bug to me).

> I've done some investigating and managed to finally get an Akregator
> which remembers the column widths as intended.  (1) was just a line of
> code needing to be added,

The line in subscriptionlistview.cpp, right? Shouldn't the header settings be 
applied correctly when the first model is set, in setModel() (the model() == 0, 
m != 0 case)? And why is this only necessary in subscriptionlistview but not 
in articlelistview?

> while (2) may be something in Qt that I
> don't fully understand but which it is possible to work around in
> Akregator.  (Short explanation: QHeaderViewPrivate::resizeSections()
> expands the last column to at least the saved lastSectionSize, which
> is not initialised unless a model is set and is not reset when
> changing the column configuration).

The whole resizing behavior in QHeaderView is weird. I think I am safe to say 
that, I have seen enough people struggling with it by now ;)
lastSectionSize not initialized as in uninitialized variable? That'd be a 
clear bug to me.

> (3) may also be a problem with Qt, but which it is not possible to
> work around in Akregator.  There is a simple patch, but I don't know
> if there would be any point in trying to get this into Qt 4.4 since
> 4.5 will be out soon (and KDE 4.3 will require Qt 4.5, is that
> correct?).  Qt 4.5 seems to be quite different in this code area, so
> maybe the bug is already fixed.

This bug affects both Qt 4.4 and 4.5 snapshot? I'd say lets try to get it to 
the trolls as quick as possible. 4.2.x will still be based on 4.4.
 
> The patch also maintains separate article list column configurations
> for the "feed" and the "group" mode, instead of simply removing/adding
> the "Feed" column.  Doing that resizes the following column ("Date")
> to fit, where it would make more sense to resize the variable-length
> "Title" column.

Makes absolute sense.

> Patches are below; since this is my first work on Akregator I thought
> it better to check with the list first before committing anything.
> Any comments?

Some minor comments below. I am fine with the feed/group separation, but please 
separate it from the other fixes when committing.

Thanks for investigating all this!
 

>  void ArticleListView::loadHeaderSettings()
>  {
>      KConfigGroup conf( Settings::self()->config(), "General" );
> -    m_headerState = QByteArray::fromBase64( conf.readEntry(
> "ArticleListHeaders" ).toAscii() ); +    m_feedHeaderState =
> QByteArray::fromBase64( conf.readEntry( "ArticleListFeedHeaders"
> ).toAscii() ); +    m_groupHeaderState = QByteArray::fromBase64(
> conf.readEntry( "ArticleListGroupHeaders" ).toAscii() ); }
>
>  QItemSelectionModel* ArticleListView::articleSelectionModel() const
> @@ -242,17 +248,19 @@
>
>  void ArticleListView::setGroupMode()
>  {
> -    if ( m_columnMode == GroupMode )
> -        return;
> -    setColumnHidden( ArticleListView::FeedTitleColumn, false );
> +    if ( m_columnMode == GroupMode ) return;

Whitespace nitpicking: please put anything following if (or else) on a 
separate line:

if ( foo )
    return;


> +    header()->resizeSection( header()->count() - 1, 1 ); // reset
> QHeaderViewPrivate::lastSectionSize

If that turns out to be Qt bug, better mark it as workaround (possibly with 
affected versions, Qt task tracker number etc.) so we can clean it up later 
again.

Frank

_______________________________________________
KDE PIM mailing list kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic