mirror of
https://github.com/irssi/irssi.git
synced 2026-08-23 10:32:31 +02:00
xdg: implement a better way
Brief about changes: - add get_irssi_cache_dir() - add get_irssi_runtime_dir() - remove is_xdg_supported() About the proposed implementation: - use XDG only when the user has the XDG_CONFIG_HOME/irssi directory - irssi_dir would equal XDG_DATA_HOME/irssi or ~/.irssi, depending on whether XDG is enabled or not, respectively. - if xdg is enabled, variables irssi_cache, irssi_runtime, would equal their respective XDG paths. - if xdg is *not* enabled, variables irssi_cache, irssi_runtime, would equal irssi_dir Notes for future code: - functions that use the irssi config file would use get_irssi_config() - functions that use the irssi data directory would use get_irssi_dir() - functions that use the irssi cache directory would use get_irssi_cache_dir() - functions that use the irssi runtime directory would use get_irssi_runtime_dir() Stuff that are still missing for complete implementation: - add checks to ensure the new referenced directories are present - docs
This commit is contained in:
parent
9175ee0bc1
commit
4059827741
9 changed files with 50 additions and 75 deletions
|
|
@ -55,9 +55,11 @@ int g_input_add(GIOChannel *source, int condition,
|
|||
int g_input_add_full(GIOChannel *source, int priority, int condition,
|
||||
GInputFunction function, void *data);
|
||||
|
||||
/* return if xdg is being used */
|
||||
int is_xdg_supported();
|
||||
/* return full path for irssi folder */
|
||||
/* return full path for irssi runtime directory */
|
||||
const char *get_irssi_runtime_dir(void);
|
||||
/* return full path for irssi cache directory */
|
||||
const char *get_irssi_cache_dir(void);
|
||||
/* return full path for irssi data directory */
|
||||
const char *get_irssi_dir(void);
|
||||
/* return full path for irssi config */
|
||||
const char *get_irssi_config(void);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue