[gnome-builder/gnome-builder-3-32] create-project: require 3-part application id
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-32] create-project: require 3-part application id
- Date: Fri, 30 Aug 2019 23:02:55 +0000 (UTC)
commit 3b2fb61bc8de459380d7683556977aac592e48a8
Author: Christian Hergert <chergert redhat com>
Date: Fri Aug 30 14:16:39 2019 -0700
create-project: require 3-part application id
This is necessary for practical applications or we can't bundle them
with systems such as Flatpak.
Fixes #1011
src/plugins/create-project/gbp-create-project-surface.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/create-project/gbp-create-project-surface.c
b/src/plugins/create-project/gbp-create-project-surface.c
index 4bd6afd02..4c0a64d1a 100644
--- a/src/plugins/create-project/gbp-create-project-surface.c
+++ b/src/plugins/create-project/gbp-create-project-surface.c
@@ -250,6 +250,16 @@ gbp_create_project_surface_name_changed (GbpCreateProjectSurface *self,
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_IS_READY]);
}
+static guint
+count_chars (const gchar *str,
+ gunichar ch)
+{
+ guint count = 0;
+ for (; *str; str = g_utf8_next_char (str))
+ count += *str == ch;
+ return count;
+}
+
static void
gbp_create_project_surface_app_id_changed (GbpCreateProjectSurface *self,
GtkEntry *entry)
@@ -261,7 +271,8 @@ gbp_create_project_surface_app_id_changed (GbpCreateProjectSurface *self,
app_id = gtk_entry_get_text (entry);
- if (!(ide_str_empty0 (app_id) || g_application_id_is_valid (app_id)))
+ if (!(ide_str_empty0 (app_id) ||
+ (g_application_id_is_valid (app_id) && count_chars (app_id, '.') >= 2)))
{
g_object_set (self->app_id_entry,
"secondary-icon-name", "dialog-warning-symbolic",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]