state = "packagekit,state,error";
else
{
- EINA_LIST_FOREACH(ctxt->packages, l, pkg)
- {
- switch (pkg->info)
- {
- case PK_INFO_ENUM_LOW:
- case PK_INFO_ENUM_ENHANCEMENT:
- case PK_INFO_ENUM_NORMAL:
- case PK_INFO_ENUM_BUGFIX:
- case PK_INFO_ENUM_IMPORTANT:
- case PK_INFO_ENUM_SECURITY:
- count++;
- break;
- default:
- break;
- }
- }
-
if (count > 0)
state = "packagekit,state,updates";
else
EINA_LIST_FOREACH(ctxt->packages, l, pkg)
{
- switch (pkg->info)
- {
- case PK_INFO_ENUM_LOW:
- emblem_name = "e/modules/packagekit/icon/low"; break;
- case PK_INFO_ENUM_ENHANCEMENT:
- emblem_name = "e/modules/packagekit/icon/enhancement"; break;
- case PK_INFO_ENUM_NORMAL:
- emblem_name = "e/modules/packagekit/icon/normal"; break;
- case PK_INFO_ENUM_BUGFIX:
- emblem_name = "e/modules/packagekit/icon/bugfix"; break;
- case PK_INFO_ENUM_IMPORTANT:
- emblem_name = "e/modules/packagekit/icon/important"; break;
- case PK_INFO_ENUM_SECURITY:
- emblem_name = "e/modules/packagekit/icon/security"; break;
- default:
- emblem_name = NULL; break;
- }
if (emblem_name)
{
// try to find a desktop file that match the executable or the name
{ /* Package ('u'info, 's'package_id, 's'summary) */
const char *error, *error_msg, *pkg_id, *summary, *info_str;
E_PackageKit_Module_Context *ctxt = data;
- PackageKit_Package_Info info;
unsigned num_elements = 0;
char **splitted;
Eina_Bool ret;
}
if (PKITV07)
ret = eldbus_message_arguments_get(msg, "sss", &info_str, &pkg_id, &summary);
- else
- ret = eldbus_message_arguments_get(msg, "uss", &info, &pkg_id, &summary);
if (!ret)
{
_store_error(ctxt, "could not get package arguments");
}
if (PKITV07)
{ DBG("PKGKIT: Package: (%s) %s [ %s ]", info_str, pkg_id, summary); }
- else
- { DBG("PKGKIT: Package: (%d) %s [ %s ]", info, pkg_id, summary); }
splitted = eina_str_split_full(pkg_id, ";", 2, &num_elements);
if (num_elements == 2)
pkg->name = eina_stringshare_add(splitted[0]);
pkg->version = eina_stringshare_add(splitted[1]);
pkg->summary = eina_stringshare_add(summary);
- if (PKITV07)
- {
- if (!info_str) pkg->info = PK_INFO_ENUM_NORMAL;
- else if (!strcmp(info_str, "normal")) pkg->info = PK_INFO_ENUM_NORMAL;
- else if (!strcmp(info_str, "security")) pkg->info = PK_INFO_ENUM_SECURITY;
- else if (!strcmp(info_str, "blocked")) pkg->info = PK_INFO_ENUM_BLOCKED;
- else if (!strcmp(info_str, "low")) pkg->info = PK_INFO_ENUM_LOW;
- else if (!strcmp(info_str, "enhancement")) pkg->info = PK_INFO_ENUM_ENHANCEMENT;
- else if (!strcmp(info_str, "bugfix")) pkg->info = PK_INFO_ENUM_BUGFIX;
- else if (!strcmp(info_str, "important")) pkg->info = PK_INFO_ENUM_IMPORTANT;
- else pkg->info = PK_INFO_ENUM_UNKNOWN;
- }
- else
- pkg->info = info;
ctxt->packages = eina_list_append(ctxt->packages, pkg);
}
if (splitted)
#define PKITV07 (ctxt->v_maj == 0) && (ctxt->v_min == 7)
#define PKITV08 (ctxt->v_maj == 0) && (ctxt->v_min == 8)
-typedef enum {
- PK_INFO_ENUM_UNKNOWN,
- PK_INFO_ENUM_INSTALLED,
- PK_INFO_ENUM_AVAILABLE,
- PK_INFO_ENUM_LOW,
- PK_INFO_ENUM_ENHANCEMENT,
- PK_INFO_ENUM_NORMAL,
- PK_INFO_ENUM_BUGFIX,
- PK_INFO_ENUM_IMPORTANT,
- PK_INFO_ENUM_SECURITY,
- PK_INFO_ENUM_BLOCKED,
- PK_INFO_ENUM_DOWNLOADING,
- PK_INFO_ENUM_UPDATING,
- PK_INFO_ENUM_INSTALLING,
- PK_INFO_ENUM_REMOVING,
- PK_INFO_ENUM_CLEANUP,
- PK_INFO_ENUM_OBSOLETING,
- PK_INFO_ENUM_COLLECTION_INSTALLED,
- PK_INFO_ENUM_COLLECTION_AVAILABLE,
- PK_INFO_ENUM_FINISHED,
- PK_INFO_ENUM_REINSTALLING,
- PK_INFO_ENUM_DOWNGRADING,
- PK_INFO_ENUM_PREPARING,
- PK_INFO_ENUM_DECOMPRESSING,
- PK_INFO_ENUM_UNTRUSTED,
- PK_INFO_ENUM_TRUSTED,
- PK_INFO_ENUM_LAST,
-} PackageKit_Package_Info;
-
typedef struct _PackageKit_Config
{
int update_interval;
const char *name;
const char *summary;
const char *version;
- PackageKit_Package_Info info;
} E_PackageKit_Package;