Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pwmt
zathura
Commits
73699b12
Commit
73699b12
authored
Dec 06, 2015
by
Sebastian Ramacher
Browse files
Handle URIs in :open
Signed-off-by:
Sebastian Ramacher
<
sebastian+dev@ramacher.at
>
parent
d895ad32
Pipeline
#34
skipped
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
zathura/commands.c
View file @
73699b12
...
...
@@ -238,9 +238,9 @@ cmd_open(girara_session_t* session, girara_list_t* argument_list)
document_close
(
zathura
,
false
);
}
document_open
(
zathura
,
girara_list_nth
(
argument_list
,
0
),
(
argc
==
2
)
?
girara_list_nth
(
argument_list
,
1
)
:
NULL
,
ZATHURA_PAGE_NUMBER_UNSPECIFIED
);
document_open
_idle
(
zathura
,
girara_list_nth
(
argument_list
,
0
),
(
argc
==
2
)
?
girara_list_nth
(
argument_list
,
1
)
:
NULL
,
ZATHURA_PAGE_NUMBER_UNSPECIFIED
,
NULL
,
NULL
);
}
else
{
girara_notify
(
session
,
GIRARA_ERROR
,
_
(
"No arguments given."
));
return
false
;
...
...
zathura/zathura.c
View file @
73699b12
...
...
@@ -46,11 +46,11 @@
typedef
struct
zathura_document_info_s
{
zathura_t
*
zathura
;
const
char
*
path
;
const
char
*
password
;
char
*
path
;
char
*
password
;
int
page_number
;
const
char
*
mode
;
const
char
*
synctex
;
char
*
mode
;
char
*
synctex
;
}
zathura_document_info_t
;
...
...
@@ -63,6 +63,20 @@ static void zathura_jumplist_save(zathura_t* zathura);
static
gboolean
zathura_signal_sigterm
(
gpointer
data
);
#endif
static
void
free_document_info
(
zathura_document_info_t
*
document_info
)
{
if
(
document_info
==
NULL
)
{
return
;
}
g_free
(
document_info
->
path
);
g_free
(
document_info
->
password
);
g_free
(
document_info
->
mode
);
g_free
(
document_info
->
synctex
);
g_free
(
document_info
);
}
/* function implementation */
zathura_t
*
zathura_create
(
void
)
...
...
@@ -610,7 +624,7 @@ document_info_open(gpointer data)
}
}
g_
free
(
document_info
);
free
_document_info
(
document_info
);
return
FALSE
;
}
...
...
@@ -1043,9 +1057,8 @@ void
document_open_idle
(
zathura_t
*
zathura
,
const
char
*
path
,
const
char
*
password
,
int
page_number
,
const
char
*
mode
,
const
char
*
synctex
)
{
if
(
zathura
==
NULL
||
path
==
NULL
)
{
return
;
}
g_return_if_fail
(
zathura
!=
NULL
);
g_return_if_fail
(
path
!=
NULL
);
zathura_document_info_t
*
document_info
=
g_try_malloc0
(
sizeof
(
zathura_document_info_t
));
if
(
document_info
==
NULL
)
{
...
...
@@ -1053,11 +1066,17 @@ document_open_idle(zathura_t* zathura, const char* path, const char* password,
}
document_info
->
zathura
=
zathura
;
document_info
->
path
=
path
;
document_info
->
password
=
password
;
document_info
->
path
=
g_strdup
(
path
);
if
(
password
!=
NULL
)
{
document_info
->
password
=
g_strdup
(
password
);
}
document_info
->
page_number
=
page_number
;
document_info
->
mode
=
mode
;
document_info
->
synctex
=
synctex
;
if
(
mode
!=
NULL
)
{
document_info
->
mode
=
g_strdup
(
mode
);
}
if
(
synctex
!=
NULL
)
{
document_info
->
synctex
=
g_strdup
(
synctex
);
}
gdk_threads_add_idle
(
document_info_open
,
document_info
);
}
...
...
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