improve stability for Cache Manager and avoid race conditions.
preparation step 2 for making dcraw multithread safe.
This commit is contained in:
@@ -24,10 +24,26 @@
|
|||||||
#include <procparamchangers.h>
|
#include <procparamchangers.h>
|
||||||
#include <safegtk.h>
|
#include <safegtk.h>
|
||||||
|
|
||||||
CacheManager cacheMgr;
|
CacheManager*
|
||||||
|
CacheManager::getInstance(void)
|
||||||
|
{
|
||||||
|
static CacheManager* instance_ = 0;
|
||||||
|
if ( instance_ == 0 )
|
||||||
|
{
|
||||||
|
static Glib::Mutex smutex_;
|
||||||
|
Glib::Mutex::Lock lock(smutex_);
|
||||||
|
if ( instance_ == 0 )
|
||||||
|
{
|
||||||
|
instance_ = new CacheManager();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return instance_;
|
||||||
|
}
|
||||||
|
|
||||||
void CacheManager::init () {
|
void CacheManager::init () {
|
||||||
|
|
||||||
|
Glib::Mutex::Lock lock(mutex_);
|
||||||
|
|
||||||
openEntries.clear ();
|
openEntries.clear ();
|
||||||
baseDir = options.cacheBaseDir;
|
baseDir = options.cacheBaseDir;
|
||||||
|
|
||||||
@@ -49,12 +65,18 @@ Thumbnail* CacheManager::getEntry (const Glib::ustring& fname) {
|
|||||||
|
|
||||||
Thumbnail* res = NULL;
|
Thumbnail* res = NULL;
|
||||||
|
|
||||||
std::map<std::string, Thumbnail*>::iterator r = openEntries.find (fname);
|
// take manager lock and search for entry, if found return it else release
|
||||||
// if it is open, return it
|
// lock and create it
|
||||||
if (r!=openEntries.end()) {
|
{
|
||||||
r->second->increaseRef ();
|
Glib::Mutex::Lock lock(mutex_);
|
||||||
return r->second;
|
|
||||||
}
|
string_thumb_map::iterator r = openEntries.find (fname);
|
||||||
|
// if it is open, return it
|
||||||
|
if (r!=openEntries.end()) {
|
||||||
|
r->second->increaseRef ();
|
||||||
|
return r->second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// compute the md5
|
// compute the md5
|
||||||
std::string md5 = getMD5 (fname);
|
std::string md5 = getMD5 (fname);
|
||||||
@@ -78,6 +100,7 @@ Thumbnail* CacheManager::getEntry (const Glib::ustring& fname) {
|
|||||||
}
|
}
|
||||||
// if not, create a new one
|
// if not, create a new one
|
||||||
if (!res) {
|
if (!res) {
|
||||||
|
|
||||||
res = new Thumbnail (this, fname, md5);
|
res = new Thumbnail (this, fname, md5);
|
||||||
if (!res->isSupported ()) {
|
if (!res->isSupported ()) {
|
||||||
delete res;
|
delete res;
|
||||||
@@ -85,20 +108,45 @@ Thumbnail* CacheManager::getEntry (const Glib::ustring& fname) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// retake the lock and see if it was added while we we're unlocked, if it
|
||||||
|
// was use it over our version. if not added we create the cache entry
|
||||||
if (res)
|
if (res)
|
||||||
openEntries[fname] = res;
|
{
|
||||||
|
Glib::Mutex::Lock lock(mutex_);
|
||||||
|
|
||||||
|
string_thumb_map::iterator r = openEntries.find (fname);
|
||||||
|
if (r!=openEntries.end()) {
|
||||||
|
delete res;
|
||||||
|
r->second->increaseRef ();
|
||||||
|
return r->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
// it wasn't, create a new entry
|
||||||
|
openEntries[fname] = res;
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CacheManager::deleteEntry (const Glib::ustring& fname) {
|
void CacheManager::deleteEntry (const Glib::ustring& fname) {
|
||||||
|
|
||||||
|
Glib::Mutex::Lock lock(mutex_);
|
||||||
|
|
||||||
// check if it is opened
|
// check if it is opened
|
||||||
std::map<std::string, Thumbnail*>::iterator r = openEntries.find (fname);
|
string_thumb_map::iterator r = openEntries.find (fname);
|
||||||
// if it is open, dont delete it
|
// if it is open, dont delete it
|
||||||
if (r!=openEntries.end()) {
|
if (r!=openEntries.end()) {
|
||||||
std::string md5 = r->second->getMD5 ();
|
std::string md5 = r->second->getMD5 ();
|
||||||
r->second->decreaseRef ();
|
|
||||||
|
// decrease reference count; this will call back into CacheManager so
|
||||||
|
// we release the lock for it.
|
||||||
|
{
|
||||||
|
lock.release();
|
||||||
|
r->second->decreaseRef ();
|
||||||
|
lock.acquire();
|
||||||
|
}
|
||||||
|
|
||||||
// if in the editor, the thumbnail still exists. If not, delete it:
|
// if in the editor, the thumbnail still exists. If not, delete it:
|
||||||
r = openEntries.find (fname);
|
r = openEntries.find (fname);
|
||||||
if (r==openEntries.end() && md5!="") {
|
if (r==openEntries.end() && md5!="") {
|
||||||
@@ -126,6 +174,8 @@ void CacheManager::deleteEntry (const Glib::ustring& fname) {
|
|||||||
|
|
||||||
void CacheManager::renameEntry (const std::string& oldfilename, const std::string& oldmd5, const std::string& newfilename) {
|
void CacheManager::renameEntry (const std::string& oldfilename, const std::string& oldmd5, const std::string& newfilename) {
|
||||||
|
|
||||||
|
Glib::Mutex::Lock lock(mutex_);
|
||||||
|
|
||||||
std::string newmd5 = getMD5 (newfilename);
|
std::string newmd5 = getMD5 (newfilename);
|
||||||
|
|
||||||
::g_rename ((getCacheFileName ("profiles", oldfilename, oldmd5) + paramFileExtension).c_str(), (getCacheFileName ("profiles", newfilename, newmd5) + paramFileExtension).c_str());
|
::g_rename ((getCacheFileName ("profiles", oldfilename, oldmd5) + paramFileExtension).c_str(), (getCacheFileName ("profiles", newfilename, newmd5) + paramFileExtension).c_str());
|
||||||
@@ -136,7 +186,7 @@ void CacheManager::renameEntry (const std::string& oldfilename, const std::strin
|
|||||||
::g_rename ((getCacheFileName ("data", oldfilename, oldmd5) + ".txt").c_str(), (getCacheFileName ("data", newfilename, newmd5) + ".txt").c_str());
|
::g_rename ((getCacheFileName ("data", oldfilename, oldmd5) + ".txt").c_str(), (getCacheFileName ("data", newfilename, newmd5) + ".txt").c_str());
|
||||||
|
|
||||||
// check if it is opened
|
// check if it is opened
|
||||||
std::map<std::string, Thumbnail*>::iterator r = openEntries.find (oldfilename);
|
string_thumb_map::iterator r = openEntries.find (oldfilename);
|
||||||
// if it is open, update md5
|
// if it is open, update md5
|
||||||
if (r!=openEntries.end()) {
|
if (r!=openEntries.end()) {
|
||||||
Thumbnail* t = r->second;
|
Thumbnail* t = r->second;
|
||||||
@@ -150,8 +200,10 @@ void CacheManager::renameEntry (const std::string& oldfilename, const std::strin
|
|||||||
|
|
||||||
void CacheManager::closeThumbnail (Thumbnail* t) {
|
void CacheManager::closeThumbnail (Thumbnail* t) {
|
||||||
|
|
||||||
|
Glib::Mutex::Lock lock(mutex_);
|
||||||
|
|
||||||
t->updateCache ();
|
t->updateCache ();
|
||||||
std::map<std::string, Thumbnail*>::iterator r = openEntries.find (t->getFileName());
|
string_thumb_map::iterator r = openEntries.find (t->getFileName());
|
||||||
if (r!=openEntries.end())
|
if (r!=openEntries.end())
|
||||||
openEntries.erase (r);
|
openEntries.erase (r);
|
||||||
delete t;
|
delete t;
|
||||||
@@ -159,11 +211,15 @@ void CacheManager::closeThumbnail (Thumbnail* t) {
|
|||||||
|
|
||||||
void CacheManager::closeCache () {
|
void CacheManager::closeCache () {
|
||||||
|
|
||||||
|
Glib::Mutex::Lock lock(mutex_);
|
||||||
|
|
||||||
applyCacheSizeLimitation ();
|
applyCacheSizeLimitation ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CacheManager::clearAll () {
|
void CacheManager::clearAll () {
|
||||||
|
|
||||||
|
Glib::Mutex::Lock lock(mutex_);
|
||||||
|
|
||||||
deleteDir ("images");
|
deleteDir ("images");
|
||||||
deleteDir ("aehistograms");
|
deleteDir ("aehistograms");
|
||||||
deleteDir ("embprofiles");
|
deleteDir ("embprofiles");
|
||||||
@@ -171,7 +227,7 @@ void CacheManager::clearAll () {
|
|||||||
deleteDir ("data");
|
deleteDir ("data");
|
||||||
|
|
||||||
// re-generate thumbnail images and clear profiles of open thumbnails
|
// re-generate thumbnail images and clear profiles of open thumbnails
|
||||||
std::map<std::string, Thumbnail*>::iterator i;
|
string_thumb_map::iterator i;
|
||||||
for (i=openEntries.begin(); i!=openEntries.end(); i++) {
|
for (i=openEntries.begin(); i!=openEntries.end(); i++) {
|
||||||
i->second->clearProcParams (CACHEMGR);
|
i->second->clearProcParams (CACHEMGR);
|
||||||
i->second->generateThumbnailImage ();
|
i->second->generateThumbnailImage ();
|
||||||
@@ -180,21 +236,25 @@ void CacheManager::clearAll () {
|
|||||||
}
|
}
|
||||||
void CacheManager::clearThumbImages () {
|
void CacheManager::clearThumbImages () {
|
||||||
|
|
||||||
|
Glib::Mutex::Lock lock(mutex_);
|
||||||
|
|
||||||
deleteDir ("images");
|
deleteDir ("images");
|
||||||
deleteDir ("aehistograms");
|
deleteDir ("aehistograms");
|
||||||
deleteDir ("embprofiles");
|
deleteDir ("embprofiles");
|
||||||
|
|
||||||
// re-generate thumbnail images of open thumbnails
|
// re-generate thumbnail images of open thumbnails
|
||||||
std::map<std::string, Thumbnail*>::iterator i;
|
string_thumb_map::iterator i;
|
||||||
for (i=openEntries.begin(); i!=openEntries.end(); i++)
|
for (i=openEntries.begin(); i!=openEntries.end(); i++)
|
||||||
i->second->generateThumbnailImage ();
|
i->second->generateThumbnailImage ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CacheManager::clearProfiles () {
|
void CacheManager::clearProfiles () {
|
||||||
|
|
||||||
|
Glib::Mutex::Lock lock(mutex_);
|
||||||
|
|
||||||
deleteDir ("profiles");
|
deleteDir ("profiles");
|
||||||
// clear profiles of open thumbnails
|
// clear profiles of open thumbnails
|
||||||
std::map<std::string, Thumbnail*>::iterator i;
|
string_thumb_map::iterator i;
|
||||||
for (i=openEntries.begin(); i!=openEntries.end(); i++)
|
for (i=openEntries.begin(); i!=openEntries.end(); i++)
|
||||||
i->second->clearProcParams (CACHEMGR);
|
i->second->clearProcParams (CACHEMGR);
|
||||||
}
|
}
|
||||||
@@ -234,9 +294,9 @@ void CacheManager::applyCacheSizeLimitation () {
|
|||||||
std::vector<FileMTimeInfo> flist;
|
std::vector<FileMTimeInfo> flist;
|
||||||
Glib::ustring dataDir = Glib::build_filename (baseDir, "data");
|
Glib::ustring dataDir = Glib::build_filename (baseDir, "data");
|
||||||
Glib::RefPtr<Gio::File> dir = Gio::File::create_for_path (dataDir);
|
Glib::RefPtr<Gio::File> dir = Gio::File::create_for_path (dataDir);
|
||||||
|
|
||||||
safe_build_file_list (dir, flist);
|
safe_build_file_list (dir, flist);
|
||||||
|
|
||||||
if (flist.size() > options.maxCacheEntries) {
|
if (flist.size() > options.maxCacheEntries) {
|
||||||
std::sort (flist.begin(), flist.end());
|
std::sort (flist.begin(), flist.end());
|
||||||
while (flist.size() > options.maxCacheEntries) {
|
while (flist.size() > options.maxCacheEntries) {
|
||||||
@@ -245,7 +305,7 @@ void CacheManager::applyCacheSizeLimitation () {
|
|||||||
::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "images"), flist.front().fname) + ".jpg").c_str());
|
::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "images"), flist.front().fname) + ".jpg").c_str());
|
||||||
::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "aehistograms"), flist.front().fname)).c_str());
|
::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "aehistograms"), flist.front().fname)).c_str());
|
||||||
::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "embprofiles"), flist.front().fname) + ".icc").c_str());
|
::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "embprofiles"), flist.front().fname) + ".icc").c_str());
|
||||||
// ::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "profiles"), flist.front().fname) + paramFileExtension).c_str());
|
// ::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "profiles"), flist.front().fname) + paramFileExtension).c_str());
|
||||||
flist.erase (flist.begin());
|
flist.erase (flist.begin());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,14 +29,21 @@ class Thumbnail;
|
|||||||
|
|
||||||
class CacheManager {
|
class CacheManager {
|
||||||
|
|
||||||
std::map<std::string, Thumbnail*> openEntries;
|
typedef std::pair<std::string, Thumbnail*> string_thumb_pair;
|
||||||
Glib::ustring baseDir;
|
typedef std::map<std::string, Thumbnail*> string_thumb_map;
|
||||||
|
|
||||||
|
string_thumb_map openEntries;
|
||||||
|
Glib::ustring baseDir;
|
||||||
|
Glib::Mutex mutex_;
|
||||||
|
|
||||||
void deleteDir (const Glib::ustring& dirName);
|
void deleteDir (const Glib::ustring& dirName);
|
||||||
|
|
||||||
public:
|
|
||||||
CacheManager () {}
|
CacheManager () {}
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
static CacheManager* getInstance(void);
|
||||||
|
|
||||||
void init ();
|
void init ();
|
||||||
Thumbnail* getEntry (const Glib::ustring& fname);
|
Thumbnail* getEntry (const Glib::ustring& fname);
|
||||||
void deleteEntry (const Glib::ustring& fname);
|
void deleteEntry (const Glib::ustring& fname);
|
||||||
@@ -44,7 +51,7 @@ class CacheManager {
|
|||||||
|
|
||||||
void closeThumbnail (Thumbnail* t);
|
void closeThumbnail (Thumbnail* t);
|
||||||
|
|
||||||
const Glib::ustring& getBaseDir () { return baseDir; }
|
const Glib::ustring& getBaseDir () { Glib::Mutex::Lock lock(mutex_); return baseDir; }
|
||||||
void closeCache ();
|
void closeCache ();
|
||||||
|
|
||||||
static std::string getMD5 (const Glib::ustring& fname);
|
static std::string getMD5 (const Glib::ustring& fname);
|
||||||
@@ -58,7 +65,7 @@ class CacheManager {
|
|||||||
Glib::ustring getCacheFileName (const Glib::ustring& subdir, const Glib::ustring& fname, const Glib::ustring& md5);
|
Glib::ustring getCacheFileName (const Glib::ustring& subdir, const Glib::ustring& fname, const Glib::ustring& md5);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern CacheManager cacheMgr;
|
#define cacheMgr CacheManager::getInstance()
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -392,7 +392,7 @@ void PreviewLoader::start () {
|
|||||||
void PreviewLoader::process (DirEntry& current) {
|
void PreviewLoader::process (DirEntry& current) {
|
||||||
|
|
||||||
if (Glib::file_test (current.fullName, Glib::FILE_TEST_EXISTS)) {
|
if (Glib::file_test (current.fullName, Glib::FILE_TEST_EXISTS)) {
|
||||||
Thumbnail* tmb = cacheMgr.getEntry (current.fullName);
|
Thumbnail* tmb = cacheMgr->getEntry (current.fullName);
|
||||||
if (tmb && pl)
|
if (tmb && pl)
|
||||||
pl->previewReady (new FileBrowserEntry (tmb, current.fullName));
|
pl->previewReady (new FileBrowserEntry (tmb, current.fullName));
|
||||||
}
|
}
|
||||||
@@ -475,7 +475,7 @@ void FileCatalog::deleteRequested (std::vector<FileBrowserEntry*> tbe) {
|
|||||||
// t->thumbnail->decreaseRef ();
|
// t->thumbnail->decreaseRef ();
|
||||||
delete t;
|
delete t;
|
||||||
// remove from cache
|
// remove from cache
|
||||||
cacheMgr.deleteEntry (fname);
|
cacheMgr->deleteEntry (fname);
|
||||||
// delete from file system
|
// delete from file system
|
||||||
::g_remove (fname.c_str());
|
::g_remove (fname.c_str());
|
||||||
// delete paramfile if found
|
// delete paramfile if found
|
||||||
@@ -538,7 +538,7 @@ void FileCatalog::renameRequested (std::vector<FileBrowserEntry*> tbe) {
|
|||||||
nBaseName += "." + getExtension (baseName);
|
nBaseName += "." + getExtension (baseName);
|
||||||
Glib::ustring nfname = Glib::build_filename (dirName, nBaseName);
|
Glib::ustring nfname = Glib::build_filename (dirName, nBaseName);
|
||||||
if (!::g_rename (ofname.c_str(), nfname.c_str())) {
|
if (!::g_rename (ofname.c_str(), nfname.c_str())) {
|
||||||
cacheMgr.renameEntry (ofname, tbe[i]->thumbnail->getMD5(), nfname);
|
cacheMgr->renameEntry (ofname, tbe[i]->thumbnail->getMD5(), nfname);
|
||||||
reparseDirectory ();
|
reparseDirectory ();
|
||||||
}
|
}
|
||||||
renameDlg->hide ();
|
renameDlg->hide ();
|
||||||
@@ -584,7 +584,7 @@ void FileCatalog::renameRequested (std::vector<FileBrowserEntry*> tbe) {
|
|||||||
}
|
}
|
||||||
Glib::ustring nfname = Glib::build_filename (dirName, nBaseName);
|
Glib::ustring nfname = Glib::build_filename (dirName, nBaseName);
|
||||||
if (!::g_rename (ofname.c_str(), nfname.c_str())) {
|
if (!::g_rename (ofname.c_str(), nfname.c_str())) {
|
||||||
cacheMgr.renameEntry (ofname, tbe[i]->thumbnail->getMD5(), nfname);
|
cacheMgr->renameEntry (ofname, tbe[i]->thumbnail->getMD5(), nfname);
|
||||||
// the remaining part (removing old and adding new entry) is done by the directory monitor
|
// the remaining part (removing old and adding new entry) is done by the directory monitor
|
||||||
reparseDirectory ();
|
reparseDirectory ();
|
||||||
// on_dir_changed (Gio::File::create_for_path (nfname), Gio::File::create_for_path (nfname), Gio::FILE_MONITOR_EVENT_CHANGED, true);
|
// on_dir_changed (Gio::File::create_for_path (nfname), Gio::File::create_for_path (nfname), Gio::FILE_MONITOR_EVENT_CHANGED, true);
|
||||||
@@ -749,7 +749,7 @@ int FileCatalog::reparseDirectory () {
|
|||||||
fileNamesToDel.push_back (t[i]->filename);
|
fileNamesToDel.push_back (t[i]->filename);
|
||||||
for (size_t i=0; i<fileNamesToDel.size(); i++) {
|
for (size_t i=0; i<fileNamesToDel.size(); i++) {
|
||||||
delete fileBrowser->delEntry (fileNamesToDel[i]);
|
delete fileBrowser->delEntry (fileNamesToDel[i]);
|
||||||
cacheMgr.deleteEntry (fileNamesToDel[i]);
|
cacheMgr->deleteEntry (fileNamesToDel[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if a new file has been added
|
// check if a new file has been added
|
||||||
@@ -820,7 +820,7 @@ void FileCatalog::addAndOpenFile (const Glib::ustring& fname) {
|
|||||||
int lastdot = info->get_name().find_last_of ('.');
|
int lastdot = info->get_name().find_last_of ('.');
|
||||||
if (options.is_extention_enabled(lastdot!=(int)Glib::ustring::npos ? info->get_name().substr (lastdot+1) : "")){
|
if (options.is_extention_enabled(lastdot!=(int)Glib::ustring::npos ? info->get_name().substr (lastdot+1) : "")){
|
||||||
// if supported, load thumbnail first
|
// if supported, load thumbnail first
|
||||||
Thumbnail* tmb = cacheMgr.getEntry (file->get_parse_name());
|
Thumbnail* tmb = cacheMgr->getEntry (file->get_parse_name());
|
||||||
if (tmb) {
|
if (tmb) {
|
||||||
FileBrowserEntry* entry = new FileBrowserEntry (tmb, file->get_parse_name());
|
FileBrowserEntry* entry = new FileBrowserEntry (tmb, file->get_parse_name());
|
||||||
previewReady (entry);
|
previewReady (entry);
|
||||||
|
|||||||
@@ -1190,7 +1190,7 @@ void Preferences::clearProfilesPressed () {
|
|||||||
md.set_title (M("PREFERENCES_CLEARDLG_TITLE"));
|
md.set_title (M("PREFERENCES_CLEARDLG_TITLE"));
|
||||||
md.show_all ();
|
md.show_all ();
|
||||||
while (gtk_events_pending ()) gtk_main_iteration ();
|
while (gtk_events_pending ()) gtk_main_iteration ();
|
||||||
cacheMgr.clearProfiles ();
|
cacheMgr->clearProfiles ();
|
||||||
md.hide ();
|
md.hide ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1201,7 +1201,7 @@ void Preferences::clearThumbImagesPressed () {
|
|||||||
md.set_title (M("PREFERENCES_CLEARDLG_TITLE"));
|
md.set_title (M("PREFERENCES_CLEARDLG_TITLE"));
|
||||||
md.show_all ();
|
md.show_all ();
|
||||||
while (gtk_events_pending ()) gtk_main_iteration ();
|
while (gtk_events_pending ()) gtk_main_iteration ();
|
||||||
cacheMgr.clearThumbImages ();
|
cacheMgr->clearThumbImages ();
|
||||||
md.hide ();
|
md.hide ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1212,7 +1212,7 @@ void Preferences::clearAllPressed () {
|
|||||||
md.set_title (M("PREFERENCES_CLEARDLG_TITLE"));
|
md.set_title (M("PREFERENCES_CLEARDLG_TITLE"));
|
||||||
md.show_all ();
|
md.show_all ();
|
||||||
while (gtk_events_pending ()) gtk_main_iteration ();
|
while (gtk_events_pending ()) gtk_main_iteration ();
|
||||||
cacheMgr.clearAll ();
|
cacheMgr->clearAll ();
|
||||||
md.hide ();
|
md.hide ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
RTWindow::RTWindow () {
|
RTWindow::RTWindow () {
|
||||||
|
|
||||||
cacheMgr.init ();
|
cacheMgr->init ();
|
||||||
|
|
||||||
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
#ifdef GLIBMM_EXCEPTIONS_ENABLED
|
||||||
try { set_default_icon_from_file (argv0+"/images/logoicon16.png");
|
try { set_default_icon_from_file (argv0+"/images/logoicon16.png");
|
||||||
@@ -248,7 +248,7 @@ bool RTWindow::on_delete_event(GdkEventAny* event) {
|
|||||||
if (options.startupDir==STARTUPDIR_LAST && fileBrowser->lastSelectedDir ()!="")
|
if (options.startupDir==STARTUPDIR_LAST && fileBrowser->lastSelectedDir ()!="")
|
||||||
options.startupPath = fileBrowser->lastSelectedDir ();
|
options.startupPath = fileBrowser->lastSelectedDir ();
|
||||||
fileBrowser->close ();
|
fileBrowser->close ();
|
||||||
cacheMgr.closeCache ();
|
cacheMgr->closeCache ();
|
||||||
|
|
||||||
|
|
||||||
options.lastScale = editorPanel->zoomBar->getScale ();
|
options.lastScale = editorPanel->zoomBar->getScale ();
|
||||||
|
|||||||
Reference in New Issue
Block a user