After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 589699 - When ~/.cache isn't exists, session data isn't saved.
When ~/.cache isn't exists, session data isn't saved.
Status: RESOLVED FIXED
Product: anjuta
Classification: Applications
Component: core application
2.26.x
Other All
: Normal normal
: ---
Assigned To: Sébastien Granjoux
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2009-07-25 16:56 UTC by Yasumichi Akahoshi
Modified: 2009-07-29 19:10 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
use g_make_directory_with_parents instead of g_make_directory (545 bytes, patch)
2009-07-28 16:17 UTC, Yasumichi Akahoshi
reviewed Details | Review
make anjuta_util_create_dir recursively. (1015 bytes, patch)
2009-07-29 13:26 UTC, Yasumichi Akahoshi
accepted-commit_now Details | Review

Description Yasumichi Akahoshi 2009-07-25 16:56:00 UTC
Please describe the problem:
When ~/.cache isn't exists, session data isn't saved.

Example of this probrem:
I adjust the layout and Lock Doc Layout. When exit anjuta and run again, return to the original layout.

I'm sorry in strange English.(I am Japanese.)

Steps to reproduce:
1. remove ~/.cache (My environment don't have ~/.cache from beginning.)
2. run anjuta on terminal


Actual results:
Anjuta say follow error.

(anjuta:11234): libanjuta-WARNING **: Error directory:
 Error creating directory: No such file or directory

(anjuta:11234): GLib-GIO-CRITICAL **: g_file_query_exists: assertion `G_IS_FILE(file)' failed

(anjuta:11234): GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed

(anjuta:11234): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

(anjuta:11234): libanjuta-CRITICAL **: anjuta_shell_session_save: assertion `session_directory != NULL' failed


Expected results:


Does this happen every time?


Other information:
Comment 1 Yasumichi Akahoshi 2009-07-28 16:17:32 UTC
Created attachment 139398 [details] [review]
use g_make_directory_with_parents instead of g_make_directory
Comment 2 Sébastien Granjoux 2009-07-28 20:31:52 UTC
Thanks for your patch. 

But I would like to keep using a GFile for this and the function g_file_make_directory_with_parents. Unfortunately, this is a quite recent function.

So could you do the following changes ?

Use a define (#if GLIB_CHECK_VERSION(2,17,1)) to check that glib is new enough and use g_file_make_directory_with_parents only in this case ?

Then if the glib is too old, writes a small function recursively calling g_file_make_directory to create all parents.

I have search g_file_make_directory_with_parents on google source and find two projects doing something like this.

Finally, keep the warning message if the creation fails.
Comment 3 Yasumichi Akahoshi 2009-07-29 13:26:55 UTC
Created attachment 139475 [details] [review]
make anjuta_util_create_dir recursively.

Thanks for your reply.
I tried to make patch again. I made anjuta_util_create_dir recursively.
Comment 4 Sébastien Granjoux 2009-07-29 19:10:07 UTC
Thanks for your bug report and your patch.

I have committed without any change in the development version. It will be available in the next stable release.