summaryrefslogtreecommitdiff
path: root/indra/newview/lldaycyclemanager.cpp
diff options
context:
space:
mode:
authorVadim ProductEngine <vsavchuk@productengine.com>2011-06-07 17:41:26 +0300
committerVadim ProductEngine <vsavchuk@productengine.com>2011-06-07 17:41:26 +0300
commit7151a4e6b02f02155387fc595034a42aebd7ec9c (patch)
tree4e8727d56b795edc20d43a70f295ec47b3c937f5 /indra/newview/lldaycyclemanager.cpp
parent497c0983bb013cb65b6faf10045ea7b62511cc55 (diff)
STORM-1255 WIP Consistency pass on sky presets removal.
* Update all related floaters when a sky preset gets removed. * Don't allow removing skies referenced by (local) day cycles. * Other minor fixes.
Diffstat (limited to 'indra/newview/lldaycyclemanager.cpp')
-rw-r--r--indra/newview/lldaycyclemanager.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/indra/newview/lldaycyclemanager.cpp b/indra/newview/lldaycyclemanager.cpp
index 07a9a72e68..ab442d7c83 100644
--- a/indra/newview/lldaycyclemanager.cpp
+++ b/indra/newview/lldaycyclemanager.cpp
@@ -109,6 +109,22 @@ bool LLDayCycleManager::deletePreset(const std::string& name)
return true;
}
+bool LLDayCycleManager::isSkyPresetReferenced(const std::string& preset_name) const
+{
+ // We're traversing local day cycles, they can only reference local skies.
+ LLWLParamKey key(preset_name, LLEnvKey::SCOPE_LOCAL);
+
+ for (dc_map_t::const_iterator it = mDayCycleMap.begin(); it != mDayCycleMap.end(); ++it)
+ {
+ if (it->second.hasReferencesTo(key))
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
boost::signals2::connection LLDayCycleManager::setModifyCallback(const modify_signal_t::slot_type& cb)
{
return mModifySignal.connect(cb);