Use isEmpty() instead of == "".
From: Erik Hovland <erik@hovland.org>
---
mythtv/libs/libmythdb/httpcomms.cpp | 6 +++---
mythtv/libs/libmythdb/lcddevice.cpp | 8 ++++----
mythtv/libs/libmythdb/mythdb.cpp | 7 ++++---
mythtv/libs/libmythdb/mythsocket.cpp | 2 +-
mythtv/libs/libmythdb/mythstorage.h | 2 +-
5 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/mythtv/libs/libmythdb/httpcomms.cpp b/mythtv/libs/libmythdb/httpcomms.cpp
index 5901c3e..33debf7 100644
a
|
b
|
QString HttpComms::getHttp(QString &url, |
302 | 302 | while (1) |
303 | 303 | { |
304 | 304 | QUrl qurl(url); |
305 | | if (hostname == "") |
| 305 | if (hostname.isEmpty()) |
306 | 306 | hostname = qurl.host(); // hold onto original host |
307 | 307 | if (qurl.host().isEmpty()) // can occur on redirects to partial paths |
308 | 308 | qurl.setHost(hostname); |
… |
… |
bool HttpComms::getHttpFile(const QString& filename, QString& url, int timeoutMS |
394 | 394 | while (1) |
395 | 395 | { |
396 | 396 | QUrl qurl(url); |
397 | | if (hostname == "") |
| 397 | if (hostname.isEmpty()) |
398 | 398 | hostname = qurl.host(); // hold onto original host |
399 | 399 | |
400 | 400 | if (qurl.host().isEmpty()) // can occur on redirects to partial paths |
… |
… |
QString HttpComms::postHttp(QUrl &url , |
547 | 547 | |
548 | 548 | while (1) |
549 | 549 | { |
550 | | if (hostname == "") |
| 550 | if (hostname.isEmpty()) |
551 | 551 | hostname = url.host(); // hold onto original host |
552 | 552 | if (url.host().isEmpty()) // can occur on redirects to partial paths |
553 | 553 | url.setHost(hostname); |
diff --git a/mythtv/libs/libmythdb/lcddevice.cpp b/mythtv/libs/libmythdb/lcddevice.cpp
index 8b36602..31cd1f2 100644
a
|
b
|
LCD::LCD() |
39 | 39 | |
40 | 40 | retryTimer(new QTimer(this)), LEDTimer(new QTimer(this)), |
41 | 41 | |
42 | | send_buffer(""), last_command(QString::null), |
43 | | |
44 | 42 | lcd_width(0), lcd_height(0), |
45 | 43 | |
46 | 44 | lcd_ready(false), lcd_showtime(false), |
… |
… |
LCD::LCD() |
51 | 49 | |
52 | 50 | lcd_popuptime(0), |
53 | 51 | |
54 | | lcd_showmusic_items(QString::null), |
55 | | lcd_keystring(QString::null), |
| 52 | lcd_showmusic_items(), |
| 53 | lcd_keystring(), |
56 | 54 | |
57 | 55 | GetLEDMask(NULL) |
58 | 56 | { |
| 57 | send_buffer.clear(); last_command.clear(); |
| 58 | lcd_showmusic_items.clear(); lcd_keystring.clear(); |
59 | 59 | |
60 | 60 | setObjectName("LCD"); |
61 | 61 | |
diff --git a/mythtv/libs/libmythdb/mythdb.cpp b/mythtv/libs/libmythdb/mythdb.cpp
index 8b9988d..d94dc79 100644
a
|
b
|
class MythDBPrivate |
63 | 63 | }; |
64 | 64 | |
65 | 65 | MythDBPrivate::MythDBPrivate() |
66 | | : m_localhostname(QString::null), m_settings(new Settings()), |
| 66 | : m_settings(new Settings()), |
67 | 67 | ignoreDatabase(false), useSettingsCache(false) |
68 | 68 | { |
| 69 | m_localhostname.clear(); |
69 | 70 | } |
70 | 71 | |
71 | 72 | MythDBPrivate::~MythDBPrivate() |
… |
… |
void MythDB::GetResolutionSetting(const QString &type, |
484 | 485 | |
485 | 486 | QString res = GetSetting(sRes); |
486 | 487 | |
487 | | if ("" != res) |
| 488 | if (!res.isEmpty()) |
488 | 489 | { |
489 | 490 | QStringList slist = res.split(QString("x")); |
490 | 491 | int w = width, h = height; |
… |
… |
void MythDB::OverrideSettingForSession(const QString &key, |
543 | 544 | void MythDB::ClearSettingsCache(QString myKey, QString newVal) |
544 | 545 | { |
545 | 546 | d->settingsCacheLock.lock(); |
546 | | if (myKey != "" && d->settingsCache.contains(myKey)) |
| 547 | if (!myKey.isEmpty() && d->settingsCache.contains(myKey)) |
547 | 548 | { |
548 | 549 | VERBOSE(VB_DATABASE, QString("Clearing Settings Cache for '%1'.") |
549 | 550 | .arg(myKey)); |
diff --git a/mythtv/libs/libmythdb/mythsocket.cpp b/mythtv/libs/libmythdb/mythsocket.cpp
index c0d3ea0..bae58c7 100644
a
|
b
|
bool MythSocket::writeStringList(QStringList &list) |
265 | 265 | } |
266 | 266 | |
267 | 267 | QString str = list.join("[]:[]"); |
268 | | if (str == QString::null) |
| 268 | if (str.isEmpty()) |
269 | 269 | { |
270 | 270 | VERBOSE(VB_IMPORTANT, LOC + |
271 | 271 | "writeStringList: Error, joined null string."); |
diff --git a/mythtv/libs/libmythdb/mythstorage.h b/mythtv/libs/libmythdb/mythstorage.h
index 11b920b..219cf6e 100644
a
|
b
|
class MPUBLIC SimpleDBStorage : public DBStorage |
50 | 50 | public: |
51 | 51 | SimpleDBStorage(StorageUser *_user, |
52 | 52 | QString _table, QString _column) : |
53 | | DBStorage(_user, _table, _column), initval(QString::null) {} |
| 53 | DBStorage(_user, _table, _column) { initval.clear(); } |
54 | 54 | virtual ~SimpleDBStorage() { } |
55 | 55 | |
56 | 56 | virtual void Load(void); |