From c8ba68e1e3664b8fb7fb4be9772d458ab069ad91 Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Wed, 12 May 2010 20:19:41 +0000 Subject: Run on 0.82 under rainbow --- diff --git a/Makefile b/Makefile index 389bba9..8f188d1 100644 --- a/Makefile +++ b/Makefile @@ -280,7 +280,9 @@ build/tuxpaint-$(VER_VERSION): @echo @mkdir -p build/tuxpaint-$(VER_VERSION) @find . -follow \ - \( -wholename '*/CVS' -o name .thumbs -o -name .cvsignore -o -name 'dummy.o' -o -name 'build' -o -name '.#*' \) \ + \( -wholename '*/CVS' -o -path './.thumbs*' -o -name .cvsignore -o -name 'dummy.o' \ + -o -path './build/*' -o -name '.#*' -o -path './.git*' -o -path './.0sugar*' \ + -o -name '*.tar.*' -o -path './obj/[^.]*' \) \ -prune -o -type f -exec cp --parents -vdp \{\} build/tuxpaint-$(VER_VERSION)/ \; .PHONY: release diff --git a/src/sugar.c b/src/sugar.c index 7e5b727..198f69f 100644 --- a/src/sugar.c +++ b/src/sugar.c @@ -21,7 +21,9 @@ (See COPYING.txt) */ +#include #include + #include #include #include @@ -47,8 +49,13 @@ void sugar_init(int * argc, char *** argv) if (sugar_handle_get_object_id(handle) != NULL) jobject = sugar_jobject_find(sugar_handle_get_object_id(handle)); - if (jobject == NULL) + if (jobject != NULL) + g_debug("Journal entry %s was found", sugar_handle_get_object_id(handle)); + else + { jobject = sugar_jobject_create(sugar_handle_get_activity_id(handle)); + g_debug("Create new Journal entry"); + } } void sugar_cleanup() @@ -74,7 +81,7 @@ void sugar_cleanup() void sugar_setup_x11(int * window_width, int * window_height) { if (!sugar_detected()) - return NULL; + return; SDL_SysWMinfo wminfo; SDL_VERSION(&wminfo.version); @@ -108,7 +115,7 @@ char * sugar_get_jobject_file() if (!sugar_detected()) return NULL; - char * file_path = sugar_jobject_get_file_path(jobject); + const char * file_path = sugar_jobject_get_file_path(jobject); if (file_path != NULL) g_debug("Load image from journal entry %s", sugar_jobject_get_uid(jobject)); @@ -124,7 +131,14 @@ void sugar_save_jobject_file(char * path) if (sugar_jobject_get_uid(jobject) == NULL) new_jobject |= TRUE; - sugar_jobject_write_file(jobject, path, TRUE); + if (!sugar_environ_get_secure_mode()) + sugar_jobject_write_file(jobject, path, TRUE); + else { + /* There is no way to just move files to the datastore w/o creating 0777 + * directories, thus have to copy files */ + sugar_jobject_write_file(jobject, path, FALSE); + unlink(path); + } g_debug("Saved %s image to journal entry %s", path, sugar_jobject_get_uid(jobject)); @@ -132,5 +146,5 @@ void sugar_save_jobject_file(char * path) char * sugar_get_savedir(void) { - return g_strdup_printf("%s/data", sugar_profile_get_activity_root()); + return g_strdup_printf("%s/data", sugar_environ_get_activity_root()); } diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 8ddcea3..5716d18 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -20744,7 +20744,7 @@ static void do_lock_file(void) /* (Make sure the directory exists, first!) */ homedirdir = get_fname("", DIR_SAVE); - mkdir(homedirdir, 0755); + mkdir(homedirdir, 0775); free(homedirdir); -- cgit v0.9.1