From 170cdee8412995465683427399659dce6fc9c8c4 Mon Sep 17 00:00:00 2001 From: Waldo Bastian Date: Tue, 14 Oct 2003 16:06:54 +0000 Subject: [PATCH] Add --lock option to run without configure options. svn path=/trunk/kdebase/kwin/; revision=258918 --- main.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 2d464a329e..01bf2daa05 100644 --- a/main.cpp +++ b/main.cpp @@ -10,6 +10,8 @@ License. See the file "COPYING" for the exact licensing terms. ******************************************************************/ //#define QT_CLEAN_NAMESPACE +#include + #include "main.h" #include @@ -79,10 +81,16 @@ int x11ErrorHandler(Display *d, XErrorEvent *e) Application::Application( ) : KApplication( ), owner( screen_number ) { + KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); + if (!config()->isImmutable() && args->isSet("lock")) + { + config()->setReadOnly(true); + config()->reparseConfiguration(); + } + if (screen_number == -1) screen_number = DefaultScreen(qt_xdisplay()); - KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); if( !owner.claim( args->isSet( "replace" ), true )) { fputs(i18n("kwin: couldn't claim manager selection, another wm running? (try using --replace)\n").local8Bit(), stderr); @@ -147,6 +155,7 @@ static const char description[] = I18N_NOOP( "The KDE window manager." ); static KCmdLineOptions args[] = { + { "lock", I18N_NOOP("Disable configuration options."), 0 }, { "replace", I18N_NOOP("Replace already running ICCCM2.0 compliant window manager."), 0 }, KCmdLineLastOption };