New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration caches #435
Configuration caches #435
Conversation
|
5c6ef1d
to
2140a6a
Compare
c895b72
to
e17a11e
Compare
Rebased and force pushed. (I meant to merge some of the commits together before pushing, but I forgot. It is probably clearer while in progress to not do that kind of rebasing, anyway.) See 381a3c9 for my solution for the non-DB settings. It works fine when I tested it. Re: "UPnP/DescXmlPath" in mythfexml.cpp
I think that is beyond the scope of this pull request. |
e17a11e
to
5bc1efd
Compare
Rebased onto master and added more logging. |
WriteDelayedSettings.patch.txt LOG_ALERT to make searching the log easier. GetSettings() does return the default given. WriteDelayedSettings() is called a number of times. However, mythtv/mythtv/libs/libmythbase/mythdb.cpp Line 966 in 4d3f06e
|
7bf00ce
to
7b60a1d
Compare
Compilation failure from
Now converted to GetMythDB(). @stuarta The changes are otherwise identical. Several commits will need to be squashed before merging this PR. |
7b60a1d
to
2d71090
Compare
Rebased onto master with the commits re-ordered and squashed. The only difference is an extra newline in configuration.h and the removal of the void parameters in XmlConfiguration::(Save|Load). |
2d71090
to
d279859
Compare
@stuarta I have now rebased this onto master and made a number of changes versus the previous version, including no longer using reversion commits. The overall changes are similar. |
|
The Configuration DBConfiguration has always been a shim to the database see commit 85bb976 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.
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.
add const char* overloads to fix overload resolution
for the classes used in this file.
remove unnecessary variable
reordered lines for enhanced clarity prevented an unwanted, inaccurate log line on Android
improve short circuit comparison make the return value actually have meaning, which it never did; see original commit 3fb9d6e 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).
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: deeed3c and 0b9d21a 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.
It's not much of a class, but this makes its function clearer and prepares MythContext for refactoring into MythGUIContext.
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).
d279859
to
773691a
Compare
@stuarta Ping. Rebased onto master to resolve minor conflict from minimum Qt version bump. |
From the comments this pull seems to follow on to some discussion you had with stuart, which I know nothing about, so I need some context. Please can you give an overall description of what the purpose is of the pull request, what features of MythTV are affected, and what changes will be visible to the user. |
#435 (comment) is about MythDB::WriteDelayedSettings(), which if I remember correctly, we discussed (privately?) on IRC. Since 2010 with c93be1c and 75cf4e4, you are supposed to be able to write settings to the database before it is connected. Looking over the current changes, I don't think this is relevant to this pull request.
I had started work on this before Stuart committed 6ba7c84 and the basic goal was the same: break dependencies on libmythupnp. However, I went further than he did and also started some code cleanup. My intention was to prepare to break the dependency of MythContext on libmythupnp, but I'm not sure that is completely possible.
Loading the configuration caches in
Aside from the extra log messages I added, there should be no visible behavior changes. UDNs for MediaRenderer, MediaServer, and MasterMediaServer will all end up saved in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The destroying of the main window was to address the case where the xml cache had been deleted and you were starting up before the database was active, and got the wrong GUI setup in your window.
That destroying of the main window is no longer necessary, so this commit is good.
Merged into master. |
Checklist
@stuarta I had hoped to do more work on this, regarding the XmlConfigurations use, but this should be an improvement over what you did.
The configuration caches are currently in libmyth/mythcontext (private).
See the commit messages for details. None of the UPnP stuff was ever saved.