我期待通過爲PolicyKit包在GNOME的源代碼,我已經遇到了一些代碼上的./src/polkitgnomeauthenticationdialog.c
,我需要與PolicyKit-gnome的以下部分是什麼意思?
if (g_strv_length (dialog->priv->users) > 1)
這是一個條件語句的一部分有點幫助568線這將決定當用戶通過輸入密碼要求他們進行身份驗證時向用戶顯示哪個對話。我需要幫助的是dialog->priv-.users
的含義。我知道這是一個以NULL結尾的字符串,因爲這就是g_strv_lngth
的操作,我收集它是與特權用戶有關的,但是語法卻讓我有些失望,特別是->
。對這條線路的快速解釋將非常感謝。
作爲參考,充分條件語句是
label = gtk_label_new (NULL);
if (g_strv_length (dialog->priv->users) > 1)
{
gtk_label_set_markup (GTK_LABEL (label),
_("An application is attempting to perform an action that requires privileges. "
"Authentication as one of the users below is required to perform this action."));
}
else
{
if (strcmp (g_get_user_name(), dialog->priv->users[0]) == 0)
{
gtk_label_set_markup (GTK_LABEL (label),
_("An application is attempting to perform an action that requires privileges. "
"Authentication is required to perform this action."));
}
else
{
gtk_label_set_markup (GTK_LABEL (label),
_("An application is attempting to perform an action that requires privileges. "
"Authentication as the super user is required to perform this action."));
}
}