1. 01 Mar, 2020 2 commits
    • Igor Poboiko's avatar
      [resources/maildir] Don't save "file:" schema to the config · 93ecfacf
      Igor Poboiko authored
      Summary:
      `ConfigWidget` uses `KConfig` underneath, and utilizes `KUrlRequester` custom
      widget. The `USER` property of this widget (which is used by `KConfig`) is of
      type `QUrl`, and thus when dialog is accepted, the `path` config property
      gets overriden with `QUrl::toString()` value, which prepends `file:` schema
      (this is basically because `KCoreConfigSkeleton::ItemPath` is inherited from
      `ItemString`, and when someone calls `ItemString::setProperty`, it gets
      casted as `QVariant::toString`).
      
      Inside the `ConfigWidget::save` the code calls `setPath` method on
      `url.toLocalFile`, which drops the scheme. Because of that, the `pathItem`
      and `path` property of `mSettings` have different values, first has schema
      and the second hasn't. Eventually, the value stored by `pathItem` wins, and
      `mSettings->path()` returns URL with schema. However, `Maildir` doesn't expect
      it and misinterprets it as the relative path to current WORKDIR (which is home
      directory), thus creating `/home/user/file:/home/user/...` file structure.
      
      The proposed solution is to simply call `mSettings->save()`, which overrides
      `pathItem` value and drops schema from it.
      
      It also fixes the `AkoNotes` resource, which uses the same `ConfigWidget`.
      Funny enough, `Contacts` resource, which is somewhat similar, is not affected
      as it has the same `Settings->save()` call.
      
      Alternative approaches include:
      1) Teach `Maildir` to drop the schema (if it's there).
      2) Teach `KCoreConfigSkeleton::ItemPath` to work with `QUrl` and don't append
      schema (it makes sense, because `ItemPath` corresponds to local file. Although
      it's not documented that it shouldn't have schema, it seems from the tests that
      it was the original intent). This could save the headache of having such issue
      in the future, but it could mess up with other programs in funny ways (as
      currently `file:` sometimes gets prepended, and some code might implicitly rely
      on it)
      
      Additional note:
      There are `ui.kcfg_Path->url().isLocalFile()` checks around, which doesn't make
      sense to me, as `KUrlRequester` is used for local files and it seems like it
      always returns `QUrl` pointing to local file (i.e. have the `file:` schema).
      
      BUG: 408354
      BUG: 411269
      BUG: 413588
      
      Test Plan:
      1) Open `akonadiconsole -> Local Folders` properties, change the folder, save
      2) `cat ~/.config/akonadi_maildir_resource_0rc`. `file:` schema gets prepended
      2.1) `akonadictl restart`. `file:` folder gets created inside homedir
      3) Apply patch, repeat (1)-(2.1). `file:` schema is dropped.
      
      Reviewers: dvratil, mlaurent
      
      Reviewed By: dvratil
      
      Subscribers: kde-pim
      
      Tags: #kde_pim
      
      Differential Revision: https://phabricator.kde.org/D27722
      93ecfacf
    • Volker Krause's avatar
      Port imap, pop3 and ews away from deprecated QSet::fromList · 4df13613
      Volker Krause authored
      Reviewers: dvratil
      
      Reviewed By: dvratil
      
      Subscribers: kde-pim
      
      Tags: #kde_pim
      
      Differential Revision: https://phabricator.kde.org/D27759
      4df13613
  2. 26 Feb, 2020 1 commit
  3. 21 Feb, 2020 1 commit
  4. 14 Feb, 2020 2 commits
  5. 12 Feb, 2020 1 commit
  6. 11 Feb, 2020 1 commit
  7. 29 Jan, 2020 1 commit
  8. 24 Jan, 2020 1 commit
  9. 17 Jan, 2020 2 commits
  10. 10 Jan, 2020 1 commit
  11. 07 Jan, 2020 2 commits
  12. 05 Jan, 2020 1 commit
  13. 03 Jan, 2020 1 commit
  14. 01 Jan, 2020 2 commits
  15. 24 Dec, 2019 1 commit
  16. 20 Dec, 2019 1 commit
  17. 16 Dec, 2019 2 commits
  18. 14 Dec, 2019 1 commit
  19. 10 Dec, 2019 1 commit
  20. 07 Dec, 2019 1 commit
  21. 05 Dec, 2019 1 commit
  22. 03 Dec, 2019 2 commits
  23. 02 Dec, 2019 1 commit
  24. 01 Dec, 2019 1 commit
  25. 30 Nov, 2019 2 commits
  26. 29 Nov, 2019 1 commit
  27. 26 Nov, 2019 3 commits
  28. 25 Nov, 2019 2 commits
  29. 24 Nov, 2019 1 commit