summaryrefslogtreecommitdiff
path: root/katze/midori-paths.vala
diff options
context:
space:
mode:
authorChristian Dywan <christian@twotoasts.de>2012-09-28 20:14:01 +0200
committerChristian Dywan <christian@twotoasts.de>2012-09-28 20:14:01 +0200
commit9f8c39f2d307e7d396d56c5bb3c15b80dfe29502 (patch)
treef777a41c2fb31a783fbaec69c213d6821e0a1b1d /katze/midori-paths.vala
parent2b3dd0fef6650136b2a8e3894964c5fcfde36d43 (diff)
downloadmidori-9f8c39f2d307e7d396d56c5bb3c15b80dfe29502.tar.gz
Rename Paths.get_config_dir/filename _for_reading/writing
And document the expected behavior.
Diffstat (limited to 'katze/midori-paths.vala')
-rw-r--r--katze/midori-paths.vala16
1 files changed, 12 insertions, 4 deletions
diff --git a/katze/midori-paths.vala b/katze/midori-paths.vala
index d60f2426..07925596 100644
--- a/katze/midori-paths.vala
+++ b/katze/midori-paths.vala
@@ -41,12 +41,14 @@ namespace Midori {
static string? user_data_dir = null;
static string? tmp_dir = null;
- public static string get_readonly_config_dir () {
+ public static string get_config_dir_for_reading () {
assert (mode != RuntimeMode.UNDEFINED);
return readonly_dir ?? config_dir;
}
- public static string get_readonly_config_filename (string filename) {
+ /* returns the path to a user configuration file whose contents should not be modified.
+ to get the path to save settings, use get_config_filename() */
+ public static string get_config_filename_for_reading (string filename) {
assert (mode != RuntimeMode.UNDEFINED);
return Path.build_path (Path.DIR_SEPARATOR_S,
readonly_dir ?? config_dir, filename);
@@ -92,12 +94,15 @@ namespace Midori {
}
}
- public static unowned string get_config_dir () {
+ public static unowned string get_config_dir_for_writing () {
assert (config_dir != null);
return config_dir;
}
- public static string get_config_filename (string filename) {
+ /* returns the path to a user configuration file to which it is permitted to write.
+ this is also necessary for files whose state is synchronized to disk by a manager,
+ e.g. cookies. */
+ public static string get_config_filename_for_writing (string filename) {
assert (mode != RuntimeMode.UNDEFINED);
assert (config_dir != null);
return Path.build_path (Path.DIR_SEPARATOR_S, config_dir, filename);
@@ -198,6 +203,8 @@ namespace Midori {
#endif
}
+ /* returns the path to a file containing read-only data installed with the application
+ if @res is true, looks in the midori resource folder specifically */
public static string get_data_filename (string filename, bool res) {
assert (command_line != null);
string res1 = res ? PACKAGE_NAME : "";
@@ -220,6 +227,7 @@ namespace Midori {
#endif
}
+ /* returns the path to a file containing system default configuration */
public static string get_preset_filename (string? folder, string filename) {
assert (config_dir != null);