diff --git a/src/main.cpp b/src/main.cpp
index 778928f4c0ff309bb468f1ed744eba420af4bf76..f7be7d9400d86f3a4a1a044972d0d8d1c7726f30 100644 (file)
--- a/src/main.cpp
+++ b/src/main.cpp
#include "application/application.h"
+#include "main-cmdlineact.h"
+
enum {
SP_ARG_NONE,
SP_ARG_NOGUI,
POPT_AUTOHELP POPT_TABLEEND
};
-class CmdLineAction {
- gint _type;
- gchar * _arg;
-
- static std::list <CmdLineAction *> _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 (SPDocument * doc) {
- printf("Doing: %s\n", _arg);
- }
-
- static void doList (SPDocument * doc) {
- for (std::list<CmdLineAction *>::iterator i = _list.begin();
- i != _list.end(); i++) {
- CmdLineAction * entry = *i;
- entry->doIt(doc);
- }
- }
-};
-std::list <CmdLineAction *> CmdLineAction::_list;
-
-
static bool needToRecodeParams = true;
gchar* blankParam = "";
}
}
+ Glib::signal_idle().connect(sigc::ptr_fun(&Inkscape::CmdLineAction::idle));
main_instance.run();
#ifdef WIN32
} else if (sp_query_x || sp_query_y) {
do_query_dimension (doc, false, sp_query_x? NR::X : NR::Y, sp_query_id);
}
-
- CmdLineAction::doList(doc);
}
fl = g_slist_remove(fl, fl->data);
gchar const *arg = poptGetOptArg(ctx);
if (arg != NULL) {
// printf("Adding in: %s\n", arg);
- new CmdLineAction(a, arg);
+ new Inkscape::CmdLineAction((a == SP_ARG_VERB), arg);
}
break;
}