Skip to content

Commit 3728fb4

Browse files
committed
Also search in /usr/share for default files
Arch uses this directory apparently
1 parent 1e3310f commit 3728fb4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/dictpopup.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ static s8 convert_to_utf8(char *str) {
184184

185185
static void copy_default_database(char *dbdir) {
186186
// TODO: Make default loc OS independent
187-
const char *default_database_location = "/usr/local/share/dictpopup/data.mdb";
187+
const char *default_database_location = "/usr/share/dictpopup/data.mdb";
188+
if (!check_file_exists(default_database_location))
189+
default_database_location = "/usr/local/share/dictpopup/data.mdb";
188190
die_on(!check_file_exists(default_database_location),
189191
"Could not access the default database either. You need to create your own with"
190192
"dictpopup-create or download data.mdb from the repository.");

src/settings.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,9 @@ static void copy_ready_callback(GObject *source_object, GAsyncResult *res, gpoin
274274

275275
static void copy_default_config(char *cfgfile) {
276276
// TODO: Make default loc OS independent
277-
const char *default_config_location = "/usr/local/share/dictpopup/config.ini";
277+
const char *default_config_location = "/usr/share/dictpopup/config.ini";
278+
if (!check_file_exists(default_config_location))
279+
default_config_location = "/usr/local/share/dictpopup/config.ini";
278280
if (!check_file_exists(default_config_location)) {
279281
dbg("Could not access default config");
280282
return;

0 commit comments

Comments
 (0)