D9715: Fix duplicated entries in Google Calendar and Tasks resource settings dialog

Igor Poboiko noreply at phabricator.kde.org
Sun Jan 7 19:28:06 GMT 2018


poboiko created this revision.
poboiko added a reviewer: KDE PIM.
poboiko added a project: KDE PIM.
poboiko requested review of this revision.

REVISION SUMMARY
  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:
  
  1. first time due to currentIndexChanged signal from combobox (common/googlesettingsdialog.cpp:72)
  2. 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.

TEST PLAN
  Opened the settings dialog for my google account. Data is no longer duplicated. I'm happy.

REPOSITORY
  R44 KDE PIM Runtime

REVISION DETAIL
  https://phabricator.kde.org/D9715

AFFECTED FILES
  resources/google/calendar/settingsdialog.cpp

To: poboiko, #kde_pim
Cc: dvasin, winterz, vkrause, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20180107/3b7e74cf/attachment.html>


More information about the kde-pim mailing list