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);
93 ag_service_unref(m_service);
108 return m_service != 0;
118 return UTF8(ag_service_get_name(m_service));
127 return UTF8(ag_service_get_display_name(m_service));
136 return ASCII(ag_service_get_service_type(m_service));
144 return ASCII(ag_service_get_i18n_domain(m_service));
153 return UTF8(ag_service_get_provider(m_service));
162 return ASCII(ag_service_get_icon_name(m_service));
174 return ag_service_has_tag(m_service, tag.toUtf8().constData());
187 m_tags =
new QSet<QString>;
188 GList *list = ag_service_get_tags(m_service);
190 while (iter != NULL) {
191 m_tags->insert(UTF8(reinterpret_cast<const gchar *> (iter->data)));
192 iter = g_list_next(iter);
206 ag_service_get_file_contents(m_service, &data, NULL);
212 if (!doc.setContent(QByteArray(data),
true,
213 &errorStr, &errorLine, &errorColumn))
215 QString message(ASCII(
"Parse error reading account service file "
216 "at line %1, column %2:\n%3"));
217 message.arg(errorLine).arg(errorColumn).arg(errorStr);
218 qWarning() << __PRETTY_FUNCTION__ << message;
223 AgService *Service::service()
const