30 #include <libaccounts-glib/ag-service.h>
32 using namespace Accounts;
52 if (m_service != 0 && mode == AddReference)
53 ag_service_ref(m_service);
70 m_service(other.m_service),
74 ag_service_ref(m_service);
79 if (m_service == other.m_service)
return *
this;
81 ag_service_unref(m_service);
82 m_service = other.m_service;
84 ag_service_ref(m_service);
91 ag_service_unref(m_service);
106 return m_service != 0;
116 return UTF8(ag_service_get_name(m_service));
125 return UTF8(ag_service_get_display_name(m_service));
134 return ASCII(ag_service_get_service_type(m_service));
142 return ASCII(ag_service_get_i18n_domain(m_service));
151 return UTF8(ag_service_get_provider(m_service));
160 return ASCII(ag_service_get_icon_name(m_service));
172 return ag_service_has_tag(m_service, tag.toUtf8().constData());
185 m_tags =
new QSet<QString>;
186 GList *list = ag_service_get_tags(m_service);
188 while (iter != NULL) {
189 m_tags->insert(UTF8(reinterpret_cast<const gchar *> (iter->data)));
190 iter = g_list_next(iter);
204 ag_service_get_file_contents(m_service, &data, NULL);
210 if (!doc.setContent(QByteArray(data),
true,
211 &errorStr, &errorLine, &errorColumn))
213 QString message(ASCII(
"Parse error reading account service file "
214 "at line %1, column %2:\n%3"));
215 message.arg(errorLine).arg(errorColumn).arg(errorStr);
216 qWarning() << __PRETTY_FUNCTION__ << message;
221 AgService *Service::service()
const