aboutsummaryrefslogtreecommitdiff
path: root/gpgme-vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-03-11 12:13:06 +0100
committerfiaxh <git@mx.ax.lt>2017-03-11 12:22:55 +0100
commit47ab19b3a06b6f96965482e4a33d443c2276c1d8 (patch)
treef6616e248a92b707269eda6a396c94180687dc45 /gpgme-vala
parent7bb6ff6250e7bfc1f5d8ee4cc5d49c7aaf5ac435 (diff)
downloaddino-47ab19b3a06b6f96965482e4a33d443c2276c1d8.tar.gz
dino-47ab19b3a06b6f96965482e4a33d443c2276c1d8.zip
UI to choose PGP key/disabled in account settings
Diffstat (limited to 'gpgme-vala')
-rw-r--r--gpgme-vala/CMakeLists.txt4
-rw-r--r--gpgme-vala/src/fix.c3
-rw-r--r--gpgme-vala/src/fix.h8
-rw-r--r--gpgme-vala/src/gpgme_fix.c12
-rw-r--r--gpgme-vala/src/gpgme_fix.h12
-rw-r--r--gpgme-vala/src/gpgme_helper.vala (renamed from gpgme-vala/src/gpgme-helper.vala)3
-rw-r--r--gpgme-vala/vapi/gpgme.vapi2
-rw-r--r--gpgme-vala/vapi/gpgme_public.vapi9
8 files changed, 33 insertions, 20 deletions
diff --git a/gpgme-vala/CMakeLists.txt b/gpgme-vala/CMakeLists.txt
index 519b4ce7..a510d293 100644
--- a/gpgme-vala/CMakeLists.txt
+++ b/gpgme-vala/CMakeLists.txt
@@ -12,7 +12,7 @@ pkg_check_modules(GPGME_VALA REQUIRED ${GPGME_VALA_PACKAGES})
vala_precompile(GPGME_VALA_C
SOURCES
- "src/gpgme-helper.vala"
+ "src/gpgme_helper.vala"
CUSTOM_VAPIS
"${CMAKE_CURRENT_SOURCE_DIR}/vapi/gpgme.vapi"
"${CMAKE_CURRENT_SOURCE_DIR}/vapi/gpgme_public.vapi"
@@ -30,7 +30,7 @@ OPTIONS
set(CFLAGS ${VALA_CFLAGS} ${GPGME_VALA_CFLAGS} ${GPGME_CFLAGS} -I${CMAKE_CURRENT_SOURCE_DIR}/src)
add_definitions(${CFLAGS})
-add_library(gpgme-vala SHARED ${GPGME_VALA_C} src/fix.c)
+add_library(gpgme-vala SHARED ${GPGME_VALA_C} src/gpgme_fix.c)
target_link_libraries(gpgme-vala ${GPGME_VALA_LIBRARIES} ${GPGME_LIBRARIES})
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/gpgme-vala/gpgme.vapi
diff --git a/gpgme-vala/src/fix.c b/gpgme-vala/src/fix.c
deleted file mode 100644
index 76aff720..00000000
--- a/gpgme-vala/src/fix.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include <fix.h>
-
-static GRecMutex gpgme_global_mutex = {0};
diff --git a/gpgme-vala/src/fix.h b/gpgme-vala/src/fix.h
deleted file mode 100644
index 15ecd3ac..00000000
--- a/gpgme-vala/src/fix.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef GPGME_FIX
-#define GPGME_FIX 1
-
-#include <glib.h>
-
-static GRecMutex gpgme_global_mutex;
-
-#endif \ No newline at end of file
diff --git a/gpgme-vala/src/gpgme_fix.c b/gpgme-vala/src/gpgme_fix.c
new file mode 100644
index 00000000..2bc139e9
--- /dev/null
+++ b/gpgme-vala/src/gpgme_fix.c
@@ -0,0 +1,12 @@
+#include <gpgme_fix.h>
+
+static GRecMutex gpgme_global_mutex = {0};
+
+gpgme_key_t gpgme_key_ref_vapi (gpgme_key_t key) {
+ gpgme_key_ref(key);
+ return key;
+}
+gpgme_key_t gpgme_key_unref_vapi (gpgme_key_t key) {
+ gpgme_key_unref(key);
+ return key;
+} \ No newline at end of file
diff --git a/gpgme-vala/src/gpgme_fix.h b/gpgme-vala/src/gpgme_fix.h
new file mode 100644
index 00000000..3daa7db0
--- /dev/null
+++ b/gpgme-vala/src/gpgme_fix.h
@@ -0,0 +1,12 @@
+#ifndef GPGME_FIX
+#define GPGME_FIX 1
+
+#include <glib.h>
+#include <gpgme.h>
+
+static GRecMutex gpgme_global_mutex;
+
+gpgme_key_t gpgme_key_ref_vapi (gpgme_key_t key);
+gpgme_key_t gpgme_key_unref_vapi (gpgme_key_t key);
+
+#endif \ No newline at end of file
diff --git a/gpgme-vala/src/gpgme-helper.vala b/gpgme-vala/src/gpgme_helper.vala
index d2f3f7e6..2a27ba3e 100644
--- a/gpgme-vala/src/gpgme-helper.vala
+++ b/gpgme-vala/src/gpgme_helper.vala
@@ -58,8 +58,7 @@ public static Gee.List<Key> get_keylist(string? pattern = null, bool secret_only
keys.add(key);
}
} catch (Error e) {
-// if (e.message != GPGError.ErrorCode.EOF.to_string()) throw e;
- if (e.message != "EOF") throw e;
+ if (e.code != GPGError.ErrorCode.EOF) throw e;
}
return keys;
}
diff --git a/gpgme-vala/vapi/gpgme.vapi b/gpgme-vala/vapi/gpgme.vapi
index 8393dca4..8c942f4b 100644
--- a/gpgme-vala/vapi/gpgme.vapi
+++ b/gpgme-vala/vapi/gpgme.vapi
@@ -24,7 +24,7 @@
[CCode (lower_case_cprefix = "gpgme_", cheader_filename = "gpgme.h")]
namespace GPG {
- [CCode (cheader_filename = "fix.h")]
+ [CCode (cheader_filename = "gpgme_fix.h")]
public static GLib.RecMutex global_mutex;
[CCode (cname = "struct _gpgme_engine_info")]
diff --git a/gpgme-vala/vapi/gpgme_public.vapi b/gpgme-vala/vapi/gpgme_public.vapi
index 86963025..942839ac 100644
--- a/gpgme-vala/vapi/gpgme_public.vapi
+++ b/gpgme-vala/vapi/gpgme_public.vapi
@@ -1,11 +1,11 @@
-[CCode (lower_case_cprefix = "gpgme_", cheader_filename = "gpgme.h")]
+[CCode (lower_case_cprefix = "gpgme_", cheader_filename = "gpgme.h,gpgme_fix.h")]
namespace GPG {
[CCode (cname = "gpgme_check_version")]
public unowned string check_version(string? required_version = null);
[Compact]
-[CCode (cname = "struct _gpgme_key", ref_function = "gpgme_key_ref", ref_function_void = true, unref_function = "gpgme_key_unref", free_function = "gpgme_key_release")]
+[CCode (cname = "struct _gpgme_key", ref_function = "gpgme_key_ref_vapi", unref_function = "gpgme_key_unref_vapi", free_function = "gpgme_key_release")]
public class Key {
public bool revoked;
public bool expired;
@@ -14,19 +14,20 @@ public class Key {
public bool can_encrypt;
public bool can_sign;
public bool can_certify;
- public bool secret;
public bool can_authenticate;
public bool is_qualified;
+ public bool secret;
public Protocol protocol;
public string issuer_serial;
public string issuer_name;
- public string issuer_id;
+ public string chain_id;
public Validity owner_trust;
[CCode(array_null_terminated = true)]
public SubKey[] subkeys;
[CCode(array_null_terminated = true)]
public UserID[] uids;
public KeylistMode keylist_mode;
+ public string fpr;
}
[CCode (cname = "struct _gpgme_user_id")]