24 #include "application.h"
28 #include <libaccounts-glib/ag-application.h>
30 using namespace Accounts;
46 m_application(application)
54 m_application(nullptr)
63 m_application(other.m_application)
65 if (m_application !=
nullptr)
66 ag_application_ref(m_application);
71 if (m_application == other.m_application)
return *
this;
72 if (m_application !=
nullptr)
73 ag_application_unref(m_application);
74 m_application = other.m_application;
75 if (m_application !=
nullptr)
76 ag_application_ref(m_application);
85 if (m_application !=
nullptr) {
86 ag_application_unref(m_application);
87 m_application =
nullptr;
97 return m_application !=
nullptr;
107 if (Q_UNLIKELY(!
isValid()))
return QString();
108 return UTF8(ag_application_get_name(m_application));
118 GDesktopAppInfo *info =
119 ag_application_get_desktop_app_info(m_application);
120 if (Q_LIKELY(info)) {
121 name = UTF8(g_app_info_get_display_name(G_APP_INFO(info)));
122 g_object_unref(info);
133 return UTF8(ag_application_get_description(m_application));
143 GDesktopAppInfo *info =
144 ag_application_get_desktop_app_info(m_application);
145 if (Q_LIKELY(info)) {
146 gchar *gIconName = g_desktop_app_info_get_string(info,
"Icon");
147 if (Q_LIKELY(gIconName)) {
151 g_object_unref(info);
163 GDesktopAppInfo *info =
164 ag_application_get_desktop_app_info(m_application);
165 if (Q_LIKELY(info)) {
166 filePath = UTF8(g_desktop_app_info_get_filename(info));
167 g_object_unref(info);
179 return UTF8(ag_application_get_i18n_domain(m_application));
189 return ag_application_supports_service(m_application,
200 return UTF8(ag_application_get_service_usage(m_application,
204 AgApplication *Application::application()
const
206 return m_application;