Patch from issue 1384: "Speedup enhancement of the thumbnails' browser"
This commit is contained in:
@@ -185,12 +185,24 @@ ProcParams* ProfileStore::getDefaultProcParams (bool isRaw) {
|
||||
//Note: the mutex is locked in getProfile, called below
|
||||
|
||||
PartialProfile* pProf = getProfile (isRaw ? options.defProfRaw : options.defProfImg);
|
||||
// NOTE: pProf should not be NULL anymore, since init() should have created the default profiles already, but the code is left as is
|
||||
if (!pProf) {
|
||||
pProf = new PartialProfile (true);
|
||||
pProf->set(true);
|
||||
partProfiles[DEFPROFILE_INTERNAL] = pProf;
|
||||
}
|
||||
// NOTE: pProf should not be NULL anymore, since init() should have created the default profiles already
|
||||
return pProf->pparams;
|
||||
}
|
||||
|
||||
/*
|
||||
* Send back a pointer to the default partial profile for raw or standard images.
|
||||
* If it doesn't already exist in the profile list, it will add it with default internal values,
|
||||
* so this method will never fails
|
||||
*/
|
||||
PartialProfile* ProfileStore::getDefaultPartialProfile (bool isRaw) {
|
||||
|
||||
if (!init())
|
||||
// I don't even know if this situation can occur
|
||||
return NULL;
|
||||
//Note: the mutex is locked in getProfile, called below
|
||||
|
||||
PartialProfile* pProf = getProfile (isRaw ? options.defProfRaw : options.defProfImg);
|
||||
// NOTE: pProf should not be NULL anymore, since init() should have created the default profiles already
|
||||
return pProf;
|
||||
}
|
||||
|
||||
|
@@ -28,10 +28,10 @@
|
||||
class ProfileStore {
|
||||
|
||||
typedef enum {
|
||||
STORESTATE_NOTINITIALIZED,
|
||||
STORESTATE_BEINGINITIALIZED,
|
||||
STORESTATE_INITIALIZED,
|
||||
STORESTATE_DELETED
|
||||
STORESTATE_NOTINITIALIZED,
|
||||
STORESTATE_BEINGINITIALIZED,
|
||||
STORESTATE_INITIALIZED,
|
||||
STORESTATE_DELETED
|
||||
} StoreState;
|
||||
|
||||
Glib::Mutex *parseMutex;
|
||||
@@ -49,6 +49,7 @@ class ProfileStore {
|
||||
rtengine::procparams::PartialProfile* getProfile (const Glib::ustring& profname);
|
||||
std::vector<Glib::ustring> getProfileNames ();
|
||||
rtengine::procparams::ProcParams* getDefaultProcParams (bool isRaw);
|
||||
rtengine::procparams::PartialProfile* getDefaultPartialProfile (bool isRaw);
|
||||
};
|
||||
|
||||
extern ProfileStore profileStore;
|
||||
|
@@ -232,8 +232,8 @@ void Thumbnail::loadProcParams () {
|
||||
|
||||
pparamsValid = false;
|
||||
pparams.setDefaults();
|
||||
// WARNING: loading the default Raw or Img pp3 file at each thumbnail may be a performance bottleneck
|
||||
pparams.load(options.profilePath+"/" + (getType()==FT_Raw?options.defProfRaw:options.defProfImg) + paramFileExtension);
|
||||
PartialProfile *defaultPP = profileStore.getDefaultPartialProfile(getType()==FT_Raw);
|
||||
defaultPP->applyTo(&pparams);
|
||||
|
||||
if (options.paramsLoadLocation==PLL_Input) {
|
||||
// try to load it from params file next to the image file
|
||||
|
Reference in New Issue
Block a user