diff --git a/CMakeLists.txt b/CMakeLists.txt index 87973b5..4051b39 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.5) -project(OTPClient VERSION "2.4.2" LANGUAGES "C") +project(OTPClient VERSION "2.4.3" LANGUAGES "C") configure_file("src/common/version.h.in" "version.h") include_directories(${PROJECT_BINARY_DIR}) @@ -11,11 +11,11 @@ option(BUILD_GUI "Build the GUI" ON) option(BUILD_CLI "Build the CLI" ON) set(CMAKE_C_STANDARD 11) -set(CMAKE_C_FLAGS "-Wall -Wextra -O3 -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute") +set(CMAKE_C_FLAGS "-Wall -Wextra -O2 -Wformat=2 -Wmissing-format-attribute -fstack-protector-strong -Wundef -Wmissing-format-attribute") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always -Wstrict-prototypes -Wunreachable-code") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wchar-subscripts -Wwrite-strings -Wpointer-arith -Wbad-function-cast -Wcast-align") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=format-security -Werror=implicit-function-declaration -Wno-sign-compare") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2") if(CMAKE_COMPILER_IS_GNUCC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pie -fPIE") endif() diff --git a/TODO.txt b/TODO.txt new file mode 100644 index 0000000..b139b1f --- /dev/null +++ b/TODO.txt @@ -0,0 +1,15 @@ +* add "border-width: 5" to: + newdb_pwd_diag_id + decpwd_diag_id + changepwd_diag_id + unlock_pwd_diag_id + diag_webcam_id + diag_qr_clipboard_id + diag_webcam_id + manual_add_diag_id + dialog_rcdb_id + edit_diag_id + warning_diag_id + settings_diag_id + +* change all paths to UI file diff --git a/data/com.github.paolostivanin.OTPClient.appdata.xml b/data/com.github.paolostivanin.OTPClient.appdata.xml index 15515c4..6e2a4b6 100644 --- a/data/com.github.paolostivanin.OTPClient.appdata.xml +++ b/data/com.github.paolostivanin.OTPClient.appdata.xml @@ -83,6 +83,16 @@ It's also possible to import/export backups from/to andOTP and import backups fr + + +

OTPClient 2.4.3 contains some small fixes

+
    +
  • fix a small andOTP export bug
  • +
  • fix wrong icon in taskbar
  • +
  • remove hard-coded paths from get-builder.c
  • +
+
+

OTPClient 2.4.2 contains a small fix to andOTP handling

diff --git a/data/com.github.paolostivanin.OTPClient.desktop b/data/com.github.paolostivanin.OTPClient.desktop index d234304..a48b858 100644 --- a/data/com.github.paolostivanin.OTPClient.desktop +++ b/data/com.github.paolostivanin.OTPClient.desktop @@ -7,4 +7,4 @@ Terminal=false Name=OTPClient Comment=GTK+ TOTP and HOTP client Categories=GTK;GNOME;Utility; - +StartupWMClass=otpclient diff --git a/src/common/andotp.c b/src/common/andotp.c index 0c204cc..be439cb 100644 --- a/src/common/andotp.c +++ b/src/common/andotp.c @@ -317,18 +317,18 @@ parse_json_data (const gchar *data, otp->secret = secure_strdup (json_string_value (json_object_get (obj, "secret"))); const gchar *issuer = json_string_value (json_object_get (obj, "issuer")); - otp->issuer = g_strdup (g_strstrip (issuer)); + otp->issuer = g_strstrip (g_strdup (issuer)); const gchar *label_with_prefix = json_string_value (json_object_get (obj, "label")); gchar **tokens = g_strsplit (label_with_prefix, ":", -1); if (tokens[0] && tokens[1]) { if(issuer != NULL && g_ascii_strcasecmp(issuer, tokens[0]) == 0) { - otp->account_name = g_strdup (g_strstrip (tokens[1])); + otp->account_name = g_strstrip (g_strdup (tokens[1])); } else { - otp->account_name = g_strdup (g_strstrip (label_with_prefix)); + otp->account_name = g_strstrip (g_strdup (label_with_prefix)); } } else { - otp->account_name = g_strdup (g_strstrip (tokens[0])); + otp->account_name = g_strstrip (g_strdup (tokens[0])); } g_strfreev (tokens); diff --git a/src/common/version.h.in b/src/common/version.h.in index b5a7b39..2522da7 100644 --- a/src/common/version.h.in +++ b/src/common/version.h.in @@ -1,7 +1,5 @@ #pragma once -#define PROJECT_NAME "@PROJECT_NAME@" -#define PROJECT_VER "@PROJECT_VERSION@" -#define PROJECT_VER_MAJOR "@PROJECT_VERSION_MAJOR@" -#define PROJECT_VER_MINOR "@PROJECT_VERSION_MINOR@" -#define PTOJECT_VER_PATCH "@PROJECT_VERSION_PATCH@" \ No newline at end of file +#define PROJECT_NAME "@PROJECT_NAME@" +#define PROJECT_VER "@PROJECT_VERSION@" +#define INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@" \ No newline at end of file diff --git a/src/get-builder.c b/src/get-builder.c index 3607776..30fa092 100644 --- a/src/get-builder.c +++ b/src/get-builder.c @@ -1,22 +1,17 @@ #include - +#include "version.h" GtkBuilder * get_builder_from_partial_path (const gchar *partial_path) { const gchar *prefix; #ifndef USE_FLATPAK_APP_FOLDER - if (g_file_test (g_strconcat ("/usr/", partial_path, NULL), G_FILE_TEST_EXISTS)) { - prefix = "/usr/"; - } else if (g_file_test (g_strconcat ("/usr/local/", partial_path, NULL), G_FILE_TEST_EXISTS)) { - prefix = "/usr/local/"; - } else { - return NULL; - } + // cmake trims the last '/', so we have to manually add it later on + prefix = INSTALL_PREFIX; #else - prefix = "/app/"; + prefix = "/app"; #endif - gchar *path = g_strconcat (prefix, partial_path, NULL); + gchar *path = g_strconcat (prefix, "/", partial_path, NULL); GtkBuilder *builder = gtk_builder_new_from_file (path); diff --git a/src/main.c b/src/main.c index 87e4954..a2ffa48 100644 --- a/src/main.c +++ b/src/main.c @@ -8,7 +8,6 @@ main (gint argc, { GtkApplication *app = gtk_application_new ("com.github.paolostivanin.OTPClient", G_APPLICATION_FLAGS_NONE); g_set_application_name (PROJECT_NAME); - g_set_prgname (PROJECT_VER); g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);