FromStringList can return an error code, make sure it is checked and reported.
From: Erik Hovland <erik@hovland.org>
---
programs/mythbackend/mainserver.cpp | 16 ++++++++++++----
programs/mythbackend/playbacksock.cpp | 11 +++++++----
programs/mythbackend/playbacksock.h | 2 +-
3 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/programs/mythbackend/mainserver.cpp b/programs/mythbackend/mainserver.cpp
index af91922..5e73693 100644
a
|
b
|
void MainServer::HandleQueryRecordings(QString type, PlaybackSock *pbs)
|
1338 | 1338 | { |
1339 | 1339 | if (proginfo->filesize == 0) |
1340 | 1340 | { |
1341 | | slave->FillProgramInfo(proginfo, playbackhost); |
1342 | | |
1343 | | if (proginfo->recendts < QDateTime::currentDateTime()) |
1344 | | proginfo->SetFilesize(proginfo->filesize); |
| 1341 | if (!slave->FillProgramInfo(proginfo, playbackhost)) |
| 1342 | { |
| 1343 | VERBOSE(VB_IMPORTANT, |
| 1344 | "MainServer::HandleQueryRecordings()" |
| 1345 | "\n\t\t\tCould not fill program info " |
| 1346 | "from backend"); |
| 1347 | } |
| 1348 | else |
| 1349 | { |
| 1350 | if (proginfo->recendts < QDateTime::currentDateTime()) |
| 1351 | proginfo->SetFilesize(proginfo->filesize); |
| 1352 | } |
1345 | 1353 | } |
1346 | 1354 | else |
1347 | 1355 | { |
diff --git a/programs/mythbackend/playbacksock.cpp b/programs/mythbackend/playbacksock.cpp
index 941aa3c..b64a616 100644
a
|
b
|
int PlaybackSock::DeleteRecording(const ProgramInfo *pginfo, bool forceMetadataD
|
142 | 142 | return strlist[0].toInt(); |
143 | 143 | } |
144 | 144 | |
145 | | void PlaybackSock::FillProgramInfo(ProgramInfo *pginfo, QString &playbackhost) |
| 145 | bool PlaybackSock::FillProgramInfo(ProgramInfo *pginfo, QString &playbackhost) |
146 | 146 | { |
147 | 147 | QStringList strlist( QString("FILL_PROGRAM_INFO") ); |
148 | 148 | strlist << playbackhost; |
… |
… |
void PlaybackSock::FillProgramInfo(ProgramInfo *pginfo, QString &playbackhost)
|
150 | 150 | |
151 | 151 | SendReceiveStringList(strlist); |
152 | 152 | |
153 | | pginfo->FromStringList(strlist, 0); |
| 153 | return pginfo->FromStringList(strlist, 0); |
154 | 154 | } |
155 | 155 | |
156 | 156 | QStringList PlaybackSock::GenPreviewPixmap(const ProgramInfo *pginfo) |
… |
… |
bool PlaybackSock::IsBusy(
|
226 | 226 | if (busy_input) |
227 | 227 | { |
228 | 228 | it++; |
229 | | busy_input->FromStringList(it, strlist.end()); |
| 229 | if (!busy_input->FromStringList(it, strlist.end())) |
| 230 | state = false; |
230 | 231 | } |
231 | 232 | |
232 | 233 | return state; |
… |
… |
ProgramInfo *PlaybackSock::GetRecording(int capturecardnum)
|
274 | 275 | SendReceiveStringList(strlist); |
275 | 276 | |
276 | 277 | ProgramInfo *info = new ProgramInfo(); |
277 | | info->FromStringList(strlist, 0); |
| 278 | if (!info->FromStringList(strlist, 0)) |
| 279 | return NULL; |
| 280 | |
278 | 281 | return info; |
279 | 282 | } |
280 | 283 | |
diff --git a/programs/mythbackend/playbacksock.h b/programs/mythbackend/playbacksock.h
index e395523..f3c7a83 100644
a
|
b
|
class PlaybackSock
|
46 | 46 | int StopRecording(const ProgramInfo *pginfo); |
47 | 47 | int CheckRecordingActive(const ProgramInfo *pginfo); |
48 | 48 | int DeleteRecording(const ProgramInfo *pginfo, bool forceMetadataDelete = false); |
49 | | void FillProgramInfo(ProgramInfo *pginfo, QString &playbackhost); |
| 49 | bool FillProgramInfo(ProgramInfo *pginfo, QString &playbackhost); |
50 | 50 | QStringList GenPreviewPixmap(const ProgramInfo *pginfo); |
51 | 51 | QStringList GenPreviewPixmap(const ProgramInfo *pginfo, |
52 | 52 | bool time_fmt_sec, |