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
|
//Note: the mutex is locked in getProfile, called below
|
||||||
|
|
||||||
PartialProfile* pProf = getProfile (isRaw ? options.defProfRaw : options.defProfImg);
|
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
|
// NOTE: pProf should not be NULL anymore, since init() should have created the default profiles already
|
||||||
if (!pProf) {
|
|
||||||
pProf = new PartialProfile (true);
|
|
||||||
pProf->set(true);
|
|
||||||
partProfiles[DEFPROFILE_INTERNAL] = pProf;
|
|
||||||
}
|
|
||||||
return pProf->pparams;
|
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 {
|
class ProfileStore {
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
STORESTATE_NOTINITIALIZED,
|
STORESTATE_NOTINITIALIZED,
|
||||||
STORESTATE_BEINGINITIALIZED,
|
STORESTATE_BEINGINITIALIZED,
|
||||||
STORESTATE_INITIALIZED,
|
STORESTATE_INITIALIZED,
|
||||||
STORESTATE_DELETED
|
STORESTATE_DELETED
|
||||||
} StoreState;
|
} StoreState;
|
||||||
|
|
||||||
Glib::Mutex *parseMutex;
|
Glib::Mutex *parseMutex;
|
||||||
@@ -49,6 +49,7 @@ class ProfileStore {
|
|||||||
rtengine::procparams::PartialProfile* getProfile (const Glib::ustring& profname);
|
rtengine::procparams::PartialProfile* getProfile (const Glib::ustring& profname);
|
||||||
std::vector<Glib::ustring> getProfileNames ();
|
std::vector<Glib::ustring> getProfileNames ();
|
||||||
rtengine::procparams::ProcParams* getDefaultProcParams (bool isRaw);
|
rtengine::procparams::ProcParams* getDefaultProcParams (bool isRaw);
|
||||||
|
rtengine::procparams::PartialProfile* getDefaultPartialProfile (bool isRaw);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern ProfileStore profileStore;
|
extern ProfileStore profileStore;
|
||||||
|
@@ -232,8 +232,8 @@ void Thumbnail::loadProcParams () {
|
|||||||
|
|
||||||
pparamsValid = false;
|
pparamsValid = false;
|
||||||
pparams.setDefaults();
|
pparams.setDefaults();
|
||||||
// WARNING: loading the default Raw or Img pp3 file at each thumbnail may be a performance bottleneck
|
PartialProfile *defaultPP = profileStore.getDefaultPartialProfile(getType()==FT_Raw);
|
||||||
pparams.load(options.profilePath+"/" + (getType()==FT_Raw?options.defProfRaw:options.defProfImg) + paramFileExtension);
|
defaultPP->applyTo(&pparams);
|
||||||
|
|
||||||
if (options.paramsLoadLocation==PLL_Input) {
|
if (options.paramsLoadLocation==PLL_Input) {
|
||||||
// try to load it from params file next to the image file
|
// try to load it from params file next to the image file
|
||||||
|
Reference in New Issue
Block a user