MythTV  master
expertsettingseditor.h
Go to the documentation of this file.
1 #ifndef EXPERTSETTINGSEDITOR_H
2 #define EXPERTSETTINGSEDITOR_H
3 
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 
MSqlQuery::next
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:812
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:127
ExpertSettingsEditor
Definition: expertsettingseditor.h:8
RawSettingsEditor
An editor screen that allows manipulation of raw settings values.
Definition: rawsettingseditor.h:25
MSqlQuery::value
QVariant value(int i) const
Definition: mythdbcon.h:204
MythScreenStack
Definition: mythscreenstack.h:16
mythdbcon.h
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:618
RawSettingsEditor::m_title
QString m_title
Definition: rawsettingseditor.h:51
ExpertSettingsEditor::ExpertSettingsEditor
ExpertSettingsEditor(MythScreenStack *parent, const char *name=nullptr)
Definition: expertsettingseditor.h:13
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:550
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:55
RawSettingsEditor::m_settings
QMap< QString, QString > m_settings
Definition: rawsettingseditor.h:52
mythcorecontext.h
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:888
MythCoreContext::GetHostName
QString GetHostName(void)
Definition: mythcorecontext.cpp:842
rawsettingseditor.h
MSqlQuery::prepare
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:837