[fix] removed open notification when sending file to somebody else

This commit is contained in:
Julian Sparber
2017-09-18 11:55:01 +02:00
parent 1e9a9d824b
commit ceedb1ae43

View File

@@ -25,6 +25,8 @@ gchar * getFilePath (const gchar *, const gchar *);
finished (SoupSession *session, SoupMessage *msg, gpointer target) finished (SoupSession *session, SoupMessage *msg, gpointer target)
{ {
//GVariant *target array: {originDevice, url, filename, downloadDirectory} //GVariant *target array: {originDevice, url, filename, downloadDirectory}
if ((char *) g_variant_get_string (
g_variant_get_child_value ((GVariant *) target, 2), NULL) != NULL) {
saveFile(msg, saveFile(msg,
(char *) g_variant_get_string ( (char *) g_variant_get_string (
g_variant_get_child_value ((GVariant *) target, 3), NULL), g_variant_get_child_value ((GVariant *) target, 3), NULL),
@@ -38,6 +40,7 @@ finished (SoupSession *session, SoupMessage *msg, gpointer target)
g_variant_get_child_value ((GVariant *) target, 2), NULL), g_variant_get_child_value ((GVariant *) target, 2), NULL),
target); target);
} }
}
int int
get (char *url, const gchar *originDevice, const gchar *downloadDirectory, const gchar *outputFilename) get (char *url, const gchar *originDevice, const gchar *downloadDirectory, const gchar *outputFilename)
@@ -70,6 +73,10 @@ get (char *url, const gchar *originDevice, const gchar *downloadDirectory, const
g_object_ref (msg); g_object_ref (msg);
//soup_session_queue_message (session, msg, finished, loop); //soup_session_queue_message (session, msg, finished, loop);
if (outputFilename == NULL) {
soup_session_queue_message (session, msg, NULL, NULL);
}
else {
GVariantBuilder *builder; GVariantBuilder *builder;
GVariant *target; GVariant *target;
@@ -82,6 +89,7 @@ get (char *url, const gchar *originDevice, const gchar *downloadDirectory, const
g_variant_builder_unref (builder); g_variant_builder_unref (builder);
soup_session_queue_message (session, msg, finished, target); soup_session_queue_message (session, msg, finished, target);
}
return 0; return 0;
} }