You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
implement file sharing by file descriptor
Using custom gdbus code, as libportal doesn't expose the raw org.freedesktop.portal.OpenURI.OpenFile method.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include <libportal/portal.h>
|
||||
|
||||
#include <jni.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../defines.h"
|
||||
#include "../util.h"
|
||||
@@ -261,7 +262,7 @@ JNIEXPORT void JNICALL Java_android_app_Activity_nativeFileChooser(JNIEnv *env,
|
||||
#endif
|
||||
|
||||
const char *type = type_jstring ? (*env)->GetStringUTFChars(env, type_jstring, NULL) : NULL;
|
||||
if (type) {
|
||||
if (type && !strchr(type, '*')) {
|
||||
GtkFileFilter *filter = gtk_file_filter_new();
|
||||
gtk_file_filter_add_mime_type(filter, type);
|
||||
gtk_file_filter_set_name(filter, type);
|
||||
|
||||
Reference in New Issue
Block a user