summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2010-10-07 10:36:15 -0400
committerDavid Zeuthen <davidz@redhat.com>2010-10-07 10:36:15 -0400
commit9e3ec1644c897010e4660370b4e68d781fb92d5d (patch)
tree39dd0e98ef094c266003d958e1628ab04fcf3394
parenta459e7954bb480d62fa805010c6946c4b059a2ea (diff)
Rename NickName to Comment
Signed-off-by: David Zeuthen <davidz@redhat.com>
-rw-r--r--doc/stc-sections.txt2
-rw-r--r--doc/stc.conf.xml2
-rw-r--r--stc/stc.c10
-rw-r--r--stc/stcitem.c18
-rw-r--r--stc/stcitem.h2
-rw-r--r--stc/stcmonitor.c12
-rw-r--r--stc/test.c24
-rw-r--r--stc/testdata/semi_valid_conf/stc.conf12
8 files changed, 41 insertions, 41 deletions
diff --git a/doc/stc-sections.txt b/doc/stc-sections.txt
index 2de9a1a..6229f39 100644
--- a/doc/stc-sections.txt
+++ b/doc/stc-sections.txt
@@ -24,7 +24,7 @@ StcItemType
StcItemState
stc_item_get_id
stc_item_get_item_type
-stc_item_get_nick_name
+stc_item_get_comment
stc_item_get_target
stc_item_get_option
stc_item_get_option_keys
diff --git a/doc/stc.conf.xml b/doc/stc.conf.xml
index 1ed592a..0c8a8f5 100644
--- a/doc/stc.conf.xml
+++ b/doc/stc.conf.xml
@@ -122,7 +122,7 @@ Options=Filesystem:mount_path=/mnt/somewhere
</varlistentry>
<varlistentry>
- <term><literal>NickName</literal></term>
+ <term><literal>Comment</literal></term>
<listitem>
<para>
A human-readable string describing the entry.
diff --git a/stc/stc.c b/stc/stc.c
index 4c2ce0d..7d975c4 100644
--- a/stc/stc.c
+++ b/stc/stc.c
@@ -283,7 +283,7 @@ handle_command_list (gint *argc,
StcItem *item = STC_ITEM (l->data);
StcItemType type;
const gchar *id;
- const gchar *nick_name;
+ const gchar *comment;
const gchar *target;
const gchar *const *options;
const gchar *const *deps;
@@ -293,7 +293,7 @@ handle_command_list (gint *argc,
type = stc_item_get_item_type (item);
id = stc_item_get_id (item);
- nick_name = stc_item_get_nick_name (item);
+ comment = stc_item_get_comment (item);
target = stc_item_get_target (item);
g_print ("%s%s%s:%s\n",
@@ -316,13 +316,13 @@ handle_command_list (gint *argc,
target,
_color_get (_COLOR_RESET));
- if (nick_name != NULL)
+ if (comment != NULL)
{
- g_print (" %sNick Name:%s %s%s%s\n",
+ g_print (" %sComment:%s %s%s%s\n",
_color_get (_COLOR_FG_WHITE),
_color_get (_COLOR_RESET),
_color_get (_COLOR_FG_GREEN),
- nick_name,
+ comment,
_color_get (_COLOR_RESET));
}
diff --git a/stc/stcitem.c b/stc/stcitem.c
index 2735e8b..0a6d321 100644
--- a/stc/stcitem.c
+++ b/stc/stcitem.c
@@ -59,7 +59,7 @@ struct _StcItem
StcItemType type;
gchar *id;
- gchar *nick_name;
+ gchar *comment;
gchar *target;
GHashTable *options;
gchar **depends;
@@ -106,7 +106,7 @@ stc_item_finalize (GObject *object)
g_object_remove_weak_pointer (G_OBJECT (item->monitor), (gpointer*) &item->monitor);
g_free (item->id);
- g_free (item->nick_name);
+ g_free (item->comment);
g_free (item->target);
g_hash_table_unref (item->options);
g_strfreev (item->depends);
@@ -177,10 +177,10 @@ stc_item_get_id (StcItem *item)
}
const gchar *
-stc_item_get_nick_name (StcItem *item)
+stc_item_get_comment (StcItem *item)
{
g_return_val_if_fail (STC_IS_ITEM (item), NULL);
- return item->nick_name;
+ return item->comment;
}
const gchar *
@@ -202,7 +202,7 @@ _stc_item_new (StcMonitor *monitor,
StcItemType type,
const gchar *id,
const gchar *target,
- const gchar *nick_name,
+ const gchar *comment,
GHashTable *options,
const gchar *const *depends,
const gchar *sort_key,
@@ -217,7 +217,7 @@ _stc_item_new (StcMonitor *monitor,
g_object_add_weak_pointer (G_OBJECT (item->monitor), (gpointer*) &item->monitor);
item->id = g_strdup (id);
item->target = g_strdup (target);
- item->nick_name = g_strdup (nick_name);
+ item->comment = g_strdup (comment);
item->type = type;
item->options = g_hash_table_ref (options);
item->depends = g_strdupv ((gchar **) depends);
@@ -305,10 +305,10 @@ _stc_item_update (StcItem *item, StcItem *other)
changed = TRUE;
}
- if (g_strcmp0 (item->nick_name, other->nick_name) != 0)
+ if (g_strcmp0 (item->comment, other->comment) != 0)
{
- g_free (item->nick_name);
- item->nick_name = g_strdup (other->nick_name);
+ g_free (item->comment);
+ item->comment = g_strdup (other->comment);
changed = TRUE;
}
diff --git a/stc/stcitem.h b/stc/stcitem.h
index acf45ee..0ca3b11 100644
--- a/stc/stcitem.h
+++ b/stc/stcitem.h
@@ -39,7 +39,7 @@ G_BEGIN_DECLS
GType stc_item_get_type (void) G_GNUC_CONST;
StcItemType stc_item_get_item_type (StcItem *item);
const gchar *stc_item_get_id (StcItem *item);
-const gchar *stc_item_get_nick_name (StcItem *item);
+const gchar *stc_item_get_comment (StcItem *item);
const gchar *stc_item_get_target (StcItem *item);
const gchar* const *stc_item_get_option_keys (StcItem *item);
const gchar *stc_item_get_option (StcItem *item,
diff --git a/stc/stcmonitor.c b/stc/stcmonitor.c
index c8ae687..09d581a 100644
--- a/stc/stcmonitor.c
+++ b/stc/stcmonitor.c
@@ -691,7 +691,7 @@ stc_monitor_load_one_file (StcMonitor *monitor,
StcItemType item_type;
const gchar *item_id;
gchar *target;
- gchar *nick_name;
+ gchar *comment;
gchar *sort_key;
gchar *s;
gchar **options_strv;
@@ -701,7 +701,7 @@ stc_monitor_load_one_file (StcMonitor *monitor,
tokens = NULL;
target = NULL;
- nick_name = NULL;
+ comment = NULL;
sort_key = NULL;
options = NULL;
depends_strv = NULL;
@@ -810,8 +810,8 @@ stc_monitor_load_one_file (StcMonitor *monitor,
g_strfreev (options_strv);
}
- /* NickName is optional */
- nick_name = g_key_file_get_string (key_file, group, "NickName", NULL);
+ /* Comment is optional */
+ comment = g_key_file_get_string (key_file, group, "Comment", NULL);
/* Depends is optional */
depends_strv = g_key_file_get_string_list (key_file, group, "Depends", NULL, NULL);
@@ -834,7 +834,7 @@ stc_monitor_load_one_file (StcMonitor *monitor,
item_type,
item_id,
target,
- nick_name,
+ comment,
options,
(const gchar *const *) depends_strv,
sort_key,
@@ -845,7 +845,7 @@ stc_monitor_load_one_file (StcMonitor *monitor,
process_next_item:
g_strfreev (tokens);
g_free (target);
- g_free (nick_name);
+ g_free (comment);
g_free (sort_key);
g_strfreev (depends_strv);
if (options != NULL)
diff --git a/stc/test.c b/stc/test.c
index e5862ed..f68f066 100644
--- a/stc/test.c
+++ b/stc/test.c
@@ -68,12 +68,12 @@ static void item_append_str (StcItem *item,
g_string_append_printf (str,
"id `%s'\n"
"target `%s'\n"
- "nick-name `%s'\n"
+ "comment `%s'\n"
"type %s\n"
"options ",
stc_item_get_id (item) != NULL ? stc_item_get_id (item) : "(none)",
stc_item_get_target (item) != NULL ? stc_item_get_target (item) : "(none)",
- stc_item_get_nick_name (item) != NULL ? stc_item_get_nick_name (item) : "(none)",
+ stc_item_get_comment (item) != NULL ? stc_item_get_comment (item) : "(none)",
item_type_to_str (stc_item_get_item_type (item)));
if (g_strv_length ((gchar **) keys) == 0)
@@ -204,49 +204,49 @@ test_stc_semi_valid_conf (void)
g_assert_cmpstr (str2->str, ==,
"id `in_pri_10'\n"
"target `Device=/dev/sda'\n"
- "nick-name `(none)'\n"
+ "comment `(none)'\n"
"type filesystem\n"
"options Filesystem:mount_path -> `/mnt/10'\n"
"dependencies (none)\n"
"\n"
"id `in_pri_50'\n"
"target `Device=/dev/sda'\n"
- "nick-name `(none)'\n"
+ "comment `(none)'\n"
"type filesystem\n"
"options Filesystem:mount_path -> `/mnt/50'\n"
"dependencies (none)\n"
"\n"
"id `in_pri_90'\n"
"target `Device=/dev/sda'\n"
- "nick-name `(none)'\n"
+ "comment `(none)'\n"
"type filesystem\n"
"options Filesystem:mount_path -> `/mnt/90'\n"
"dependencies (none)\n"
"\n"
"id `multiple_instances_same_id'\n"
"target `Device=/dev/multiple_instances_same_id/second'\n"
- "nick-name `(none)'\n"
+ "comment `(none)'\n"
"type filesystem\n"
"options Filesystem:mount_path -> `/mnt/m_second'\n"
"dependencies (none)\n"
"\n"
"id `BigStorage'\n"
"target `Device=/dev/disk/md-uuid-01234:56789'\n"
- "nick-name `BigStorage'\n"
+ "comment `BigStorage'\n"
"type filesystem\n"
"options Filesystem:mount_path -> `/mnt/BigStorage'\n"
"dependencies BigStorage_mdraid\n"
"\n"
"id `BigStorage_mdraid'\n"
"target `UUID=01234:56789'\n"
- "nick-name `BigStorage RAID Array'\n"
+ "comment `BigStorage RAID Array'\n"
"type md-raid\n"
"options (none)\n"
"dependencies (none)\n"
"\n"
"id `SekritStuff'\n"
"target `Device=/dev/disk/by-uuid/1234'\n"
- "nick-name `My Secret Stuff'\n"
+ "comment `My Secret Stuff'\n"
"type filesystem\n"
"options Filesystem:mount_path -> `/mnt/SekritStuff'\n"
" Filesystem:options -> `noatime,dirsync'\n"
@@ -254,21 +254,21 @@ test_stc_semi_valid_conf (void)
"\n"
"id `SekritStuff_LUKS'\n"
"target `Device=/dev/disk/by-uuid/12345'\n"
- "nick-name `My Secret Stuff (Encrypted)'\n"
+ "comment `My Secret Stuff (Encrypted)'\n"
"type luks\n"
"options LUKS:password -> `xyz123'\n"
"dependencies (none)\n"
"\n"
"id `ItemWithUnresolved'\n"
"target `Device=/dev/sda'\n"
- "nick-name `(none)'\n"
+ "comment `(none)'\n"
"type filesystem\n"
"options Filesystem:mount_path -> `/mnt/Z'\n"
"dependencies NonExisting\n"
"\n"
"id `OtherRaid'\n"
"target `Name=homehost:array_name'\n"
- "nick-name `Other RAID'\n"
+ "comment `Other RAID'\n"
"type md-raid\n"
"options (none)\n"
"dependencies (none)\n"
diff --git a/stc/testdata/semi_valid_conf/stc.conf b/stc/testdata/semi_valid_conf/stc.conf
index ca7cacd..5f53e7b 100644
--- a/stc/testdata/semi_valid_conf/stc.conf
+++ b/stc/testdata/semi_valid_conf/stc.conf
@@ -2,24 +2,24 @@
#
[Filesystem BigStorage]
-NickName=BigStorage
+Comment=BigStorage
Device=/dev/disk/md-uuid-01234:56789
Options=Filesystem:mount_path=/mnt/BigStorage
Depends=BigStorage_mdraid
Auto=yes
[MDRaid BigStorage_mdraid]
-NickName=BigStorage RAID Array
+Comment=BigStorage RAID Array
UUID=01234:56789
[Filesystem SekritStuff]
-NickName=My Secret Stuff
+Comment=My Secret Stuff
Device=/dev/disk/by-uuid/1234
Options=Filesystem:mount_path=/mnt/SekritStuff;Filesystem:options=noatime,dirsync
Depends=SekritStuff_LUKS
[LUKS SekritStuff_LUKS]
-NickName=My Secret Stuff (Encrypted)
+Comment=My Secret Stuff (Encrypted)
Device=/dev/disk/by-uuid/12345
Options=LUKS:password=xyz123
@@ -29,7 +29,7 @@ Options=Filesystem:mount_path=/mnt/Z
Depends=NonExisting
[MDRaid OtherRaid]
-NickName=Other RAID
+Comment=Other RAID
Name=homehost:array_name
# ...and that we reject invalid items
@@ -54,5 +54,5 @@ Options=foo
# can't use Device for MDRaid (it doesn't exist yet)
[MDRaid bar]
-NickName=Other RAID
+Comment=Other RAID
Device=/dev/md0