Author: mvidner Date: Mon Jul 21 15:09:08 2008 New Revision: 49277 URL: http://svn.opensuse.org/viewcvs/yast?rev=49277&view=rev Log: Added the debugging option --disable-timer. Modified: branches/tmp/lslezak/workshop/core/dbus/SCR_service/DBusServer.cc branches/tmp/lslezak/workshop/core/dbus/SCR_service/DBusServer.h branches/tmp/lslezak/workshop/core/dbus/SCR_service/SCR_dbus_server.cc Modified: branches/tmp/lslezak/workshop/core/dbus/SCR_service/DBusServer.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/workshop/core/dbus... ============================================================================== --- branches/tmp/lslezak/workshop/core/dbus/SCR_service/DBusServer.cc (original) +++ branches/tmp/lslezak/workshop/core/dbus/SCR_service/DBusServer.cc Mon Jul 21 15:09:08 2008 @@ -118,11 +118,14 @@ /** * Server that exposes a method call and waits for it to be called */ -void DBusServer::run() +void DBusServer::run(bool forever) { y2milestone("Listening for incoming DBus messages..."); - registerSignalHandler(); + if (forever) + y2milestone("Timer disabled"); + else + registerSignalHandler(); // mainloop while (true) @@ -158,7 +161,8 @@ } // reset the timer when a message is received - resetTimer(); + if (! forever) + resetTimer(); // create a reply to the message DBusMsg reply; Modified: branches/tmp/lslezak/workshop/core/dbus/SCR_service/DBusServer.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/workshop/core/dbus... ============================================================================== --- branches/tmp/lslezak/workshop/core/dbus/SCR_service/DBusServer.h (original) +++ branches/tmp/lslezak/workshop/core/dbus/SCR_service/DBusServer.h Mon Jul 21 15:09:08 2008 @@ -31,7 +31,11 @@ ~DBusServer(); bool connect(); - void run(); + /** + * Runs the server + * @param forever for debugging, disables exiting after timeout + */ + void run(bool forever = false); private: Modified: branches/tmp/lslezak/workshop/core/dbus/SCR_service/SCR_dbus_server.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/workshop/core/dbus... ============================================================================== --- branches/tmp/lslezak/workshop/core/dbus/SCR_service/SCR_dbus_server.cc (original) +++ branches/tmp/lslezak/workshop/core/dbus/SCR_service/SCR_dbus_server.cc Mon Jul 21 15:09:08 2008 @@ -10,11 +10,24 @@ DBusServer server; + bool forever = false; + bool badopts = false; + if (argc > 1) { + if (!strcmp(argv[1], "--disable-timer")) // like in packagekitd + forever = true; + else + badopts = true; + if (argc > 2) + badopts = true; + } + if (badopts) + y2error ("Usage: %s [--disable-timer]", argv[0]); + bool connected = server.connect(); if (connected) { - server.run(); + server.run(forever); return 0; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org