aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-07-15 16:11:23 +0200
committerThomas White <taw@physics.org>2021-07-15 17:05:43 +0200
commitcfda5fd637fbc2002195ee9e39612d5319a12800 (patch)
tree3e385b9c7326da5d5b2d6a0a87eed2747cc9a2e4 /src
parentc5a89386f273473954ec5f9e460052c175236c16 (diff)
GUI: Remove extra layer of relative paths
Not needed any more.
Diffstat (limited to 'src')
-rw-r--r--src/gui_project.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/gui_project.c b/src/gui_project.c
index 315a929d..854b93a5 100644
--- a/src/gui_project.c
+++ b/src/gui_project.c
@@ -1329,21 +1329,6 @@ int default_project(struct crystfelproject *proj)
}
-static char *relative_path(struct crystfelproject *proj, const char *fn)
-{
- GFile *pwd = g_file_new_for_path(".");
- GFile *fn_gfile = g_file_new_for_path(fn);
- char *rel = g_file_get_relative_path(pwd, fn_gfile);
- if ( rel == NULL ) {
- ERROR("Can't make relative path for '%s'\n", fn);
- return NULL;
- }
- g_object_unref(pwd);
- g_object_unref(fn_gfile);
- return rel;
-}
-
-
int add_indexing_result(struct crystfelproject *proj,
const char *name,
char **streams,
@@ -1363,7 +1348,7 @@ int add_indexing_result(struct crystfelproject *proj,
for ( i=0; i<n_streams; i++ ) {
new_results[proj->n_results].indices[i] = NULL;
- new_results[proj->n_results].streams[i] = relative_path(proj, streams[i]);
+ new_results[proj->n_results].streams[i] = strdup(streams[i]);
}
proj->results = new_results;
@@ -1386,9 +1371,9 @@ int add_merge_result(struct crystfelproject *proj, const char *name,
if ( new_results == NULL ) return 1;
new_results[proj->n_merge_results].name = strdup(name);
- new_results[proj->n_merge_results].hkl = relative_path(proj, hkl);
- new_results[proj->n_merge_results].hkl1 = relative_path(proj, hkl1);
- new_results[proj->n_merge_results].hkl2 = relative_path(proj, hkl2);
+ new_results[proj->n_merge_results].hkl = strdup(hkl);
+ new_results[proj->n_merge_results].hkl1 = strdup(hkl1);
+ new_results[proj->n_merge_results].hkl2 = strdup(hkl2);
proj->merge_results = new_results;
proj->n_merge_results++;