[mythtv-commits] [MythTV/mythtv] bda2c8: Remove classes Configuration and DBConfiguration

Scott Theisen noreply at github.com
Fri Nov 18 20:02:19 UTC 2022


  Branch: refs/heads/master
  Home:   https://github.com/MythTV/mythtv
  Commit: bda2c8b54249dac4134c4c32da912289c1b207e7
      https://github.com/MythTV/mythtv/commit/bda2c8b54249dac4134c4c32da912289c1b207e7
  Author: Scott Theisen <scott.the.elm at gmail.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M mythtv/libs/libmyth/backendselect.cpp
    M mythtv/libs/libmyth/backendselect.h
    M mythtv/libs/libmyth/mythcontext.cpp
    M mythtv/libs/libmythbase/configuration.cpp
    M mythtv/libs/libmythbase/configuration.h
    M mythtv/libs/libmythbase/mythcorecontext.cpp
    M mythtv/libs/libmythbase/mythcorecontext.h
    M mythtv/libs/libmythupnp/ssdp.cpp
    M mythtv/libs/libmythupnp/upnputil.cpp
    M mythtv/programs/mythbackend/mediaserver.cpp
    M mythtv/programs/mythfrontend/mediarenderer.cpp

  Log Message:
  -----------
  Remove classes Configuration and DBConfiguration

The Configuration DBConfiguration has always been a shim to the
database see commit 85bb9769453db457b727e286e51306d32e87d874
so I have replaced those few uses in mediaserver.cpp with direct
GetMythDB() database accesses.

However, setting a DBConfiguration to the global Configuration
was incorrect since the UPnP code looks for values that are
not present in the database, only optionally present in config.xml.

Note: I now have UDNs for MediaRenderer, MediaServer, and MasterMediaServer
in config.xml.  However, I also had UPnP/UDN/* in the settings table of my
database.


  Commit: 722368e3ce2e62cce40b3cf320ee8fbffd9be6fa
      https://github.com/MythTV/mythtv/commit/722368e3ce2e62cce40b3cf320ee8fbffd9be6fa
  Author: Scott Theisen <scott.the.elm at gmail.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M mythtv/libs/libmythbase/configuration.cpp
    M mythtv/libs/libmythbase/configuration.h

  Log Message:
  -----------
  XmlConfiguration: add default initializers and constructor


  Commit: dcdc3bbd97d8621723d0b463270ffba92f05da6a
      https://github.com/MythTV/mythtv/commit/dcdc3bbd97d8621723d0b463270ffba92f05da6a
  Author: Scott Theisen <scott.the.elm at gmail.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M mythtv/libs/libmyth/backendselect.cpp
    M mythtv/libs/libmyth/backendselect.h
    M mythtv/libs/libmyth/mythcontext.cpp
    M mythtv/libs/libmythbase/mythcorecontext.cpp
    M mythtv/libs/libmythbase/mythcorecontext.h
    M mythtv/libs/libmythupnp/eventing.cpp
    M mythtv/libs/libmythupnp/httprequest.cpp
    M mythtv/libs/libmythupnp/mmulticastsocketdevice.cpp
    M mythtv/libs/libmythupnp/ssdp.cpp
    M mythtv/libs/libmythupnp/upnpcds.cpp
    M mythtv/libs/libmythupnp/upnpcmgr.cpp
    M mythtv/libs/libmythupnp/upnpdevice.cpp
    M mythtv/libs/libmythupnp/upnpmsrr.cpp
    M mythtv/libs/libmythupnp/upnptaskcache.h
    M mythtv/libs/libmythupnp/upnptasknotify.cpp
    M mythtv/libs/libmythupnp/upnptasksearch.cpp
    M mythtv/libs/libmythupnp/upnputil.cpp
    M mythtv/programs/mythfrontend/mediarenderer.cpp
    M mythtv/programs/mythfrontend/mythfexml.cpp

  Log Message:
  -----------
  XmlConfiguration: minimize lifetime of instances

This is intended to prevent the loss of changes made to the configuration file
between it being read into the XmlConfiguration instance and saving that instance.
Also, this removes the unnecessary global state.

mythcontext.cpp: use XmlConfiguration::k_default_filename and the default constructor.


  Commit: 647099bba3b917120fbf2ef576af0e7f6cddba16
      https://github.com/MythTV/mythtv/commit/647099bba3b917120fbf2ef576af0e7f6cddba16
  Author: Scott Theisen <scott.the.elm at gmail.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M mythtv/libs/libmythupnp/libmythupnp.pro

  Log Message:
  -----------
  libmythupnp.pro: remove configuration.h missed by 6ba7c84c7e15d0c00741cdfa9fbcb8b8c5c07470


  Commit: 93090ec3551f0ad278b7eff853cfa78e73033539
      https://github.com/MythTV/mythtv/commit/93090ec3551f0ad278b7eff853cfa78e73033539
  Author: Scott Theisen <scott.the.elm at gmail.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M mythtv/libs/libmythbase/configuration.cpp
    M mythtv/libs/libmythbase/configuration.h

  Log Message:
  -----------
  XmlConfiguration: Style and variable names


  Commit: 8dffb3de9776686a9238ba8ca83ecdb1ee9f5b1b
      https://github.com/MythTV/mythtv/commit/8dffb3de9776686a9238ba8ca83ecdb1ee9f5b1b
  Author: Scott Theisen <scott.the.elm at gmail.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M mythtv/libs/libmyth/mythcontext.cpp
    M mythtv/libs/libmythbase/configuration.cpp
    M mythtv/libs/libmythbase/configuration.h

  Log Message:
  -----------
  XmlConfiguration: Use QVariant, overloading, to reduce code duplication

add const char* overloads to fix overload resolution


  Commit: 8efa7b8a94bda0bf927e9371e739ef1a26e00ed6
      https://github.com/MythTV/mythtv/commit/8efa7b8a94bda0bf927e9371e739ef1a26e00ed6
  Author: Scott Theisen <scott.the.elm at gmail.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M mythtv/libs/libmythbase/configuration.h

  Log Message:
  -----------
  libmythbase/configuration.h: add specified Qt includes

for the classes used in this file.


  Commit: 5e37e2b44123ac518cf4646391e8658a258d0258
      https://github.com/MythTV/mythtv/commit/5e37e2b44123ac518cf4646391e8658a258d0258
  Author: Scott Theisen <scott.the.elm at gmail.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M mythtv/libs/libmythbase/configuration.cpp

  Log Message:
  -----------
  XmlConfiguration: add more log messages for debugging


  Commit: eb265588c00a79cdfd5a8176913747faa8939dc1
      https://github.com/MythTV/mythtv/commit/eb265588c00a79cdfd5a8176913747faa8939dc1
  Author: Scott Theisen <scott.the.elm at gmail.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M mythtv/libs/libmyth/mythcontext.cpp

  Log Message:
  -----------
  mythcontext.cpp: LoadDatabaseSettings part 1

remove unnecessary variable


  Commit: 3006e9d4da7bcdf160cb165033932c1d1fa85509
      https://github.com/MythTV/mythtv/commit/3006e9d4da7bcdf160cb165033932c1d1fa85509
  Author: Scott Theisen <scott.the.elm at gmail.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M mythtv/libs/libmyth/mythcontext.cpp

  Log Message:
  -----------
  mythcontext.cpp: LoadDatabaseSettings() part 2

reordered lines for enhanced clarity
prevented an unwanted, inaccurate log line on Android


  Commit: d7bedc56275656b768817fb80ca83281951ddb66
      https://github.com/MythTV/mythtv/commit/d7bedc56275656b768817fb80ca83281951ddb66
  Author: Scott Theisen <scott.the.elm at gmail.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M mythtv/libs/libmyth/mythcontext.cpp

  Log Message:
  -----------
  mythcontext.cpp: SaveDatabaseParams

improve short circuit comparison

make the return value actually have meaning, which it never did;
see original commit 3fb9d6eb779e08d91df8a849a5be38e219c34bed from 2012

It now returns if the settings were saved successfully, instead of always returning true,
which frankly I'm surprised was never caught
(I would have thought this would throw a warning on the compiler or other analysis tools).


  Commit: 023b27c0cdf4089e09f79d7502c3ded36e96b1d5
      https://github.com/MythTV/mythtv/commit/023b27c0cdf4089e09f79d7502c3ded36e96b1d5
  Author: Scott Theisen <scott.the.elm at gmail.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M mythtv/libs/libmyth/mythcontext.cpp

  Log Message:
  -----------
  mythcontext.cpp: Spaces and braces


  Commit: 0a2a067c02ff03afc38119f67bb8ee13a4708dcf
      https://github.com/MythTV/mythtv/commit/0a2a067c02ff03afc38119f67bb8ee13a4708dcf
  Author: Scott Theisen <scott.the.elm at gmail.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M mythtv/libs/libmyth/mythcontext.cpp

  Log Message:
  -----------
  mythcontextprivate: remove unecessary variable m_settingsCacheDirty

by moving the only code using it into the same function and making it local to
that function.

The only times saveSettingsCache() is called are right there in MythContext::Init()
and in mythfrontend::main() immediately before exiting.  Thus this change should
have no noticeable functional change.

For reference, these lines are originally from:
deeed3c2bccb77277cd3568b4760fbf433dcde19 and 0b9d21aa4cf7ab56999e9eabed74bf0930ff12ee
references https://code.mythtv.org/trac/ticket/13239

It is not clear to me from either commit or the referenced issue why the main window
is being destroyed in the first place.


  Commit: 694a8124f8fd30fd5c1616257935b7d7cd15ec2f
      https://github.com/MythTV/mythtv/commit/694a8124f8fd30fd5c1616257935b7d7cd15ec2f
  Author: Scott Theisen <scott.the.elm at gmail.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M mythtv/libs/libmyth/mythcontext.cpp

  Log Message:
  -----------
  mythcontext.cpp: separate out class GUISettingsCache

It's not much of a class, but this makes its function clearer and prepares
MythContext for refactoring into MythGUIContext.


  Commit: 03c4852e0c1709a05dfeda6c23b8d1e61b947cc4
      https://github.com/MythTV/mythtv/commit/03c4852e0c1709a05dfeda6c23b8d1e61b947cc4
  Author: Scott Theisen <scott.the.elm at gmail.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M mythtv/libs/libmyth/backendselect.h
    M mythtv/libs/libmyth/mythcontext.cpp

  Log Message:
  -----------
  mythcontext.cpp: remove pointless casts

I don't like the pointer use of BackendSelection::Prompt(), but I am not
investigating replacing it at this time.  It should probably return a DatabaseParams
and take by reference as an output a BackendSelection::Decision (enum).


  Commit: 296931bcf01f194de669701c7d65e8878b4a94c7
      https://github.com/MythTV/mythtv/commit/296931bcf01f194de669701c7d65e8878b4a94c7
  Author: Scott Theisen <scott.the.elm at gmail.com>
  Date:   2022-11-18 (Fri, 18 Nov 2022)

  Changed paths:
    M mythtv/libs/libmyth/mythcontext.cpp

  Log Message:
  -----------
  mythcontext.cpp: remove support for decade old legacy config.xml format

from 3fb9d6eb779e08d91df8a849a5be38e219c34bed


Compare: https://github.com/MythTV/mythtv/compare/d8976e59ea42...296931bcf01f


More information about the mythtv-commits mailing list