Go to the documentation of this file.
23 static bool checkPath(QString path, QStringList &probs)
28 probs.push_back(QObject::tr(
"Path \"%1\" doesn't exist.").arg(path));
32 QFile test(path.append(
"/.test"));
33 if (test.open(QIODevice::WriteOnly))
37 probs.push_back(QObject::tr(
"Unable to create file \"%1\" - directory "
38 "is not writable?").arg(path));
50 bool problemFound =
false;
54 query.
prepare(
"SELECT count(groupname) FROM storagegroup;");
61 if (query.
value(0).toInt() == 0)
64 QObject::tr(
"No Storage Group directories are defined. You "
65 "must add at least one directory to the Default "
66 "Storage Group where new recordings will be "
68 probs.push_back(trMesg);
69 LOG(VB_GENERAL, LOG_ERR, trMesg);
73 query.
prepare(
"SELECT groupname, dirname "
75 "WHERE hostname = :HOSTNAME;");
88 QObject::tr(
"No Storage Group directories are defined. "
89 "You must add at least one directory to the "
90 "Default Storage Group where new recordings "
92 probs.push_back(trMesg);
93 LOG(VB_GENERAL, LOG_ERR, trMesg);
106 dirname = QString::fromUtf8(query.
value(1)
107 .toByteArray().constData());
108 QStringList tokens = dirname.split(
",");
110 while (curToken < tokens.size())
112 checkDir.setPath(tokens[curToken]);
126 bool problemFound =
false;
130 query.
prepare(
"SELECT groupname "
132 "WHERE hostname = :HOSTNAME;");
139 if (query.
size() < 1)
147 groups += query.
value(0).toString();
150 if (groups.contains(
"Videos"))
152 if (groups.contains(
"Fanart") &&
153 groups.contains(
"Coverart") &&
154 groups.contains(
"Screenshots") &&
155 groups.contains(
"Banners"))
156 problemFound =
false;
160 QObject::tr(
"You have a Video Storage "
161 "Group, but have not set up "
162 "all Image Groups. If you continue, "
163 "video image downloads will be saved in "
164 "your Videos Storage Group. Do you want "
165 "to store them in their own groups?");
166 probs.push_back(trMesg);
167 LOG(VB_GENERAL, LOG_ERR, trMesg);
181 bool problemFound =
false;
185 query.
prepare(
"SELECT cardid, startchan, sourceid, inputname, parentid"
186 " FROM capturecard;");
196 int cardid = query.
value(0).toInt();
197 QString startchan = query.
value(1).toString();
198 int sourceid = query.
value(2).toInt();
199 int parentid = query.
value(4).toInt();
207 probs.push_back(QObject::tr(
"Card %1 (%2) No video source connected")
208 .arg(cardid).arg(query.
value(3).toString()));
215 if (!newchan.isEmpty())
217 if (newchan.compare(startchan) != 0)
221 QString(
"start channel from %1 to %2 ").arg(startchan, newchan) +
222 QString(
"for card %1 (%2)").arg(cardid).arg(query.
value(3).toString());
225 LOG(VB_GENERAL, LOG_INFO,
226 QString(
"CheckSetup[%1]: ").arg(cardid) +
"Changed " + msg);
230 LOG(VB_GENERAL, LOG_ERR,
231 QString(
"CheckSetup[%1]: ").arg(cardid) +
"Failed to change " + msg);
237 probs.push_back(QObject::tr(
"Card %1 (%2) No visible channels found")
238 .arg(cardid).arg(query.
value(3).toString()));
251 bool problemFound =
false;
255 query.
prepare(
"SELECT count(*) total, "
256 " count(distinct right(if(displayname<>'',"
257 " displayname, NULL), 2)) uniq "
259 "WHERE parentid = 0");
267 int total = query.
value(0).toInt();
268 int uniq = query.
value(1).toInt();
271 probs.push_back(QObject::tr(
272 "The display names for one or more inputs are not "
273 "sufficiently unique. They must be set and the "
274 "last two characters must be unique because some "
275 "themes use them to identify the input."));
295 bool needsReminder =
false;
298 query.
prepare(
"SELECT sourceid "
300 "WHERE xmltvgrabber LIKE 'tv_grab_%';");
305 else if (query.
size() >= 1)
307 needsReminder =
true;
310 return needsReminder;
bool isActive(void) const
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
QSqlQuery wrapper that fetches a DB connection from the connection pool.
bool checkStoragePaths(QStringList &probs)
Do the Storage Group filesystem paths exist? Are they writable? Is the Live TV filesystem large enoug...
static bool SetStartChannel(uint inputid, const QString &channum)
QVariant value(int i) const
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
bool checkChannelPresets(QStringList &probs)
bool checkInputDisplayNames(QStringList &probs)
bool CheckSetup(QStringList &problems)
Build up a string of common problems that the user should correct in the MythTV-Setup program.
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
static void DBError(const QString &where, const MSqlQuery &query)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
static bool checkPath(QString path, QStringList &probs)
Check that a directory path exists and is writable.
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
bool checkImageStoragePaths(QStringList &probs)
QString GetHostName(void)
bool IsMasterHost(void)
is this the same host as the master
static QString GetStartChannel(uint inputid)
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.