Bug 206307 - Descending order functionality does not work when printing
Summary: Descending order functionality does not work when printing
Status: VERIFIED FIXED
Alias: None
Product: kaddressbook
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-05 00:10 UTC by Sabine Faure
Modified: 2009-10-23 16:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Exported Contact as a Vcard file (152 bytes, text/plain)
2009-10-09 20:07 UTC, Sabine Faure
Details
Helene Duchateau exported as a Vcard file (271 bytes, text/plain)
2009-10-09 20:08 UTC, Sabine Faure
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sabine Faure 2009-09-05 00:10:02 UTC
Version:            (using Devel)
Compiler:          gcc 4.3.2 
OS:                Linux
Installed from:    Compiled sources

- Configure Akonadi with an IMAP and Kolab resource.
- Launch Kaddressbook
- Create at least 3 Contacts in an Address Book (ex: AB 1)
- Select everything in AB1
- Go to File menu/Print...
- Select 'Print to File (PDF)'
- Choose a name and a location for the .PDF file
- Click on 'Print'
- Check the 'Selected contacts' QToolButton
- Click on 'Next'
- Select 'Formatted Name' from the Criterion QComboBox
- Select 'Descending' from the Order QcomboBox
- Click on 'Next'
- Click on 'Finish'

If you open the .pdf you can see that the Contacts are ordered in an ascending order (the default order) eventhough you selected the 'Descending' option


Trunk, Svn Rev 1019588
Comment 1 Tobias Koenig 2009-09-05 10:28:06 UTC
SVN commit 1020045 by tokoe:

Introduced new class ContactSorter, that sorts a list
of contacts according to a given ContactField.
This fixes the 'descending sorting does not work in printing'
as well.

BUG: 206307


 M  +1 -1      CMakeLists.txt  
 A             contactsorter.cpp   [License: GPL (v2+)]
 A             contactsorter.h   [License: GPL (v2+)]
 M  +24 -40    printing/printingwizard.cpp  
 M  +6 -4      printing/printingwizard.h  
 D             printing/printsortmode.cpp  
 D             printing/printsortmode.h  
 M  +5 -5      printing/stylepage.cpp  
 M  +5 -5      printing/stylepage.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1020045
Comment 2 Sabine Faure 2009-09-11 00:17:47 UTC
The Descending order is now implemented.

However, it seems that there is a problem with the alphabetical order in it.
to test this create three additional Contacts in your address book (ex: Hugo Boss, Fernand Deschamps, Helene Duchateau).


Trunk, Svn Rev 1021831
Comment 3 Sabine Faure 2009-09-11 20:49:27 UTC
Hi Tobias,

I retested this today following your IRC query.
The descending order works with the default option 'Given name' that has been added since I last tested (before that you had to pick one yourself).

So if you select 'Formated name' instead, then there is a pb with the alphabetical order which is displayed like this in the .pdf:
Hugo Boss
Fernand Deschamps
Helene Duchateau

Trunk, Svn Rev 1022237
Comment 4 Tobias Koenig 2009-09-14 18:01:31 UTC
Hej Sabine,

can you check please whether all three contacts have a formatted name
set at all, please?
If you have stored them in a vCard file, there should be lines starting
with 'FN:' on the Kolab server the XML attachment has an element 'name'
with the attribute 'full-name'.

Ciao,
Tobias
Comment 5 Sabine Faure 2009-10-01 20:06:12 UTC
Good point indeed !
I've checked all the .xml files and it turns out that my 'Helene Duchateau' contact has no Full-name.
From what you say above this is why that contact is not sorted properly.

I created my 'Helene Duchateau' contact with a display name and exported it as a Vcard file on my hard drive. When I reimported it somehow the display name got lost and this is why the sorting is disrupted.

Maybe the 'full name' display radio button should be checked by default to avoid that. 

Trunk, Svn Rev 1030016
Comment 6 Tobias Koenig 2009-10-03 13:21:14 UTC
Hej Sabine,

I can't reproduce that the display name get lost when
exporting and reimporting a contact as vCard.
Can you still reproduce it? If yes, could you send me
the vCard, please?

Setting the display name automatically is not an option
IMHO as KAddressBook (nor any other component) should alter
the data without the user being aware of.
Comment 7 Sabine Faure 2009-10-09 20:04:11 UTC
Sure. 

I retested this today with a new contact (Aurelie Artichaud) and the Display name is still lost when reimporting into the Kolab resource.

Please find both Vcard file attached.

Trunk, Svn Rev 1033074
Comment 8 Sabine Faure 2009-10-09 20:07:24 UTC
Created attachment 37476 [details]
Exported Contact as a Vcard file
Comment 9 Sabine Faure 2009-10-09 20:08:44 UTC
Created attachment 37477 [details]
Helene Duchateau exported as a Vcard file
Comment 10 Tobias Koenig 2009-10-13 14:35:59 UTC
Hej Sabine,

does the formatted name also disappear if you import it into the 'Personal Contacts' address book?
If that is not the case, then the bug is not inside KAddressBook but in the Kolab resource.

Ciao,
Tobias
Comment 11 Sabine Faure 2009-10-23 16:31:09 UTC
I retested this today and it works now.

When importing a Vcard the display name is imported as well and so when sorting the contact for printing it also works now.

So I am closing this bug.

Trunk, Svn Rev 1039367