Go to the documentation of this file.
24 static bool checkPath(QString path, QStringList &probs)
29 probs.push_back(QObject::tr(
"Path \"%1\" doesn't exist.").arg(path));
33 QFile test(path.append(
"/.test"));
34 if (test.open(QIODevice::WriteOnly))
38 probs.push_back(QObject::tr(
"Unable to create file \"%1\" - directory "
39 "is not writable?").arg(path));
51 bool problemFound =
false;
55 query.
prepare(
"SELECT count(groupname) FROM storagegroup;");
62 if (query.
value(0).toInt() == 0)
65 QObject::tr(
"No Storage Group directories are defined. You "
66 "must add at least one directory to the Default "
67 "Storage Group where new recordings will be "
69 probs.push_back(trMesg);
70 LOG(VB_GENERAL, LOG_ERR, trMesg);
74 query.
prepare(
"SELECT groupname, dirname "
76 "WHERE hostname = :HOSTNAME;");
89 QObject::tr(
"No Storage Group directories are defined. "
90 "You must add at least one directory to the "
91 "Default Storage Group where new recordings "
93 probs.push_back(trMesg);
94 LOG(VB_GENERAL, LOG_ERR, trMesg);
107 dirname = QString::fromUtf8(query.
value(1)
108 .toByteArray().constData());
109 QStringList tokens = dirname.split(
",");
111 while (curToken < tokens.size())
113 checkDir.setPath(tokens[curToken]);
127 bool problemFound =
false;
131 query.
prepare(
"SELECT groupname "
133 "WHERE hostname = :HOSTNAME;");
140 if (query.
size() < 1)
148 groups += query.
value(0).toString();
151 if (groups.contains(
"Videos"))
153 if (groups.contains(
"Fanart") &&
154 groups.contains(
"Coverart") &&
155 groups.contains(
"Screenshots") &&
156 groups.contains(
"Banners"))
157 problemFound =
false;
161 QObject::tr(
"You have a Video Storage "
162 "Group, but have not set up "
163 "all Image Groups. If you continue, "
164 "video image downloads will be saved in "
165 "your Videos Storage Group. Do you want "
166 "to store them in their own groups?");
167 probs.push_back(trMesg);
168 LOG(VB_GENERAL, LOG_ERR, trMesg);
182 bool problemFound =
false;
186 query.
prepare(
"SELECT cardid, startchan, sourceid, inputname, parentid"
187 " FROM capturecard;");
197 int cardid = query.
value(0).toInt();
198 QString startchan = query.
value(1).toString();
199 int sourceid = query.
value(2).toInt();
200 int parentid = query.
value(4).toInt();
208 probs.push_back(QObject::tr(
"Card %1 (%2) No video source connected")
209 .arg(cardid).arg(query.
value(3).toString()));
216 if (!newchan.isEmpty())
218 if (newchan.compare(startchan) != 0)
222 QString(
"start channel from %1 to %2 ").arg(startchan, newchan) +
223 QString(
"for card %1 (%2)").arg(cardid).arg(query.
value(3).toString());
226 LOG(VB_GENERAL, LOG_INFO,
227 QString(
"CheckSetup[%1]: ").arg(cardid) +
"Changed " + msg);
231 LOG(VB_GENERAL, LOG_ERR,
232 QString(
"CheckSetup[%1]: ").arg(cardid) +
"Failed to change " + msg);
238 probs.push_back(QObject::tr(
"Card %1 (%2) No visible channels found")
239 .arg(cardid).arg(query.
value(3).toString()));
252 bool problemFound =
false;
256 query.
prepare(
"SELECT count(*) total, "
257 " count(distinct right(if(displayname<>'',"
258 " displayname, NULL), 2)) uniq "
260 "WHERE parentid = 0");
268 int total = query.
value(0).toInt();
269 int uniq = query.
value(1).toInt();
272 probs.push_back(QObject::tr(
273 "The display names for one or more inputs are not "
274 "sufficiently unique. They must be set and the "
275 "last two characters must be unique because some "
276 "themes use them to identify the input."));
296 bool needsReminder =
false;
299 query.
prepare(
"SELECT sourceid "
301 "WHERE xmltvgrabber LIKE 'tv_grab_%';");
306 else if (query.
size() >= 1)
308 needsReminder =
true;
311 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.