fixed bugs in loading dynamic profiles
This commit is contained in:
parent
6ae57cd556
commit
eeb2da2613
@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dynamicprofile.h"
|
#include "dynamicprofile.h"
|
||||||
|
#include "profilestore.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <glibmm/regex.h>
|
#include <glibmm/regex.h>
|
||||||
|
|
||||||
@ -235,13 +236,13 @@ PartialProfile *loadDynamicProfile(const ImageMetaData *im)
|
|||||||
if (entry.matches(im)) {
|
if (entry.matches(im)) {
|
||||||
printf("found matching profile %s\n",
|
printf("found matching profile %s\n",
|
||||||
entry.profilepath.c_str());
|
entry.profilepath.c_str());
|
||||||
PartialProfile p(true, true);
|
const PartialProfile *p =
|
||||||
if (!p.load(options.findProfilePath(entry.profilepath))) {
|
profileStore.getProfile(entry.profilepath);
|
||||||
p.applyTo(ret->pparams);
|
if (p != nullptr) {
|
||||||
|
p->applyTo(ret->pparams);
|
||||||
} else {
|
} else {
|
||||||
printf("ERROR loading matching profile\n");
|
printf("ERROR loading matching profile\n");
|
||||||
}
|
}
|
||||||
p.deleteInstance();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "dynamicprofilepanel.h"
|
#include "dynamicprofilepanel.h"
|
||||||
#include "multilangmgr.h"
|
#include "multilangmgr.h"
|
||||||
|
#include "profilestore.h"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
@ -377,7 +378,12 @@ void DynamicProfilePanel::render_profilepath(
|
|||||||
auto row = *iter;
|
auto row = *iter;
|
||||||
Gtk::CellRendererText *ct = static_cast<Gtk::CellRendererText *>(cell);
|
Gtk::CellRendererText *ct = static_cast<Gtk::CellRendererText *>(cell);
|
||||||
auto value = row[columns_.profilepath];
|
auto value = row[columns_.profilepath];
|
||||||
ct->property_text() = value;
|
auto pse = profileStore.findEntryFromFullPath(value);
|
||||||
|
if (pse != nullptr) {
|
||||||
|
ct->property_text() = pse->label;
|
||||||
|
} else {
|
||||||
|
ct->property_text() = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -438,11 +438,13 @@ Gtk::Widget* Preferences::getProcParamsPanel ()
|
|||||||
Gtk::VBox* vbpp = Gtk::manage (new Gtk::VBox ());
|
Gtk::VBox* vbpp = Gtk::manage (new Gtk::VBox ());
|
||||||
Gtk::Label* drlab = Gtk::manage (new Gtk::Label (M("PREFERENCES_FORRAW") + ":", Gtk::ALIGN_START));
|
Gtk::Label* drlab = Gtk::manage (new Gtk::Label (M("PREFERENCES_FORRAW") + ":", Gtk::ALIGN_START));
|
||||||
rprofiles = Gtk::manage (new ProfileStoreComboBox ());
|
rprofiles = Gtk::manage (new ProfileStoreComboBox ());
|
||||||
|
rprofiles->addRow(profileStore.getInternalDynamicPSE());
|
||||||
setExpandAlignProperties(rprofiles, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
|
setExpandAlignProperties(rprofiles, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_CENTER);
|
||||||
rprofiles->set_size_request(50, -1);
|
rprofiles->set_size_request(50, -1);
|
||||||
rpconn = rprofiles->signal_changed().connect( sigc::mem_fun(*this, &Preferences::forRAWComboChanged) );
|
rpconn = rprofiles->signal_changed().connect( sigc::mem_fun(*this, &Preferences::forRAWComboChanged) );
|
||||||
Gtk::Label* drimg = Gtk::manage (new Gtk::Label (M("PREFERENCES_FORIMAGE") + ":", Gtk::ALIGN_START));
|
Gtk::Label* drimg = Gtk::manage (new Gtk::Label (M("PREFERENCES_FORIMAGE") + ":", Gtk::ALIGN_START));
|
||||||
iprofiles = Gtk::manage (new ProfileStoreComboBox ());
|
iprofiles = Gtk::manage (new ProfileStoreComboBox ());
|
||||||
|
iprofiles->addRow(profileStore.getInternalDynamicPSE());
|
||||||
iprofiles->set_size_request(50, -1);
|
iprofiles->set_size_request(50, -1);
|
||||||
setExpandAlignProperties(iprofiles, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL);
|
setExpandAlignProperties(iprofiles, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL);
|
||||||
ipconn = iprofiles->signal_changed().connect( sigc::mem_fun(*this, &Preferences::forImageComboChanged) );
|
ipconn = iprofiles->signal_changed().connect( sigc::mem_fun(*this, &Preferences::forImageComboChanged) );
|
||||||
|
@ -227,13 +227,17 @@ rtengine::procparams::ProcParams* Thumbnail::createProcParamsForUpdate(bool retu
|
|||||||
imageMetaData = rtengine::ImageMetaData::fromFile (fname, nullptr);
|
imageMetaData = rtengine::ImageMetaData::fromFile (fname, nullptr);
|
||||||
}
|
}
|
||||||
PartialProfile *pp = loadDynamicProfile(imageMetaData);
|
PartialProfile *pp = loadDynamicProfile(imageMetaData);
|
||||||
|
int err = 0;
|
||||||
if (options.paramsLoadLocation == PLL_Input) {
|
if (options.paramsLoadLocation == PLL_Input) {
|
||||||
pp->pparams->save(fname + paramFileExtension);
|
err = pp->pparams->save(fname + paramFileExtension);
|
||||||
} else {
|
} else {
|
||||||
pp->pparams->save(getCacheFileName ("profiles", paramFileExtension));
|
err = pp->pparams->save(getCacheFileName ("profiles", paramFileExtension));
|
||||||
}
|
}
|
||||||
pp->deleteInstance();
|
pp->deleteInstance();
|
||||||
delete pp;
|
delete pp;
|
||||||
|
if (!err) {
|
||||||
|
loadProcParams();
|
||||||
|
}
|
||||||
} else if (defProf != DEFPROFILE_DYNAMIC && !options.CPBPath.empty() && !defaultPparamsPath.empty() && (!hasProcParams() || forceCPB) && cfs && cfs->exifValid) {
|
} else if (defProf != DEFPROFILE_DYNAMIC && !options.CPBPath.empty() && !defaultPparamsPath.empty() && (!hasProcParams() || forceCPB) && cfs && cfs->exifValid) {
|
||||||
// First generate the communication file, with general values and EXIF metadata
|
// First generate the communication file, with general values and EXIF metadata
|
||||||
rtengine::ImageMetaData* imageMetaData;
|
rtengine::ImageMetaData* imageMetaData;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user