[Kommander-devel] DCOP quit throws parse error

Eric Laffoon eric at kdewebdev.org
Wed Mar 1 06:21:51 EST 2006


Hi,
Why doesn't this code block work in Initialization?
===
@# see if we are running as root and throw dialog if not
@if(@exec(whoami) != "root") then
	@switch(
	@Message.warning(In order to run this you must run as root, Need to run as 
root, Open as root, Run anyway, Cancel))
	@# handle dialog ouput
	@case(1)
	@exec(kdesu kmdr-executor @global(_KDDIR)/@global(_NAME))
	@dcop(@dcopid, MainApplication-Interface, quit)
	@case(2)
	@#nothing to do
	@case(3)
	@dcop(@dcopid, MainApplication-Interface, quit)
	@end
@endif
===
It throws an error for unmatched parenthesis. My suspicion is that it tries to 
execute inside the DCOP call and in doing so quits before it hit's the close 
in the code. FWIW I also tried using an @exec DCOP call and using redirect to 
create a file which I could call with sh in an exec... No joy. I didn't test 
the signal slot method with a button so I don't know if it has problems but 
the above code should work, theoretically. I can also see where it would 
likely fail in this case. Is there anything I'm missing or any creative way 
to achieve this in a script we can offer?
-- 
Eric Laffoon
Project Lead - kdewebdev module


More information about the Kommander-devel mailing list