use empty() instead of comparison with an empty string

This commit is contained in:
Ingo Weyrich
2019-07-22 13:49:08 +02:00
parent fd6453d1a8
commit cbb3f05b7e
25 changed files with 85 additions and 356 deletions

View File

@@ -117,9 +117,9 @@ void Thumbnail::_generateThumbnailImage ()
imgRatio = -1.;
// generate thumbnail image
Glib::ustring ext = getExtension (fname);
const std::string ext = getExtension(fname).lowercase();
if (ext == "") {
if (ext.empty()) {
return;
}
@@ -127,20 +127,20 @@ void Thumbnail::_generateThumbnailImage ()
cfs.exifValid = false;
cfs.timeValid = false;
if (ext.lowercase() == "jpg" || ext.lowercase() == "jpeg") {
if (ext == "jpg" || ext == "jpeg") {
infoFromImage (fname);
tpp = rtengine::Thumbnail::loadFromImage (fname, tw, th, 1, pparams->wb.equal);
if (tpp) {
cfs.format = FT_Jpeg;
}
} else if (ext.lowercase() == "png") {
} else if (ext == "png") {
tpp = rtengine::Thumbnail::loadFromImage (fname, tw, th, 1, pparams->wb.equal);
if (tpp) {
cfs.format = FT_Png;
}
} else if (ext.lowercase() == "tif" || ext.lowercase() == "tiff") {
} else if (ext == "tif" || ext == "tiff") {
infoFromImage (fname);
tpp = rtengine::Thumbnail::loadFromImage (fname, tw, th, 1, pparams->wb.equal);
@@ -716,7 +716,7 @@ void Thumbnail::generateExifDateTimeStrings ()
exifString = Glib::ustring::compose ("f/%1 %2s %3%4 %5mm", Glib::ustring(rtengine::FramesData::apertureToString(cfs.fnumber)), Glib::ustring(rtengine::FramesData::shutterToString(cfs.shutter)), M("QINFO_ISO"), cfs.iso, Glib::ustring::format(std::setw(3), std::fixed, std::setprecision(2), cfs.focalLen));
if (options.fbShowExpComp && cfs.expcomp != "0.00" && cfs.expcomp != "") { // don't show exposure compensation if it is 0.00EV;old cache iles do not have ExpComp, so value will not be displayed.
if (options.fbShowExpComp && cfs.expcomp != "0.00" && !cfs.expcomp.empty()) { // don't show exposure compensation if it is 0.00EV;old cache iles do not have ExpComp, so value will not be displayed.
exifString = Glib::ustring::compose ("%1 %2EV", exifString, cfs.expcomp); // append exposure compensation to exifString
}