MythTV  master
expertsettingseditor.h
Go to the documentation of this file.
1 #ifndef EXPERTSETTINGSEDITOR_H
2 #define EXPERTSETTINGSEDITOR_H
3 
4 #include "mythcorecontext.h"
5 #include "mythdbcon.h"
6 #include "rawsettingseditor.h"
7 
9 {
10  Q_OBJECT
11 
12  public:
13  ExpertSettingsEditor(MythScreenStack *parent, const char *name = nullptr)
14  : RawSettingsEditor(parent, name)
15  {
17 
18  query.prepare("SELECT value, data "
19  "FROM settings "
20  "WHERE hostname = :HOSTNAME");
21  query.bindValue(":HOSTNAME", gCoreContext->GetHostName());
22 
23  if (query.exec())
24  {
25  while (query.next())
26  {
27  m_settings[query.value(0).toString()] =
28  query.value(0).toString();
29  }
30  }
31 
32  m_title = tr("Expert Settings Editor");
33  m_settings["EventCmdRecPending"] = tr("Recording Pending");
34  }
35 };
36 
37 #endif
38 
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:782
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:863
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:125
ExpertSettingsEditor(MythScreenStack *parent, const char *name=nullptr)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
QVariant value(int i) const
Definition: mythdbcon.h:198
static MSqlQueryInfo InitCon(ConnectionReuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:535
const char * name
Definition: ParseText.cpp:328
QMap< QString, QString > m_settings
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:807
An editor screen that allows manipulation of raw settings values.
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:603
QString GetHostName(void)