Skip to content

Commit

Permalink
configuration.cpp: add more log messages for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
ulmus-scott committed Jan 7, 2022
1 parent 13b0a44 commit 5bc1efd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mythtv/libs/libmythbase/configuration.cpp
Expand Up @@ -16,6 +16,8 @@ bool XmlConfiguration::Load(void)
{
QString pathName = m_path + '/' + m_fileName;

LOG(VB_GENERAL, LOG_DEBUG, QString("Loading %1").arg(pathName));

QFile file(pathName);

if (file.exists() && !m_fileName.isEmpty()) // Ignore empty filenames
Expand Down Expand Up @@ -64,6 +66,8 @@ bool XmlConfiguration::Save(void)
QString pathName = m_path + '/' + m_fileName;
QString old = pathName + ".old";

LOG(VB_GENERAL, LOG_DEBUG, QString("Saving %1").arg(pathName));

QFile file(pathName + ".new");

if (!file.exists())
Expand Down Expand Up @@ -171,13 +175,19 @@ QString XmlConfiguration::GetValue(const QString &setting)
// -=>TODO: This Always assumes firstChild is a Text Node... should change
if (!node.isNull() && !(textNode = node.firstChild().toText()).isNull())
{
LOG(VB_GENERAL, LOG_DEBUG, QString("Got \"%1\" for \"%2\"").arg(textNode.nodeValue(), setting));

return textNode.nodeValue();
}

LOG(VB_GENERAL, LOG_DEBUG, QString("Using default for \"%1\"").arg(setting));
return QString();
}

void XmlConfiguration::SetValue(const QString &setting, const QString& value)
{
LOG(VB_GENERAL, LOG_DEBUG, QString("Setting \"%1\" to \"%2\"").arg(setting, value));

QDomNode node = FindNode(setting, true);

if (!node.isNull())
Expand All @@ -200,6 +210,7 @@ void XmlConfiguration::SetValue(const QString &setting, const QString& value)

void XmlConfiguration::ClearValue(const QString &setting)
{
LOG(VB_GENERAL, LOG_DEBUG, QString("clearing %1").arg(setting));
QDomNode node = FindNode(setting, false);
if (!node.isNull())
{
Expand Down

0 comments on commit 5bc1efd

Please sign in to comment.