Correct the usage of std::string and QString

QStrings shouldn't be == "" to check for empty string, use .isEmpty()
QStrings shouldn't be != "" to check for non empty, use .size()
std::string shouldn't be cleared with = "", use .clear()

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-05-10 21:37:18 -03:00 committed by Dirk Hohndel
parent 3b7624ff46
commit cf848e5233
5 changed files with 18 additions and 18 deletions

View file

@ -525,15 +525,15 @@ int EXIFInfo::parseFromEXIFSegment(const unsigned char *buf, unsigned len)
void EXIFInfo::clear()
{
// Strings
ImageDescription = "";
Make = "";
Model = "";
Software = "";
DateTime = "";
DateTimeOriginal = "";
DateTimeDigitized = "";
SubSecTimeOriginal = "";
Copyright = "";
ImageDescription.clear();
Make.clear();
Model.clear();
Software.clear();
DateTime.clear();
DateTimeOriginal.clear();
DateTimeDigitized.clear();
SubSecTimeOriginal.clear();
Copyright.clear();
// Shorts / unsigned / double
ByteAlign = 0;

View file

@ -48,11 +48,11 @@ GlobeGPS::GlobeGPS(QWidget *parent) : MarbleWidget(parent),
QDir marble;
if (!list.contains("earth/googlesat/googlesat.dgml")) {
subsurfaceDataPath = getSubsurfaceDataPath("marbledata");
if (subsurfaceDataPath != "") {
if (subsurfaceDataPath.size()) {
MarbleDirs::setMarbleDataPath(subsurfaceDataPath);
} else {
subsurfaceDataPath = getSubsurfaceDataPath("data");
if (subsurfaceDataPath != "")
if (subsurfaceDataPath.size())
MarbleDirs::setMarbleDataPath(subsurfaceDataPath);
}
}

View file

@ -30,7 +30,7 @@ UserManual::UserManual(QWidget *parent) : QMainWindow(parent),
ui->webView->page()->setLinkDelegationPolicy(QWebPage::DelegateExternalLinks);
QString searchPath = getSubsurfaceDataPath("Documentation");
if (searchPath != "") {
if (searchPath.size()) {
QUrl url(searchPath.append("/user-manual.html"));
ui->webView->setUrl(url);
} else {