|
|
|
@ -338,7 +338,7 @@ KioskRun::shutdownConfigEnv()
|
|
|
|
|
m_instance = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class ImmutabletqStatus
|
|
|
|
|
class ImmutableStatus
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
bool m_fileScope;
|
|
|
|
@ -352,7 +352,7 @@ bool
|
|
|
|
|
KioskRun::isConfigImmutable(const TQString &filename, const TQString &group)
|
|
|
|
|
{
|
|
|
|
|
(void) configFile(filename);
|
|
|
|
|
ImmutabletqStatus *status = m_immutableStatusCache.find(filename);
|
|
|
|
|
ImmutableStatus *status = m_immutableStatusCache.find(filename);
|
|
|
|
|
assert(status);
|
|
|
|
|
if (group.isEmpty())
|
|
|
|
|
return status->m_fileScope;
|
|
|
|
@ -364,7 +364,7 @@ void
|
|
|
|
|
KioskRun::setConfigImmutable(const TQString &filename, const TQString &_group, bool bImmutable)
|
|
|
|
|
{
|
|
|
|
|
(void) configFile(filename);
|
|
|
|
|
ImmutabletqStatus *status = m_immutableStatusCache.find(filename);
|
|
|
|
|
ImmutableStatus *status = m_immutableStatusCache.find(filename);
|
|
|
|
|
assert(status);
|
|
|
|
|
if (_group.isEmpty())
|
|
|
|
|
{
|
|
|
|
@ -412,9 +412,9 @@ static void addImmutable(TQString &ext)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQString
|
|
|
|
|
KioskRun::saveImmutabletqStatus(const TQString &filename)
|
|
|
|
|
KioskRun::saveImmutableStatus(const TQString &filename)
|
|
|
|
|
{
|
|
|
|
|
ImmutabletqStatus *status = new ImmutabletqStatus;
|
|
|
|
|
ImmutableStatus *status = new ImmutableStatus;
|
|
|
|
|
status->m_fileScope = false;
|
|
|
|
|
status->m_dirty = false;
|
|
|
|
|
m_immutableStatusCache.insert(filename, status);
|
|
|
|
@ -505,21 +505,21 @@ KioskRun::saveImmutabletqStatus(const TQString &filename)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
KioskRun::restoreImmutabletqStatus(const TQString &filename, bool force)
|
|
|
|
|
KioskRun::restoreImmutableStatus(const TQString &filename, bool force)
|
|
|
|
|
{
|
|
|
|
|
ImmutabletqStatus *status = m_immutableStatusCache.take(filename);
|
|
|
|
|
ImmutableStatus *status = m_immutableStatusCache.take(filename);
|
|
|
|
|
if (!status)
|
|
|
|
|
{
|
|
|
|
|
kdDebug() << "KioskRun::restoreImmutabletqStatus(" << filename << ") status info missing" << endl;
|
|
|
|
|
kdDebug() << "KioskRun::restoreImmutableStatus(" << filename << ") status info missing" << endl;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if (!force && !status->m_dirty)
|
|
|
|
|
{
|
|
|
|
|
kdDebug() << "KioskRun::restoreImmutabletqStatus(" << filename << ") not changed" << endl;
|
|
|
|
|
kdDebug() << "KioskRun::restoreImmutableStatus(" << filename << ") not changed" << endl;
|
|
|
|
|
delete status;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
kdDebug() << "KioskRun::restoreImmutabletqStatus(" << filename << ") restoring" << endl;
|
|
|
|
|
kdDebug() << "KioskRun::restoreImmutableStatus(" << filename << ") restoring" << endl;
|
|
|
|
|
|
|
|
|
|
TQString path = status->m_tmpFile;
|
|
|
|
|
|
|
|
|
@ -625,7 +625,7 @@ KioskRun::flushConfigCache()
|
|
|
|
|
KConfig *config = it.current();
|
|
|
|
|
bool dirty = config->isDirty();
|
|
|
|
|
config->sync(); // Save
|
|
|
|
|
if (!restoreImmutabletqStatus(file, dirty))
|
|
|
|
|
if (!restoreImmutableStatus(file, dirty))
|
|
|
|
|
return false;
|
|
|
|
|
m_saveConfigCache.remove(file);
|
|
|
|
|
}
|
|
|
|
@ -646,7 +646,7 @@ KioskRun::configFile(const TQString &filename)
|
|
|
|
|
|
|
|
|
|
setupConfigEnv();
|
|
|
|
|
|
|
|
|
|
TQString saveLocation = saveImmutabletqStatus(filename);
|
|
|
|
|
TQString saveLocation = saveImmutableStatus(filename);
|
|
|
|
|
config = new KSimpleConfig(saveLocation);
|
|
|
|
|
m_saveConfigCache.insert(filename, config);
|
|
|
|
|
|
|
|
|
|