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 if (Q_UNLIKELY(!
isValid()))
return QString();
117 return UTF8(ag_service_get_name(m_service));
126 return UTF8(ag_service_get_display_name(m_service));
135 return ASCII(ag_service_get_service_type(m_service));
143 return ASCII(ag_service_get_i18n_domain(m_service));
152 return UTF8(ag_service_get_provider(m_service));
161 return ASCII(ag_service_get_icon_name(m_service));
173 return ag_service_has_tag(m_service, tag.toUtf8().constData());
186 m_tags =
new QSet<QString>;
187 GList *list = ag_service_get_tags(m_service);
189 while (iter != NULL) {
190 m_tags->insert(UTF8(
reinterpret_cast<const gchar *
> (iter->data)));
191 iter = g_list_next(iter);
205 ag_service_get_file_contents(m_service, &data, NULL);
211 if (!doc.setContent(QByteArray(data),
true,
212 &errorStr, &errorLine, &errorColumn))
214 QString message(QStringLiteral(
"Parse error reading account service file "
215 "at line %1, column %2:\n%3"));
216 message = message.arg(errorLine).arg(errorColumn).arg(errorStr);
217 qWarning() << __PRETTY_FUNCTION__ << message;
222 AgService *Service::service()
const