Patch from issue 1384: "Speedup enhancement of the thumbnails' browser"

This commit is contained in:
natureh
2012-06-02 14:46:50 +02:00
parent c78e5699e6
commit 842e446060
3 changed files with 25 additions and 12 deletions

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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