本文整理汇总了C++中GList::split方法的典型用法代码示例。如果您正苦于以下问题:C++ GList::split方法的具体用法?C++ GList::split怎么用?C++ GList::split使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GList
的用法示例。
在下文中一共展示了GList::split方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getOAuthCredentials
/*
This should be replaced by more convenient method of accessing gnome-keyring..
We have very unnecessery dependecies with gnome devs here.
*/
const QStringList DesktopCouchProvider::getOAuthCredentials(void)
{
QLog::getLogger()->log("Retrieving credentials...",QLog::INFO);
//QStringList* creds = NULL;
g_set_application_name("desktop-couch-qt");
GnomeKeyringAttributeList* attributes;
GnomeKeyringResult result;
GList* found_list;
GList* i;
GnomeKeyringFound * found;
attributes = g_array_new(FALSE, FALSE, sizeof (GnomeKeyringAttribute));
gnome_keyring_attribute_list_append_string(attributes,"desktopcouch","oauth");
result = gnome_keyring_find_items_sync(GNOME_KEYRING_ITEM_GENERIC_SECRET,attributes,&found_list);
char* item;
if (result == GNOME_KEYRING_RESULT_OK )
{
for ( i = found_list; i != NULL; i = i->next )
{
found = (GnomeKeyringFound*)i->data;
item = g_strdup(found->secret);
QString i(item);
QStringList lcreds = i.split(":");
return lcreds;
}
}
QLog::getLogger()->log("Retrieving credentials failed...\n(check if Gnome-Keyring-Daemon is running)",QLog::ERROR);
return QStringList();
}