diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-05-15 14:10:16 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-05-15 14:10:16 -0500 |
commit | d3a9d56143cf668c7d29b26a324a424d02036371 (patch) | |
tree | aa69f1c1e1facdce0ad705d66b07d2af0b0e2c31 /tdecore/kconfigbackend.cpp | |
parent | fffcd810f84ca3ad146a43b97aed02067adcf4f6 (diff) | |
download | tdelibs-d3a9d56143cf668c7d29b26a324a424d02036371.tar.gz tdelibs-d3a9d56143cf668c7d29b26a324a424d02036371.zip |
Add the ability to force read-only configuration file access in a TDE application
Force tde-config to use read-only access
This closes Bug 293
Diffstat (limited to 'tdecore/kconfigbackend.cpp')
-rw-r--r-- | tdecore/kconfigbackend.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/tdecore/kconfigbackend.cpp b/tdecore/kconfigbackend.cpp index 9ee9dd606..4ad0e5fb2 100644 --- a/tdecore/kconfigbackend.cpp +++ b/tdecore/kconfigbackend.cpp @@ -247,17 +247,22 @@ void KConfigBackEnd::changeFileName(const TQString &_fileName, mfileName = _fileName; resType = _resType; useKDEGlobals = _useKDEGlobals; - if (mfileName.isEmpty()) + if (mfileName.isEmpty()) { mLocalFileName = TQString::null; - else if (!TQDir::isRelativePath(mfileName)) + } + else if (!TQDir::isRelativePath(mfileName)) { mLocalFileName = mfileName; - else - mLocalFileName = KGlobal::dirs()->saveLocation(resType) + mfileName; + } + else { + mLocalFileName = KGlobal::dirs()->saveLocation(resType, TQString(), false) + mfileName; + } - if (useKDEGlobals) + if (useKDEGlobals) { mGlobalFileName = KGlobal::dirs()->saveLocation("config", TQString(), false) + TQString::fromLatin1("kdeglobals"); - else + } + else { mGlobalFileName = TQString::null; + } d->localLastModified = TQDateTime(); d->localLastSize = 0; |