1. 03 Aug, 2020 5 commits
    • Antonio Larrosa Jimenez's avatar
    • Antonio Larrosa Jimenez's avatar
    • Antonio Larrosa Jimenez's avatar
      Use nullptr instead of 0L · 01534f7f
      Antonio Larrosa Jimenez authored and Antonio Larrosa Jimenez's avatar Antonio Larrosa Jimenez committed
      Some habits are hard to break
    • Antonio Larrosa Jimenez's avatar
      Check availability of Postgresql backend and clean a bit the code · 217fc7bd
      Antonio Larrosa Jimenez authored and Antonio Larrosa Jimenez's avatar Antonio Larrosa Jimenez committed
      Rename `areRequirementsAvailable` method to `isAvailable` and implement the
      method for DbConfigPostgresql too.
      Extract the code from `DbConfig::configuredDatabase` that selects the fallback
      to use to a new separate static method, `defaultAvailableDatabaseBackend`
      to be more clear about what that code does and simplify `configuredDatabase`.
      Now if Postgresql is expected to be used (because akonadi was built like that)
      but QPSQL is not available or the initdb/pg_ctl binaries don't exist, then we
      fallback to trying to use QSQLITE3.
      As with the `DbConfigMysql` change, if QSQLITE3 can't be used either, then
      the code will continue trying to use postgresql and fail as expected.
    • Antonio Larrosa Jimenez's avatar
      Fallback to using the QSQLITE3 driver if QMYSQL can't be used · 8240e111
      Antonio Larrosa Jimenez authored and Antonio Larrosa Jimenez's avatar Antonio Larrosa Jimenez committed
      On SUSE Linux Enterprise Desktop (SLED) with the PackageHub repository
      enabled (which provides the KDE packages) the mysql package is not available,
      so there's no mysqld, and the QMYSQL driver can't be used.
      OTOH, SUSE Linux Enterprise Server (SLES) with the same PackageHub repository
      enabled has a mariadb package available which provides the mysqld binary.
      Since the akonadi-server package for SLES and SLED is the same, we can't
      just set DATABASE_BACKEND to SQLITE at buildtime and we need to choose
      a fallback at runtime, which is what this commit implements.
      If it's the first time akonadi starts and mysql is expected to be used, this
      commit checks if it's really usable, and if it's not, it checks if the QSQLITE3 driver
      is available and if it is, we fall back to it instead of using mysql.
      Since we need to find out if a DbConfig* object can be initialized before
      it's actually initialized, I added a bool storeSettings parameter to
      DbConfig::init(QSettings &) that can be used to try the initialization
      (find out available paths, etc.) without storing anything.
      Then I added two methods DbConfigMysql::areRequirementsAvailable and
      DbConfigSqlite::areRequirementsAvailable that check if the given object
      has the system requirements available. I didn't add it to
      DbConfigPostgresql because Postgresql isn't used by default in any case.
      Also, note that this check is only done the first time akonadi starts
      when it's not configured. Once it starts with mysql or sqlite3 this
      configuration is stored and used the next times without any further
  2. 02 Aug, 2020 1 commit
  3. 30 Jul, 2020 2 commits
  4. 28 Jul, 2020 2 commits
  5. 27 Jul, 2020 2 commits
  6. 23 Jul, 2020 2 commits
  7. 20 Jul, 2020 1 commit
  8. 13 Jul, 2020 3 commits
  9. 12 Jul, 2020 1 commit
  10. 09 Jul, 2020 1 commit
  11. 08 Jul, 2020 1 commit
  12. 07 Jul, 2020 1 commit
  13. 06 Jul, 2020 1 commit
  14. 03 Jul, 2020 1 commit
  15. 02 Jul, 2020 2 commits
  16. 29 Jun, 2020 2 commits
  17. 25 Jun, 2020 3 commits
  18. 24 Jun, 2020 1 commit
  19. 22 Jun, 2020 1 commit
  20. 19 Jun, 2020 4 commits
  21. 18 Jun, 2020 1 commit
  22. 17 Jun, 2020 2 commits