30 #include <libaccounts-glib/ag-service.h> 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(ASCII(
"Parse error reading account service file " 215 "at line %1, column %2:\n%3"));
216 message.arg(errorLine).arg(errorColumn).arg(errorStr);
217 qWarning() << __PRETTY_FUNCTION__ << message;
222 AgService *Service::service()
const bool isValid() const
Check whether this object represents a Service.
QSet< QString > tags() const
Return all tags of the service as a set.
const QDomDocument domDocument() const
Get the contents of the service XML file.
Representation of an account service.
QString serviceType() const
Get the service type ID of the service.
bool hasTag(const QString &tag) const
Check if this service has a tag.
Service()
Construct an invalid service.
QString trCatalog() const
QString iconName() const
Get the icon name for this service.
QString displayName() const
Get the display name of the service, untranslated.
QString name() const
Get the name of the service.
QString provider() const
Get the provider ID of the service.