[mythtv-commits] Ticket #4265: Perl Bindings depend on mysql.txt for DB Connection
MythTV
mythtv at cvs.mythtv.org
Fri Jan 18 12:05:33 UTC 2008
#4265: Perl Bindings depend on mysql.txt for DB Connection
------------------------------+---------------------------------------------
Reporter: stuartm | Owner: xris
Type: defect | Status: new
Priority: blocker | Milestone: 0.21
Component: perl / nuvexport | Version: head
Severity: medium | Resolution:
Mlocked: 0 |
------------------------------+---------------------------------------------
Comment(by nigel):
Writing the last successful connection into config.xml is pretty easy.
Something like this (untested) should do it:
{{{
% svn diff mythcontext.cpp
Index: mythcontext.cpp
===================================================================
--- mythcontext.cpp (revision 15473)
+++ mythcontext.cpp (working copy)
@@ -69,8 +69,9 @@
// Some common UPnP search and XML value strings
const QString gBackendURI = "urn:schemas-mythtv-
org:device:MasterMediaServer:1";
-const QString kDefaultPIN =
"UPnP/MythFrontend/DefaultBackend/SecurityPin";
-const QString kDefaultUSN = "UPnP/MythFrontend/DefaultBackend/USN";
+const QString kDefaultBE = "UPnP/MythFrontend/DefaultBackend/";
+const QString kDefaultPIN = kDefaultBE + "SecurityPin";
+const QString kDefaultUSN = kDefaultBE + "USN";
int parse_verbose_arg(QString arg)
@@ -663,6 +664,12 @@
DBfound:
//VERBOSE(VB_GENERAL, "FindDatabase() - Success!");
ResetDatabase();
+ m_XML->SetValue(kDefaultBE + "lastDBhostName",
m_DBparams.dbHostName);
+ m_XML->SetValue(kDefaultBE + "lastDBuserName",
m_DBparams.dbUserName);
+ m_XML->SetValue(kDefaultBE + "lastDBpassword",
m_DBparams.dbPassword);
+ m_XML->SetValue(kDefaultBE + "lastDBname", m_DBparams.dbName);
+ m_XML->SetValue(kDefaultBE + "lastDBport", m_DBparams.dbPort);
+ m_XML->Save();
DeleteUPnP();
return true;
}}}
Note, it would be just as easy to write these into mysql.txt instead of
config.xml (and that would automatically handle
the "contact the last server directly"), or to only write them when the
user elects to "Save backend details" (just move these SetValue()s to line
1288). It just depends on whether we want to keep the config.xml for UPnP
only.
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/4265#comment:4>
MythTV <http://svn.mythtv.org/trac>
MythTV
More information about the mythtv-commits
mailing list