From 77b6240463b6631adcaa03edb493dba04ce7c566 Mon Sep 17 00:00:00 2001 From: Sophie Krause Date: Thu, 6 Feb 2025 14:03:25 +0100 Subject: [PATCH] test changes --- .gitignore | 1 + docs/main.typ | 2 +- li.sopht.Flashcards.json | 6 +++--- resources/meson.build | 6 ------ resources/{ => ui}/flashcards.gresource.xml | 0 resources/ui/meson.build | 6 ++++++ resources/ui/window.blp | 5 +++-- src/database.c | 6 +++--- 8 files changed, 17 insertions(+), 15 deletions(-) rename resources/{ => ui}/flashcards.gresource.xml (100%) diff --git a/.gitignore b/.gitignore index 3ab04ca..2c8d25d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ builddir/ .flatpak-builder/ repo/ +app/ # Prerequisites *.d diff --git a/docs/main.typ b/docs/main.typ index 0de69f9..ff44b01 100644 --- a/docs/main.typ +++ b/docs/main.typ @@ -1,7 +1,7 @@ #import "template.typ": * #show: project.with( - title: "Karteikarten-Anwendung mit GTK und Libadwaita", + title: "Karteikarten-Anwendung in C mit GTK4 und Libadwaita", subtitle: "Hardwarenahe Programmierung", authors: ( "Sophie Krause", diff --git a/li.sopht.Flashcards.json b/li.sopht.Flashcards.json index 6512bdf..edcef9c 100644 --- a/li.sopht.Flashcards.json +++ b/li.sopht.Flashcards.json @@ -41,9 +41,9 @@ "buildsystem": "meson", "sources": [ { - "type": "git", - "tag": "main", - "url": "https://gitlab.cvh-server.de/skrause/flashcards" + "type": "file", + "url": "https://gitlab.cvh-server.de/skrause/flashcards", + "tag": "main" } ] } diff --git a/resources/meson.build b/resources/meson.build index a142ae1..f8c19c1 100644 --- a/resources/meson.build +++ b/resources/meson.build @@ -1,11 +1,5 @@ subdir('ui') -resources = gnome.compile_resources('resources', - 'flashcards.gresource.xml', - dependencies: blueprints, - c_name: 'flashcards' -) - compile_schemas = find_program('glib-compile-schemas', required: false, disabler: true) test('Validate schema file', compile_schemas, diff --git a/resources/flashcards.gresource.xml b/resources/ui/flashcards.gresource.xml similarity index 100% rename from resources/flashcards.gresource.xml rename to resources/ui/flashcards.gresource.xml diff --git a/resources/ui/meson.build b/resources/ui/meson.build index 1d54641..e3fe7ef 100644 --- a/resources/ui/meson.build +++ b/resources/ui/meson.build @@ -6,3 +6,9 @@ blueprints = custom_target('blueprints', output: '.', command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'], ) + +resources = gnome.compile_resources('resources', + 'flashcards.gresource.xml', + dependencies: blueprints, + c_name: 'flashcards' +) \ No newline at end of file diff --git a/resources/ui/window.blp b/resources/ui/window.blp index 2e249bb..c7aeb5d 100644 --- a/resources/ui/window.blp +++ b/resources/ui/window.blp @@ -66,7 +66,8 @@ template $FlashcardsAppWindow : Adw.ApplicationWindow { Adw.Clamp { hexpand: true; - child: Adw.Bin { + + Adw.Bin { margin-top: 12; margin-bottom: 12; margin-start: 12; @@ -83,7 +84,7 @@ template $FlashcardsAppWindow : Adw.ApplicationWindow { wrap: true; label: "Wie viel Grad hat ein Kreis?"; }; - }; + } } } } diff --git a/src/database.c b/src/database.c index bbdee75..4d6e6ae 100644 --- a/src/database.c +++ b/src/database.c @@ -111,10 +111,10 @@ GArray *database_load_categories() while (sqlite3_step(stmt) == SQLITE_ROW) { int id = sqlite3_column_int(stmt, 0); - const unsigned char *temp_name = sqlite3_column_text(stmt, 1); + const char *temp_name = (const char *)sqlite3_column_text(stmt, 1); - char *name = g_new0(char, strlen(temp_name)); - strcpy(name, temp_name); + char *name = g_new0(char, strlen(temp_name) + 1); + strncpy(name, temp_name, strlen(temp_name) + 1); category c = {id, name}; g_array_append_val(categories, c); }