New upstream version

- Add a --verbose and --version argument to colormgr
- Add DTP94 native sensor support
- Allow profiles to have a 'score' which affects the standard space
- Change the Adobe RGB description to be 'Compatible with Adobe RGB (1998)'
- Detect profiles from adobe.com and color.org and add metadata
- Do not auto-add profiles due to device-id metadata if they have been removed
- Ensure profiles with MAPPING_device_id get auto-added to devices
- Install various helper libraries for access to hardware
- Set the additional 'OwnerCmdline' metadata on each device
This commit is contained in:
Richard Hughes 2013-02-04 22:18:01 +00:00
parent a3c0c15f13
commit bcfba95478
4 changed files with 42 additions and 248 deletions

1
.gitignore vendored
View File

@ -26,3 +26,4 @@
/colord-0.1.26.tar.xz
/colord-0.1.27.tar.xz
/colord-0.1.28.tar.xz
/colord-0.1.29.tar.xz

View File

@ -1,236 +0,0 @@
diff --git a/src/cd-main.c b/src/cd-main.c
index a5e0ff6..ce4de30 100644
--- a/src/cd-main.c
+++ b/src/cd-main.c
@@ -265,25 +265,16 @@ out:
}
/**
- * cd_main_device_auto_add_profile_md:
+ * cd_main_auto_add_from_md:
**/
static gboolean
-cd_main_device_auto_add_profile_md (CdDevice *device, CdProfile *profile)
+cd_main_auto_add_from_md (CdMainPrivate *priv,
+ CdDevice *device,
+ CdProfile *profile)
{
- const gchar *device_id;
gboolean ret = FALSE;
GError *error = NULL;
- /* does the profile have device metadata */
- device_id = cd_profile_get_metadata_item (profile,
- CD_PROFILE_METADATA_MAPPING_DEVICE_ID);
- if (device_id == NULL)
- goto out;
-
- /* does this device match? */
- if (g_strcmp0 (cd_device_get_id (device), device_id) != 0)
- goto out;
-
/* auto-add soft relationship */
g_debug ("CdMain: Automatically MD add %s to %s",
cd_profile_get_id (profile),
@@ -307,12 +298,12 @@ out:
}
/**
- * cd_main_device_auto_add_profile_db:
+ * cd_main_auto_add_from_db:
**/
static gboolean
-cd_main_device_auto_add_profile_db (CdMainPrivate *priv,
- CdDevice *device,
- CdProfile *profile)
+cd_main_auto_add_from_db (CdMainPrivate *priv,
+ CdDevice *device,
+ CdProfile *profile)
{
gboolean ret = FALSE;
GError *error = NULL;
@@ -350,36 +341,37 @@ out:
}
/**
- * cd_main_device_auto_add_profile:
+ * cd_main_device_auto_add_from_md:
**/
-static gboolean
-cd_main_device_auto_add_profile (CdMainPrivate *priv,
- CdDevice *device,
- CdProfile *profile)
+static void
+cd_main_device_auto_add_from_md (CdMainPrivate *priv,
+ CdDevice *device)
{
- gboolean ret;
-
- /* try adding devices from the mapping db -- we do this first
- * as the database entries might be hard */
- ret = cd_main_device_auto_add_profile_db (priv, device, profile);
- if (ret)
- goto out;
+ CdProfile *profile_tmp;
+ GPtrArray *array;
+ guint i;
- /* first try finding profile metadata to the device,
- * which will be added soft */
- ret = cd_main_device_auto_add_profile_md (device, profile);
- if (ret)
+ /* get all the profiles, and check to see if any of them contain
+ * MAPPING_device_id that matches the device */
+ array = cd_profile_array_get_by_metadata (priv->profiles_array,
+ CD_PROFILE_METADATA_MAPPING_DEVICE_ID,
+ cd_device_get_id (device));
+ if (array == NULL)
goto out;
+ for (i = 0; i < array->len; i++) {
+ profile_tmp = g_ptr_array_index (array, i);
+ cd_main_auto_add_from_md (priv, device, profile_tmp);
+ }
out:
- return ret;
+ if (array != NULL)
+ g_ptr_array_unref (array);
}
/**
- * cd_main_device_auto_add_profiles:
+ * cd_main_device_auto_add_from_db:
**/
static void
-cd_main_device_auto_add_profiles (CdMainPrivate *priv,
- CdDevice *device)
+cd_main_device_auto_add_from_db (CdMainPrivate *priv, CdDevice *device)
{
CdProfile *profile_tmp;
const gchar *object_id_tmp;
@@ -404,15 +396,15 @@ cd_main_device_auto_add_profiles (CdMainPrivate *priv,
profile_tmp = cd_profile_array_get_by_id_owner (priv->profiles_array,
object_id_tmp,
cd_device_get_owner (device));
- if (profile_tmp != NULL) {
- cd_main_device_auto_add_profile (priv,
- device,
- profile_tmp);
- g_object_unref (profile_tmp);
- } else {
- g_debug ("CdMain: profile %s is not (yet) available",
- object_id_tmp);
+ if (profile_tmp == NULL) {
+ g_debug ("CdMain: profile %s with owner %i is not (yet) available",
+ object_id_tmp, cd_device_get_owner (device));
+ continue;
}
+
+ /* does the profile have the correct device metadata */
+ cd_main_auto_add_from_db (priv, device, profile_tmp);
+ g_object_unref (profile_tmp);
}
out:
if (array != NULL)
@@ -493,8 +485,9 @@ cd_main_device_add (CdMainPrivate *priv,
/* add to array */
cd_device_array_add (priv->devices_array, device);
- /* auto add profiles from the database */
- cd_main_device_auto_add_profiles (priv, device);
+ /* auto add profiles from the database and metadata */
+ cd_main_device_auto_add_from_db (priv, device);
+ cd_main_device_auto_add_from_md (priv, device);
out:
return ret;
}
@@ -656,11 +649,11 @@ cd_main_sensor_array_to_variant (GPtrArray *array)
}
/**
- * cd_main_profile_auto_add_to_device:
+ * cd_main_profile_auto_add_from_db:
**/
static void
-cd_main_profile_auto_add_to_device (CdMainPrivate *priv,
- CdProfile *profile)
+cd_main_profile_auto_add_from_db (CdMainPrivate *priv,
+ CdProfile *profile)
{
CdDevice *device_tmp;
const gchar *device_id_tmp;
@@ -692,15 +685,12 @@ cd_main_profile_auto_add_to_device (CdMainPrivate *priv,
device_tmp = cd_device_array_get_by_id_owner (priv->devices_array,
device_id_tmp,
cd_profile_get_owner (profile));
- if (device_tmp != NULL) {
- cd_main_device_auto_add_profile (priv,
- device_tmp,
- profile);
- g_object_unref (device_tmp);
- } else {
- g_debug ("CdMain: device %s is not (yet) available",
- device_id_tmp);
- }
+ if (device_tmp == NULL)
+ continue;
+
+ /* hard add */
+ cd_main_auto_add_from_db (priv, device_tmp, profile);
+ g_object_unref (device_tmp);
}
out:
if (array != NULL)
@@ -708,6 +698,32 @@ out:
}
/**
+ * cd_main_profile_auto_add_from_md:
+ **/
+static void
+cd_main_profile_auto_add_from_md (CdMainPrivate *priv,
+ CdProfile *profile)
+{
+ CdDevice *device = NULL;
+ const gchar *device_id;
+
+ /* does the device exists that matches the md */
+ device_id = cd_profile_get_metadata_item (profile,
+ CD_PROFILE_METADATA_MAPPING_DEVICE_ID);
+ if (device_id == NULL)
+ goto out;
+ device = cd_device_array_get_by_id_owner (priv->devices_array,
+ device_id,
+ cd_profile_get_owner (profile));
+ if (device == NULL)
+ goto out;
+ cd_main_auto_add_from_md (priv, device, profile);
+out:
+ if (device != NULL)
+ g_object_unref (device);
+}
+
+/**
* cd_main_profile_register_on_bus:
**/
static gboolean
@@ -1375,9 +1391,6 @@ cd_main_daemon_method_call (GDBusConnection *connection, const gchar *sender,
goto out;
}
- /* auto add profiles from the database */
- cd_main_profile_auto_add_to_device (priv, profile);
-
/* get any file descriptor in the message */
message = g_dbus_method_invocation_get_message (invocation);
fd_list = g_dbus_message_get_unix_fd_list (message);
@@ -1421,6 +1434,10 @@ cd_main_daemon_method_call (GDBusConnection *connection, const gchar *sender,
}
}
+ /* auto add profiles from the database and metadata */
+ cd_main_profile_auto_add_from_db (priv, profile);
+ cd_main_profile_auto_add_from_md (priv, profile);
+
/* register on bus */
ret = cd_main_profile_register_on_bus (priv, profile, &error);
if (!ret) {

View File

@ -3,6 +3,10 @@
# quite a lot of time. Don't enable this for test builds.
%define enable_print_profiles 0
# SANE is pretty insane when it comes to handling devices, and we get AVCs
# popping up all over the place.
%define enable_sane 0
# Don't build the print profiles for secondary architectures on the
# logic that these are probably not doing press proofing or editing
# in different CMYK spaces
@ -14,15 +18,12 @@
Summary: Color daemon
Name: colord
Version: 0.1.28
Release: 2%{?dist}
Version: 0.1.29
Release: 1%{?dist}
License: GPLv2+ and LGPLv2+
URL: http://www.freedesktop.org/software/colord/
Source0: http://www.freedesktop.org/software/colord/releases/%{name}-%{version}.tar.xz
# Upstream fixes required for g-s-d
Patch0: colord-upstream-fixes.patch
BuildRequires: dbus-devel
BuildRequires: docbook-utils
BuildRequires: gettext
@ -42,6 +43,12 @@ BuildRequires: color-filesystem
BuildRequires: argyllcms
%endif
# for SANE support
%if 0%{?enable_sane}
BuildRequires: sane-backends-devel
BuildRequires: dbus-devel
%endif
Requires: color-filesystem
Requires: systemd-units
Requires(pre): shadow-utils
@ -68,6 +75,7 @@ to color profiles in the system context.
Summary: Development package for %{name}
Requires: %{name} = %{version}-%{release}
Requires: %{name}-libs = %{version}-%{release}
Obsoletes: colorhug-client-devel <= 0.1.13
%description devel
Files for development with %{name}.
@ -95,7 +103,6 @@ This may be useful for CMYK soft-proofing or for extra device support.
%prep
%setup -q
%patch0 -p1 -b .upstream-fixes
%build
# we can't use _hardened_build here, see
@ -115,6 +122,9 @@ ulimit -Sv 2000000
--enable-print-profiles \
%else
--disable-print-profiles \
%endif
%if 0%{?enable_sane}
--enable-sane \
%endif
--disable-static \
--disable-rpath \
@ -148,7 +158,9 @@ exit 0
/sbin/ldconfig
glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
%postun libs -p /sbin/ldconfig
%postun
/sbin/ldconfig
glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
%files -f %{name}.lang
%doc README AUTHORS NEWS COPYING
@ -176,6 +188,11 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
%{_datadir}/dbus-1/interfaces/org.freedesktop.ColorHelper.xml
%{_datadir}/dbus-1/services/org.freedesktop.ColorHelper.service
# sane helper
%if 0%{?enable_sane}
%{_libexecdir}/colord-sane
%endif
# common colorspaces
%dir %{_icccolordir}/colord
%{_icccolordir}/colord/AdobeRGB1998.icc
@ -203,7 +220,7 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
%files libs
%doc COPYING
%{_libdir}/libcolord.so.*
%{_libdir}/lib*.so.*
%{_libdir}/girepository-1.0/*.typelib
%files extra-profiles
@ -233,9 +250,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
%files devel
%{_includedir}/colord-1
%{_libdir}/libcolord.so
%{_libdir}/pkgconfig/colord.pc
%{_datadir}/gir-1.0/Colord-1.0.gir
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*.pc
%{_datadir}/gir-1.0/*.gir
%{_datadir}/vala/vapi/colord.vapi
%files devel-docs
@ -243,6 +260,18 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
%{_datadir}/gtk-doc/html/colord/*
%changelog
* Mon Feb 04 2013 Richard Hughes <richard@hughsie.com> 0.1.29-1
- New upstream version
- Add a --verbose and --version argument to colormgr
- Add DTP94 native sensor support
- Allow profiles to have a 'score' which affects the standard space
- Change the Adobe RGB description to be 'Compatible with Adobe RGB (1998)'
- Detect profiles from adobe.com and color.org and add metadata
- Do not auto-add profiles due to device-id metadata if they have been removed
- Ensure profiles with MAPPING_device_id get auto-added to devices
- Install various helper libraries for access to hardware
- Set the additional 'OwnerCmdline' metadata on each device
* Fri Jan 16 2013 Richard Hughes <richard@hughsie.com> 0.1.28-2
- Backport some fixes from upstream for gnome-settings-daemon.

View File

@ -1 +1 @@
14a37f7aae8b47d247adea77686d6bd1 colord-0.1.28.tar.xz
5cadede0c67946113b4d176d7661abc3 colord-0.1.29.tar.xz