summaryrefslogtreecommitdiffstats
path: root/tdecore/kconfigbase.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-05-15 14:10:16 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-05-15 14:10:16 -0500
commitd3a9d56143cf668c7d29b26a324a424d02036371 (patch)
treeaa69f1c1e1facdce0ad705d66b07d2af0b0e2c31 /tdecore/kconfigbase.cpp
parentfffcd810f84ca3ad146a43b97aed02067adcf4f6 (diff)
downloadtdelibs-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/kconfigbase.cpp')
-rw-r--r--tdecore/kconfigbase.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/tdecore/kconfigbase.cpp b/tdecore/kconfigbase.cpp
index 9ad660037..c5c0a4e25 100644
--- a/tdecore/kconfigbase.cpp
+++ b/tdecore/kconfigbase.cpp
@@ -1139,16 +1139,18 @@ static TQString translatePath( TQString path )
// return original path, if it refers to another type of URL (e.g. http:/), or
// if the path is already relative to another directory
- if (!startsWithFile && path[0] != '/' ||
- startsWithFile && path[5] != '/')
+ if (((!startsWithFile) && (path[0] != '/')) || (startsWithFile && (path[5] != '/'))) {
return path;
+ }
- if (startsWithFile)
+ if (startsWithFile) {
path.remove(0,5); // strip leading "file:/" off the string
+ }
// keep only one single '/' at the beginning - needed for cleanHomeDirPath()
- while (path[0] == '/' && path[1] == '/')
+ while (path[0] == '/' && path[1] == '/') {
path.remove(0,1);
+ }
// we can not use KGlobal::dirs()->relativeLocation("home", path) here,
// since it would not recognize paths without a trailing '/'.