From: gouldtj Date: Thu, 1 Mar 2007 07:21:46 +0000 (+0000) Subject: r14649@tres: ted | 2007-02-28 23:21:44 -0800 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4b4bd4fc0604303d7ff0bb8c0d549bac32101ee9;p=inkscape.git r14649@tres: ted | 2007-02-28 23:21:44 -0800 Somehow that didn't get deleted. --- diff --git a/src/main.cpp b/src/main.cpp index dbca3f74c..d3433756c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -389,92 +389,6 @@ struct poptOption options[] = { POPT_AUTOHELP POPT_TABLEEND }; -#include -#include -#include -#include -#include - -class CmdLineAction { - gint _type; - gchar * _arg; - - static std::list _list; - -public: - CmdLineAction (gint type, gchar const * arg) : _type(type), _arg(NULL) { - if (arg != NULL) { - _arg = g_strdup(arg); - } - - _list.insert(_list.end(), this); - - return; - } - - ~CmdLineAction () { - if (_arg != NULL) { - g_free(_arg); - } - } - - void doIt (Inkscape::UI::View::View * view) { - //printf("Doing: %s\n", _arg); - switch (_type) { - case SP_ARG_VERB: { - Inkscape::Verb * verb = Inkscape::Verb::getbyid(_arg); - if (verb == NULL) { - printf(_("Unable to find verb ID '%s' specified on the command line.\n"), _arg); - break; - } - SPAction * action = verb->get_action(view); - sp_action_perform(action, NULL); - break; - } - case SP_ARG_SELECT: { - SPDesktop * desktop = dynamic_cast(view); - if (desktop == NULL) { break; } - - SPDocument * doc = view->doc(); - SPObject * obj = doc->getObjectById(_arg); - if (obj == NULL) { - printf("Unable to find node ID: '%s'\n", _arg); - break; - } - - Inkscape::Selection * selection = sp_desktop_selection(desktop); - selection->add(obj, false); - break; - } - } - } - - static void doList (Inkscape::UI::View::View * view) { - for (std::list::iterator i = _list.begin(); - i != _list.end(); i++) { - CmdLineAction * entry = *i; - entry->doIt(view); - } - } - - static bool idle (void) { - std::list desktops; - inkscape_get_all_desktops(desktops); - - // We're going to assume one desktop per document, because no one - // should have had time to make more at this point. - for (std::list::iterator i = desktops.begin(); - i != desktops.end(); i++) { - SPDesktop * desktop = *i; - //Inkscape::UI::View::View * view = dynamic_cast(desktop); - doList(desktop); - } - return false; - } -}; -std::list CmdLineAction::_list; - - static bool needToRecodeParams = true; gchar* blankParam = "";