The problem is following:
when I open settings dialog for my Google Calendar resource (in i.e. KOrganizer), all the items in "Calendars" and "Tasklists" lists gets duplicated. I wasn't able to find such a bug in BugZilla, though.
On first launch of settings dialog, GoogleSettingsDialog::currentAccountChanged signal gets called twice in a row:
- first time due to currentIndexChanged signal from combobox (common/googlesettingsdialog.cpp:72)
- second time, manually, in GoogleSettingsDialog::reloadAccounts() (common/googlesettingsdialog.cpp:107). Somehow, the disconnect-workaround there doesn't work (BTW, the code around there looks weird. Should there be "connect" on line 149?)
As a result, SettingsDialog::slotReloadCalendars() and SettingsDialog::slotReloadTaskLists() are called twice, running job and clearing corresponding lists twice as well. Then, in SettingsDialog::slot***Retrieved(), which gets called twice again after job is done, the data gets added twice. The contents of lists gets duplicated. Simple as that.
The problem is thus that list gets cleared when job is set up, and not before populating the lists.
I propose the most trivial (and harmless) solution to this problem: just clear corresponding lists once again, when the job is done, and right before putting new data there.