From 8b4b49cad2253ab1b9492656aff7bf02eddf07aa Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 18 Nov 2013 15:40:14 +0000 Subject: [PATCH] Read-only mode fixes. --- src/Airports/xmlloader.cxx | 2 +- src/GUI/new_gui.cxx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Airports/xmlloader.cxx b/src/Airports/xmlloader.cxx index 59a9ca969..8291358b4 100644 --- a/src/Airports/xmlloader.cxx +++ b/src/Airports/xmlloader.cxx @@ -50,7 +50,7 @@ void XMLLoader::load(FGAirportDynamics* d) } flightgear::NavDataCache* cache = flightgear::NavDataCache::instance(); - if (!cache->isCachedFileModified(path)) { + if (!cache->isCachedFileModified(path) || cache->isReadOnly()) { return; } diff --git a/src/GUI/new_gui.cxx b/src/GUI/new_gui.cxx index ca1c2f50d..af0738121 100644 --- a/src/GUI/new_gui.cxx +++ b/src/GUI/new_gui.cxx @@ -339,8 +339,10 @@ NewGUI::readDir (const SGPath& path) string name = nameprop->getStringValue(); _dialog_names[name] = xmlPath; // update cached values - cache->stampCacheFile(xmlPath); - cache->writeStringProperty(xmlPath.str(), name); + if (!cache->isReadOnly()) { + cache->stampCacheFile(xmlPath); + cache->writeStringProperty(xmlPath.str(), name); + } } // of directory children iteration txn.commit(); -- 2.39.5