Do not assign empty strings on creation of std::string or Glib::ustring

This commit is contained in:
Ingo Weyrich 2019-07-31 20:21:16 +02:00
parent 4101102ddf
commit 41fc34c5c6
14 changed files with 13 additions and 19 deletions

View File

@ -65,7 +65,7 @@ Glib::ustring relativePathIfInside(const Glib::ustring &procparams_fname, bool f
return embedded_fname;
}
Glib::ustring prefix = "";
Glib::ustring prefix;
if (embedded_fname.length() > 5 && embedded_fname.substr(0, 5) == "file:") {
embedded_fname = embedded_fname.substr(5);

View File

@ -535,7 +535,7 @@ PartialProfile *ProfileStore::loadDynamicProfile (const FramesMetaData *im)
return ret;
}
ProfileStoreEntry::ProfileStoreEntry() : label (""), type (PSET_FOLDER), parentFolderId (0), folderId (0) {}
ProfileStoreEntry::ProfileStoreEntry() : type (PSET_FOLDER), parentFolderId (0), folderId (0) {}
ProfileStoreEntry::ProfileStoreEntry (Glib::ustring label, PSEType type, unsigned short parentFolder, unsigned short folder) : label (label), type (type), parentFolderId (parentFolder), folderId (folder) {}

View File

@ -132,7 +132,7 @@ Glib::ustring LFModifier::getDisplayString() const
return "NONE";
} else {
Glib::ustring ret;
Glib::ustring sep = "";
Glib::ustring sep;
if (flags_ & LF_MODIFY_DISTORTION) {
ret += "distortion";
sep = ", ";

View File

@ -811,7 +811,7 @@ Glib::ustring BatchQueue::calcAutoFileNameBase (const Glib::ustring& origFileNam
break;
}
Glib::ustring tok = "";
Glib::ustring tok;
while ((i < origFileName.size()) && !(origFileName[i] == '\\' || origFileName[i] == '/')) {
tok = tok + origFileName[i++];
@ -857,7 +857,7 @@ Glib::ustring BatchQueue::calcAutoFileNameBase (const Glib::ustring& origFileNam
// constructing full output path
// printf ("path=|%s|\n", options.savePath.c_str());
Glib::ustring path = "";
Glib::ustring path;
if (options.saveUsePathTemplate) {
unsigned int ix = 0;

View File

@ -40,7 +40,6 @@ BatchQueueEntry::BatchQueueEntry (rtengine::ProcessingJob* pjob, const rtengine:
job(pjob),
params(new rtengine::procparams::ProcParams(pparams)),
progress(0),
outFileName(""),
sequence(0),
forceFormatOpts(false),
fast_pipeline(job->fastPipeline()),

View File

@ -23,7 +23,7 @@
#include "curveeditorgroup.h"
Axis::Axis()
: label(""), decimal(5), increment(0.001), pageIncrement(0.01), rangeLowerBound(0.), rangeUpperBound(1.)
: decimal(5), increment(0.001), pageIncrement(0.01), rangeLowerBound(0.), rangeUpperBound(1.)
{}
Axis::Axis(Glib::ustring label, unsigned int decimal, double increment, double pageIncrement, double valMin = 0.0, double valMax = 1.0)

View File

@ -397,7 +397,7 @@ void CurveEditorGroup::setUnChanged (bool uc, CurveEditor* ce)
}
}
CurveEditorSubGroup::CurveEditorSubGroup(Glib::ustring& curveDir) : curveDir(curveDir), lastFilename(""), valLinear(0), valUnchanged(0), parent(nullptr)
CurveEditorSubGroup::CurveEditorSubGroup(Glib::ustring& curveDir) : curveDir(curveDir), valLinear(0), valUnchanged(0), parent(nullptr)
{
leftBar = nullptr;
bottomBar = nullptr;

View File

@ -632,7 +632,7 @@ Glib::ustring ExifPanel::getSelection (bool onlyeditable)
Gtk::TreeModel::iterator iter = exifTreeModel->get_iter (rows[0]);
Glib::ustring ret = "";
Glib::ustring ret;
bool first = true;
bool editable = false;

View File

@ -20,7 +20,7 @@
#include "multilangmgr.h"
#include "rtimage.h"
FavoritBrowser::FavoritBrowser () : listener (NULL), lastSelectedDir ("")
FavoritBrowser::FavoritBrowser () : listener (NULL)
{
scrollw = Gtk::manage (new Gtk::ScrolledWindow ());

View File

@ -457,8 +457,6 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) :
hScrollPos[i] = 0;
vScrollPos[i] = 0;
}
selectedDirectory = "";
}
FileCatalog::~FileCatalog()

View File

@ -86,7 +86,6 @@ FlatField::FlatField () : FoldableToolPanel(this, "flatfield", M("TP_FLATFIELD_L
flatFieldFileReset->signal_clicked().connect( sigc::mem_fun(*this, &FlatField::flatFieldFile_Reset), true );
flatFieldAutoSelectconn = flatFieldAutoSelect->signal_toggled().connect ( sigc::mem_fun(*this, &FlatField::flatFieldAutoSelectChanged), true);
flatFieldBlurTypeconn = flatFieldBlurType->signal_changed().connect( sigc::mem_fun(*this, &FlatField::flatFieldBlurTypeChanged) );
lastShortcutPath = "";
// Set filename filters
b_filter_asCurrent = false;

View File

@ -34,7 +34,7 @@ using namespace rtengine::procparams;
extern Options options;
ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iunchanged(nullptr), icmplistener(nullptr), lastRefFilename(""), camName("")
ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iunchanged(nullptr), icmplistener(nullptr)
{
auto m = ProcEventMapper::getInstance();
EvICMprimariMethod = m->newEvent(GAMMA, "HISTORY_MSG_ICM_OUTPUT_PRIMARIES");
@ -304,8 +304,6 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha
ipDialog->set_show_hidden(true); // ProgramData is hidden on Windows
#endif
oldip = "";
wprofnamesconn = wProfNames->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::wpChanged));
oprofnamesconn = oProfNames->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::opChanged));
orendintentconn = oRendIntent->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::oiChanged));

View File

@ -256,7 +256,7 @@ int processLineParams ( int argc, char **argv )
{
rtengine::procparams::PartialProfile *rawParams = nullptr, *imgParams = nullptr;
std::vector<Glib::ustring> inputFiles;
Glib::ustring outputPath = "";
Glib::ustring outputPath;
std::vector<rtengine::procparams::PartialProfile*> processingParams;
bool outputDirectory = false;
bool leaveUntouched = false;
@ -271,7 +271,7 @@ int processLineParams ( int argc, char **argv )
int subsampling = 3;
int bits = -1;
bool isFloat = false;
std::string outputType = "";
std::string outputType;
unsigned errors = 0;
for ( int iArg = 1; iArg < argc; iArg++) {

View File

@ -42,7 +42,7 @@ void ProfilePanel::cleanup ()
delete partialProfileDlg;
}
ProfilePanel::ProfilePanel () : storedPProfile(nullptr), lastFilename(""), imagePath(""), lastSavedPSE(nullptr), customPSE(nullptr)
ProfilePanel::ProfilePanel () : storedPProfile(nullptr), lastSavedPSE(nullptr), customPSE(nullptr)
{
tpc = nullptr;