]> granicus.if.org Git - graphviz/commitdiff
Fix setting of data file paths
authorerg <devnull@localhost>
Tue, 12 May 2009 14:46:42 +0000 (14:46 +0000)
committererg <devnull@localhost>
Tue, 12 May 2009 14:46:42 +0000 (14:46 +0000)
cmd/smyrna/viewport.c

index c5fb951c7c72a15616fdf7c7ba8392d1d481d5d7..a9067f81420fe3d8a4f845b67c97cf18059dd47b 100755 (executable)
@@ -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)