Commit 7efeb298 authored by Jakub Janků's avatar Jakub Janků Committed by Frediano Ziglio
Browse files

Revert 4b9092b9 and add SpiceSession:webdav-server property instead

This reverts commit 4b9092b9


"session: make spice_session_get_webdav_server() public".

Instead of publishing the function to access the PhodavServer
from spice-gtk-session.c, install a new read-only property
"webdav-server" and use g_object_get() to retrieve it.
Signed-off-by: Jakub Janků's avatarJakub Janků <jjanku@redhat.com>
Acked-by: Frediano Ziglio's avatarFrediano Ziglio <fziglio@redhat.com>
Acked-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
parent f33d589d
Pipeline #200459 passed with stage
in 3 minutes and 40 seconds
......@@ -144,7 +144,6 @@ spice_session_new;
spice_session_open_fd;
spice_session_verify_get_type;
spice_set_session_option;
spice_session_get_webdav_server;
spice_smartcard_channel_get_type;
spice_smartcard_manager_get;
spice_smartcard_manager_get_readers;
......
......@@ -123,7 +123,6 @@ spice_session_new
spice_session_open_fd
spice_session_verify_get_type
spice_set_session_option
spice_session_get_webdav_server
spice_smartcard_channel_get_type
spice_smartcard_manager_get
spice_smartcard_manager_get_readers
......
......@@ -1135,7 +1135,9 @@ static gchar *strv_uris_transform_to_data(SpiceGtkSessionPrivate *s,
gchar **uris, gsize *size_out, GdkDragAction action)
{
SpiceWebdavChannel *webdav;
PhodavServer *phodav;
/* if there's version mismatch between spice-client-gtk and spice-client-glib,
* "webdav-server" property might not be present, so phodav must be initialized to NULL */
PhodavServer *phodav = NULL;
PhodavVirtualDir *root;
gchar **uri_ptr, *path, **paths, *data;
......@@ -1154,8 +1156,12 @@ static gchar *strv_uris_transform_to_data(SpiceGtkSessionPrivate *s,
return NULL;
}
phodav = spice_session_get_webdav_server(s->session);
g_object_get(s->session, "webdav-server", &phodav, NULL);
if (!phodav) {
return NULL;
}
g_object_get(phodav, "root-file", &root, NULL);
g_object_unref(phodav);
paths = g_new0(gchar *, g_strv_length(uris) + 2);
......
......@@ -87,6 +87,7 @@ gboolean spice_session_get_smartcard_enabled(SpiceSession *session);
gboolean spice_session_get_usbredir_enabled(SpiceSession *session);
gboolean spice_session_get_gl_scanout_enabled(SpiceSession *session);
PhodavServer *spice_session_get_webdav_server(SpiceSession *session);
guint spice_session_get_n_display_channels(SpiceSession *session);
gboolean spice_session_set_migration_session(SpiceSession *session, SpiceSession *mig_session);
SpiceAudio *spice_audio_get(SpiceSession *session, GMainContext *context);
......
......@@ -196,6 +196,7 @@ enum {
PROP_SECURE_CHANNELS,
PROP_SHARED_DIR,
PROP_SHARE_DIR_RO,
PROP_WEBDAV_SERVER,
PROP_USERNAME,
PROP_UNIX_PATH,
PROP_PREF_COMPRESSION,
......@@ -705,6 +706,9 @@ static void spice_session_get_property(GObject *gobject,
case PROP_SHARE_DIR_RO:
g_value_set_boolean(value, s->share_dir_ro);
break;
case PROP_WEBDAV_SERVER:
g_value_set_object(value, spice_session_get_webdav_server(session));
break;
case PROP_PREF_COMPRESSION:
g_value_set_enum(value, s->preferred_compression);
break;
......@@ -1484,6 +1488,27 @@ static void spice_session_class_init(SpiceSessionClass *klass)
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
/**
* SpiceSession:webdav-server:
*
* Phodav server that is internally used by #SpiceSession to make
* #SpiceSession:shared-dir available to the host.
*
* Since: 0.39
**/
g_object_class_install_property
(gobject_class, PROP_WEBDAV_SERVER,
g_param_spec_object("webdav-server",
"WebDAV server",
"PhodavServer object used for directory sharing",
#ifdef USE_PHODAV
PHODAV_TYPE_SERVER,
#else
G_TYPE_OBJECT,
#endif
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
/**
* SpiceSession:preferred-compression:
*
......@@ -2807,6 +2832,7 @@ gboolean spice_session_get_smartcard_enabled(SpiceSession *session)
return session->priv->smartcard;
}
G_GNUC_INTERNAL
PhodavServer* spice_session_get_webdav_server(SpiceSession *session)
{
SpiceSessionPrivate *priv;
......
......@@ -38,8 +38,6 @@ G_BEGIN_DECLS
#define SPICE_WEBDAV_CLIPBOARD_FOLDER_PATH "/.spice-clipboard"
typedef struct _PhodavServer PhodavServer;
/**
* SpiceSessionVerify:
* @SPICE_SESSION_VERIFY_PUBKEY: verify certificate public key matching
......@@ -117,7 +115,6 @@ gboolean spice_session_has_channel_type(SpiceSession *session, gint type);
gboolean spice_session_get_read_only(SpiceSession *session);
SpiceURI *spice_session_get_proxy_uri(SpiceSession *session);
gboolean spice_session_is_for_migration(SpiceSession *session);
PhodavServer *spice_session_get_webdav_server(SpiceSession *session);
G_END_DECLS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment