database: Define chatlog database location
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
* vim: expandtab:ts=4:sts=4:sw=4
|
||||
*
|
||||
* Copyright (C) 2012 - 2019 James Booth <boothj5@gmail.com>
|
||||
* Copyright (C) 2020 Michael Vetter <jubalh@idoru.org>
|
||||
*
|
||||
* This file is part of Profanity.
|
||||
*
|
||||
@@ -138,6 +139,22 @@ files_get_log_file(char *log_file)
|
||||
return result;
|
||||
}
|
||||
|
||||
char*
|
||||
files_get_chatlog_database_path(void)
|
||||
{
|
||||
gchar *xdg_data = _files_get_xdg_data_home();
|
||||
GString *logfile = g_string_new(xdg_data);
|
||||
|
||||
g_string_append(logfile, "/profanity/chatlog.db");
|
||||
|
||||
char *result = strdup(logfile->str);
|
||||
|
||||
free(xdg_data);
|
||||
g_string_free(logfile, TRUE);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
char*
|
||||
files_get_config_path(char *config_base)
|
||||
{
|
||||
|
||||
@@ -60,6 +60,7 @@ void files_create_directories(void);
|
||||
|
||||
char* files_get_config_path(char *config_base);
|
||||
char* files_get_data_path(char *data_base);
|
||||
char* files_get_chatlog_database_path(void);
|
||||
|
||||
char* files_get_log_file(char *log_file);
|
||||
char* files_get_inputrc_file(void);
|
||||
|
||||
Reference in New Issue
Block a user