From e5e7c47ff41491014daf6a49cd344531d6172ce4 Mon Sep 17 00:00:00 2001 From: erg Date: Tue, 12 May 2009 14:46:42 +0000 Subject: [PATCH] Fix setting of data file paths --- cmd/smyrna/viewport.c | 37 ++++++++++--------------------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/cmd/smyrna/viewport.c b/cmd/smyrna/viewport.c index c5fb951c7..a9067f814 100755 --- a/cmd/smyrna/viewport.c +++ b/cmd/smyrna/viewport.c @@ -317,52 +317,35 @@ static gboolean gl_main_expose(gpointer data) { } return 0; } + void get_data_dir() { -/* -#define SMYRNA_GLADE "c:/graphviz-ms/graphviz2/share/gui/smyrna.glade" -#define GTKTOPVIEW_ATTRS "c:/graphviz-ms/share/gui/attrs.txt" -#define DEFAULT_ATTRIBUTES_TEMPLATE_DOT_FILE "c:/graphviz-ms/graphviz2/share/gui/attr_template.dot" -*/ - - - - #ifdef WIN32 int a=GetCurrentDirectory(0, NULL); -#else - int a=getenv ("SMYRNA_PATH"); #endif - if (view->template_file) - { + if (view->template_file) { free(view->template_file); free(view->glade_file); free(view->attr_file); } +#ifdef WIN32 view->template_file=(char*)malloc(sizeof(char)*(a+13)); view->glade_file=(char*)malloc(sizeof(char)*(a+13)); view->attr_file=(char*)malloc(sizeof(char)*(a+10)); -#ifdef WIN32 + GetCurrentDirectory(a, view->template_file); GetCurrentDirectory(a, view->glade_file); GetCurrentDirectory(a, view->attr_file); -#else - view->template_file=getenv ("SMYRNA_PATH");; - view->glade_file=getenv ("SMYRNA_PATH");; - view->attr_file=getenv ("SMYRNA_PATH");; -#endif - strcat(view->template_file,"\\template.dot"); strcat(view->glade_file,"\\smyrna.glade"); strcat(view->attr_file,"\\attrs.txt"); - - -/*#define SMYRNA_GLADE "c:/graphviz-ms/graphviz2/share/gui/smyrna.glade" -#define GTKTOPVIEW_ATTRS "c:/graphviz-ms/share/gui/attrs.txt" -#define DEFAULT_ATTRIBUTES_TEMPLATE_DOT_FILE "c:/graphviz-ms/graphviz2/share/gui/attr_template.dot"*/ - - +#else + view->template_file = smyrnaPath ("template.dot"); + view->glade_file = smyrnaPath ("smyrna.glade"); + view->attr_file = smyrnaPath ("attrs.txt"); +#endif + } void init_viewport(ViewInfo * view) -- 2.40.0