Bug 74992 - new arrived emails are not sorted
Summary: new arrived emails are not sorted
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-11 19:40 UTC by thomas zöger
Modified: 2007-09-14 12:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description thomas zöger 2004-02-11 19:40:12 UTC
Version:            (using KDE KDE 3.2.0)
Installed from:    SuSE RPMs
OS:          Linux

If an email arrives on a folder which is sorted by 'Sender'
the new mail just appears at the end of the list (not correctly
sorted) it's a bug!

 cheers, thomas
Comment 1 Till Adam 2004-02-11 21:40:09 UTC
CVS commit by tilladam: 

Make sure that when the user clicks on a column header to resort the 
headers listview the .sorted file is invalidated and a new one generated, 
because newly arriving mail triggering a reload of the list view will 
result in a re-lapse to the sort order active on folder entry. Same goes
for a reload triggered by a config dialog apply/ok.

Thomas, thanks for reminding me, I've been meaning to fix that for ages.

CCMAIL: 54958-done@bugs.kde.org
CCMAIL: 74992-done@bugs.kde.org


  M +9 -0      DESIGN   1.16
  M +6 -0      kmheaders.cpp   1.609


--- kdepim/kmail/DESIGN  #1.15:1.16
@@ -730,4 +730,13 @@
   .sorted file as well.
 
+  Note that as an optimization newly arriving mail as part of a mailcheck in
+  an imap folder is not added via msgAdded, but rather via complete reload of
+  the folder via readSortOrder(). That's because only the headers are gotten
+  for each mail on imap and that is so fast, that adding them individually to
+  the list view is very slow by comparison. Thus we need to make sure that
+  writeSortOrder() is called whenever something related to sorting changes, 
+  otherwise we read stale info from the .sorted file. The reload is triggered
+  by the folderComplete() signal of imap folders.
+
 What happens when a message is removed from the folder?
   In this case the msgRemoved slot kicks in and updates the headers list. First

--- kdepim/kmail/kmheaders.cpp  #1.608:1.609
@@ -2637,4 +2637,10 @@ void KMHeaders::setSorting( int column, 
   KListView::setSorting( column, ascending );
   ensureCurrentItemVisible();
+  // Make sure the config and .sorted file are updated, otherwise stale info
+  // is read on new imap mail. ( folder->folderComplete() -> readSortOrder() ).
+  if ( mFolder ) {
+    writeFolderConfig();
+    writeSortOrder();
+  }
 }
 


Comment 2 thomas zöger 2004-02-12 01:36:09 UTC
Hello Till,
 it's a honor to help you with this GREAT product!
cheers, thomas

> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>
> http://bugs.kde.org/show_bug.cgi?id=74992
> adam@kde.org changed:
>
>            What    |Removed                     |Added
> ---------------------------------------------------------------------------
>- Status|UNCONFIRMED                 |RESOLVED
>          Resolution|                            |FIXED
>
>
>
> ------- Additional Comments From adam@kde.org  2004-02-11 21:40 -------
> CVS commit by tilladam:
>
> Make sure that when the user clicks on a column header to resort the
> headers listview the .sorted file is invalidated and a new one generated,
> because newly arriving mail triggering a reload of the list view will
> result in a re-lapse to the sort order active on folder entry. Same goes
> for a reload triggered by a config dialog apply/ok.
>
> Thomas, thanks for reminding me, I've been meaning to fix that for ages.
>
> CCMAIL: 54958-done@bugs.kde.org
> CCMAIL: 74992-done@bugs.kde.org
>
>
>   M +9 -0      DESIGN   1.16
>   M +6 -0      kmheaders.cpp   1.609
>
>
> --- kdepim/kmail/DESIGN  #1.15:1.16
> @@ -730,4 +730,13 @@
>    .sorted file as well.
>
> +  Note that as an optimization newly arriving mail as part of a mailcheck
> in +  an imap folder is not added via msgAdded, but rather via complete
> reload of +  the folder via readSortOrder(). That's because only the
> headers are gotten +  for each mail on imap and that is so fast, that
> adding them individually to +  the list view is very slow by comparison.
> Thus we need to make sure that +  writeSortOrder() is called whenever
> something related to sorting changes, +  otherwise we read stale info from
> the .sorted file. The reload is triggered +  by the folderComplete() signal
> of imap folders.
> +
>  What happens when a message is removed from the folder?
>    In this case the msgRemoved slot kicks in and updates the headers list.
> First
>
> --- kdepim/kmail/kmheaders.cpp  #1.608:1.609
> @@ -2637,4 +2637,10 @@ void KMHeaders::setSorting( int column,
>    KListView::setSorting( column, ascending );
>    ensureCurrentItemVisible();
> +  // Make sure the config and .sorted file are updated, otherwise stale
> info +  // is read on new imap mail. ( folder->folderComplete() ->
> readSortOrder() ). +  if ( mFolder ) {
> +    writeFolderConfig();
> +    writeSortOrder();
> +  }
>  }

Comment 3 thomas zöger 2004-03-16 10:00:32 UTC
it's not fixed yet in 1.6.1
cheers ,zeth