Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2010-05-12 20:19:41 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2010-05-12 20:19:41 (GMT)
commitc8ba68e1e3664b8fb7fb4be9772d458ab069ad91 (patch)
tree92efbba0f2a0b007b863a01bc4dcae5abb5c52e4
parent2ed7f9a8446d6c876743164dff86f68408bd932e (diff)
Run on 0.82 under rainbow
-rw-r--r--Makefile4
-rw-r--r--src/sugar.c24
-rw-r--r--src/tuxpaint.c2
3 files changed, 23 insertions, 7 deletions
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 <unistd.h>
#include <SDL/SDL_syswm.h>
+
#include <sugar/env.h>
#include <sugar/ds.h>
#include <sugar/shell.h>
@@ -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);