Merge lp:~zeitgeist/zeitgeist/bluebird_basedir into lp:~zeitgeist/zeitgeist/bluebird

Proposed by Seif Lotfy
Status: Merged
Merge reported by: Seif Lotfy
Merged at revision: not available
Proposed branch: lp:~zeitgeist/zeitgeist/bluebird_basedir
Merge into: lp:~zeitgeist/zeitgeist/bluebird
Diff against target: 29 lines (+9/-4)
1 file modified
src/constants.vala (+9/-4)
To merge this branch: bzr merge lp:~zeitgeist/zeitgeist/bluebird_basedir
Reviewer Review Type Date Requested Status
Manish Sinha (मनीष सिन्हा) Approve
Michal Hruby (community) Approve
Review via email: mp+69658@code.launchpad.net

Description of the change

This is just a place holder. It should be merged once we are all happy with the results of this one file "constants.vala"

To post a comment you must log in.
Revision history for this message
Michal Hruby (mhr3) wrote :

We don't need gio (File.*), use DirUtils.* functions, join paths with Path.build_filename ()

review: Needs Fixing
Revision history for this message
Manish Sinha (मनीष सिन्हा) (manishsinha) wrote :

Instead of
Environment.get_user_data_dir () + "/"+ ZEITGEIST_DATA_FOLDER;

Use
Path.build_filename(path1 path2, path3...)

review: Needs Fixing (paths)
42. By Seif Lotfy

use Path.build_filename instead of +

Revision history for this message
Manish Sinha (मनीष सिन्हा) (manishsinha) wrote :

Do we need FileTest.IS_DIR
or FileTest.IS_DIR | FileTest.EXISTS ?

43. By Seif Lotfy

use DirUtils.create instead of (File.*)

Revision history for this message
Michal Hruby (mhr3) :
review: Approve
Revision history for this message
Manish Sinha (मनीष सिन्हा) (manishsinha) :
review: Approve
44. By Seif Lotfy

Use env paths if gives else fallback to the datapaths

45. By Seif Lotfy

renamed paths and changed removed const from DATABASE_FILE_PATH and DATABASE_FILE_BACKUP_PATH

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/constants.vala'
2--- src/constants.vala 2011-07-27 22:28:45 +0000
3+++ src/constants.vala 2011-07-28 14:42:47 +0000
4@@ -46,16 +46,21 @@
5 // default size is 2000
6 public const uint CACHE_SIZE = 0;
7
8- public const string ZEITGEIST_DATA_FOLDER = "zeitgeist";
9-
10+ public const string ZEITGEIST_DATA_FOLDER = "bluebird";
11 public const string ZEITGEIST_DATABASE_FILENAME = "activity.sqlite";
12
13 public void initialize ()
14 {
15 // FIXME: append "/zeitgeist"
16- BASE_DIRECTORY = Environment.get_user_data_dir ();
17+ BASE_DIRECTORY = Path.build_filename(Environment.get_user_data_dir (), ZEITGEIST_DATA_FOLDER);
18+ // If directory does not exist create directory
19+ if (!FileUtils.test (BASE_DIRECTORY, FileTest.IS_DIR)){
20+ DirUtils.create (BASE_DIRECTORY, 0755);
21+ }
22 DATA_PATH = Environment.get_variable ("ZEITGEIST_DATA_PATH");
23- // FIXME: make sure paths exist
24+
25+ stdout.printf("BASE_DIRECTORY = %s\n", BASE_DIRECTORY);
26+ stdout.printf("DATA_PATH = %s\n", DATA_PATH);
27 }
28 }
29 }

Subscribers

People subscribed via source and target branches