Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zathura
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
114
Issues
114
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pwmt
zathura
Commits
68b665a4
Commit
68b665a4
authored
Jan 06, 2014
by
Sebastian Ramacher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move config file loading to config.c
parent
43500539
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
30 deletions
+26
-30
config.c
config.c
+22
-4
config.h
config.h
+1
-4
print.c
print.c
+2
-2
zathura.c
zathura.c
+1
-20
No files found.
config.c
View file @
68b665a4
...
...
@@ -15,8 +15,12 @@
#include <girara/shortcuts.h>
#include <girara/config.h>
#include <girara/commands.h>
#include <girara/utils.h>
#include <glib/gi18n.h>
#define GLOBAL_RC "/etc/zathurarc"
#define ZATHURA_RC "zathurarc"
static
void
cb_jumplist_change
(
girara_session_t
*
session
,
const
char
*
name
,
girara_setting_type_t
UNUSED
(
type
),
void
*
value
,
void
*
UNUSED
(
data
))
...
...
@@ -454,11 +458,25 @@ config_load_default(zathura_t* zathura)
}
void
config_load_file
(
zathura_t
*
zathura
,
const
char
*
path
)
config_load_file
s
(
zathura_t
*
zathura
)
{
if
(
zathura
==
NULL
||
path
==
NULL
)
{
return
;
/* load global configuration files */
char
*
config_path
=
girara_get_xdg_path
(
XDG_CONFIG_DIRS
);
girara_list_t
*
config_dirs
=
girara_split_path_array
(
config_path
);
ssize_t
size
=
girara_list_size
(
config_dirs
)
-
1
;
for
(;
size
>=
0
;
--
size
)
{
const
char
*
dir
=
girara_list_nth
(
config_dirs
,
size
);
char
*
file
=
g_build_filename
(
dir
,
ZATHURA_RC
,
NULL
);
girara_config_parse
(
zathura
->
ui
.
session
,
file
);
g_free
(
file
);
}
girara_list_free
(
config_dirs
);
g_free
(
config_path
);
girara_config_parse
(
zathura
->
ui
.
session
,
GLOBAL_RC
);
girara_config_parse
(
zathura
->
ui
.
session
,
path
);
/* load local configuration files */
char
*
configuration_file
=
g_build_filename
(
zathura
->
config
.
config_dir
,
ZATHURA_RC
,
NULL
);
girara_config_parse
(
zathura
->
ui
.
session
,
configuration_file
);
g_free
(
configuration_file
);
}
config.h
View file @
68b665a4
...
...
@@ -3,9 +3,6 @@
#ifndef CONFIG_H
#define CONFIG_H
#define GLOBAL_RC "/etc/zathurarc"
#define ZATHURA_RC "zathurarc"
#include "zathura.h"
/**
...
...
@@ -21,6 +18,6 @@ void config_load_default(zathura_t* zathura);
* @param zathura The zathura session
* @param path Path to the configuration file
*/
void
config_load_file
(
zathura_t
*
zathura
,
const
char
*
path
);
void
config_load_file
s
(
zathura_t
*
zathura
);
#endif // CONFIG_H
print.c
View file @
68b665a4
...
...
@@ -168,8 +168,8 @@ cb_print_draw_page(GtkPrintOperation* print_operation, GtkPrintContext*
static
void
cb_print_request_page_setup
(
GtkPrintOperation
*
UNUSED
(
print_operation
),
GtkPrintContext
*
UNUSED
(
context
),
gint
page_number
,
GtkPageSetup
*
setup
,
zathura_t
*
zathura
)
GtkPrintContext
*
UNUSED
(
context
),
gint
page_number
,
GtkPageSetup
*
setup
,
zathura_t
*
zathura
)
{
if
(
zathura
==
NULL
||
zathura
->
document
==
NULL
)
{
return
;
...
...
zathura.c
View file @
68b665a4
...
...
@@ -101,26 +101,7 @@ zathura_init(zathura_t* zathura)
/* configuration */
config_load_default
(
zathura
);
/* load global configuration files */
char
*
config_path
=
girara_get_xdg_path
(
XDG_CONFIG_DIRS
);
girara_list_t
*
config_dirs
=
girara_split_path_array
(
config_path
);
ssize_t
size
=
girara_list_size
(
config_dirs
)
-
1
;
for
(;
size
>=
0
;
--
size
)
{
const
char
*
dir
=
girara_list_nth
(
config_dirs
,
size
);
char
*
file
=
g_build_filename
(
dir
,
ZATHURA_RC
,
NULL
);
config_load_file
(
zathura
,
file
);
g_free
(
file
);
}
girara_list_free
(
config_dirs
);
g_free
(
config_path
);
config_load_file
(
zathura
,
GLOBAL_RC
);
/* load local configuration files */
char
*
configuration_file
=
g_build_filename
(
zathura
->
config
.
config_dir
,
ZATHURA_RC
,
NULL
);
config_load_file
(
zathura
,
configuration_file
);
g_free
(
configuration_file
);
config_load_files
(
zathura
);
/* UI */
if
(
girara_session_init
(
zathura
->
ui
.
session
,
"zathura"
)
==
false
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment