Merge pull request #5386 from Beep6581/use_empty

use empty() instead of comparison with an empty string
This commit is contained in:
Ingo Weyrich 2019-07-22 16:16:24 +02:00 committed by GitHub
commit c5e9482a29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 85 additions and 356 deletions

View File

@ -5653,7 +5653,7 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double
double ImProcFunctions::getAutoDistor (const Glib::ustring &fname, int thumb_size)
{
if (fname != "") {
if (!fname.empty()) {
rtengine::RawMetaDataLocation ri;
int w_raw = -1, h_raw = thumb_size;
int w_thumb = -1, h_thumb = thumb_size;

View File

@ -39,11 +39,11 @@ namespace
Glib::ustring expandRelativePath(const Glib::ustring &procparams_fname, const Glib::ustring &prefix, Glib::ustring embedded_fname)
{
if (embedded_fname == "" || !Glib::path_is_absolute(procparams_fname)) {
if (embedded_fname.empty() || !Glib::path_is_absolute(procparams_fname)) {
return embedded_fname;
}
if (prefix != "") {
if (!prefix.empty()) {
if (embedded_fname.length() < prefix.length() || embedded_fname.substr(0, prefix.length()) != prefix) {
return embedded_fname;
}
@ -61,7 +61,7 @@ Glib::ustring expandRelativePath(const Glib::ustring &procparams_fname, const Gl
Glib::ustring relativePathIfInside(const Glib::ustring &procparams_fname, bool fnameAbsolute, Glib::ustring embedded_fname)
{
if (fnameAbsolute || embedded_fname == "" || !Glib::path_is_absolute(procparams_fname)) {
if (fnameAbsolute || embedded_fname.empty() || !Glib::path_is_absolute(procparams_fname)) {
return embedded_fname;
}

View File

@ -3824,7 +3824,7 @@ bool RawImageSource::findInputProfile(Glib::ustring inProfile, cmsHPROFILE embed
return false;
}
if (inProfile == "(embedded)" && embedded) {
if (embedded && inProfile == "(embedded)") {
in = embedded;
} else if (inProfile == "(cameraICC)") {
// DCPs have higher quality, so use them first
@ -3833,7 +3833,7 @@ bool RawImageSource::findInputProfile(Glib::ustring inProfile, cmsHPROFILE embed
if (*dcpProf == nullptr) {
in = ICCStore::getInstance()->getStdProfile(camName);
}
} else if (inProfile != "(camera)" && inProfile != "") {
} else if (inProfile != "(camera)" && !inProfile.empty()) {
Glib::ustring normalName = inProfile;
if (!inProfile.compare (0, 5, "file:")) {

View File

@ -1326,7 +1326,7 @@ private:
} else {
// use the selected output profile if present, otherwise use LCMS2 profile generate by lab2rgb16 w/ gamma
if (params.icm.outputProfile != "" && params.icm.outputProfile != ColorManagementParams::NoICMString) {
if (!params.icm.outputProfile.empty() && params.icm.outputProfile != ColorManagementParams::NoICMString) {
// if ICCStore::getInstance()->getProfile send back an object, then ICCStore::getInstance()->getContent will do too
cmsHPROFILE jprof = ICCStore::getInstance()->getProfile (params.icm.outputProfile); //get outProfile

View File

@ -224,7 +224,7 @@ void StdImageSource::colorSpaceConversion (Imagefloat* im, const ColorManagement
cmsHPROFILE in = nullptr;
cmsHPROFILE out = ICCStore::getInstance()->workingSpace (cmp.workingProfile);
if (cmp.inputProfile == "(embedded)" || cmp.inputProfile == "" || cmp.inputProfile == "(camera)" || cmp.inputProfile == "(cameraICC)") {
if (cmp.inputProfile == "(embedded)" || cmp.inputProfile.empty() || cmp.inputProfile == "(camera)" || cmp.inputProfile == "(cameraICC)") {
if (embedded) {
in = embedded;
} else {

View File

@ -257,65 +257,18 @@ public:
std::ostringstream af;
if (aff & 1)
if (af.str() == "") {
af << "Center";
} else {
af << ", Center";
} else if (aff & 2)
if (af.str() == "") {
af << "Top";
} else {
af << ", Top";
} else if (aff & 4)
if (af.str() == "") {
af << "Bottom";
} else {
af << ", Bottom";
} else if (aff & 8)
if (af.str() == "") {
af << "Left";
} else {
af << ", Left";
} else if (aff & 16)
if (af.str() == "") {
af << "Right";
} else {
af << ", Right";
} else if (aff & 32)
if (af.str() == "") {
af << "Upper-left";
} else {
af << ", Upper-left";
} else if (aff & 64)
if (af.str() == "") {
af << "Upper-right";
} else {
af << ", Upper-right";
} else if (aff & 128)
if (af.str() == "") {
af << " Lower-left";
} else {
af << ", Lower-left";
} else if (aff & 256)
if (af.str() == "") {
af << "Lower-right";
} else {
af << ", Lower-right";
} else if (aff & 512)
if (af.str() == "") {
af << "Far Left";
} else {
af << ", Far Left";
} else if (aff & 1024) {
if (af.str() == "") {
af << "Far Right";
} else {
af << ", Far Right";
if (aff) {
for (size_t i = 0; i < afpchoices.size(); ++i) {
if (aff & (1 << i)) {
if (!af.str().empty()) {
af << ", ";
}
af << afpchoices.at(i);
}
}
}
str << "AFPointsInFocus = " << af.str();
str << "AFPointsInFocus = " << (af.str().empty() ? "None" : af.str());
return str.str();
}
};
@ -553,7 +506,7 @@ public:
std::map<std::string, std::string>::const_iterator r = lenses.find (lid.str());
if (r != lenses.end()) {
if (r == lenses.begin() && EffectiveMaxApertureString != "") { // first entry is for unchipped lenses
if (r == lenses.begin() && !EffectiveMaxApertureString.empty()) { // first entry is for unchipped lenses
Tag *FLTag = t->getParent()->getRoot()->findTag ("FocalLength");
ld << "Lens = MF ";

View File

@ -667,7 +667,7 @@ rtengine::ProcessingJob* BatchQueue::imageReady(rtengine::IImagefloat* img)
Glib::ustring fname;
SaveFormat saveFormat;
if (processing->outFileName == "") { // auto file name
if (processing->outFileName.empty()) { // auto file name
Glib::ustring s = calcAutoFileNameBase (processing->filename, processing->sequence);
saveFormat = options.saveFormatBatch;
fname = autoCompleteFileName (s, saveFormat.format);
@ -686,7 +686,7 @@ rtengine::ProcessingJob* BatchQueue::imageReady(rtengine::IImagefloat* img)
//printf ("fname=%s, %s\n", fname.c_str(), removeExtension(fname).c_str());
if (img && fname != "") {
if (img && !fname.empty()) {
int err = 0;
if (saveFormat.format == "tif") {

View File

@ -125,7 +125,7 @@ void DarkFrame::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi
Glib::ustring fname = Glib::path_get_basename(dfp->GetCurrentImageFilePath());
Glib::ustring filetype;
if (fname != "") {
if (!fname.empty()) {
// get image filetype, set filter to the same as current image's filetype
std::string::size_type idx;
idx = fname.rfind('.');

View File

@ -496,7 +496,7 @@ void ExifPanel::addPressed ()
Glib::ustring sel = getSelection (true);
if (sel == "") {
if (sel.empty()) {
tcombo->set_active_text ("Exif.UserComment");
} else {
tcombo->set_active_text (sel);
@ -658,7 +658,7 @@ Glib::ustring ExifPanel::getSelection (bool onlyeditable)
void ExifPanel::updateChangeList (Gtk::TreeModel::Children root, std::string prefix)
{
if (prefix != "") {
if (!prefix.empty()) {
prefix = prefix + ".";
}

View File

@ -97,7 +97,7 @@ void FavoritBrowser::dirSelected (const Glib::ustring& dirname, const Glib::ustr
void FavoritBrowser::addPressed ()
{
if (lastSelectedDir == "") {
if (lastSelectedDir.empty()) {
return;
}

View File

@ -358,7 +358,7 @@ void FilePanel::saveOptions ()
options.browserToolPanelWidth = winW - get_position();
options.browserToolPanelHeight = tpcPaned->get_position ();
if (options.startupDir == STARTUPDIR_LAST && fileCatalog->lastSelectedDir () != "") {
if (options.startupDir == STARTUPDIR_LAST && !fileCatalog->lastSelectedDir().empty()) {
options.startupPath = fileCatalog->lastSelectedDir ();
}

View File

@ -192,7 +192,7 @@ void FlatField::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi
Glib::ustring fname = Glib::path_get_basename(ffp->GetCurrentImageFilePath());
Glib::ustring filetype;
if (fname != "") {
if (!fname.empty()) {
// get image filetype, set filter to the same as current image's filetype
std::string::size_type idx;
idx = fname.rfind('.');

View File

@ -504,7 +504,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
if (pp->icm.inputProfile == "(none)") {
inone->set_active(true);
updateDCP(pp->icm.dcpIlluminant, "");
} else if (pp->icm.inputProfile == "(embedded)" || ((pp->icm.inputProfile == "(camera)" || pp->icm.inputProfile == "") && icamera->get_state() == Gtk::STATE_INSENSITIVE)) {
} else if (pp->icm.inputProfile == "(embedded)" || ((pp->icm.inputProfile == "(camera)" || pp->icm.inputProfile.empty()) && icamera->get_state() == Gtk::STATE_INSENSITIVE)) {
iembedded->set_active(true);
updateDCP(pp->icm.dcpIlluminant, "");
} else if ((pp->icm.inputProfile == "(cameraICC)") && icameraICC->get_state() != Gtk::STATE_INSENSITIVE) {
@ -519,7 +519,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
// If neither (camera) nor (cameraICC) are available, as is the case when loading a non-raw, activate (embedded).
iembedded->set_active(true);
updateDCP(pp->icm.dcpIlluminant, "(cameraICC)");
} else if ((pp->icm.inputProfile == "(camera)" || pp->icm.inputProfile == "") && icamera->get_state() != Gtk::STATE_INSENSITIVE) {
} else if ((pp->icm.inputProfile == "(camera)" || pp->icm.inputProfile.empty()) && icamera->get_state() != Gtk::STATE_INSENSITIVE) {
icamera->set_active(true);
updateDCP(pp->icm.dcpIlluminant, "");
} else {
@ -949,7 +949,7 @@ void ICMPanel::setRawMeta(bool raw, const rtengine::FramesData* pMeta)
void ICMPanel::ipSelectionChanged()
{
if (ipDialog->get_filename() == "") {
if (ipDialog->get_filename().empty()) {
return;
}

View File

@ -247,7 +247,7 @@ bool ImageArea::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr)
(*i)->expose (cr);
}
if (options.showInfo && infotext != "") {
if (options.showInfo && !infotext.empty()) {
iBackBuffer.copySurface(cr);
}

View File

@ -34,7 +34,7 @@ InspectorBuffer::InspectorBuffer(const Glib::ustring &imagePath) : currTransform
// generate thumbnail image
Glib::ustring ext = getExtension (imagePath);
if (ext == "") {
if (ext.empty()) {
imgPath.clear();
return;
}

View File

@ -45,6 +45,12 @@ void LWButton::setPosition (int x, int y)
ypos = y;
}
void LWButton::addPosition (int x, int y)
{
xpos += x;
ypos += y;
}
void LWButton::getPosition (int& x, int& y) const
{
@ -219,15 +225,11 @@ void LWButton::getAlignment (Alignment& ha, Alignment& va) const
Glib::ustring LWButton::getToolTip (int x, int y) const
{
if (inside(x, y)) {
if (toolTip) {
return *toolTip;
} else {
return "";
}
} else {
return "";
}
if (inside(x, y) && toolTip) {
return *toolTip;
} else {
return {};
}
}
void LWButton::setToolTip (Glib::ustring* tooltip)

View File

@ -57,6 +57,7 @@ public:
void getSize (int& minw, int& minh) const;
void getAlignment (Alignment& ha, Alignment& va) const;
void setPosition (int x, int y);
void addPosition (int x, int y);
void getPosition (int& x, int& y) const;
bool inside (int x, int y) const;
void setIcon (Cairo::RefPtr<RTSurface> i);

View File

@ -24,21 +24,18 @@ LWButtonSet::LWButtonSet () : aw(0), ah(0), ax(-1), ay(-1)
LWButtonSet::~LWButtonSet ()
{
for (size_t i = 0; i < buttons.size(); i++) {
delete buttons[i];
for (const auto entry : buttons) {
delete entry;
}
}
void LWButtonSet::add (LWButton* b)
{
buttons.push_back (b);
}
void LWButtonSet::getMinimalDimensions (int& w, int& h)
void LWButtonSet::getMinimalDimensions (int& w, int& h) const
{
w = 0;
h = 0;
@ -104,108 +101,86 @@ void LWButtonSet::arrangeButtons (int x, int y, int w, int h)
void LWButtonSet::move (int nx, int ny)
{
for (size_t i = 0; i < buttons.size(); i++) {
int x, y;
buttons[i]->getPosition (x, y);
buttons[i]->setPosition (x + nx - ax, y + ny - ay);
for (const auto entry : buttons) {
entry->addPosition(nx - ax, ny - ay);
}
ax = nx;
ay = ny;
}
void LWButtonSet::redraw (Cairo::RefPtr<Cairo::Context> context)
{
for (size_t i = 0; i < buttons.size(); i++) {
buttons[i]->redraw (context);
for (const auto entry : buttons) {
entry->redraw(context);
}
}
bool LWButtonSet::motionNotify (int x, int y)
{
bool res = false;
for (size_t i = 0; i < buttons.size(); i++) {
bool handled = buttons[i]->motionNotify (x, y);
res = res || handled;
for (const auto entry : buttons) {
res = entry->motionNotify(x, y) || res;
}
return res;
}
bool LWButtonSet::pressNotify (int x, int y)
{
bool res = false;
for (size_t i = 0; i < buttons.size(); i++) {
bool handled = buttons[i]->pressNotify (x, y);
res = res || handled;
for (const auto entry : buttons) {
res = entry->pressNotify(x, y) || res;
}
return res;
}
bool LWButtonSet::releaseNotify (int x, int y)
{
bool res = false;
for (size_t i = 0; i < buttons.size(); i++) {
bool handled = buttons[i]->releaseNotify (x, y);
res = res || handled;
for (const auto entry : buttons) {
res = entry->releaseNotify(x, y) || res;
}
return res;
}
bool LWButtonSet::inside (int x, int y)
bool LWButtonSet::inside (int x, int y) const
{
for (size_t i = 0; i < buttons.size(); i++)
if (buttons[i]->inside (x, y)) {
for (const auto entry : buttons) {
if (entry->inside(x, y)) {
return true;
}
}
return false;
}
void LWButtonSet::setButtonListener (LWButtonListener* bl)
{
for (size_t i = 0; i < buttons.size(); i++) {
buttons[i]->setButtonListener (bl);
for (const auto entry : buttons) {
entry->setButtonListener(bl);
}
}
void LWButtonSet::getAllocatedDimensions (int& w, int& h)
void LWButtonSet::getAllocatedDimensions (int& w, int& h) const
{
w = aw;
h = ah;
}
void LWButtonSet::setColors (const Gdk::RGBA& bg, const Gdk::RGBA& fg)
{
for (size_t i = 0; i < buttons.size(); i++) {
buttons[i]->setColors (bg, fg);
for (const auto entry : buttons) {
entry->setColors(bg, fg);
}
}
Glib::ustring LWButtonSet::getToolTip (int x, int y)
Glib::ustring LWButtonSet::getToolTip (int x, int y) const
{
for (const auto entry : buttons) {
const auto ttip = entry->getToolTip(x, y);
for (size_t i = 0; i < buttons.size(); i++) {
Glib::ustring ttip = buttons[i]->getToolTip (x, y);
if (ttip != "") {
if (!ttip.empty()) {
return ttip;
}
}
return "";
return {};
}

View File

@ -16,8 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LWBUTTONSET_
#define _LWBUTTONSET_
#pragma once
#include <gtkmm.h>
#include "lwbutton.h"
@ -35,20 +34,18 @@ public:
void add (LWButton* b);
void getMinimalDimensions (int& w, int& h);
void getAllocatedDimensions (int& w, int& h);
void getMinimalDimensions (int& w, int& h) const;
void getAllocatedDimensions (int& w, int& h) const;
void arrangeButtons (int x, int y, int w, int h);
void setColors (const Gdk::RGBA& bg, const Gdk::RGBA& fg);
bool motionNotify (int x, int y);
bool pressNotify (int x, int y);
bool releaseNotify (int x, int y);
void move (int nx, int ny);
bool inside (int x, int y);
bool inside (int x, int y) const;
Glib::ustring getToolTip (int x, int y);
Glib::ustring getToolTip (int x, int y) const;
void setButtonListener (LWButtonListener* bl);
void redraw (Cairo::RefPtr<Cairo::Context> context);
};
#endif

View File

@ -309,7 +309,7 @@ void PlacesBrowser::dirSelected (const Glib::ustring& dirname, const Glib::ustri
void PlacesBrowser::addPressed ()
{
if (lastSelectedDir == "") {
if (lastSelectedDir.empty()) {
return;
}

View File

@ -88,159 +88,3 @@ Glib::ustring RenameDialog::getNewName ()
return newName->get_text ();
}
//void RenameDialog::fillTemplateList ()
//{
//
// templateModel->clear ();
//
// for (size_t i = 0; i < options.renameTemplates.size(); i++) {
// Gtk::TreeModel::iterator iter = templateModel->append ();
// iter->set_value (templateColumns.tmplName, options.renameTemplates[i]);
// iter->set_value (templateColumns.rowSeparator, false);
// }
//
// // append separator and the manage... item
// Gtk::TreeModel::iterator iter = templateModel->append ();
// iter->set_value (templateColumns.tmplName, Glib::ustring(""));
// iter->set_value (templateColumns.rowSeparator, true);
// iter = templateModel->append ();
// iter->set_value (templateColumns.tmplName, Glib::ustring(M("FILEBROWSER_ADDDELTEMPLATE")));
// iter->set_value (templateColumns.rowSeparator, false);
//}
//bool RenameDialog::rowSeparatorFunc (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::iterator& iter)
//{
//
// return iter->get_value (templateColumns.rowSeparator);
//}
//void RenameDialog::useTemplToggled ()
//{
//
// templates->set_sensitive (useTmpl->get_active ());
//
// if (useTmpl->get_active () && isTemplSelected ()) {
// all->set_sensitive (true);
// newName->set_text (applyTemplate (oldName->get_text(), imageData, getActiveTemplate()));
// } else {
// all->set_sensitive (false);
// }
//
// newName->select_region (0, newName->get_text().size());
//}
//bool RenameDialog::isTemplSelected ()
//{
//
// Gtk::TreeModel::iterator iter = templates->get_active();
// return iter && iter->get_value (templateColumns.tmplName) != M("FILEBROWSER_ADDDELTEMPLATE");
//}
//Glib::ustring RenameDialog::getActiveTemplate ()
//{
//
// Gtk::TreeModel::iterator iter = templates->get_active();
//
// if (iter && iter->get_value (templateColumns.tmplName) != M("FILEBROWSER_ADDDELTEMPLATE")) {
// return iter->get_value (templateColumns.tmplName);
// } else {
// return "";
// }
//}
//void RenameDialog::tmplSelectionChanged ()
//{
//
// Gtk::TreeModel::iterator iter = templates->get_active();
//
// if (iter && iter->get_value (templateColumns.tmplName) == M("FILEBROWSER_ADDDELTEMPLATE")) {
// RenameTemplateEditor* rte = new RenameTemplateEditor (p);
//
// if (rte->run() == Gtk::RESPONSE_OK) {
// fillTemplateList ();
// }
//
// delete rte;
// // show add/del template dialog
// } else {
// useTemplToggled ();
// }
//}
//RenameTemplateEditor::RenameTemplateEditor (Gtk::Window* parent)
// : Gtk::Dialog ("Edit rename templates", *parent, true)
//{
//
// list = Gtk::manage (new Gtk::ListViewText (1, false, Gtk::SELECTION_MULTIPLE));
// list->set_headers_visible (false);
// get_content_area ()->pack_start (*list);
//
// Gtk::HBox* hb = Gtk::manage (new Gtk::HBox ());
// templ = Gtk::manage (new Gtk::Entry ());
// Gtk::Button* add = Gtk::manage (new Gtk::Button ());
// Gtk::Button* del = Gtk::manage (new Gtk::Button ());
// add->add (*Gtk::manage (new RTImage ("add-small.png")));
// del->add (*Gtk::manage (new RTImage ("remove-small.png")));
// hb->pack_start (*templ);
// hb->pack_start (*add, Gtk::PACK_SHRINK, 2);
// hb->pack_start (*del, Gtk::PACK_SHRINK, 2);
//
// get_content_area ()->pack_start (*hb, Gtk::PACK_SHRINK, 4);
//
// add_button (Gtk::Stock::OK, Gtk::RESPONSE_OK);
//
// refreshTemplateList ();
//
// add->signal_pressed().connect( sigc::mem_fun(*this, &RenameTemplateEditor::addPressed) );
// del->signal_pressed().connect( sigc::mem_fun(*this, &RenameTemplateEditor::delPressed) );
//
// show_all_children ();
//
// set_size_request (-1, 250);
//}
//
//void RenameTemplateEditor::refreshTemplateList ()
//{
//
// list->remove_all_columns();
//
// for (size_t i = 0; i < options.renameTemplates.size(); i++) {
// list->append (options.renameTemplates[i]);
// }
//}
//
//void RenameTemplateEditor::addPressed ()
//{
//
// if (templ->get_text() != "") {
// options.renameTemplates.push_back (templ->get_text ());
// refreshTemplateList ();
// templ->set_text("");
// }
//}
//
//void RenameTemplateEditor::delPressed ()
//{
//
// std::vector<int> sel = list->get_selected ();
//
// for (size_t i = 0; i < sel.size(); i++) {
// Glib::ustring toDel = list->get_text (sel[i]);
// std::vector<Glib::ustring>::iterator f = std::find (options.renameTemplates.begin(), options.renameTemplates.end(), toDel);
//
// if (f != options.renameTemplates.end()) {
// options.renameTemplates.erase (f);
// }
// }
//
// refreshTemplateList ();
//}
//Glib::ustring RenameDialog::applyTemplate (const Glib::ustring& oName, const CacheImageData* cid, const Glib::ustring& templ)
//{
//
// return Glib::ustring ("szeva");
//
//}

View File

@ -30,62 +30,19 @@ class RenameDialog : public Gtk::Dialog
protected:
// class TemplateColumns : public Gtk::TreeModel::ColumnRecord
// {
// public:
// Gtk::TreeModelColumn<Glib::ustring> tmplName;
// Gtk::TreeModelColumn<bool> rowSeparator;
// TemplateColumns()
// {
// add(tmplName);
// add(rowSeparator);
// }
// };
// TemplateColumns templateColumns;
// Glib::RefPtr<Gtk::ListStore> templateModel;
Gtk::Window* p;
Gtk::Label* oldName;
Gtk::Entry* newName;
// Gtk::CheckButton* useTmpl;
// MyComboBox* templates;
// Gtk::Button* all;
const CacheImageData* imageData;
// void fillTemplateList ();
public:
explicit RenameDialog (Gtk::Window* parent);
void initName (const Glib::ustring& iname, const CacheImageData* cid);
Glib::ustring getNewName ();
// bool rowSeparatorFunc (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::iterator& iter);
// void tmplSelectionChanged ();
// void useTemplToggled ();
// bool isTemplSelected ();
// Glib::ustring getActiveTemplate ();
// static Glib::ustring applyTemplate (const Glib::ustring& oName, const CacheImageData* cid, const Glib::ustring& templ);
};
//class RenameTemplateEditor : public Gtk::Dialog
//{
//
//protected:
// Gtk::ListViewText* list;
// Gtk::Entry* templ;
//
// void refreshTemplateList ();
//public:
// explicit RenameTemplateEditor (Gtk::Window* parent);
//
// Glib::ustring getSelectedTemplate ();
//
// void addPressed ();
// void delPressed ();
//};
#endif

View File

@ -748,7 +748,7 @@ bool ThumbBrowserBase::Internal::on_query_tooltip (int x, int y, bool keyboard_t
}
}
if (ttip != "") {
if (!ttip.empty()) {
tooltip->set_markup (ttip);
return true;
} else {

View File

@ -401,7 +401,7 @@ void ThumbBrowserEntryBase::updateBackBuffer ()
// draw date/time label
int tpos = fnlabh;
if (options.fbShowDateTime && datetimeline != "") {
if (options.fbShowDateTime && !datetimeline.empty()) {
fn = w->create_pango_layout (datetimeline);
fn->set_width (textw * Pango::SCALE);
fn->set_ellipsize (Pango::ELLIPSIZE_MIDDLE);
@ -412,7 +412,7 @@ void ThumbBrowserEntryBase::updateBackBuffer ()
}
// draw basic exif info
if (options.fbShowBasicExif && exifline != "") {
if (options.fbShowBasicExif && !exifline.empty()) {
fn = w->create_pango_layout (exifline);
fn->set_width (textw * Pango::SCALE);
fn->set_ellipsize (Pango::ELLIPSIZE_MIDDLE);

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 files do not have ExpComp, so value will not be displayed.
exifString = Glib::ustring::compose ("%1 %2EV", exifString, cfs.expcomp); // append exposure compensation to exifString
}