mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
refs #684, #766, #776 Support %OwnerName% in cache keys by allowing CCached::m_element to be a dummy
and by using a trick with explicit destructor call and placement new to reconstruct CCached when owner's name changes.
This commit is contained in:
@@ -74,7 +74,12 @@ namespace BlackMisc
|
||||
template <typename T>
|
||||
CSetting(T *owner) :
|
||||
CSetting::CCached(CSettingsCache::instance(), Trait::key(), Trait::humanReadable(), Trait::isValid, Trait::defaultValue(), owner)
|
||||
{}
|
||||
{
|
||||
if (! this->isInitialized())
|
||||
{
|
||||
this->onOwnerNameChanged([this, owner] { Private::reconstruct(this, owner); });
|
||||
}
|
||||
}
|
||||
|
||||
//! Constructor.
|
||||
//! \param owner Will be the parent of the internal QObject used to access the value.
|
||||
|
||||
Reference in New Issue
Block a user