-
diff --git a/mythplugins/mytharchive/mytharchivehelper/main.cpp b/mythplugins/mytharchive/mytharchivehelper/main.cpp
index df4b201..c326d64 100644
a
|
b
|
static int grabThumbnail(QString inFile, QString thumbList, QString outFile, int |
1728 | 1728 | { |
1729 | 1729 | // work out what format to save to |
1730 | 1730 | QString saveFormat = "JPEG"; |
1731 | | if (outFile.right(4) == ".png") |
| 1731 | if (outFile.endsWith(".png")) |
1732 | 1732 | saveFormat = "PNG"; |
1733 | 1733 | |
1734 | 1734 | int count = 0; |
-
diff --git a/mythplugins/mythgame/mythgame/gamehandler.cpp b/mythplugins/mythgame/mythgame/gamehandler.cpp
index 54d873d..ef61987 100644
a
|
b
|
static void UpdateGameCounts(QStringList updatelist) |
337 | 337 | pos = (RomName.length() - extlength) - 1; |
338 | 338 | basename = RomName.left(pos); |
339 | 339 | |
340 | | if (basename.right(1) == ".") |
| 340 | if (basename.endsWith(".")) |
341 | 341 | basename = RomName.left(pos - 1); |
342 | 342 | } |
343 | 343 | else |
-
diff --git a/mythplugins/mythmusic/mythmusic/cddecoder.cpp b/mythplugins/mythmusic/mythmusic/cddecoder.cpp
index ac793b2..9e69977 100644
a
|
b
|
MusicMetadata *CdDecoder::getMetadata() |
767 | 767 | } |
768 | 768 | } |
769 | 769 | |
770 | | if (compilation_artist.toLower().left(7) == "various") |
| 770 | if (compilation_artist.startsWith("various", Qt::CaseInsensitive)) |
771 | 771 | compilation_artist = QObject::tr("Various Artists"); |
772 | 772 | |
773 | 773 | if (artist.isEmpty()) |
-
diff --git a/mythplugins/mythmusic/mythmusic/musicplayer.cpp b/mythplugins/mythmusic/mythmusic/musicplayer.cpp
index b2b075b..6f83ee6 100644
a
|
b
|
void MusicPlayer::customEvent(QEvent *event) |
576 | 576 | if (!me) |
577 | 577 | return; |
578 | 578 | |
579 | | if (me->Message().left(14) == "PLAYBACK_START") |
| 579 | if (me->Message().startsWith("PLAYBACK_START")) |
580 | 580 | { |
581 | 581 | m_wasPlaying = m_isPlaying; |
582 | 582 | QString hostname = me->Message().mid(15); |
… |
… |
void MusicPlayer::customEvent(QEvent *event) |
588 | 588 | stop(true); |
589 | 589 | } |
590 | 590 | } |
591 | | else if (me->Message().left(12) == "PLAYBACK_END") |
| 591 | else if (me->Message().startsWith("PLAYBACK_END")) |
592 | 592 | { |
593 | 593 | if (m_wasPlaying) |
594 | 594 | { |
… |
… |
void MusicPlayer::customEvent(QEvent *event) |
605 | 605 | m_wasPlaying = false; |
606 | 606 | } |
607 | 607 | } |
608 | | else if (me->Message().left(13) == "MUSIC_COMMAND") |
| 608 | else if (me->Message().startsWith("MUSIC_COMMAND")) |
609 | 609 | { |
610 | 610 | QStringList list = me->Message().simplified().split(' '); |
611 | 611 | |
-
diff --git a/mythplugins/mythmusic/mythmusic/shoutcast.cpp b/mythplugins/mythmusic/mythmusic/shoutcast.cpp
index 065e35c..11e1fd2 100644
a
|
b
|
class ShoutCastResponse |
186 | 186 | QString getGenre(void) { return getString("icy-genre"); } |
187 | 187 | QString getName(void) { return getString("icy-name"); } |
188 | 188 | int getStatus(void) { return getInt("status"); } |
189 | | bool isICY(void) { return QString(m_data["protocol"]).left(3) == "ICY"; } |
| 189 | bool isICY(void) { return QString(m_data["protocol"]).startsWith("ICY"); } |
190 | 190 | QString getContent(void) { return getString("content-type"); } |
191 | 191 | QString getLocation(void) { return getString("location"); } |
192 | 192 | |
… |
… |
int ShoutCastResponse::fillResponse(const char *s, int l) |
215 | 215 | break; |
216 | 216 | |
217 | 217 | // Extract the line |
218 | | QByteArray snip(d.data(), pos + 1); |
| 218 | QString snip(QByteArray(d.data(), pos + 1)); |
219 | 219 | d.remove(0, pos + 2); |
220 | 220 | result += pos + 2; |
221 | 221 | |
222 | | if (snip.left(4) == "ICY ") |
| 222 | if (snip.startsWith("ICY ")) |
223 | 223 | { |
224 | 224 | int space = snip.indexOf(' '); |
225 | 225 | m_data["protocol"] = "ICY"; |
… |
… |
int ShoutCastResponse::fillResponse(const char *s, int l) |
230 | 230 | else |
231 | 231 | m_data["status"] = tmp; |
232 | 232 | } |
233 | | else if (snip.left(7) == "HTTP/1.") |
| 233 | else if (snip.startsWith("HTTP/1.")) |
234 | 234 | { |
235 | 235 | int space = snip.indexOf(' '); |
236 | 236 | m_data["protocol"] = snip.left(space); |
… |
… |
int ShoutCastResponse::fillResponse(const char *s, int l) |
241 | 241 | else |
242 | 242 | m_data["status"] = tmp; |
243 | 243 | } |
244 | | else if (snip.left(9).toLower() == "location:") |
| 244 | else if (snip.startsWith("location:", Qt::CaseInsensitive)) |
245 | 245 | { |
246 | 246 | m_data["location"] = snip.mid(9).trimmed(); |
247 | 247 | } |
248 | | else if (snip.left(13).toLower() == "content-type:") |
| 248 | else if (snip.startsWith("content-type:", Qt::CaseInsensitive)) |
249 | 249 | { |
250 | 250 | m_data["content-type"] = snip.mid(13).trimmed(); |
251 | 251 | } |
252 | | else if (snip.left(4) == "icy-") |
| 252 | else if (snip.startsWith("icy-")) |
253 | 253 | { |
254 | 254 | int pos = snip.indexOf(':'); |
255 | 255 | QString key = snip.left(pos); |
-
diff --git a/mythplugins/mythmusic/mythmusic/smartplaylist.cpp b/mythplugins/mythmusic/mythmusic/smartplaylist.cpp
index 78b2cb0..e34a9d8 100644
a
|
b
|
QString getOrderBySQL(QString orderByFields) |
254 | 254 | Field = lookupField(fieldName.left(fieldName.length() - 4)); |
255 | 255 | if (Field) |
256 | 256 | { |
257 | | if (fieldName.right(3) == "(D)") |
| 257 | if (fieldName.endsWith("(D)")) |
258 | 258 | order = " DESC"; |
259 | 259 | else |
260 | 260 | order = " ASC"; |
… |
… |
void SmartPLOrderByDialog::orderByChanged(void) |
2030 | 2030 | m_deleteButton->SetEnabled(true); |
2031 | 2031 | m_moveUpButton->SetEnabled((m_fieldList->GetCurrentPos() != 0)); |
2032 | 2032 | m_moveDownButton->SetEnabled((m_fieldList->GetCurrentPos() != m_fieldList->GetCount() - 1) ); |
2033 | | m_ascendingButton->SetEnabled((m_fieldList->GetValue().right(3) == "(D)") ); |
2034 | | m_descendingButton->SetEnabled((m_fieldList->GetValue().right(3) == "(A)")); |
| 2033 | m_ascendingButton->SetEnabled((m_fieldList->GetValue().endsWith("(D)")) ); |
| 2034 | m_descendingButton->SetEnabled((m_fieldList->GetValue().endsWith("(A)"))); |
2035 | 2035 | } |
2036 | 2036 | else |
2037 | 2037 | { |
-
diff --git a/mythplugins/mythzoneminder/mythzoneminder/zmconsole.cpp b/mythplugins/mythzoneminder/mythzoneminder/zmconsole.cpp
index 6a0cf01..ac01fec 100644
a
|
b
|
void ZMConsole::getDaemonStatus(void) |
206 | 206 | { |
207 | 207 | zm->getServerStatus(m_daemonStatus, m_cpuStat, m_diskStat); |
208 | 208 | |
209 | | if (m_daemonStatus.left(7) == "running") |
| 209 | if (m_daemonStatus.startsWith("running")) |
210 | 210 | { |
211 | 211 | m_status_text->SetFontState("running"); |
212 | 212 | m_status_text->SetText(tr("Running")); |
-
diff --git a/mythtv/libs/libmyth/programinfo.cpp b/mythtv/libs/libmyth/programinfo.cpp
index 968a85c..36803b7 100644
a
|
b
|
ProgramInfo::ProgramInfo(const QString &_pathname, |
866 | 866 | |
867 | 867 | QString pn = _pathname; |
868 | 868 | if ((!_pathname.startsWith("myth://")) && |
869 | | (_pathname.right(4).toLower() == ".iso" || |
870 | | _pathname.right(4).toLower() == ".img" || |
| 869 | (_pathname.endsWith(".iso", Qt::CaseInsensitive) || |
| 870 | _pathname.endsWith(".img", Qt::CaseInsensitive) || |
871 | 871 | QDir(_pathname + "/VIDEO_TS").exists())) |
872 | 872 | { |
873 | 873 | pn = QString("dvd:%1").arg(_pathname); |
… |
… |
void ProgramInfo::ToMap(InfoMap &progMap, |
1676 | 1676 | progMap["yearstars"] = ""; |
1677 | 1677 | |
1678 | 1678 | if (!originalAirDate.isValid() || |
1679 | | (!programid.isEmpty() && (programid.left(2) == "MV"))) |
| 1679 | (!programid.isEmpty() && programid.startsWith("MV"))) |
1680 | 1680 | { |
1681 | 1681 | progMap["originalairdate"] = ""; |
1682 | 1682 | progMap["shortoriginalairdate"] = ""; |
… |
… |
static ProgramInfoType discover_program_info_type( |
2176 | 2176 | if (fn_lower.startsWith("dvd:") || |
2177 | 2177 | fn_lower.endsWith(".iso") || |
2178 | 2178 | fn_lower.endsWith(".img") || |
2179 | | ((pathname.left(1) == "/") && |
| 2179 | ((pathname.startsWith("/")) && |
2180 | 2180 | QDir(pathname + "/VIDEO_TS").exists())) |
2181 | 2181 | { |
2182 | 2182 | pit = kProgramInfoTypeVideoDVD; |
2183 | 2183 | } |
2184 | 2184 | else if (fn_lower.startsWith("bd:") || |
2185 | | ((pathname.left(1) == "/") && |
| 2185 | ((pathname.startsWith("/")) && |
2186 | 2186 | QDir(pathname + "/BDMV").exists())) |
2187 | 2187 | { |
2188 | 2188 | pit = kProgramInfoTypeVideoBD; |
… |
… |
QString ProgramInfo::DiscoverRecordingDirectory(void) const |
4107 | 4107 | return ""; |
4108 | 4108 | |
4109 | 4109 | QString path = GetPlaybackURL(false, true); |
4110 | | if (path.left(1) == "/") |
| 4110 | if (path.startsWith("/")) |
4111 | 4111 | { |
4112 | 4112 | QFileInfo testFile(path); |
4113 | 4113 | return testFile.path(); |
… |
… |
QString ProgramInfo::i18n(const QString &msg) |
4508 | 4508 | void ProgramInfo::SubstituteMatches(QString &str) |
4509 | 4509 | { |
4510 | 4510 | QString pburl = GetPlaybackURL(false, true); |
4511 | | if (pburl.left(7) == "myth://") |
| 4511 | if (pburl.startsWith("myth://")) |
4512 | 4512 | { |
4513 | 4513 | str.replace(QString("%DIR%"), pburl); |
4514 | 4514 | } |
-
diff --git a/mythtv/libs/libmyth/programinfo.h b/mythtv/libs/libmyth/programinfo.h
index 6e8e263..5402aad 100644
a
|
b
|
class MPUBLIC ProgramInfo |
320 | 320 | { return GetProgramInfoType() == kProgramInfoTypeVideoDVD; } |
321 | 321 | bool IsVideoBD(void) const |
322 | 322 | { return GetProgramInfoType() == kProgramInfoTypeVideoBD; } |
323 | | bool IsLocal(void) const { return pathname.left(1) == "/" |
| 323 | bool IsLocal(void) const { return pathname.startsWith("/") |
324 | 324 | #ifdef _WIN32 |
325 | 325 | || pathname.at(1) == ':' |
326 | 326 | #endif |
327 | 327 | ; } |
328 | | bool IsMythStream(void) const { return pathname.left(7) == "myth://"; } |
| 328 | bool IsMythStream(void) const { return pathname.startsWith("myth://"); } |
329 | 329 | bool IsPathSet(void) const { return GetBasename() != pathname; } |
330 | 330 | bool HasPathname(void) const { return !GetPathname().isEmpty(); } |
331 | 331 | bool IsFileReadable(void) const; |
-
diff --git a/mythtv/libs/libmyth/schemawizard.cpp b/mythtv/libs/libmyth/schemawizard.cpp
index 13f30fb..8b6870d 100644
a
|
b
|
SchemaUpgradeWizard::PromptForUpgrade(const char *name, |
425 | 425 | if (m_expertMode) |
426 | 426 | { |
427 | 427 | resp = getResponse("Would you like to use the existing schema?", "yes"); |
428 | | if (resp.isEmpty() || resp.left(1).toLower() == "y") |
| 428 | if (resp.isEmpty() || resp.startsWith("y", Qt::CaseInsensitive)) |
429 | 429 | return MYTH_SCHEMA_USE_EXISTING; |
430 | 430 | } |
431 | 431 | |
432 | 432 | resp = getResponse("\nShall I upgrade this database?", "yes"); |
433 | | if (!resp.isEmpty() && resp.left(1).toLower() != "y") |
| 433 | if (!resp.isEmpty() && !resp.startsWith("y", Qt::CaseInsensitive)) |
434 | 434 | return MYTH_SCHEMA_EXIT; |
435 | 435 | |
436 | 436 | if (connections) |
… |
… |
SchemaUpgradeWizard::PromptForUpgrade(const char *name, |
441 | 441 | { |
442 | 442 | resp = getResponse("\nA database backup might be a good idea" |
443 | 443 | "\nAre you sure you want to upgrade?", "no"); |
444 | | if (resp.isEmpty() || resp.left(1).toLower() == "n") |
| 444 | if (resp.isEmpty() || resp.startsWith("n", Qt::CaseInsensitive)) |
445 | 445 | return MYTH_SCHEMA_EXIT; |
446 | 446 | } |
447 | 447 | |
-
diff --git a/mythtv/libs/libmyth/settings.h b/mythtv/libs/libmyth/settings.h
index c3ad34c..04bf691 100644
a
|
b
|
class MPUBLIC BooleanSetting : public Setting |
441 | 441 | virtual void setValue(const QString &newValue) |
442 | 442 | { |
443 | 443 | setValue((newValue=="1" || |
444 | | newValue.toLower().left(1)=="y" || |
445 | | newValue.toLower().left(1)=="t")); |
| 444 | newValue.toLower().startsWith("y") || |
| 445 | newValue.toLower().startsWith("t"))); |
446 | 446 | } |
447 | 447 | |
448 | 448 | signals: |
-
diff --git a/mythtv/libs/libmyth/storagegroupeditor.cpp b/mythtv/libs/libmyth/storagegroupeditor.cpp
index fd5afc3..6ab6d99 100644
a
|
b
|
void StorageGroupEditor::open(QString name) |
96 | 96 | if (name.isEmpty()) |
97 | 97 | return; |
98 | 98 | |
99 | | if (name.right(1) != "/") |
| 99 | if (!name.endsWith("/")) |
100 | 100 | name.append("/"); |
101 | 101 | |
102 | 102 | MSqlQuery query(MSqlQuery::InitCon()); |
… |
… |
void StorageGroupEditor::open(QString name) |
118 | 118 | if (result == SGPopup_CANCEL) |
119 | 119 | return; |
120 | 120 | |
121 | | if (name.right(1) != "/") |
| 121 | if (!name.endsWith("/")) |
122 | 122 | name.append("/"); |
123 | 123 | |
124 | 124 | MSqlQuery query(MSqlQuery::InitCon()); |
… |
… |
void StorageGroupListEditor::open(QString name) |
257 | 257 | { |
258 | 258 | lastValue = name; |
259 | 259 | |
260 | | if (name.left(28) == "__CREATE_NEW_STORAGE_GROUP__") |
| 260 | if (name.startsWith("__CREATE_NEW_STORAGE_GROUP__")) |
261 | 261 | { |
262 | 262 | if (name.length() > 28) |
263 | 263 | { |
… |
… |
void StorageGroupListEditor::open(QString name) |
286 | 286 | void StorageGroupListEditor::doDelete(void) |
287 | 287 | { |
288 | 288 | QString name = listbox->getValue(); |
289 | | if (name.left(28) == "__CREATE_NEW_STORAGE_GROUP__") |
| 289 | if (name.startsWith("__CREATE_NEW_STORAGE_GROUP__")) |
290 | 290 | return; |
291 | 291 | |
292 | 292 | bool is_master_host = gCoreContext->IsMasterHost(); |
-
diff --git a/mythtv/libs/libmythbase/logging.cpp b/mythtv/libs/libmythbase/logging.cpp
index de06e4e..6435e5a 100644
a
|
b
|
int verboseArgParse(QString arg) |
1120 | 1120 | option = (*it).toLower(); |
1121 | 1121 | bool reverseOption = false; |
1122 | 1122 | |
1123 | | if (option != "none" && option.left(2) == "no") |
| 1123 | if (option != "none" && option.startsWith("no")) |
1124 | 1124 | { |
1125 | 1125 | reverseOption = true; |
1126 | 1126 | option = option.right(option.length() - 2); |
-
diff --git a/mythtv/libs/libmythbase/mythmiscutil.cpp b/mythtv/libs/libmythbase/mythmiscutil.cpp
index 7477afb..ff8330a 100644
a
|
b
|
void wrapList(QStringList &list, int width) |
959 | 959 | QString left = string.left(width); |
960 | 960 | bool inserted = false; |
961 | 961 | |
962 | | while( !inserted && left.right(1) != " " ) |
| 962 | while( !inserted && !left.endsWith(" " )) |
963 | 963 | { |
964 | 964 | if( string.mid(left.size(), 1) == " " ) |
965 | 965 | { |
-
diff --git a/mythtv/libs/libmythbase/plist.cpp b/mythtv/libs/libmythbase/plist.cpp
index 5cc2c7d..7429f21 100644
a
|
b
|
void PList::ParseBinaryPList(const QByteArray &data) |
233 | 233 | .arg(size).arg(data.left(8).data())); |
234 | 234 | |
235 | 235 | // check plist type & version |
236 | | if ((data.left(6) != MAGIC) || |
| 236 | if ((!data.startsWith(MAGIC)) || |
237 | 237 | (data.mid(MAGIC_SIZE, VERSION_SIZE) != VERSION)) |
238 | 238 | { |
239 | 239 | LOG(VB_GENERAL, LOG_ERR, LOC + "Unrecognised start sequence. Corrupt?"); |
-
diff --git a/mythtv/libs/libmythbase/remotefile.cpp b/mythtv/libs/libmythbase/remotefile.cpp
index 678d546..fa30039 100644
a
|
b
|
bool RemoteFile::DeleteFile(const QString &url) |
268 | 268 | QString filename = qurl.path(); |
269 | 269 | QString sgroup = qurl.userName(); |
270 | 270 | |
271 | | if (!qurl.fragment().isEmpty() || url.right(1) == "#") |
| 271 | if (!qurl.fragment().isEmpty() || url.endsWith("#")) |
272 | 272 | filename = filename + "#" + qurl.fragment(); |
273 | 273 | |
274 | | if (filename.left(1) == "/") |
| 274 | if (filename.startsWith("/")) |
275 | 275 | filename = filename.right(filename.length()-1); |
276 | 276 | |
277 | 277 | if (filename.isEmpty() || sgroup.isEmpty()) |
… |
… |
bool RemoteFile::Exists(const QString &url, struct stat *fileinfo) |
301 | 301 | QString filename = qurl.path(); |
302 | 302 | QString sgroup = qurl.userName(); |
303 | 303 | |
304 | | if (!qurl.fragment().isEmpty() || url.right(1) == "#") |
| 304 | if (!qurl.fragment().isEmpty() || url.endsWith("#")) |
305 | 305 | filename = filename + "#" + qurl.fragment(); |
306 | 306 | |
307 | | if (filename.left(1) == "/") |
| 307 | if (filename.startsWith("/")) |
308 | 308 | filename = filename.right(filename.length()-1); |
309 | 309 | |
310 | 310 | if (filename.isEmpty()) |
… |
… |
QString RemoteFile::GetFileHash(const QString &url) |
356 | 356 | QString hostname = qurl.host(); |
357 | 357 | QString sgroup = qurl.userName(); |
358 | 358 | |
359 | | if (!qurl.fragment().isEmpty() || url.right(1) == "#") |
| 359 | if (!qurl.fragment().isEmpty() || url.endsWith("#")) |
360 | 360 | filename = filename + "#" + qurl.fragment(); |
361 | 361 | |
362 | | if (filename.left(1) == "/") |
| 362 | if (filename.startsWith("/")) |
363 | 363 | filename = filename.right(filename.length()-1); |
364 | 364 | |
365 | 365 | if (filename.isEmpty() || sgroup.isEmpty()) |
… |
… |
QDateTime RemoteFile::LastModified(const QString &url) |
651 | 651 | QString filename = qurl.path(); |
652 | 652 | QString sgroup = qurl.userName(); |
653 | 653 | |
654 | | if (!qurl.fragment().isEmpty() || url.right(1) == "#") |
| 654 | if (!qurl.fragment().isEmpty() || url.endsWith("#")) |
655 | 655 | filename = filename + "#" + qurl.fragment(); |
656 | 656 | |
657 | | if (filename.left(1) == "/") |
| 657 | if (filename.startsWith("/")) |
658 | 658 | filename = filename.right(filename.length()-1); |
659 | 659 | |
660 | 660 | if (filename.isEmpty() || sgroup.isEmpty()) |
-
diff --git a/mythtv/libs/libmythbase/storagegroup.cpp b/mythtv/libs/libmythbase/storagegroup.cpp
index 6682136..1729626 100644
a
|
b
|
bool StorageGroup::FindDirs(const QString group, const QString hostname, |
549 | 549 | .toByteArray().constData()); |
550 | 550 | dirname.replace(QRegExp("^\\s*"), ""); |
551 | 551 | dirname.replace(QRegExp("\\s*$"), ""); |
552 | | if (dirname.right(1) == "/") |
| 552 | if (dirname.endsWith("/")) |
553 | 553 | dirname.remove(dirname.length() - 1, 1); |
554 | 554 | |
555 | 555 | if (dirlist) |
-
diff --git a/mythtv/libs/libmythprotoserver/requesthandler/fileserverhandler.cpp b/mythtv/libs/libmythprotoserver/requesthandler/fileserverhandler.cpp
index ddaf837..b8ae482 100644
a
|
b
|
QString FileServerHandler::LocalFilePath(const QUrl &url, |
90 | 90 | lpath = lpath.section('/', -1); |
91 | 91 | |
92 | 92 | QString fpath = lpath; |
93 | | if (fpath.right(4) == ".png") |
| 93 | if (fpath.endsWith(".png")) |
94 | 94 | fpath = fpath.left(fpath.length() - 4); |
95 | 95 | |
96 | 96 | ProgramInfo pginfo(fpath); |
97 | 97 | if (pginfo.GetChanID()) |
98 | 98 | { |
99 | 99 | QString pburl = GetPlaybackURL(&pginfo); |
100 | | if (pburl.left(1) == "/") |
| 100 | if (pburl.startsWith("/")) |
101 | 101 | { |
102 | 102 | lpath = pburl.section('/', 0, -2) + "/" + lpath; |
103 | 103 | LOG(VB_FILE, LOG_INFO, |
… |
… |
QList<FileSystemInfo> FileServerHandler::QueryFileSystems(void) |
517 | 517 | .toByteArray().constData()); |
518 | 518 | disk.setPath(currentDir); |
519 | 519 | |
520 | | if (currentDir.right(1) == "/") |
| 520 | if (currentDir.endsWith("/")) |
521 | 521 | currentDir.remove(currentDir.length() - 1, 1); |
522 | 522 | |
523 | 523 | checkDir.setPath(currentDir); |
-
diff --git a/mythtv/libs/libmythprotoserver/requesthandler/fileserverutil.cpp b/mythtv/libs/libmythprotoserver/requesthandler/fileserverutil.cpp
index 6d5f98a..3e990f0 100644
a
|
b
|
QString GetPlaybackURL(ProgramInfo *pginfo, bool storePath) |
58 | 58 | else |
59 | 59 | { |
60 | 60 | result = pginfo->GetPlaybackURL(false, true); |
61 | | if (storePath && result.left(1) == "/") |
| 61 | if (storePath && result.startsWith("/")) |
62 | 62 | recordingPathCache[cacheKey] = result; |
63 | 63 | } |
64 | 64 | |
-
diff --git a/mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp b/mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp
index 2932cd8..c1202ed 100644
a
|
b
|
DVDInfo::DVDInfo(const QString &filename) |
38 | 38 | { |
39 | 39 | LOG(VB_PLAYBACK, LOG_INFO, QString("DVDInfo: Trying %1").arg(filename)); |
40 | 40 | QString name = filename; |
41 | | if (name.left(6) == "dvd://") |
| 41 | if (name.startsWith("dvd://")) |
42 | 42 | name.remove(0,5); |
43 | | else if (name.left(5) == "dvd:/") |
| 43 | else if (name.startsWith("dvd:/")) |
44 | 44 | name.remove(0,4); |
45 | | else if (name.left(4) == "dvd:") |
| 45 | else if (name.startsWith("dvd:")) |
46 | 46 | name.remove(0,4); |
47 | 47 | |
48 | 48 | QByteArray fname = name.toLocal8Bit(); |
-
diff --git a/mythtv/libs/libmythtv/cc608decoder.cpp b/mythtv/libs/libmythtv/cc608decoder.cpp
index 3e3b449..a38ed79 100644
a
|
b
|
void CC608Decoder::FormatCCField(int tc, int field, int data) |
376 | 376 | len = NewRowCC(mode, len); |
377 | 377 | |
378 | 378 | if (len == 0 || |
379 | | ccbuf[mode].left(1) == "\b") |
| 379 | ccbuf[mode].startsWith("\b")) |
380 | 380 | { |
381 | 381 | ccbuf[mode] += (char)'\b'; |
382 | 382 | len++; |
… |
… |
QString CC608Decoder::GetXDS(const QString &key) const |
1122 | 1122 | |
1123 | 1123 | if (key == "ratings") |
1124 | 1124 | return QString::number(GetRatingSystems(false)); |
1125 | | else if (key.left(11) == "has_rating_") |
| 1125 | else if (key.startsWith("has_rating_")) |
1126 | 1126 | return ((1<<key.right(1).toUInt()) & GetRatingSystems(false))?"1":"0"; |
1127 | | else if (key.left(7) == "rating_") |
| 1127 | else if (key.startsWith("rating_")) |
1128 | 1128 | return GetRatingString(key.right(1).toUInt(), false); |
1129 | 1129 | |
1130 | 1130 | else if (key == "future_ratings") |
1131 | 1131 | return QString::number(GetRatingSystems(true)); |
1132 | | else if (key.left(11) == "has_future_rating_") |
| 1132 | else if (key.startsWith("has_future_rating_")) |
1133 | 1133 | return ((1<<key.right(1).toUInt()) & GetRatingSystems(true))?"1":"0"; |
1134 | | else if (key.left(14) == "future_rating_") |
| 1134 | else if (key.startsWith("future_rating_")) |
1135 | 1135 | return GetRatingString(key.right(1).toUInt(), true); |
1136 | 1136 | |
1137 | 1137 | else if (key == "programname") |
-
diff --git a/mythtv/libs/libmythtv/channelscan/channelscanner.cpp b/mythtv/libs/libmythtv/channelscan/channelscanner.cpp
index 3986991..3d03200 100644
a
|
b
|
void ChannelScanner::Scan( |
140 | 140 | |
141 | 141 | // HACK HACK HACK -- begin |
142 | 142 | // if using QAM we may need additional time... (at least with HD-3000) |
143 | | if ((mod.left(3).toLower() == "qam") && |
| 143 | if ((mod.startsWith("qam", Qt::CaseInsensitive)) && |
144 | 144 | (sigmonScanner->GetSignalTimeout() < 1000)) |
145 | 145 | { |
146 | 146 | sigmonScanner->SetSignalTimeout(1000); |
-
diff --git a/mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.cpp b/mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.cpp
index a5a82fd..9e6281c 100644
a
|
b
|
void IPTVChannelFetcher::SetMessage(const QString &status) |
210 | 210 | QString IPTVChannelFetcher::DownloadPlaylist(const QString &url, |
211 | 211 | bool inQtThread) |
212 | 212 | { |
213 | | if (url.left(4).toLower() == "file") |
| 213 | if (url.startsWith("file", Qt::CaseInsensitive)) |
214 | 214 | { |
215 | 215 | QString ret = ""; |
216 | 216 | QUrl qurl(url); |
-
diff --git a/mythtv/libs/libmythtv/decoderbase.cpp b/mythtv/libs/libmythtv/decoderbase.cpp
index 2f1933d..f181d2f 100644
a
|
b
|
int to_track_type(const QString &str) |
1145 | 1145 | { |
1146 | 1146 | int ret = -1; |
1147 | 1147 | |
1148 | | if (str.left(5) == "AUDIO") |
| 1148 | if (str.startsWith("AUDIO")) |
1149 | 1149 | ret = kTrackTypeAudio; |
1150 | | else if (str.left(5) == "VIDEO") |
| 1150 | else if (str.startsWith("VIDEO")) |
1151 | 1151 | ret = kTrackTypeVideo; |
1152 | | else if (str.left(8) == "SUBTITLE") |
| 1152 | else if (str.startsWith("SUBTITLE")) |
1153 | 1153 | ret = kTrackTypeSubtitle; |
1154 | | else if (str.left(5) == "CC608") |
| 1154 | else if (str.startsWith("CC608")) |
1155 | 1155 | ret = kTrackTypeCC608; |
1156 | | else if (str.left(5) == "CC708") |
| 1156 | else if (str.startsWith("CC708")) |
1157 | 1157 | ret = kTrackTypeCC708; |
1158 | | else if (str.left(3) == "TTC") |
| 1158 | else if (str.startsWith("TTC")) |
1159 | 1159 | ret = kTrackTypeTeletextCaptions; |
1160 | | else if (str.left(3) == "TTM") |
| 1160 | else if (str.startsWith("TTM")) |
1161 | 1161 | ret = kTrackTypeTeletextMenu; |
1162 | | else if (str.left(3) == "TFL") |
| 1162 | else if (str.startsWith("TFL")) |
1163 | 1163 | ret = kTrackTypeTextSubtitle; |
1164 | | else if (str.left(7) == "RAWTEXT") |
| 1164 | else if (str.startsWith("RAWTEXT")) |
1165 | 1165 | ret = kTrackTypeRawText; |
1166 | 1166 | return ret; |
1167 | 1167 | } |
-
diff --git a/mythtv/libs/libmythtv/fileringbuffer.cpp b/mythtv/libs/libmythtv/fileringbuffer.cpp
index 6f51aa1..65e15c1 100644
a
|
b
|
bool FileRingBuffer::OpenFile(const QString &lfilename, uint retry_ms) |
200 | 200 | } |
201 | 201 | |
202 | 202 | bool is_local = |
203 | | (filename.left(4) != "/dev") && |
204 | | ((filename.left(1) == "/") || QFile::exists(filename)); |
| 203 | (!filename.startsWith("/dev")) && |
| 204 | ((filename.startsWith("/")) || QFile::exists(filename)); |
205 | 205 | |
206 | 206 | if (is_local) |
207 | 207 | { |
-
diff --git a/mythtv/libs/libmythtv/jobqueue.cpp b/mythtv/libs/libmythtv/jobqueue.cpp
index bfa39ac..b29aa09 100644
a
|
b
|
void JobQueue::customEvent(QEvent *e) |
91 | 91 | MythEvent *me = (MythEvent *)e; |
92 | 92 | QString message = me->Message(); |
93 | 93 | |
94 | | if (message.left(9) == "LOCAL_JOB") |
| 94 | if (message.startsWith("LOCAL_JOB")) |
95 | 95 | { |
96 | 96 | // LOCAL_JOB action ID jobID |
97 | 97 | // LOCAL_JOB action type chanid recstartts hostname |
-
diff --git a/mythtv/libs/libmythtv/mythplayer.cpp b/mythtv/libs/libmythtv/mythplayer.cpp
index 7b2b2b0..febd635 100644
a
|
b
|
void MythPlayer::InitFilters(void) |
1046 | 1046 | } |
1047 | 1047 | else |
1048 | 1048 | { |
1049 | | if ((filters.length() > 1) && (filters.right(1) != ",")) |
| 1049 | if ((filters.length() > 1) && (!filters.endsWith(","))) |
1050 | 1050 | filters += ","; |
1051 | 1051 | filters += videoFiltersForProgram.mid(1); |
1052 | 1052 | } |
-
diff --git a/mythtv/libs/libmythtv/playercontext.cpp b/mythtv/libs/libmythtv/playercontext.cpp
index 2f9f664..aff3aea 100644
a
|
b
|
QString PlayerContext::GetFilters(const QString &baseFilters) const |
747 | 747 | } |
748 | 748 | else |
749 | 749 | { |
750 | | if (!filters.isEmpty() && (filters.right(1) != ",")) |
| 750 | if (!filters.isEmpty() && (!filters.endsWith(","))) |
751 | 751 | filters += ","; |
752 | 752 | |
753 | 753 | filters += chanFilters.mid(1); |
-
diff --git a/mythtv/libs/libmythtv/previewgenerator.cpp b/mythtv/libs/libmythtv/previewgenerator.cpp
index a5f002c..67b62b8 100644
a
|
b
|
bool PreviewGenerator::IsLocal(void) const |
722 | 722 | { |
723 | 723 | QString tmppathname = pathname; |
724 | 724 | |
725 | | if (tmppathname.left(4) == "dvd:") |
| 725 | if (tmppathname.startsWith("dvd:")) |
726 | 726 | tmppathname = tmppathname.section(":", 1, 1); |
727 | 727 | |
728 | 728 | if (!QFileInfo(tmppathname).isReadable()) |
… |
… |
char *PreviewGenerator::GetScreenGrab( |
779 | 779 | } |
780 | 780 | |
781 | 781 | // pre-test local files for existence and size. 500 ms speed-up... |
782 | | if (filename.left(1)=="/") |
| 782 | if (filename.startsWith("/")) |
783 | 783 | { |
784 | 784 | QFileInfo info(filename); |
785 | 785 | bool invalid = (!info.exists() || !info.isReadable() || |
-
diff --git a/mythtv/libs/libmythtv/previewgeneratorqueue.cpp b/mythtv/libs/libmythtv/previewgeneratorqueue.cpp
index 2272b17..0f11a22 100644
a
|
b
|
QString PreviewGeneratorQueue::GeneratePreviewImage( |
273 | 273 | if (!is_special) |
274 | 274 | { |
275 | 275 | QDateTime previewLastModified; |
276 | | bool streaming = filename.left(1) != "/"; |
| 276 | bool streaming = !filename.startsWith("/"); |
277 | 277 | bool locally_accessible = false; |
278 | 278 | bool bookmark_updated = false; |
279 | 279 | |
-
diff --git a/mythtv/libs/libmythtv/recorders/channelbase.cpp b/mythtv/libs/libmythtv/recorders/channelbase.cpp
index 35544fc..eeaddf1 100644
a
|
b
|
ChannelBase *ChannelBase::CreateChannel( |
1173 | 1173 | else if ((genOpt.cardtype == "IMPORT") || |
1174 | 1174 | (genOpt.cardtype == "DEMO") || |
1175 | 1175 | (genOpt.cardtype == "MPEG" && |
1176 | | genOpt.videodev.toLower().left(5) == "file:")) |
| 1176 | genOpt.videodev.toLower().startsWith("file:"))) |
1177 | 1177 | { |
1178 | 1178 | channel = new DummyChannel(tvrec); |
1179 | 1179 | } |
-
diff --git a/mythtv/libs/libmythtv/recorders/firewiredevice.cpp b/mythtv/libs/libmythtv/recorders/firewiredevice.cpp
index c9f5f34..c735f21 100644
a
|
b
|
bool FirewireDevice::SetChannel(const QString &panel_model, |
230 | 230 | |
231 | 231 | // the PACE is obviously not a Motorola channel changer, but the |
232 | 232 | // same commands work for it as the Motorola. |
233 | | bool is_mot = ((panel_model.toUpper().left(4) == "DCT-") || |
234 | | (panel_model.toUpper().left(4) == "DCH-") || |
235 | | (panel_model.toUpper().left(4) == "DCX-") || |
236 | | (panel_model.toUpper().left(4) == "QIP-") || |
237 | | (panel_model.toUpper().left(4) == "MOTO") || |
238 | | (panel_model.toUpper().left(5) == "PACE-")); |
| 233 | bool is_mot = ((panel_model.toUpper().startsWith("DCT-")) || |
| 234 | (panel_model.toUpper().startsWith("DCH-")) || |
| 235 | (panel_model.toUpper().startsWith("DCX-")) || |
| 236 | (panel_model.toUpper().startsWith("QIP-")) || |
| 237 | (panel_model.toUpper().startsWith("MOTO")) || |
| 238 | (panel_model.toUpper().startsWith("PACE-"))); |
239 | 239 | |
240 | 240 | if (is_mot && !alt_method) |
241 | 241 | { |
-
diff --git a/mythtv/libs/libmythtv/recorders/mpegrecorder.cpp b/mythtv/libs/libmythtv/recorders/mpegrecorder.cpp
index 8a5ff14..46d8e3a 100644
a
|
b
|
void MpegRecorder::SetOption(const QString &opt, int value) |
185 | 185 | } |
186 | 186 | else if (opt == "mpeg2audvolume") |
187 | 187 | audvolume = value; |
188 | | else if (opt.right(16) == "_mpeg4avgbitrate") |
| 188 | else if (opt.endsWith("_mpeg4avgbitrate")) |
189 | 189 | { |
190 | | if (opt.left(3) == "low") |
| 190 | if (opt.startsWith("low")) |
191 | 191 | low_mpeg4avgbitrate = value; |
192 | | else if (opt.left(6) == "medium") |
| 192 | else if (opt.startsWith("medium")) |
193 | 193 | medium_mpeg4avgbitrate = value; |
194 | | else if (opt.left(4) == "high") |
| 194 | else if (opt.startsWith("high")) |
195 | 195 | high_mpeg4avgbitrate = value; |
196 | 196 | else |
197 | 197 | V4LRecorder::SetOption(opt, value); |
198 | 198 | } |
199 | | else if (opt.right(17) == "_mpeg4peakbitrate") |
| 199 | else if (opt.endsWith("_mpeg4peakbitrate")) |
200 | 200 | { |
201 | | if (opt.left(3) == "low") |
| 201 | if (opt.startsWith("low")) |
202 | 202 | low_mpeg4peakbitrate = value; |
203 | | else if (opt.left(6) == "medium") |
| 203 | else if (opt.startsWith("medium")) |
204 | 204 | medium_mpeg4peakbitrate = value; |
205 | | else if (opt.left(4) == "high") |
| 205 | else if (opt.startsWith("high")) |
206 | 206 | high_mpeg4peakbitrate = value; |
207 | 207 | else |
208 | 208 | V4LRecorder::SetOption(opt, value); |
… |
… |
void MpegRecorder::SetOptionsFromProfile(RecordingProfile *profile, |
296 | 296 | (void)audiodev; |
297 | 297 | (void)vbidev; |
298 | 298 | |
299 | | if (videodev.toLower().left(5) == "file:") |
| 299 | if (videodev.toLower().startsWith("file:")) |
300 | 300 | { |
301 | 301 | deviceIsMpegFile = true; |
302 | 302 | bufferSize = 64000; |
… |
… |
bool MpegRecorder::SetV4L2DeviceOptions(int chanfd) |
755 | 755 | // Set controls |
756 | 756 | if (driver != "hdpvr") |
757 | 757 | { |
758 | | if (driver.left(7) != "saa7164") |
| 758 | if (!driver.startsWith("saa7164")) |
759 | 759 | { |
760 | 760 | add_ext_ctrl(ext_ctrls, V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ, |
761 | 761 | GetFilteredAudioSampleRate()); |
… |
… |
bool MpegRecorder::SetV4L2DeviceOptions(int chanfd) |
783 | 783 | } |
784 | 784 | maxbitrate = std::max(maxbitrate, bitrate); |
785 | 785 | |
786 | | if (driver == "hdpvr" || driver.left(7) == "saa7164") |
| 786 | if (driver == "hdpvr" || driver.startsWith("saa7164")) |
787 | 787 | { |
788 | 788 | add_ext_ctrl(ext_ctrls, V4L2_CID_MPEG_VIDEO_BITRATE_MODE, |
789 | 789 | (maxbitrate == bitrate) ? |
-
diff --git a/mythtv/libs/libmythtv/recorders/v4lchannel.cpp b/mythtv/libs/libmythtv/recorders/v4lchannel.cpp
index c325e23..1ef7059 100644
a
|
b
|
static int format_to_mode(const QString &fmt) |
158 | 158 | else if (fmt == "NTSC-JP") |
159 | 159 | return V4L2_STD_NTSC_M_JP; |
160 | 160 | // generics... |
161 | | else if (fmt.left(4) == "NTSC") |
| 161 | else if (fmt.startsWith("NTSC")) |
162 | 162 | return V4L2_STD_NTSC; |
163 | | else if (fmt.left(4) == "ATSC") |
| 163 | else if (fmt.startsWith("ATSC")) |
164 | 164 | return V4L2_STD_NTSC; // We've dropped V4L ATSC support... |
165 | | else if (fmt.left(3) == "PAL") |
| 165 | else if (fmt.startsWith("PAL")) |
166 | 166 | return V4L2_STD_PAL; |
167 | 167 | return V4L2_STD_NTSC; |
168 | 168 | } |
-
diff --git a/mythtv/libs/libmythtv/recordingprofile.cpp b/mythtv/libs/libmythtv/recordingprofile.cpp
index e8060a4..71ed05a 100644
a
|
b
|
class ImageSize : public VerticalConfigurationGroup |
1114 | 1114 | setLabel(labelName); |
1115 | 1115 | |
1116 | 1116 | QSize defaultsize(768, 576), maxsize(768, 576); |
1117 | | bool transcoding = profName.left(11) == "Transcoders"; |
1118 | | bool ivtv = profName.left(20) == "IVTV MPEG-2 Encoders"; |
| 1117 | bool transcoding = profName.startsWith("Transcoders"); |
| 1118 | bool ivtv = profName.startsWith("IVTV MPEG-2 Encoders"); |
1119 | 1119 | |
1120 | 1120 | if (transcoding) |
1121 | 1121 | { |
… |
… |
class ImageSize : public VerticalConfigurationGroup |
1125 | 1125 | else |
1126 | 1126 | defaultsize = QSize(480, 576); |
1127 | 1127 | } |
1128 | | else if (tvFormat.toLower().left(4) == "ntsc") |
| 1128 | else if (tvFormat.toLower().startsWith("ntsc")) |
1129 | 1129 | { |
1130 | 1130 | maxsize = QSize(720, 480); |
1131 | 1131 | defaultsize = (ivtv) ? QSize(720, 480) : QSize(480, 480); |
… |
… |
RecordingProfile::RecordingProfile(QString profName) |
1211 | 1211 | |
1212 | 1212 | if (!profName.isEmpty()) |
1213 | 1213 | { |
1214 | | if (profName.left(11) == "Transcoders") |
| 1214 | if (profName.startsWith("Transcoders")) |
1215 | 1215 | { |
1216 | 1216 | tr_filters = new TranscodeFilters(*this); |
1217 | 1217 | tr_lossless = new TranscodeLossless(*this); |
… |
… |
void RecordingProfile::CompleteLoad(int profileId, const QString &type, |
1401 | 1401 | audioSettings = new AudioCompressionSettings(*this, profileName); |
1402 | 1402 | addChild(audioSettings); |
1403 | 1403 | |
1404 | | if (!profileName.isEmpty() && profileName.left(11) == "Transcoders") |
| 1404 | if (!profileName.isEmpty() && profileName.startsWith("Transcoders")) |
1405 | 1405 | { |
1406 | 1406 | connect(tr_resize, SIGNAL(valueChanged (bool)), |
1407 | 1407 | this, SLOT( ResizeTranscode(bool))); |
-
diff --git a/mythtv/libs/libmythtv/ringbuffer.cpp b/mythtv/libs/libmythtv/ringbuffer.cpp
index 0e3673a..59a9286 100644
a
|
b
|
RingBuffer *RingBuffer::Create( |
150 | 150 | |
151 | 151 | if (!stream_only && (dvdurl || dvddir || dvdext)) |
152 | 152 | { |
153 | | if (lfilename.left(4) == "dvd:") // URI "dvd:" + path |
| 153 | if (lfilename.startsWith("dvd:")) // URI "dvd:" + path |
154 | 154 | lfilename.remove(0,4); // e.g. "dvd:/dev/dvd" |
155 | 155 | |
156 | 156 | if (!(mythurl || QFile::exists(lfilename))) |
… |
… |
RingBuffer *RingBuffer::Create( |
161 | 161 | } |
162 | 162 | else if (!stream_only && (bdurl || bddir)) |
163 | 163 | { |
164 | | if (lfilename.left(3) == "bd:") // URI "bd:" + path |
| 164 | if (lfilename.startsWith("bd:")) // URI "bd:" + path |
165 | 165 | lfilename.remove(0,3); // e.g. "bd:/videos/ET" |
166 | 166 | |
167 | 167 | if (!(mythurl || QFile::exists(lfilename))) |
-
diff --git a/mythtv/libs/libmythtv/sourceutil.cpp b/mythtv/libs/libmythtv/sourceutil.cpp
index f64d55e..0408cd0 100644
a
|
b
|
QString SourceUtil::GetChannelSeparator(uint sourceid) |
80 | 80 | { |
81 | 81 | const QString channum = query.value(0).toString(); |
82 | 82 | const int where = channum.indexOf(sepExpr); |
83 | | if (channum.right(2).left(1) == "0") |
| 83 | if (channum.right(2).startsWith("0")) |
84 | 84 | counts["0"]++; |
85 | 85 | else |
86 | 86 | counts[(where < 0) ? "" : QString(channum.at(where))]++; |
… |
… |
static QStringList get_cardtypes(uint sourceid) |
190 | 190 | /// BEGIN HACK HACK HACK -- return correct card type for child cards |
191 | 191 | QString cardtype = query.value(0).toString().toUpper(); |
192 | 192 | QString inputname = query.value(1).toString().toUpper(); |
193 | | cardtype = ((cardtype == "DVB") && (inputname.left(3) != "DVB")) ? |
| 193 | cardtype = ((cardtype == "DVB") && (!inputname.startsWith("DVB"))) ? |
194 | 194 | "V4L" : cardtype; |
195 | 195 | /// END HACK HACK HACK |
196 | 196 | list += cardtype; |
-
diff --git a/mythtv/libs/libmythtv/transporteditor.cpp b/mythtv/libs/libmythtv/transporteditor.cpp
index 53216ba..f33dc41 100644
a
|
b
|
class TransportWizard : public ConfigurationWizard |
66 | 66 | |
67 | 67 | static QString pp_modulation(QString mod) |
68 | 68 | { |
69 | | if (mod.right(3) == "vsb") |
| 69 | if (mod.endsWith("vsb")) |
70 | 70 | return mod.left(mod.length() - 3) + "-VSB"; |
71 | 71 | |
72 | | if (mod.left(4) == "qam_") |
| 72 | if (mod.startsWith("qam_")) |
73 | 73 | return "QAM-" + mod.mid(4, mod.length()); |
74 | 74 | |
75 | 75 | if (mod == "analog") |
-
diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
index 1575a6c..1d4147d 100644
a
|
b
|
bool TV::HandleTrackAction(PlayerContext *ctx, const QString &action) |
3649 | 3649 | ctx->player->ToggleCaptions(); |
3650 | 3650 | } |
3651 | 3651 | } |
3652 | | else if (action.left(6) == "TOGGLE") |
| 3652 | else if (action.startsWith("TOGGLE")) |
3653 | 3653 | { |
3654 | 3654 | int type = to_track_type(action.mid(6)); |
3655 | 3655 | if (type == kTrackTypeTeletextMenu) |
… |
… |
bool TV::HandleTrackAction(PlayerContext *ctx, const QString &action) |
3659 | 3659 | else |
3660 | 3660 | handled = false; |
3661 | 3661 | } |
3662 | | else if (action.left(6) == "SELECT") |
| 3662 | else if (action.startsWith("SELECT")) |
3663 | 3663 | { |
3664 | 3664 | int type = to_track_type(action.mid(6)); |
3665 | 3665 | int num = action.section("_", -1).toInt(); |
… |
… |
bool TV::HandleTrackAction(PlayerContext *ctx, const QString &action) |
3668 | 3668 | else |
3669 | 3669 | handled = false; |
3670 | 3670 | } |
3671 | | else if (action.left(4) == "NEXT" || action.left(4) == "PREV") |
| 3671 | else if (action.startsWith("NEXT") || action.startsWith("PREV")) |
3672 | 3672 | { |
3673 | | int dir = (action.left(4) == "NEXT") ? +1 : -1; |
| 3673 | int dir = (action.startsWith("NEXT")) ? +1 : -1; |
3674 | 3674 | int type = to_track_type(action.mid(4)); |
3675 | 3675 | if (type >= kTrackTypeAudio) |
3676 | 3676 | ctx->player->ChangeTrack(type, dir); |
3677 | | else if (action.right(2) == "CC") |
| 3677 | else if (action.endsWith("CC")) |
3678 | 3678 | ctx->player->ChangeCaptionTrack(dir); |
3679 | 3679 | else |
3680 | 3680 | handled = false; |
… |
… |
void TV::customEvent(QEvent *e) |
9297 | 9297 | { |
9298 | 9298 | GetStatus(); |
9299 | 9299 | } |
9300 | | else if (message.left(14) == "DONE_RECORDING") |
| 9300 | else if (message.startsWith("DONE_RECORDING")) |
9301 | 9301 | { |
9302 | 9302 | int seconds = 0; |
9303 | 9303 | //long long frames = 0; |
… |
… |
void TV::customEvent(QEvent *e) |
9358 | 9358 | ReturnPlayerLock(mctx); |
9359 | 9359 | } |
9360 | 9360 | |
9361 | | if (message.left(14) == "ASK_RECORDING ") |
| 9361 | if (message.startsWith("ASK_RECORDING ")) |
9362 | 9362 | { |
9363 | 9363 | int timeuntil = 0, hasrec = 0, haslater = 0; |
9364 | 9364 | if (tokens.size() >= 5) |
… |
… |
void TV::customEvent(QEvent *e) |
9395 | 9395 | ReturnPlayerLock(mctx); |
9396 | 9396 | } |
9397 | 9397 | |
9398 | | if (message.left(11) == "QUIT_LIVETV") |
| 9398 | if (message.startsWith("QUIT_LIVETV")) |
9399 | 9399 | { |
9400 | 9400 | cardnum = (tokens.size() >= 2) ? tokens[1].toUInt() : 0; |
9401 | 9401 | |
… |
… |
void TV::customEvent(QEvent *e) |
9434 | 9434 | ReturnPlayerLock(mctx); |
9435 | 9435 | } |
9436 | 9436 | |
9437 | | if (message.left(12) == "LIVETV_WATCH") |
| 9437 | if (message.startsWith("LIVETV_WATCH")) |
9438 | 9438 | { |
9439 | 9439 | int watch = 0; |
9440 | 9440 | if (tokens.size() >= 3) |
… |
… |
void TV::customEvent(QEvent *e) |
9475 | 9475 | ReturnPlayerLock(mctx); |
9476 | 9476 | } |
9477 | 9477 | |
9478 | | if (message.left(12) == "LIVETV_CHAIN") |
| 9478 | if (message.startsWith("LIVETV_CHAIN")) |
9479 | 9479 | { |
9480 | 9480 | QString id = QString::null; |
9481 | 9481 | if ((tokens.size() >= 2) && tokens[1] == "UPDATE") |
… |
… |
void TV::customEvent(QEvent *e) |
9495 | 9495 | ReturnPlayerLock(mctx); |
9496 | 9496 | } |
9497 | 9497 | |
9498 | | if (message.left(12) == "EXIT_TO_MENU") |
| 9498 | if (message.startsWith("EXIT_TO_MENU")) |
9499 | 9499 | { |
9500 | 9500 | PlayerContext *mctx = GetPlayerReadLock(0, __FILE__, __LINE__); |
9501 | 9501 | for (uint i = 0; mctx && (i < player.size()); i++) |
… |
… |
void TV::customEvent(QEvent *e) |
9510 | 9510 | ReturnPlayerLock(mctx); |
9511 | 9511 | } |
9512 | 9512 | |
9513 | | if (message.left(6) == "SIGNAL") |
| 9513 | if (message.startsWith("SIGNAL")) |
9514 | 9514 | { |
9515 | 9515 | cardnum = (tokens.size() >= 2) ? tokens[1].toUInt() : 0; |
9516 | 9516 | QStringList signalList = me->ExtraDataList(); |
… |
… |
void TV::customEvent(QEvent *e) |
9534 | 9534 | ReturnPlayerLock(mctx); |
9535 | 9535 | } |
9536 | 9536 | |
9537 | | if (message.left(15) == "NETWORK_CONTROL") |
| 9537 | if (message.startsWith("NETWORK_CONTROL")) |
9538 | 9538 | { |
9539 | 9539 | if ((tokens.size() >= 2) && |
9540 | 9540 | (tokens[1] != "ANSWER") && (tokens[1] != "RESPONSE")) |
… |
… |
void TV::customEvent(QEvent *e) |
9552 | 9552 | } |
9553 | 9553 | } |
9554 | 9554 | |
9555 | | if (message.left(9) == "START_EPG") |
| 9555 | if (message.startsWith("START_EPG")) |
9556 | 9556 | { |
9557 | 9557 | int editType = tokens[1].toInt(); |
9558 | 9558 | DoEditSchedule(editType); |
9559 | 9559 | } |
9560 | 9560 | |
9561 | | if (message.left(11) == "EPG_EXITING" || |
9562 | | message.left(18) == "PROGFINDER_EXITING" || |
9563 | | message.left(21) == "VIEWSCHEDULED_EXITING" || |
9564 | | message.left(19) == "PLAYBACKBOX_EXITING" || |
9565 | | message.left(22) == "SCHEDULEEDITOR_EXITING") |
| 9561 | if (message.startsWith("EPG_EXITING") || |
| 9562 | message.startsWith("PROGFINDER_EXITING") || |
| 9563 | message.startsWith("VIEWSCHEDULED_EXITING") || |
| 9564 | message.startsWith("PLAYBACKBOX_EXITING") || |
| 9565 | message.startsWith("SCHEDULEEDITOR_EXITING")) |
9566 | 9566 | { |
9567 | 9567 | // Resize the window back to the MythTV Player size |
9568 | 9568 | PlayerContext *actx = GetPlayerReadLock(-1, __FILE__, __LINE__); |
… |
… |
void TV::customEvent(QEvent *e) |
9604 | 9604 | isEmbedded = false; |
9605 | 9605 | ignoreKeyPresses = false; |
9606 | 9606 | |
9607 | | if (message.left(19) == "PLAYBACKBOX_EXITING") |
| 9607 | if (message.startsWith("PLAYBACKBOX_EXITING")) |
9608 | 9608 | { |
9609 | 9609 | ProgramInfo pginfo(me->ExtraDataList()); |
9610 | 9610 | if (pginfo.HasPathname() || pginfo.GetChanID()) |
… |
… |
void TV::customEvent(QEvent *e) |
9615 | 9615 | |
9616 | 9616 | } |
9617 | 9617 | |
9618 | | if (message.left(14) == "COMMFLAG_START" && (tokens.size() >= 2)) |
| 9618 | if (message.startsWith("COMMFLAG_START") && (tokens.size() >= 2)) |
9619 | 9619 | { |
9620 | 9620 | uint evchanid = 0; |
9621 | 9621 | QDateTime evrecstartts; |
… |
… |
void TV::customEvent(QEvent *e) |
9642 | 9642 | ReturnPlayerLock(mctx); |
9643 | 9643 | } |
9644 | 9644 | |
9645 | | if (message.left(15) == "COMMFLAG_UPDATE" && (tokens.size() >= 3)) |
| 9645 | if (message.startsWith("COMMFLAG_UPDATE") && (tokens.size() >= 3)) |
9646 | 9646 | { |
9647 | 9647 | uint evchanid = 0; |
9648 | 9648 | QDateTime evrecstartts; |
… |
… |
void TV::OSDDialogEvent(int result, QString text, QString action) |
10683 | 10683 | EnableUpmix(actx, true); |
10684 | 10684 | else if (action == ACTION_DISABLEUPMIX) |
10685 | 10685 | EnableUpmix(actx, false); |
10686 | | else if (action.left(13) == "ADJUSTSTRETCH") |
| 10686 | else if (action.startsWith("ADJUSTSTRETCH")) |
10687 | 10687 | { |
10688 | 10688 | bool floatRead; |
10689 | 10689 | float stretch = action.right(action.length() - 13).toFloat(&floatRead); |
… |
… |
void TV::OSDDialogEvent(int result, QString text, QString action) |
10701 | 10701 | |
10702 | 10702 | ChangeTimeStretch(actx, 0, !floatRead); // just display |
10703 | 10703 | } |
10704 | | else if (action.left(11) == "SELECTSCAN_") |
| 10704 | else if (action.startsWith("SELECTSCAN_")) |
10705 | 10705 | { |
10706 | 10706 | QString msg = QString::null; |
10707 | 10707 | actx->LockDeletePlayer(__FILE__, __LINE__); |
… |
… |
void TV::OSDDialogEvent(int result, QString text, QString action) |
10712 | 10712 | if (!msg.isEmpty()) |
10713 | 10713 | SetOSDMessage(actx, msg); |
10714 | 10714 | } |
10715 | | else if (action.left(15) == ACTION_TOGGELAUDIOSYNC) |
| 10715 | else if (action.startsWith(ACTION_TOGGELAUDIOSYNC)) |
10716 | 10716 | ChangeAudioSync(actx, 0); |
10717 | 10717 | else if (action == ACTION_TOGGLESUBTITLEZOOM) |
10718 | 10718 | ChangeSubtitleZoom(actx, 0); |
… |
… |
void TV::OSDDialogEvent(int result, QString text, QString action) |
10724 | 10724 | EnableVisualisation(actx, true); |
10725 | 10725 | else if (action == ACTION_DISABLEVISUALISATION) |
10726 | 10726 | EnableVisualisation(actx, false); |
10727 | | else if (action.left(11) == ACTION_TOGGLESLEEP) |
| 10727 | else if (action.startsWith(ACTION_TOGGLESLEEP)) |
10728 | 10728 | { |
10729 | 10729 | ToggleSleepTimer(actx, action.left(13)); |
10730 | 10730 | } |
10731 | | else if (action.left(17) == "TOGGLEPICCONTROLS") |
| 10731 | else if (action.startsWith("TOGGLEPICCONTROLS")) |
10732 | 10732 | { |
10733 | 10733 | adjustingPictureAttribute = (PictureAttribute) |
10734 | 10734 | (action.right(1).toInt() - 1); |
10735 | 10735 | DoTogglePictureAttribute(actx, kAdjustingPicture_Playback); |
10736 | 10736 | } |
10737 | | else if (action.left(18) == ACTION_TOGGLESTUDIOLEVELS) |
| 10737 | else if (action.startsWith(ACTION_TOGGLESTUDIOLEVELS)) |
10738 | 10738 | { |
10739 | 10739 | DoToggleStudioLevels(actx); |
10740 | 10740 | } |
… |
… |
void TV::OSDDialogEvent(int result, QString text, QString action) |
10742 | 10742 | { |
10743 | 10743 | DoToggleNightMode(actx); |
10744 | 10744 | } |
10745 | | else if (action.left(12) == "TOGGLEASPECT") |
| 10745 | else if (action.startsWith("TOGGLEASPECT")) |
10746 | 10746 | { |
10747 | 10747 | ToggleAspectOverride(actx, |
10748 | 10748 | (AspectOverrideMode) action.right(1).toInt()); |
10749 | 10749 | } |
10750 | | else if (action.left(10) == "TOGGLEFILL") |
| 10750 | else if (action.startsWith("TOGGLEFILL")) |
10751 | 10751 | { |
10752 | 10752 | ToggleAdjustFill(actx, (AdjustFillMode) action.right(1).toInt()); |
10753 | 10753 | } |
… |
… |
void TV::OSDDialogEvent(int result, QString text, QString action) |
10757 | 10757 | } |
10758 | 10758 | else if (action == ACTION_GUIDE) |
10759 | 10759 | EditSchedule(actx, kScheduleProgramGuide); |
10760 | | else if (action.left(10) == "CHANGROUP_" && db_use_channel_groups) |
| 10760 | else if (action.startsWith("CHANGROUP_") && db_use_channel_groups) |
10761 | 10761 | { |
10762 | 10762 | if (action == "CHANGROUP_ALL_CHANNELS") |
10763 | 10763 | { |
… |
… |
void TV::OSDDialogEvent(int result, QString text, QString action) |
10846 | 10846 | browsehelper->BrowseStart(actx); |
10847 | 10847 | else if (action == "PREVCHAN") |
10848 | 10848 | PopPreviousChannel(actx, true); |
10849 | | else if (action.left(14) == "SWITCHTOINPUT_") |
| 10849 | else if (action.startsWith("SWITCHTOINPUT_")) |
10850 | 10850 | { |
10851 | 10851 | switchToInputId = action.mid(14).toUInt(); |
10852 | 10852 | QMutexLocker locker(&timerIdLock); |
… |
… |
void TV::OSDDialogEvent(int result, QString text, QString action) |
10884 | 10884 | actx->player->GoToMenu(menu); |
10885 | 10885 | actx->UnlockDeletePlayer(__FILE__, __LINE__); |
10886 | 10886 | } |
10887 | | else if (action.left(13) == ACTION_JUMPCHAPTER) |
| 10887 | else if (action.startsWith(ACTION_JUMPCHAPTER)) |
10888 | 10888 | { |
10889 | 10889 | int chapter = action.right(3).toInt(); |
10890 | 10890 | DoJumpChapter(actx, chapter); |
10891 | 10891 | } |
10892 | | else if (action.left(11) == ACTION_SWITCHTITLE) |
| 10892 | else if (action.startsWith(ACTION_SWITCHTITLE)) |
10893 | 10893 | { |
10894 | 10894 | int title = action.right(3).toInt(); |
10895 | 10895 | DoSwitchTitle(actx, title); |
10896 | 10896 | } |
10897 | | else if (action.left(13) == ACTION_SWITCHANGLE) |
| 10897 | else if (action.startsWith(ACTION_SWITCHANGLE)) |
10898 | 10898 | { |
10899 | 10899 | int angle = action.right(3).toInt(); |
10900 | 10900 | DoSwitchAngle(actx, angle); |
… |
… |
void TV::OSDDialogEvent(int result, QString text, QString action) |
10906 | 10906 | } |
10907 | 10907 | else if (action == "TOGGLEAUTOEXPIRE") |
10908 | 10908 | ToggleAutoExpire(actx); |
10909 | | else if (action.left(14) == "TOGGLECOMMSKIP") |
| 10909 | else if (action.startsWith("TOGGLECOMMSKIP")) |
10910 | 10910 | SetAutoCommercialSkip( |
10911 | 10911 | actx, (CommSkipMode)(action.right(1).toInt())); |
10912 | 10912 | else if (action == "QUEUETRANSCODE") |
… |
… |
bool TV::HandleJumpToProgramAction( |
12282 | 12282 | QStringList::const_iterator it = actions.begin(); |
12283 | 12283 | for (; it != actions.end(); ++it) |
12284 | 12284 | { |
12285 | | if ((*it).left(8) != "JUMPPROG") |
| 12285 | if (!(*it).startsWith("JUMPPROG")) |
12286 | 12286 | continue; |
12287 | 12287 | |
12288 | 12288 | const QString &action = *it; |
-
diff --git a/mythtv/libs/libmythtv/videoout_xv.cpp b/mythtv/libs/libmythtv/videoout_xv.cpp
index e2df180..cbdedf2 100644
a
|
b
|
bool VideoOutputXv::InitSetupBuffers(void) |
845 | 845 | } |
846 | 846 | |
847 | 847 | // Create video buffers |
848 | | bool use_xv = (renderer.left(2) == "xv"); |
| 848 | bool use_xv = (renderer.startsWith("xv")); |
849 | 849 | bool use_shm = (renderer == "xshm"); |
850 | 850 | bool ok = InitVideoBuffers(use_xv, use_shm); |
851 | 851 | |
-
diff --git a/mythtv/libs/libmythtv/videooutbase.cpp b/mythtv/libs/libmythtv/videooutbase.cpp
index 2e5dc13..9ba7394 100644
a
|
b
|
int VideoOutput::CalcHueBase(const QString &adaptor_name) |
1871 | 1871 | { |
1872 | 1872 | hue_adj = 50; |
1873 | 1873 | } |
1874 | | else if (adaptor_name.left(4) == "NV17") /* nVidia */ |
| 1874 | else if (adaptor_name.startsWith("NV17")) /* nVidia */ |
1875 | 1875 | { |
1876 | 1876 | hue_adj = 0; |
1877 | 1877 | } |
-
diff --git a/mythtv/libs/libmythtv/videosource.cpp b/mythtv/libs/libmythtv/videosource.cpp
index de13cfa..5f0ead3 100644
a
|
b
|
void HDHomeRunDeviceIDList::fillSelections(const QString &cur) |
1464 | 1464 | QString sel = man_addr; |
1465 | 1465 | devs.push_back(sel); |
1466 | 1466 | |
1467 | | if (3 == devs.size() && current.left(8).toUpper() == "FFFFFFFF") |
| 1467 | if (3 == devs.size() && current.startsWith("FFFFFFFF", Qt::CaseInsensitive)) |
1468 | 1468 | { |
1469 | | current = sel = (current.right(1) == "0") ? |
| 1469 | current = sel = (current.endsWith("0")) ? |
1470 | 1470 | *(devs.begin()) : *(++devs.begin()); |
1471 | 1471 | } |
1472 | 1472 | else |
… |
… |
static QString remove_chaff(const QString &name) |
3538 | 3538 | { |
3539 | 3539 | // Trim off some of the chaff. |
3540 | 3540 | QString short_name = name; |
3541 | | if (short_name.left(14) == "LG Electronics") |
| 3541 | if (short_name.startsWith("LG Electronics")) |
3542 | 3542 | short_name = short_name.right(short_name.length() - 15); |
3543 | | if (short_name.left(4) == "Oren") |
| 3543 | if (short_name.startsWith("Oren")) |
3544 | 3544 | short_name = short_name.right(short_name.length() - 5); |
3545 | | if (short_name.left(8) == "Nextwave") |
| 3545 | if (short_name.startsWith("Nextwave")) |
3546 | 3546 | short_name = short_name.right(short_name.length() - 9); |
3547 | | if (short_name.right(8).toLower() == "frontend") |
| 3547 | if (short_name.startsWith("frontend", Qt::CaseInsensitive)) |
3548 | 3548 | short_name = short_name.left(short_name.length() - 9); |
3549 | | if (short_name.right(7) == "VSB/QAM") |
| 3549 | if (short_name.endsWith("VSB/QAM")) |
3550 | 3550 | short_name = short_name.left(short_name.length() - 8); |
3551 | | if (short_name.right(3) == "VSB") |
| 3551 | if (short_name.endsWith("VSB")) |
3552 | 3552 | short_name = short_name.left(short_name.length() - 4); |
3553 | | if (short_name.right(5) == "DVB-T") |
| 3553 | if (short_name.endsWith("DVB-T")) |
3554 | 3554 | short_name = short_name.left(short_name.length() - 6); |
3555 | 3555 | |
3556 | 3556 | // It would be infinitely better if DVB allowed us to query |
… |
… |
static QString remove_chaff(const QString &name) |
3558 | 3558 | // demodulator name. This means cards like the Air2PC HD5000 |
3559 | 3559 | // and DViCO Fusion HDTV cards are not identified correctly. |
3560 | 3560 | short_name = short_name.simplified(); |
3561 | | if (short_name.left(7).toLower() == "or51211") |
| 3561 | if (short_name.startsWith("or51211", Qt::CaseInsensitive)) |
3562 | 3562 | short_name = "pcHDTV HD-2000"; |
3563 | | else if (short_name.left(7).toLower() == "or51132") |
| 3563 | else if (short_name.startsWith("or51132", Qt::CaseInsensitive)) |
3564 | 3564 | short_name = "pcHDTV HD-3000"; |
3565 | | else if (short_name.left(7).toLower() == "bcm3510") |
| 3565 | else if (short_name.startsWith("bcm3510", Qt::CaseInsensitive)) |
3566 | 3566 | short_name = "Air2PC v1"; |
3567 | | else if (short_name.left(7).toLower() == "nxt2002") |
| 3567 | else if (short_name.startsWith("nxt2002", Qt::CaseInsensitive)) |
3568 | 3568 | short_name = "Air2PC v2"; |
3569 | | else if (short_name.left(7).toLower() == "nxt200x") |
| 3569 | else if (short_name.startsWith("nxt200x", Qt::CaseInsensitive)) |
3570 | 3570 | short_name = "Air2PC v2"; |
3571 | | else if (short_name.left(8).toLower() == "lgdt3302") |
| 3571 | else if (short_name.startsWith("lgdt3302", Qt::CaseInsensitive)) |
3572 | 3572 | short_name = "DViCO HDTV3"; |
3573 | | else if (short_name.left(8).toLower() == "lgdt3303") |
| 3573 | else if (short_name.startsWith("lgdt3303", Qt::CaseInsensitive)) |
3574 | 3574 | short_name = "DViCO v2 or Air2PC v3 or pcHDTV HD-5500"; |
3575 | 3575 | |
3576 | 3576 | return short_name; |
… |
… |
void DVBConfigurationGroup::probeCard(const QString &videodevice) |
3655 | 3655 | #if 0 // frontends on hybrid DVB-T/Analog cards |
3656 | 3656 | QString short_name = remove_chaff(frontend_name); |
3657 | 3657 | buttonAnalog->setVisible( |
3658 | | short_name.left(15).toLower() == "zarlink zl10353" || |
3659 | | short_name.toLower() == "wintv hvr 900 m/r: 65008/a1c0" || |
3660 | | short_name.left(17).toLower() == "philips tda10046h"); |
| 3658 | short_name.startsWith("zarlink zl10353", |
| 3659 | Qt::CaseInsensitive) || |
| 3660 | short_name.startsWith("wintv hvr 900 m/r: 65008/a1c0", |
| 3661 | Qt::CaseInsensitive) || |
| 3662 | short_name.startsWith("philips tda10046h", |
| 3663 | Qt::CaseInsensitive)); |
3661 | 3664 | #endif |
3662 | 3665 | } |
3663 | 3666 | break; |
… |
… |
void DVBConfigurationGroup::probeCard(const QString &videodevice) |
3681 | 3684 | if (frontend_name.toLower().indexOf("usb") < 0) |
3682 | 3685 | { |
3683 | 3686 | buttonAnalog->setVisible( |
3684 | | short_name.left(6).toLower() == "pchdtv" || |
3685 | | short_name.left(5).toLower() == "dvico" || |
3686 | | short_name.left(8).toLower() == "nextwave"); |
| 3687 | short_name.startsWith("pchdtv", Qt::CaseInsensitive) || |
| 3688 | short_name.startsWith("dvico", Qt::CaseInsensitive) || |
| 3689 | short_name.startsWith("nextwave", Qt::CaseInsensitive)); |
3687 | 3690 | } |
3688 | 3691 | #endif |
3689 | 3692 | } |
-
diff --git a/mythtv/libs/libmythui/myththemedmenu.cpp b/mythtv/libs/libmythui/myththemedmenu.cpp
index 6711d44..e3fa9de 100644
a
|
b
|
bool MythThemedMenu::handleAction(const QString &action, const QString &password |
762 | 762 | if (!password.isEmpty() && !checkPinCode(password)) |
763 | 763 | return true; |
764 | 764 | |
765 | | if (action.left(5) == "EXEC ") |
| 765 | if (action.startsWith("EXEC ")) |
766 | 766 | { |
767 | 767 | QString rest = action.right(action.length() - 5); |
768 | 768 | if (cbs && cbs->exec_program) |
… |
… |
bool MythThemedMenu::handleAction(const QString &action, const QString &password |
770 | 770 | |
771 | 771 | return false; |
772 | 772 | } |
773 | | else if (action.left(7) == "EXECTV ") |
| 773 | else if (action.startsWith("EXECTV ")) |
774 | 774 | { |
775 | 775 | QString rest = action.right(action.length() - 7).trimmed(); |
776 | 776 | if (cbs && cbs->exec_program_tv) |
777 | 777 | cbs->exec_program_tv(rest); |
778 | 778 | } |
779 | | else if (action.left(5) == "MENU ") |
| 779 | else if (action.startsWith("MENU ")) |
780 | 780 | { |
781 | 781 | QString menu = action.right(action.length() - 5); |
782 | 782 | |
… |
… |
bool MythThemedMenu::handleAction(const QString &action, const QString &password |
789 | 789 | else |
790 | 790 | delete newmenu; |
791 | 791 | } |
792 | | else if (action.left(6) == "UPMENU") |
| 792 | else if (action.startsWith("UPMENU")) |
793 | 793 | { |
794 | 794 | m_wantpop = true; |
795 | 795 | } |
796 | | else if (action.left(12) == "CONFIGPLUGIN") |
| 796 | else if (action.startsWith("CONFIGPLUGIN")) |
797 | 797 | { |
798 | 798 | QString rest = action.right(action.length() - 13); |
799 | 799 | if (cbs && cbs->configplugin) |
800 | 800 | cbs->configplugin(rest); |
801 | 801 | } |
802 | | else if (action.left(6) == "PLUGIN") |
| 802 | else if (action.startsWith("PLUGIN")) |
803 | 803 | { |
804 | 804 | QString rest = action.right(action.length() - 7); |
805 | 805 | if (cbs && cbs->plugin) |
806 | 806 | cbs->plugin(rest); |
807 | 807 | } |
808 | | else if (action.left(8) == "SHUTDOWN") |
| 808 | else if (action.startsWith("SHUTDOWN")) |
809 | 809 | { |
810 | 810 | if (m_allocedstate) |
811 | 811 | { |
812 | 812 | m_wantpop = true; |
813 | 813 | } |
814 | 814 | } |
815 | | else if (action.left(5) == "EJECT") |
| 815 | else if (action.startsWith("EJECT")) |
816 | 816 | { |
817 | 817 | if (cbs && cbs->eject) |
818 | 818 | cbs->eject(); |
819 | 819 | } |
820 | | else if (action.left(5) == "JUMP ") |
| 820 | else if (action.startsWith("JUMP ")) |
821 | 821 | { |
822 | 822 | QString rest = action.right(action.length() - 5); |
823 | 823 | GetMythMainWindow()->JumpTo(rest, false); |
824 | 824 | } |
825 | | else if (action.left(6) == "MEDIA ") |
| 825 | else if (action.startsWith("MEDIA ")) |
826 | 826 | { |
827 | 827 | // the format is MEDIA HANDLER URL |
828 | 828 | // TODO: allow spaces in the url |
-
diff --git a/mythtv/libs/libmythui/mythuiwebbrowser.cpp b/mythtv/libs/libmythui/mythuiwebbrowser.cpp
index 3a35549..0b59608 100644
a
|
b
|
void BrowserApi::customEvent(QEvent *e) |
244 | 244 | MythEvent *me = (MythEvent *)e; |
245 | 245 | QString message = me->Message(); |
246 | 246 | |
247 | | if (message.left(13) != "MUSIC_CONTROL") |
| 247 | if (!message.startsWith("MUSIC_CONTROL")) |
248 | 248 | return; |
249 | 249 | |
250 | 250 | QStringList tokens = message.simplified().split(" "); |
-
diff --git a/mythtv/libs/libmythupnp/upnpdevice.cpp b/mythtv/libs/libmythupnp/upnpdevice.cpp
index 7cbdb4d..dcb30e5 100644
a
|
b
|
QString UPnpDevice::toString(uint padding) const |
856 | 856 | } |
857 | 857 | |
858 | 858 | // remove trailing newline |
859 | | if (ret.right(1)=="\n") |
| 859 | if (ret.endsWith("\n")) |
860 | 860 | ret = ret.left(ret.length()-1); |
861 | 861 | |
862 | 862 | // add any padding as necessary |
-
diff --git a/mythtv/programs/mythbackend/autoexpire.cpp b/mythtv/programs/mythbackend/autoexpire.cpp
index b3b02e6..5755850 100644
a
|
b
|
void AutoExpire::ExpireRecordings(void) |
571 | 571 | // Wasn't found so check locally |
572 | 572 | QString file = GetPlaybackURL(p); |
573 | 573 | |
574 | | if (file.left(1) == "/") |
| 574 | if (file.startsWith("/")) |
575 | 575 | { |
576 | 576 | p->SetPathname(file); |
577 | 577 | p->SetHostname(myHostName); |
-
diff --git a/mythtv/programs/mythbackend/backendutil.cpp b/mythtv/programs/mythbackend/backendutil.cpp
index 321e259..70e5384 100644
a
|
b
|
QString GetPlaybackURL(ProgramInfo *pginfo, bool storePath) |
36 | 36 | locker.unlock(); |
37 | 37 | result = pginfo->GetPlaybackURL(false, true); |
38 | 38 | locker.relock(); |
39 | | if (storePath && result.left(1) == "/") |
| 39 | if (storePath && result.startsWith("/")) |
40 | 40 | recordingPathCache[cacheKey] = result; |
41 | 41 | } |
42 | 42 | |
-
diff --git a/mythtv/programs/mythbackend/httpconfig.cpp b/mythtv/programs/mythbackend/httpconfig.cpp
index 36522b5..061c9f7 100644
a
|
b
|
bool HttpConfig::ProcessRequest(HTTPRequest *request) |
72 | 72 | } |
73 | 73 | |
74 | 74 | // FIXME, this is always false, what's it for |
75 | | if (request->m_sBaseUrl.right(7) == "config" && |
| 75 | // JMS "fixed" by using endsWith() |
| 76 | if (request->m_sBaseUrl.endsWith("config") && |
76 | 77 | !database_settings.empty()) |
77 | 78 | { |
78 | 79 | QString checkResult; |
-
diff --git a/mythtv/programs/mythbackend/mainserver.cpp b/mythtv/programs/mythbackend/mainserver.cpp
index e9cae9b..fea6690 100644
a
|
b
|
void MainServer::ProcessRequestWork(MythSocket *sock) |
717 | 717 | } |
718 | 718 | else if (command == "MESSAGE") |
719 | 719 | { |
720 | | if ((listline.size() >= 2) && (listline[1].left(11) == "SET_VERBOSE")) |
| 720 | if ((listline.size() >= 2) && (listline[1].startsWith("SET_VERBOSE"))) |
721 | 721 | HandleSetVerbose(listline, pbs); |
722 | 722 | else if ((listline.size() >= 2) && |
723 | | (listline[1].left(13) == "SET_LOG_LEVEL")) |
| 723 | (listline[1].startsWith("SET_LOG_LEVEL"))) |
724 | 724 | HandleSetLogLevel(listline, pbs); |
725 | 725 | else |
726 | 726 | HandleMessage(listline, pbs); |
… |
… |
void MainServer::customEvent(QEvent *e) |
1001 | 1001 | broadcast += extra; |
1002 | 1002 | } |
1003 | 1003 | |
1004 | | if (me->Message().left(11) == "AUTO_EXPIRE") |
| 1004 | if (me->Message().startsWith("AUTO_EXPIRE")) |
1005 | 1005 | { |
1006 | 1006 | QStringList tokens = me->Message() |
1007 | 1007 | .split(" ", QString::SkipEmptyParts); |
… |
… |
void MainServer::customEvent(QEvent *e) |
1041 | 1041 | return; |
1042 | 1042 | } |
1043 | 1043 | |
1044 | | if (me->Message().left(21) == "QUERY_NEXT_LIVETV_DIR" && m_sched) |
| 1044 | if (me->Message().startsWith("QUERY_NEXT_LIVETV_DIR") && m_sched) |
1045 | 1045 | { |
1046 | 1046 | QStringList tokens = me->Message() |
1047 | 1047 | .split(" ", QString::SkipEmptyParts); |
… |
… |
void MainServer::customEvent(QEvent *e) |
1057 | 1057 | return; |
1058 | 1058 | } |
1059 | 1059 | |
1060 | | if ((me->Message().left(16) == "DELETE_RECORDING") || |
1061 | | (me->Message().left(22) == "FORCE_DELETE_RECORDING")) |
| 1060 | if ((me->Message().startsWith("DELETE_RECORDING")) || |
| 1061 | (me->Message().startsWith("FORCE_DELETE_RECORDING"))) |
1062 | 1062 | { |
1063 | 1063 | QStringList tokens = me->Message() |
1064 | 1064 | .split(" ", QString::SkipEmptyParts); |
… |
… |
void MainServer::customEvent(QEvent *e) |
1090 | 1090 | return; |
1091 | 1091 | } |
1092 | 1092 | |
1093 | | if (me->Message().left(21) == "RESCHEDULE_RECORDINGS" && m_sched) |
| 1093 | if (me->Message().startsWith("RESCHEDULE_RECORDINGS") && m_sched) |
1094 | 1094 | { |
1095 | 1095 | QStringList request = me->ExtraDataList(); |
1096 | 1096 | m_sched->Reschedule(request); |
1097 | 1097 | return; |
1098 | 1098 | } |
1099 | 1099 | |
1100 | | if (me->Message().left(23) == "SCHEDULER_ADD_RECORDING" && m_sched) |
| 1100 | if (me->Message().startsWith("SCHEDULER_ADD_RECORDING") && m_sched) |
1101 | 1101 | { |
1102 | 1102 | ProgramInfo pi(me->ExtraDataList()); |
1103 | 1103 | if (!pi.GetChanID()) |
… |
… |
void MainServer::customEvent(QEvent *e) |
1110 | 1110 | return; |
1111 | 1111 | } |
1112 | 1112 | |
1113 | | if (me->Message().left(23) == "UPDATE_RECORDING_STATUS" && m_sched) |
| 1113 | if (me->Message().startsWith("UPDATE_RECORDING_STATUS") && m_sched) |
1114 | 1114 | { |
1115 | 1115 | QStringList tokens = me->Message() |
1116 | 1116 | .split(" ", QString::SkipEmptyParts); |
… |
… |
void MainServer::customEvent(QEvent *e) |
1131 | 1131 | return; |
1132 | 1132 | } |
1133 | 1133 | |
1134 | | if (me->Message().left(13) == "LIVETV_EXITED") |
| 1134 | if (me->Message().startsWith("LIVETV_EXITED")) |
1135 | 1135 | { |
1136 | 1136 | QString chainid = me->ExtraData(); |
1137 | 1137 | LiveTVChain *chain = GetExistingChain(chainid); |
… |
… |
void MainServer::customEvent(QEvent *e) |
1144 | 1144 | if (me->Message() == "CLEAR_SETTINGS_CACHE") |
1145 | 1145 | gCoreContext->ClearSettingsCache(); |
1146 | 1146 | |
1147 | | if (me->Message().left(14) == "RESET_IDLETIME" && m_sched) |
| 1147 | if (me->Message().startsWith("RESET_IDLETIME") && m_sched) |
1148 | 1148 | m_sched->ResetIdleTime(); |
1149 | 1149 | |
1150 | 1150 | if (me->Message() == "LOCAL_RECONNECT_TO_MASTER") |
… |
… |
void MainServer::customEvent(QEvent *e) |
1153 | 1153 | if (me->Message() == "LOCAL_SLAVE_BACKEND_ENCODERS_OFFLINE") |
1154 | 1154 | HandleSlaveDisconnectedEvent(*me); |
1155 | 1155 | |
1156 | | if (me->Message().left(6) == "LOCAL_") |
| 1156 | if (me->Message().startsWith("LOCAL_")) |
1157 | 1157 | return; |
1158 | 1158 | |
1159 | 1159 | MythEvent mod_me(""); |
1160 | | if (me->Message().left(23) == "MASTER_UPDATE_PROG_INFO") |
| 1160 | if (me->Message().startsWith("MASTER_UPDATE_PROG_INFO")) |
1161 | 1161 | { |
1162 | 1162 | QStringList tokens = me->Message().simplified().split(" "); |
1163 | 1163 | uint chanid = 0; |
… |
… |
void MainServer::customEvent(QEvent *e) |
1188 | 1188 | } |
1189 | 1189 | } |
1190 | 1190 | |
1191 | | if (me->Message().left(13) == "DOWNLOAD_FILE") |
| 1191 | if (me->Message().startsWith("DOWNLOAD_FILE")) |
1192 | 1192 | { |
1193 | 1193 | QStringList extraDataList = me->ExtraDataList(); |
1194 | 1194 | QString localFile = extraDataList[1]; |
… |
… |
void MainServer::customEvent(QEvent *e) |
1230 | 1230 | sockListLock.unlock(); |
1231 | 1231 | |
1232 | 1232 | bool sendGlobal = false; |
1233 | | if (ismaster && broadcast[1].left(7) == "GLOBAL_") |
| 1233 | if (ismaster && broadcast[1].startsWith("GLOBAL_")) |
1234 | 1234 | { |
1235 | 1235 | broadcast[1].replace("GLOBAL_", "LOCAL_"); |
1236 | 1236 | MythEvent me(broadcast[1], broadcast[2]); |
… |
… |
void MainServer::BackendQueryDiskSpace(QStringList &strlist, bool consolidated, |
4483 | 4483 | * value using QString::fromUtf8() to prevent corruption. */ |
4484 | 4484 | currentDir = QString::fromUtf8(query.value(1) |
4485 | 4485 | .toByteArray().constData()); |
4486 | | if (currentDir.right(1) == "/") |
| 4486 | if (currentDir.endsWith("/")) |
4487 | 4487 | currentDir.remove(currentDir.length() - 1, 1); |
4488 | 4488 | |
4489 | 4489 | checkDir.setPath(currentDir); |
… |
… |
QString MainServer::LocalFilePath(const QUrl &url, const QString &wantgroup) |
6130 | 6130 | lpath = lpath.section('/', -1); |
6131 | 6131 | |
6132 | 6132 | QString fpath = lpath; |
6133 | | if (fpath.right(4) == ".png") |
| 6133 | if (fpath.endsWith(".png")) |
6134 | 6134 | fpath = fpath.left(fpath.length() - 4); |
6135 | 6135 | |
6136 | 6136 | ProgramInfo pginfo(fpath); |
6137 | 6137 | if (pginfo.GetChanID()) |
6138 | 6138 | { |
6139 | 6139 | QString pburl = GetPlaybackURL(&pginfo); |
6140 | | if (pburl.left(1) == "/") |
| 6140 | if (pburl.startsWith("/")) |
6141 | 6141 | { |
6142 | 6142 | lpath = pburl.section('/', 0, -2) + "/" + lpath; |
6143 | 6143 | LOG(VB_FILE, LOG_INFO, |
-
diff --git a/mythtv/programs/mythbackend/services/content.cpp b/mythtv/programs/mythbackend/services/content.cpp
index 97fabe0..c0c591e 100644
a
|
b
|
QFileInfo Content::GetPreviewImage( int nChanId, |
493 | 493 | // ------------------------------------------------------------------ |
494 | 494 | // Must generate Preview Image, Generate Image and save. |
495 | 495 | // ------------------------------------------------------------------ |
496 | | if (!pginfo.IsLocal() && sFileName.left(1) == "/") |
| 496 | if (!pginfo.IsLocal() && sFileName.startsWith("/")) |
497 | 497 | pginfo.SetPathname(sFileName); |
498 | 498 | |
499 | 499 | if (!pginfo.IsLocal()) |
-
diff --git a/mythtv/programs/mythcommflag/CommDetector2.cpp b/mythtv/programs/mythcommflag/CommDetector2.cpp
index 76a74c3..002ac40 100644
a
|
b
|
QString debugDirectory(int chanid, const QDateTime& recstartts) |
223 | 223 | return ""; |
224 | 224 | |
225 | 225 | QString pburl = pginfo.GetPlaybackURL(true); |
226 | | if (pburl.left(1) != "/") |
| 226 | if (!pburl.startsWith("/")) |
227 | 227 | return ""; |
228 | 228 | |
229 | 229 | QString basename(query.value(0).toString()); |
-
diff --git a/mythtv/programs/mythfilldatabase/xmltvparser.cpp b/mythtv/programs/mythfilldatabase/xmltvparser.cpp
index f7830106..18430ad 100644
a
|
b
|
ChannelInfo *XMLTVParser::parseChannel(QDomElement &element, QUrl &baseUrl) |
85 | 85 | { |
86 | 86 | QString base = baseUrl.toString(QUrl::StripTrailingSlash); |
87 | 87 | chaninfo->icon = base + |
88 | | ((path.left(1) == "/") ? path : QString("/") + path); |
| 88 | ((path.startsWith("/")) ? path : QString("/") + path); |
89 | 89 | } |
90 | 90 | else if (!path.isEmpty()) |
91 | 91 | { |
-
diff --git a/mythtv/programs/mythfrontend/globalsettings.cpp b/mythtv/programs/mythfrontend/globalsettings.cpp
index 36bf5b9..293153b 100644
a
|
b
|
void PlaybackProfileConfig::Save(void) |
920 | 920 | |
921 | 921 | void PlaybackProfileConfig::pressed(QString cmd) |
922 | 922 | { |
923 | | if (cmd.left(4) == "edit") |
| 923 | if (cmd.startsWith("edit")) |
924 | 924 | { |
925 | 925 | uint i = cmd.mid(4).toUInt(); |
926 | 926 | PlaybackProfileItemConfig itemcfg(items[i]); |
… |
… |
void PlaybackProfileConfig::pressed(QString cmd) |
931 | 931 | InitLabel(i); |
932 | 932 | needs_save = true; |
933 | 933 | } |
934 | | else if (cmd.left(3) == "del") |
| 934 | else if (cmd.startsWith("del")) |
935 | 935 | { |
936 | 936 | uint i = cmd.mid(3).toUInt(); |
937 | 937 | del_items.push_back(items[i]); |
-
diff --git a/mythtv/programs/mythfrontend/idlescreen.cpp b/mythtv/programs/mythfrontend/idlescreen.cpp
index 8a1d98c..ec50a99 100644
a
|
b
|
void IdleScreen::customEvent(QEvent* event) |
142 | 142 | { |
143 | 143 | MythEvent *me = static_cast<MythEvent *>(event); |
144 | 144 | |
145 | | if (me->Message().left(18) == "SHUTDOWN_COUNTDOWN") |
| 145 | if (me->Message().startsWith("SHUTDOWN_COUNTDOWN")) |
146 | 146 | { |
147 | 147 | QString secs = me->Message().mid(19); |
148 | 148 | m_secondsToShutdown = secs.toInt(); |
149 | 149 | UpdateStatus(); |
150 | 150 | } |
151 | | else if (me->Message().left(12) == "SHUTDOWN_NOW") |
| 151 | else if (me->Message().startsWith("SHUTDOWN_NOW")) |
152 | 152 | { |
153 | 153 | if (gCoreContext->IsFrontendOnly()) |
154 | 154 | { |
-
diff --git a/mythtv/programs/mythfrontend/main.cpp b/mythtv/programs/mythfrontend/main.cpp
index 2a13d60..dfd6d34 100644
a
|
b
|
static void TVMenuCallback(void *data, QString &selection) |
775 | 775 | (void)data; |
776 | 776 | QString sel = selection.toLower(); |
777 | 777 | |
778 | | if (sel.left(9) == "settings ") |
| 778 | if (sel.startsWith("settings ")) |
779 | 779 | { |
780 | 780 | GetMythUI()->AddCurrentLocation("Setup"); |
781 | 781 | gCoreContext->ActivateSettingsCache(false); |
… |
… |
static void TVMenuCallback(void *data, QString &selection) |
786 | 786 | startTVNormal(); |
787 | 787 | else if (sel == "tv_watch_live_epg") |
788 | 788 | startTVInGuide(); |
789 | | else if (sel.left(18) == "tv_watch_recording") |
| 789 | else if (sel.startsWith("tv_watch_recording")) |
790 | 790 | { |
791 | 791 | // use selection here because its case is untouched |
792 | 792 | if ((selection.length() > 19) && (selection.mid(18, 1) == " ")) |
… |
… |
static void TVMenuCallback(void *data, QString &selection) |
1000 | 1000 | else |
1001 | 1001 | LOG(VB_GENERAL, LOG_ERR, "Unknown menu action: " + selection); |
1002 | 1002 | |
1003 | | if (sel.left(9) == "settings " || sel == "video_settings_general") |
| 1003 | if (sel.startsWith("settings ") || sel == "video_settings_general") |
1004 | 1004 | { |
1005 | 1005 | GetMythUI()->RemoveCurrentLocation(); |
1006 | 1006 | |
-
diff --git a/mythtv/programs/mythfrontend/networkcontrol.cpp b/mythtv/programs/mythfrontend/networkcontrol.cpp
index 18fa2a1..1b03165 100644
a
|
b
|
void NetworkControl::customEvent(QEvent *e) |
1257 | 1257 | MythEvent *me = (MythEvent *)e; |
1258 | 1258 | QString message = me->Message(); |
1259 | 1259 | |
1260 | | if (message.left(13) == "MUSIC_CONTROL") |
| 1260 | if (message.startsWith("MUSIC_CONTROL")) |
1261 | 1261 | { |
1262 | 1262 | QStringList tokens = message.simplified().split(" "); |
1263 | 1263 | if ((tokens.size() >= 4) && |
… |
… |
void NetworkControl::customEvent(QEvent *e) |
1271 | 1271 | } |
1272 | 1272 | |
1273 | 1273 | } |
1274 | | else if (message.left(15) == "NETWORK_CONTROL") |
| 1274 | else if (message.startsWith("NETWORK_CONTROL")) |
1275 | 1275 | { |
1276 | 1276 | QStringList tokens = message.simplified().split(" "); |
1277 | 1277 | if ((tokens.size() >= 3) && |
-
diff --git a/mythtv/programs/mythfrontend/playbackbox.cpp b/mythtv/programs/mythfrontend/playbackbox.cpp
index ff618ce..af4af85 100644
a
|
b
|
void PlaybackBox::customEvent(QEvent *event) |
3884 | 3884 | MythEvent *me = (MythEvent *)event; |
3885 | 3885 | QString message = me->Message(); |
3886 | 3886 | |
3887 | | if (message.left(21) == "RECORDING_LIST_CHANGE") |
| 3887 | if (message.startsWith("RECORDING_LIST_CHANGE")) |
3888 | 3888 | { |
3889 | 3889 | QStringList tokens = message.simplified().split(" "); |
3890 | 3890 | uint chanid = 0; |
… |
… |
void PlaybackBox::customEvent(QEvent *event) |
3920 | 3920 | m_programInfoCache.ScheduleLoad(); |
3921 | 3921 | } |
3922 | 3922 | } |
3923 | | else if (message.left(15) == "NETWORK_CONTROL") |
| 3923 | else if (message.startsWith("NETWORK_CONTROL")) |
3924 | 3924 | { |
3925 | 3925 | QStringList tokens = message.simplified().split(" "); |
3926 | 3926 | if ((tokens[1] != "ANSWER") && (tokens[1] != "RESPONSE")) |
… |
… |
void PlaybackBox::customEvent(QEvent *event) |
3948 | 3948 | keyevent); |
3949 | 3949 | } |
3950 | 3950 | } |
3951 | | else if (message.left(16) == "UPDATE_FILE_SIZE") |
| 3951 | else if (message.startsWith("UPDATE_FILE_SIZE")) |
3952 | 3952 | { |
3953 | 3953 | QStringList tokens = message.simplified().split(" "); |
3954 | 3954 | bool ok = false; |
-
diff --git a/mythtv/programs/mythfrontend/progfind.cpp b/mythtv/programs/mythfrontend/progfind.cpp
index 222e9e5..4369311 100644
a
|
b
|
bool ProgFinder::formatSelectedData(QString& data) |
670 | 670 | |
671 | 671 | if (searchChar == "T") |
672 | 672 | { |
673 | | if (data.left(4) != "The " && data.left(2) != "A ") |
| 673 | if (!data.startsWith("The ") && !data.startsWith("A ")) |
674 | 674 | { |
675 | 675 | // nothing, use as is |
676 | 676 | } |
677 | | else if (data.left(5) == "The T") |
| 677 | else if (data.startsWith("The T")) |
678 | 678 | data = data.mid(4) + ", The"; |
679 | | else if (data.left(3) == "A T") |
| 679 | else if (data.startsWith("A T")) |
680 | 680 | data = data.mid(2) + ", A"; |
681 | 681 | else |
682 | 682 | { |
… |
… |
bool ProgFinder::formatSelectedData(QString& data) |
686 | 686 | } |
687 | 687 | else if (searchChar == "A") |
688 | 688 | { |
689 | | if (data.left(4) != "The " && data.left(2) != "A ") |
| 689 | if (!data.startsWith("The ") && !data.startsWith("A ")) |
690 | 690 | { |
691 | 691 | // nothing, use as is |
692 | 692 | } |
693 | | else if (data.left(5) == "The A") |
| 693 | else if (data.startsWith("The A")) |
694 | 694 | data = data.mid(4) + ", The"; |
695 | | else if (data.left(3) == "A A") |
| 695 | else if (data.startsWith("A A")) |
696 | 696 | data = data.mid(2) + ", A"; |
697 | | else if (data.left(4) == "An A") |
| 697 | else if (data.startsWith("An A")) |
698 | 698 | data = data.mid(3) + ", An"; |
699 | 699 | else |
700 | 700 | { |
… |
… |
bool ProgFinder::formatSelectedData(QString& data) |
704 | 704 | } |
705 | 705 | else |
706 | 706 | { |
707 | | if (data.left(4) == "The ") |
| 707 | if (data.startsWith("The ")) |
708 | 708 | data = data.mid(4) + ", The"; |
709 | | else if (data.left(2) == "A ") |
| 709 | else if (data.startsWith("A ")) |
710 | 710 | data = data.mid(2) + ", A"; |
711 | | else if (data.left(3) == "An ") |
| 711 | else if (data.startsWith("An ")) |
712 | 712 | data = data.mid(3) + ", An"; |
713 | 713 | } |
714 | 714 | |
… |
… |
bool ProgFinder::formatSelectedData(QString& data, int charNum) |
721 | 721 | |
722 | 722 | if (charNum == 29 || charNum == 10) |
723 | 723 | { |
724 | | if (data.left(5) == "The T" && charNum == 29) |
| 724 | if (data.startsWith("The T") && charNum == 29) |
725 | 725 | data = data.mid(4) + ", The"; |
726 | | else if (data.left(5) == "The A" && charNum == 10) |
| 726 | else if (data.startsWith("The A") && charNum == 10) |
727 | 727 | data = data.mid(4) + ", The"; |
728 | | else if (data.left(3) == "A T" && charNum == 29) |
| 728 | else if (data.startsWith("A T") && charNum == 29) |
729 | 729 | data = data.mid(2) + ", A"; |
730 | | else if (data.left(3) == "A A" && charNum == 10) |
| 730 | else if (data.startsWith("A A") && charNum == 10) |
731 | 731 | data = data.mid(2) + ", A"; |
732 | | else if (data.left(4) == "An A" && charNum == 10) |
| 732 | else if (data.startsWith("An A") && charNum == 10) |
733 | 733 | data = data.mid(3) + ", An"; |
734 | | else if (data.left(4) != "The " && data.left(2) != "A ") |
| 734 | else if (!data.startsWith("The ") && !data.startsWith("A ")) |
735 | 735 | { |
736 | 736 | // use as is |
737 | 737 | } |
… |
… |
bool ProgFinder::formatSelectedData(QString& data, int charNum) |
743 | 743 | } |
744 | 744 | else |
745 | 745 | { |
746 | | if (data.left(4) == "The ") |
| 746 | if (data.startsWith("The ")) |
747 | 747 | data = data.mid(4) + ", The"; |
748 | | if (data.left(2) == "A ") |
| 748 | if (data.startsWith("A ")) |
749 | 749 | data = data.mid(2) + ", A"; |
750 | | if (data.left(3) == "An ") |
| 750 | if (data.startsWith("An ")) |
751 | 751 | data = data.mid(3) + ", An"; |
752 | 752 | } |
753 | 753 | |
… |
… |
bool ProgFinder::formatSelectedData(QString& data, int charNum) |
756 | 756 | |
757 | 757 | void ProgFinder::restoreSelectedData(QString &data) |
758 | 758 | { |
759 | | if (data.right(5) == ", The") |
| 759 | if (data.endsWith(", The")) |
760 | 760 | data = "The " + data.left(data.length() - 5); |
761 | | if (data.right(3) == ", A") |
| 761 | if (data.endsWith(", A")) |
762 | 762 | data = "A " + data.left(data.length() - 3); |
763 | 763 | } |
764 | 764 | |
-
diff --git a/mythtv/programs/mythfrontend/upnpscanner.cpp b/mythtv/programs/mythfrontend/upnpscanner.cpp
index e475621..b1d8c37 100644
a
|
b
|
bool UPNPScanner::ParseDescription(const QUrl &url, QNetworkReply *reply) |
1275 | 1275 | QUrl::RemoveQuery); |
1276 | 1276 | |
1277 | 1277 | // strip leading slashes off the controlURL |
1278 | | while (!controlURL.isEmpty() && controlURL.left(1) == "/") |
| 1278 | while (!controlURL.isEmpty() && controlURL.startsWith("/")) |
1279 | 1279 | controlURL = controlURL.mid(1); |
1280 | 1280 | |
1281 | 1281 | // strip leading slashes off the eventURL |
1282 | | //while (!eventURL.isEmpty() && eventURL.left(1) == "/") |
| 1282 | //while (!eventURL.isEmpty() && eventURL.startsWith("/")) |
1283 | 1283 | // eventURL = eventURL.mid(1); |
1284 | 1284 | |
1285 | 1285 | // strip trailing slashes off URLBase |
1286 | | while (!URLBase.isEmpty() && URLBase.right(1) == "/") |
| 1286 | while (!URLBase.isEmpty() && URLBase.endsWith("/")) |
1287 | 1287 | URLBase = URLBase.mid(0, URLBase.size() - 1); |
1288 | 1288 | |
1289 | 1289 | controlURL = URLBase + "/" + controlURL; |
-
diff --git a/mythtv/programs/mythfrontend/videolist.cpp b/mythtv/programs/mythfrontend/videolist.cpp
index 0cd21e5..818d2cc 100644
a
|
b
|
static QString path_to_node_name(const QString &path) |
211 | 211 | { |
212 | 212 | QString ret; |
213 | 213 | int slashLoc = path.lastIndexOf('/', -2) + 1; |
214 | | if (path.right(1) == "/") |
| 214 | if (path.endsWith("/")) |
215 | 215 | ret = path.mid(slashLoc, path.length() - slashLoc - 1); |
216 | 216 | else |
217 | 217 | ret = path.mid(slashLoc); |
-
diff --git a/mythtv/programs/mythlcdserver/lcdprocclient.cpp b/mythtv/programs/mythlcdserver/lcdprocclient.cpp
index b62365a..2d29128 100644
a
|
b
|
void LCDProcClient::customEvent(QEvent *e) |
2438 | 2438 | { |
2439 | 2439 | MythEvent *me = (MythEvent *) e; |
2440 | 2440 | |
2441 | | if (me->Message().left(21) == "RECORDING_LIST_CHANGE" || |
| 2441 | if (me->Message().startsWith("RECORDING_LIST_CHANGE") || |
2442 | 2442 | me->Message() == "UPDATE_PROG_INFO") |
2443 | 2443 | { |
2444 | 2444 | if (lcd_showrecstatus && !updateRecInfoTimer->isActive()) |
-
diff --git a/mythtv/programs/mythtranscode/main.cpp b/mythtv/programs/mythtranscode/main.cpp
index f20a1b0..347f20f 100644
a
|
b
|
int main(int argc, char *argv[]) |
541 | 541 | return QueueTranscodeJob(pginfo, profilename, hostname, useCutlist); |
542 | 542 | } |
543 | 543 | |
544 | | if (infile.left(7) == "myth://" && (outfile.isEmpty() || outfile != "-") && |
| 544 | if (infile.startsWith("myth://") && (outfile.isEmpty() || outfile != "-") && |
545 | 545 | fifodir.isEmpty() && !cmdline.toBool("hls") && !cmdline.toBool("avf")) |
546 | 546 | { |
547 | 547 | LOG(VB_GENERAL, LOG_ERR, |
-
diff --git a/mythtv/programs/mythtranscode/transcode.cpp b/mythtv/programs/mythtranscode/transcode.cpp
index 45b94b9..b6b0a4e 100644
a
|
b
|
int Transcode::TranscodeFile(const QString &inputname, |
644 | 644 | } |
645 | 645 | } |
646 | 646 | |
647 | | if (encodingType.left(4).toLower() == "mpeg") |
| 647 | if (encodingType.startsWith("mpeg", Qt::CaseInsensitive)) |
648 | 648 | { |
649 | 649 | // make sure dimensions are valid for MPEG codecs |
650 | 650 | newHeight = (newHeight + 15) & ~0xF; |
-
diff --git a/mythtv/programs/mythwelcome/welcomedialog.cpp b/mythtv/programs/mythwelcome/welcomedialog.cpp
index 89d4263..f092608 100644
a
|
b
|
void WelcomeDialog::customEvent(QEvent *e) |
149 | 149 | { |
150 | 150 | MythEvent *me = (MythEvent *) e; |
151 | 151 | |
152 | | if (me->Message().left(21) == "RECORDING_LIST_CHANGE" || |
| 152 | if (me->Message().startsWith("RECORDING_LIST_CHANGE") || |
153 | 153 | me->Message() == "UPDATE_PROG_INFO") |
154 | 154 | { |
155 | 155 | LOG(VB_GENERAL, LOG_NOTICE, |
… |
… |
void WelcomeDialog::customEvent(QEvent *e) |
169 | 169 | setPendingRecListUpdate(true); |
170 | 170 | } |
171 | 171 | } |
172 | | else if (me->Message().left(15) == "SCHEDULE_CHANGE") |
| 172 | else if (me->Message().startsWith("SCHEDULE_CHANGE")) |
173 | 173 | { |
174 | 174 | LOG(VB_GENERAL, LOG_NOTICE, |
175 | 175 | "MythWelcome received a SCHEDULE_CHANGE event"); |
… |
… |
void WelcomeDialog::customEvent(QEvent *e) |
187 | 187 | setPendingSchedUpdate(true); |
188 | 188 | } |
189 | 189 | } |
190 | | else if (me->Message().left(18) == "SHUTDOWN_COUNTDOWN") |
| 190 | else if (me->Message().startsWith("SHUTDOWN_COUNTDOWN")) |
191 | 191 | { |
192 | 192 | #if 0 |
193 | 193 | LOG(VB_GENERAL, LOG_NOTICE, |
… |
… |
void WelcomeDialog::customEvent(QEvent *e) |
198 | 198 | updateStatusMessage(); |
199 | 199 | updateScreen(); |
200 | 200 | } |
201 | | else if (me->Message().left(12) == "SHUTDOWN_NOW") |
| 201 | else if (me->Message().startsWith("SHUTDOWN_NOW")) |
202 | 202 | { |
203 | 203 | LOG(VB_GENERAL, LOG_NOTICE, |
204 | 204 | "MythWelcome received a SHUTDOWN_NOW event"); |