[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet-gtk] branch master updated: fix installation paths, fix some com
From: |
gnunet |
Subject: |
[gnunet-gtk] branch master updated: fix installation paths, fix some compiler warnings |
Date: |
Sun, 15 Dec 2024 12:51:44 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet-gtk.
The following commit(s) were added to refs/heads/master by this push:
new 08bbb65d fix installation paths, fix some compiler warnings
08bbb65d is described below
commit 08bbb65def42eabb40705f7dca67338835ce97b0
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Dec 15 12:51:41 2024 +0100
fix installation paths, fix some compiler warnings
---
contrib/Makefile.am | 2 +-
debian/gnunet-gtk.install | 2 +-
src/fs/Makefile.am | 2 +-
src/lib/os_installation.c | 2 +-
src/namestore/Makefile.am | 4 +-
src/namestore/gnunet-namestore-gtk.c | 185 ++++++++++++++++++++++-------------
6 files changed, 124 insertions(+), 73 deletions(-)
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index 21848043..0acaad5f 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -3,7 +3,7 @@
SUBDIRS = .
-pkgdatadir= $(prefix)/share/gnunet/
+pkgdatadir= $(prefix)/share/gnunet-gtk/
IMAGES = \
gnunet-setup-oxygen-cancel.png \
diff --git a/debian/gnunet-gtk.install b/debian/gnunet-gtk.install
index b4ab04be..62aef2c1 100644
--- a/debian/gnunet-gtk.install
+++ b/debian/gnunet-gtk.install
@@ -1,5 +1,5 @@
debian/contrib/gnunet-setup-pkexec /usr/bin
debian/contrib/org.debian.pkexec.gnunet-setup.policy
/usr/share/polkit-1/actions/
usr/bin/
-usr/lib/*/gnunet/*.so
+usr/lib/*/gnunet-gtk/*.so
usr/share
diff --git a/src/fs/Makefile.am b/src/fs/Makefile.am
index 89f1e78c..50abec5d 100644
--- a/src/fs/Makefile.am
+++ b/src/fs/Makefile.am
@@ -46,7 +46,7 @@ gnunet_fs_gtk_LDADD += \
-lextractor
endif
-pkgcfgdir= $(prefix)/share/gnunet/config.d/
+pkgcfgdir= $(prefix)/share/gnunet-gtk/config.d/
pkgcfg_DATA = \
gnunet-fs-gtk.conf
diff --git a/src/lib/os_installation.c b/src/lib/os_installation.c
index 18f1cf4a..72f0e407 100644
--- a/src/lib/os_installation.c
+++ b/src/lib/os_installation.c
@@ -32,7 +32,7 @@
*/
static const struct GNUNET_OS_ProjectData gtk_pd = {
.libname = "libgnunetgtk",
- .project_dirname = "gnunet", // FIXME: should change to gnunet-gtk
eventually!
+ .project_dirname = "gnunet-gtk",
.binary_name = "gnunet-fs-gtk",
.env_varname = "GNUNET_GTK_PREFIX",
.env_varname_alt = "GNUNET_PREFIX",
diff --git a/src/namestore/Makefile.am b/src/namestore/Makefile.am
index 4bd69fc1..aa7d4fb4 100644
--- a/src/namestore/Makefile.am
+++ b/src/namestore/Makefile.am
@@ -1,8 +1,8 @@
# This Makefile.am is in the public domain
SUBDIRS = .
-plugindir = $(libdir)/gnunet
-pkgcfgdir= $(prefix)/share/gnunet/config.d/
+plugindir = $(libdir)/gnunet-gtk
+pkgcfgdir= $(prefix)/share/gnunet-gtk/config.d/
AM_CPPFLAGS = \
-I$(top_srcdir)/ \
diff --git a/src/namestore/gnunet-namestore-gtk.c
b/src/namestore/gnunet-namestore-gtk.c
index ff12a3df..e5b8453b 100644
--- a/src/namestore/gnunet-namestore-gtk.c
+++ b/src/namestore/gnunet-namestore-gtk.c
@@ -398,17 +398,17 @@ static struct GNUNET_NAMESTORE_Handle *namestore;
/**
* Tree store with all of the values we're modifying for GNS.
*/
-static GtkTreeStore *ts;
+static GtkTreeStore *main_ts;
/**
* Tree model (same object as 'ts', just different type).
*/
-static GtkTreeModel *tm;
+static GtkTreeModel *main_tm;
/**
* The main tree view for 'gns' that shows the records.
*/
-static GtkTreeView *tv;
+static GtkTreeView *main_tv;
/**
* Private key of the zone we are currently editing.
@@ -463,7 +463,12 @@ static GtkComboBox *zone_combo_box;
/**
* Our configuration.
*/
-static const struct GNUNET_CONFIGURATION_Handle *cfg;
+static const struct GNUNET_CONFIGURATION_Handle *gnunet_cfg;
+
+/**
+ * Our configuration.
+ */
+static const struct GNUNET_CONFIGURATION_Handle *gnunet_gtk_cfg;
/**
* Ongoing identity operation.
@@ -835,7 +840,7 @@ clear_zone_view ()
GTK_WIDGET (get_object ("gnunet_namestore_gtk_qr_saveas_button")));
gtk_widget_hide (
GTK_WIDGET (get_object ("gnunet_namestore_gtk_qr_vseparator")));
- gtk_tree_store_clear (ts);
+ gtk_tree_store_clear (main_ts);
}
@@ -1792,7 +1797,10 @@ check_permissions (struct RecordInfo *ri, guint n_type)
ri->data,
ri->rd_count,
rd));
- if (GNUNET_OK != check_record_permitted (ri->rd_count, rd, n_type))
+ if (GNUNET_OK !=
+ check_record_permitted (ri->rd_count,
+ rd,
+ n_type))
{
show_error_message (
_ ("Record combination not permitted"),
@@ -1824,14 +1832,14 @@ gnunet_namestore_gtk_popup_edit_button_activate_cb
(GtkWidget *widget,
GtkTreeIter iter;
struct GNUNET_HashCode name_hash;
- sel = gtk_tree_view_get_selection (tv);
+ sel = gtk_tree_view_get_selection (main_tv);
if (! gtk_tree_selection_get_selected (sel, NULL, &iter))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "No row selected\n");
return;
}
/* clang-format off */
- gtk_tree_model_get (tm,
+ gtk_tree_model_get (main_tm,
&iter,
GNS_TREESTORE_COL_NAME, &n_name,
GNS_TREESTORE_COL_RECORD_TYPE, &n_type,
@@ -1890,14 +1898,15 @@ gnunet_namestore_gtk_type_cellrenderercombo_changed_cb (
GNS_TYPE_TO_NAME_LISTSTORE_COLUMN_TYPE, &type,
-1);
/* check if this is a new record */
- if (! gtk_tree_model_get_iter_from_string (tm,
+ if (! gtk_tree_model_get_iter_from_string (main_tm,
&it,
path_string))
{
GNUNET_break (0);
return;
}
- gtk_tree_model_get (tm, &it,
+ gtk_tree_model_get (main_tm,
+ &it,
GNS_TREESTORE_COL_NAME, &name_str,
-1);
if (NULL == name_str)
@@ -1964,14 +1973,15 @@ gnunet_namestore_gtk_name_cellrenderertext_edited_cb (
gtk_widget_error_bell (GTK_WIDGET (main_window));
return;
}
- if (! gtk_tree_model_get_iter_from_string (tm,
+ if (! gtk_tree_model_get_iter_from_string (main_tm,
&it,
path))
{
GNUNET_break (0);
return;
}
- gtk_tree_model_get (tm, &it,
+ gtk_tree_model_get (main_tm,
+ &it,
GNS_TREESTORE_COL_NOT_DUMMY_ROW, ¬_dummy,
GNS_TREESTORE_COL_NAME, &name,
-1);
@@ -1990,7 +2000,7 @@ gnunet_namestore_gtk_name_cellrenderertext_edited_cb (
GtkTreePath *sel_path;
sel_path = gtk_tree_row_reference_get_path (ri->rr);
- sel = gtk_tree_view_get_selection (tv);
+ sel = gtk_tree_view_get_selection (main_tv);
gtk_tree_selection_select_path (sel, sel_path);
gtk_tree_path_free (sel_path);
return;
@@ -1998,7 +2008,7 @@ gnunet_namestore_gtk_name_cellrenderertext_edited_cb (
/* change dummy line to new name, then add new dummy */
ri = GNUNET_new (struct RecordInfo);
- gtk_tree_store_set (ts,
+ gtk_tree_store_set (main_ts,
&it,
GNS_TREESTORE_COL_NAME, new_text,
GNS_TREESTORE_COL_NAME_IS_VISIBLE, TRUE,
@@ -2009,9 +2019,9 @@ gnunet_namestore_gtk_name_cellrenderertext_edited_cb (
GNS_TREESTORE_COL_TYPE_IS_EDITABLE, TRUE,
GNS_TREESTORE_COL_NAME_IS_EDITABLE, FALSE,
-1);
- tpath = gtk_tree_model_get_path (tm,
+ tpath = gtk_tree_model_get_path (main_tm,
&it);
- ri->rr = gtk_tree_row_reference_new (tm,
+ ri->rr = gtk_tree_row_reference_new (main_tm,
tpath);
ri->name = GNUNET_strdup (name);
gtk_tree_path_free (tpath);
@@ -2022,7 +2032,7 @@ gnunet_namestore_gtk_name_cellrenderertext_edited_cb (
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
/* add a new dummy line */
- gtk_tree_store_insert_with_values (ts,
+ gtk_tree_store_insert_with_values (main_ts,
&it,
NULL,
0,
@@ -2055,7 +2065,7 @@ create_popup_menu ()
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Considering creating popup menu...\n");
- sel = gtk_tree_view_get_selection (tv);
+ sel = gtk_tree_view_get_selection (main_tv);
if (! gtk_tree_selection_get_selected (sel,
NULL,
&it))
@@ -2064,7 +2074,8 @@ create_popup_menu ()
"No row selected\n");
return NULL;
}
- gtk_tree_model_get (tm, &it,
+ gtk_tree_model_get (main_tm,
+ &it,
GNS_TREESTORE_COL_NAME_IS_VISIBLE, &name_vis,
-1);
if (name_vis)
@@ -2169,13 +2180,13 @@ gnunet_namestore_gtk_treeview_key_press_event_cb
(GtkWidget *widget,
if ( (GDK_KEY_PRESS != event_key->type) ||
(GDK_KEY_Delete != event_key->keyval) )
return FALSE;
- sel = gtk_tree_view_get_selection (tv);
+ sel = gtk_tree_view_get_selection (main_tv);
if (! gtk_tree_selection_get_selected (sel,
NULL,
&iter))
return TRUE; /* nothing selected */
/* clang-format off */
- gtk_tree_model_get (tm,
+ gtk_tree_model_get (main_tm,
&iter,
GNS_TREESTORE_COL_NOT_DUMMY_ROW, ¬_dummy,
GNS_TREESTORE_COL_NAME, &name,
@@ -2190,7 +2201,10 @@ gnunet_namestore_gtk_treeview_key_press_event_cb
(GtkWidget *widget,
ric = GNUNET_CONTAINER_multihashmap_get (n2r, &name_hash);
GNUNET_assert (NULL != ric);
- if ((gtk_tree_model_iter_parent (tm, &parent, &iter)) && (ric->rd_count > 0))
+ if ( (gtk_tree_model_iter_parent (main_tm,
+ &parent,
+ &iter)) &&
+ (ric->rd_count > 0) )
{
struct GNUNET_GNSRECORD_Data rd_old[ric->rd_count];
struct GNUNET_GNSRECORD_Data rd_new[ric->rd_count - 1];
@@ -2213,7 +2227,8 @@ gnunet_namestore_gtk_treeview_key_press_event_cb
(GtkWidget *widget,
ric->rd_count,
rd_old));
/* clang-format off */
- gtk_tree_model_get (tm, &iter,
+ gtk_tree_model_get (main_tm,
+ &iter,
GNS_TREESTORE_COL_RECORD_TYPE, &n_type,
GNS_TREESTORE_COL_IS_PUBLIC, &n_public,
GNS_TREESTORE_COL_EXP_TIME, &n_exp_time,
@@ -2317,7 +2332,8 @@ static void
zone_sync_proc (void *cls)
{
(void) cls;
- gtk_tree_view_set_model (tv, tm);
+ gtk_tree_view_set_model (main_tv,
+ main_tm);
#if HAVE_QRENCODE_H
setup_qrcode ();
gtk_widget_show (GTK_WIDGET (get_object ("gnunet_namestore_gtk_qr_image")));
@@ -2381,11 +2397,18 @@ free_ri (struct RecordInfo *ri)
struct GNUNET_HashCode name_hash;
path = gtk_tree_row_reference_get_path (ri->rr);
- GNUNET_assert (gtk_tree_model_get_iter (tm, &iter_name, path));
+ GNUNET_assert (gtk_tree_model_get_iter (main_tm,
+ &iter_name,
+ path));
gtk_tree_path_free (path);
- gtk_tree_store_remove (ts, &iter_name);
- GNUNET_CRYPTO_hash (ri->name, strlen (ri->name), &name_hash);
- release_ri (NULL, &name_hash, ri);
+ gtk_tree_store_remove (main_ts,
+ &iter_name);
+ GNUNET_CRYPTO_hash (ri->name,
+ strlen (ri->name),
+ &name_hash);
+ release_ri (NULL,
+ &name_hash,
+ ri);
}
@@ -2444,28 +2467,39 @@ zone_iteration_proc (void *cls,
"Zone iteration result `%s', %u records\n",
name,
rd_count);
- GNUNET_CRYPTO_hash (name, strlen (name), &name_hash);
- sel = gtk_tree_view_get_selection (tv);
- if (gtk_tree_selection_get_selected (sel, NULL, &sel_iter))
- sel_path = gtk_tree_model_get_path (tm, &sel_iter);
+ GNUNET_CRYPTO_hash (name,
+ strlen (name),
+ &name_hash);
+ sel = gtk_tree_view_get_selection (main_tv);
+ if (gtk_tree_selection_get_selected (sel,
+ NULL,
+ &sel_iter))
+ sel_path = gtk_tree_model_get_path (main_tm,
+ &sel_iter);
else
sel_path = NULL;
- ri = GNUNET_CONTAINER_multihashmap_get (n2r, &name_hash);
+ ri = GNUNET_CONTAINER_multihashmap_get (n2r,
+ &name_hash);
if (NULL != ri)
{
rr = ri->rr;
path = gtk_tree_row_reference_get_path (rr);
- GNUNET_assert (gtk_tree_model_get_iter (tm, &iter_name, path));
+ GNUNET_assert (gtk_tree_model_get_iter (main_tm,
+ &iter_name,
+ path));
gtk_tree_path_free (path);
/* remove all records, we'll re-add those that are left next */
- if (gtk_tree_model_iter_children (tm, &iter_record, &iter_name))
- while (gtk_tree_store_remove (ts, &iter_record))
+ if (gtk_tree_model_iter_children (main_tm,
+ &iter_record,
+ &iter_name))
+ while (gtk_tree_store_remove (main_ts,
+ &iter_record))
;
}
else
{
ri = GNUNET_new (struct RecordInfo);
- gtk_tree_store_insert_with_values (ts,
+ gtk_tree_store_insert_with_values (main_ts,
&iter_name,
NULL,
-1,
@@ -2487,8 +2521,10 @@ zone_iteration_proc (void *cls,
UINT_MAX,
-1);
- path = gtk_tree_model_get_path (tm, &iter_name);
- rr = gtk_tree_row_reference_new (tm, path);
+ path = gtk_tree_model_get_path (main_tm,
+ &iter_name);
+ rr = gtk_tree_row_reference_new (main_tm,
+ path);
ri->rr = rr;
ri->name = GNUNET_strdup (name);
gtk_tree_path_free (path);
@@ -2565,7 +2601,9 @@ zone_iteration_proc (void *cls,
type_str =
strdup (GNUNET_GNSRECORD_number_to_typename (rd[c].record_type));
else
- GNUNET_asprintf (&type_str, "%s", EXPIRE_INVALID_STRING);
+ GNUNET_asprintf (&type_str,
+ "%s",
+ EXPIRE_INVALID_STRING);
if ((0 == strcmp (name, GNUNET_GNS_EMPTY_LABEL_AT)) &&
(GNUNET_GNSRECORD_TYPE_NICK == rd[c].record_type) &&
(NULL == current_pseudonym))
@@ -2574,7 +2612,7 @@ zone_iteration_proc (void *cls,
setup_qrcode ();
#endif
}
- gtk_tree_store_insert_with_values (ts,
+ gtk_tree_store_insert_with_values (main_ts,
&iter_record,
&iter_name,
-1,
@@ -2610,8 +2648,10 @@ zone_iteration_proc (void *cls,
}
if (NULL != sel_path)
{
- gtk_tree_selection_select_path (sel, sel_path);
- gtk_tree_view_expand_to_path (tv, sel_path);
+ gtk_tree_selection_select_path (sel,
+ sel_path);
+ gtk_tree_view_expand_to_path (main_tv,
+ sel_path);
gtk_tree_path_free (sel_path);
}
}
@@ -2624,7 +2664,8 @@ zone_iteration_proc (void *cls,
* @param ego ego handle
*/
static void
-load_zone (const char *name, struct GNUNET_IDENTITY_Ego *ego)
+load_zone (const char *name,
+ struct GNUNET_IDENTITY_Ego *ego)
{
char *label;
GtkTreeIter toplevel;
@@ -2638,7 +2679,8 @@ load_zone (const char *name, struct GNUNET_IDENTITY_Ego
*ego)
}
GNUNET_free (current_pseudonym);
current_pseudonym = NULL;
- gtk_tree_view_set_model (tv, NULL);
+ gtk_tree_view_set_model (main_tv,
+ NULL);
if (NULL == name)
return; /* empty zone */
current_pseudonym = GNUNET_strdup (name);
@@ -2650,7 +2692,7 @@ load_zone (const char *name, struct GNUNET_IDENTITY_Ego
*ego)
label);
g_free (label);
/* Append a top level row and leave it empty */
- gtk_tree_store_insert_with_values (ts,
+ gtk_tree_store_insert_with_values (main_ts,
&toplevel,
NULL,
-1,
@@ -2676,7 +2718,7 @@ load_zone (const char *name, struct GNUNET_IDENTITY_Ego
*ego)
setup_qrcode ();
#endif
GNUNET_assert (NULL != n2r);
- zmon = GNUNET_NAMESTORE_zone_monitor_start (cfg,
+ zmon = GNUNET_NAMESTORE_zone_monitor_start (gnunet_cfg,
pkey,
GNUNET_YES,
&zone_iteration_error,
@@ -2823,7 +2865,7 @@ cleanup_task (void *cls)
GNUNET_free (moc->data);
GNUNET_free (moc);
}
- gtk_tree_store_clear (ts);
+ gtk_tree_store_clear (main_ts);
if (NULL != current_pseudonym)
{
GNUNET_free (current_pseudonym);
@@ -3226,13 +3268,18 @@ gnunet_namestore_gtk_zone_del_button_clicked_cb
(GtkButton *button,
pseu = current_pseudonym;
current_pseudonym = NULL;
- GNUNET_CONTAINER_multihashmap_iterate (n2r, &delete_records, NULL);
- gtk_tree_store_clear (ts);
+ GNUNET_CONTAINER_multihashmap_iterate (n2r,
+ &delete_records,
+ NULL);
+ gtk_tree_store_clear (main_ts);
gtk_widget_set_sensitive (GTK_WIDGET (get_object (
"gnunet_namestore_gtk_zone_del_button")),
FALSE);
gtk_widget_set_sensitive (main_window, FALSE);
- iop = GNUNET_IDENTITY_delete (identity, pseu, &iop_cont, NULL);
+ iop = GNUNET_IDENTITY_delete (identity,
+ pseu,
+ &iop_cont,
+ NULL);
GNUNET_free (pseu);
}
@@ -3279,14 +3326,16 @@ read_service_conf (void *cls,
if (option[0] != '.')
return;
if (GNUNET_OK !=
- GNUNET_STRINGS_string_to_data (value, strlen (value), &pk, sizeof (pk)))
- {
- GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
- section,
- option,
- _ (
- "Properly base32-encoded public key
required"))
- ;
+ GNUNET_STRINGS_string_to_data (value,
+ strlen (value),
+ &pk,
+ sizeof (pk)))
+ {
+ GNUNET_log_config_invalid (
+ GNUNET_ERROR_TYPE_ERROR,
+ section,
+ option,
+ _ ("Properly base32-encoded public key required"));
return;
}
tld = GNUNET_new (struct GNS_TopLevelDomain);
@@ -3307,8 +3356,9 @@ run (void *cls)
gchar *label;
ml = cls;
- cfg = GNUNET_GTK_main_loop_get_gnunet_configuration (ml);
- GNUNET_CONFIGURATION_iterate_section_values (cfg,
+ gnunet_gtk_cfg = GNUNET_GTK_main_loop_get_gtk_configuration (ml);
+ gnunet_cfg = GNUNET_GTK_main_loop_get_gnunet_configuration (ml);
+ GNUNET_CONFIGURATION_iterate_section_values (gnunet_cfg,
"gns",
&read_service_conf,
NULL);
@@ -3339,7 +3389,7 @@ run (void *cls)
status_label = GTK_LABEL (get_object ("gnunet_namestore_gtk_status_label"));
zone_combo_box =
GTK_COMBO_BOX (get_object ("gnunet_namestore_gtk_zone_combobox"));
- namestore = GNUNET_NAMESTORE_connect (cfg);
+ namestore = GNUNET_NAMESTORE_connect (gnunet_cfg);
if (NULL == namestore)
{
label = g_markup_printf_escaped (
@@ -3349,12 +3399,13 @@ run (void *cls)
GNUNET_SCHEDULER_add_shutdown (&cleanup_task, NULL);
return;
}
- ts = GTK_TREE_STORE (get_object ("gnunet_namestore_gtk_treestore"));
- tv = GTK_TREE_VIEW (get_object ("gnunet_namestore_gtk_treeview"));
+ main_ts = GTK_TREE_STORE (get_object ("gnunet_namestore_gtk_treestore"));
+ main_tv = GTK_TREE_VIEW (get_object ("gnunet_namestore_gtk_treeview"));
zone_liststore = GTK_LIST_STORE (get_object ("zone_liststore"));
- tm = GTK_TREE_MODEL (ts);
- n2r = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_NO);
- identity = GNUNET_IDENTITY_connect (cfg,
+ main_tm = GTK_TREE_MODEL (main_ts);
+ n2r = GNUNET_CONTAINER_multihashmap_create (128,
+ GNUNET_NO);
+ identity = GNUNET_IDENTITY_connect (gnunet_cfg,
&identity_cb,
NULL);
gtk_widget_show (main_window);
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet-gtk] branch master updated: fix installation paths, fix some compiler warnings,
gnunet <=