summaryrefslogtreecommitdiffstats
path: root/tdecore/tdeconfigbackend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdecore/tdeconfigbackend.cpp')
-rw-r--r--tdecore/tdeconfigbackend.cpp84
1 files changed, 8 insertions, 76 deletions
diff --git a/tdecore/tdeconfigbackend.cpp b/tdecore/tdeconfigbackend.cpp
index 3dd450061..c7944ed12 100644
--- a/tdecore/tdeconfigbackend.cpp
+++ b/tdecore/tdeconfigbackend.cpp
@@ -43,9 +43,9 @@
#include "tdeconfigbase.h"
#include <tdeapplication.h>
#include <tdeglobal.h>
-#include <kprocess.h>
+#include <tdeprocess.h>
#include <tdelocale.h>
-#include <kstandarddirs.h>
+#include <tdestandarddirs.h>
#include <ksavefile.h>
#include <kurl.h>
#include <kde_file.h>
@@ -353,7 +353,7 @@ bool TDEConfigINIBackEnd::parseConfigFiles()
TQStringList tdercs = TDEGlobal::dirs()->
findAllResources("config", TQString::fromLatin1("kdeglobals"));
-#ifdef Q_WS_WIN
+#ifdef TQ_WS_WIN
TQString etc_tderc = TQFile::decodeName( TQCString(getenv("WINDIR")) + "\\tderc" );
#else
TQString etc_tderc = TQString::fromLatin1("/etc/tderc");
@@ -431,80 +431,23 @@ bool TDEConfigINIBackEnd::parseConfigFiles()
return true;
}
-#ifdef HAVE_MMAP
-#ifdef SIGBUS
-static sigjmp_buf mmap_jmpbuf;
-struct sigaction mmap_old_sigact;
-
-extern "C" {
- static void mmap_sigbus_handler(int)
- {
- siglongjmp (mmap_jmpbuf, 1);
- }
-}
-#endif
-#endif
-
extern bool kde_kiosk_exception;
void TDEConfigINIBackEnd::parseSingleConfigFile(TQFile &rFile,
KEntryMap *pWriteBackMap,
bool bGlobal, bool bDefault)
{
- const char *s; // May get clobbered by sigsetjump, but we don't use them afterwards.
- const char *eof; // May get clobbered by sigsetjump, but we don't use them afterwards.
- TQByteArray data;
-
if (!rFile.isOpen()) // come back, if you have real work for us ;->
return;
- //using kdDebug() here leads to an infinite loop
- //remove this for the release, aleXXX
- //tqWarning("Parsing %s, global = %s default = %s",
- // rFile.name().latin1(), bGlobal ? "true" : "false", bDefault ? "true" : "false");
-
TQCString aCurrentGroup("<default>");
unsigned int ll = localeString.length();
-#ifdef HAVE_MMAP
- static volatile const char *map;
- map = ( const char* ) mmap(0, rFile.size(), PROT_READ, MAP_PRIVATE,
- rFile.handle(), 0);
-
- if ( map != MAP_FAILED )
- {
- s = (const char*) map;
- eof = s + rFile.size();
-
-#ifdef SIGBUS
- struct sigaction act;
- act.sa_handler = mmap_sigbus_handler;
- sigemptyset( &act.sa_mask );
-#ifdef SA_ONESHOT
- act.sa_flags = SA_ONESHOT;
-#else
- act.sa_flags = SA_RESETHAND;
-#endif
- sigaction( SIGBUS, &act, &mmap_old_sigact );
-
- if (sigsetjmp (mmap_jmpbuf, 1))
- {
-tqWarning("SIGBUS while reading %s", rFile.name().latin1());
- munmap(( char* )map, rFile.size());
- sigaction (SIGBUS, &mmap_old_sigact, 0);
- return;
- }
-#endif
- }
- else
-#endif
- {
- rFile.at(0);
- data = rFile.readAll();
- s = data.data();
- eof = s + data.size();
- }
+ rFile.at(0);
+ TQByteArray data = rFile.readAll();
+ const char *s = data.data();
+ const char *eof = s + data.size();
bool fileOptionImmutable = false;
bool groupOptionImmutable = false;
@@ -757,19 +700,8 @@ tqWarning("SIGBUS while reading %s", rFile.name().latin1());
}
}
-
if (fileOptionImmutable)
bFileImmutable = true;
-
-#ifdef HAVE_MMAP
- if (map)
- {
- munmap(( char* )map, rFile.size());
-#ifdef SIGBUS
- sigaction (SIGBUS, &mmap_old_sigact, 0);
-#endif
- }
-#endif
}
void TDEConfigINIBackEnd::translateKey(TDELocale& locale, TQCString currentGroup, TQCString key) {
@@ -1178,7 +1110,7 @@ bool TDEConfigBackEnd::checkConfigFilesWritable(bool warnUser)
// Note: We don't ask the user if we should not ask this question again because we can't save the answer.
errorMsg += i18n("Please contact your system administrator.");
TQString cmdToExec = TDEStandardDirs::findExe(TQString("kdialog"));
- TDEApplication *app = kapp;
+ TDEApplication *app = tdeApp;
if (!cmdToExec.isEmpty() && app)
{
TDEProcess lprocess;