After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 606045 - The PreferencesDialog shows ICC profiles which are not applicable
The PreferencesDialog shows ICC profiles which are not applicable
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: General
0.6.x
Other Linux
: Normal enhancement
: ---
Assigned To: F-spot maintainers
F-spot maintainers
Depends on:
Blocks:
 
 
Reported: 2010-01-04 19:39 UTC by Pascal de Bruijn
Modified: 2010-01-05 11:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
PreferencesDialog shows only relevant ICC profiles for selection (20.55 KB, patch)
2010-01-04 19:40 UTC, Pascal de Bruijn
needs-work Details | Review

Description Pascal de Bruijn 2010-01-04 19:39:43 UTC
Currently the F-Spot PreferencesDialog shows all installed profiles for both screen and printing.

However, for the screen, only "Display" profiles should be displayed and allowed to be chosen. And for printing, only "Output" profiles should be displayed and allowed to be chosen.

The profile type can be determined via LCMS, using the DeviceClass/ProfileClass property in the profile header.
Comment 1 Pascal de Bruijn 2010-01-04 19:40:59 UTC
Created attachment 150789 [details] [review]
PreferencesDialog shows only relevant ICC profiles for selection

This patch fixed the above reported bug, and seems to work just fine.

Additional testing would be appreciated.
Comment 2 Stephane Delcroix 2010-01-05 10:03:21 UTC
Review of attachment 150789 [details] [review]:

::: f-spot-0.6.1.5-orig/src/Cms/NativeMethods.cs
@@ +99,3 @@
 
+		[DllImport ("liblcms-1.0.0.dll", EntryPoint = "cmsGetDeviceClass")]
+		public static extern uint cmsGetDeviceClass (HandleRef hprofile);

the method name should be CmsGetDeviceClass, with an uppercase C

::: f-spot-0.6.1.5-orig/src/Cms/Profile.cs
@@ +268,3 @@
 		}
+
+		public uint DeviceClass {

should return a IccDeviceClass, not an uint

@@ +271,3 @@
+			get {
+				return NativeMethods.cmsGetDeviceClass (this.handle);
+			}

single line accessors are usually written on a single line (sic)

::: f-spot-0.6.1.5-orig/src/Core/ColorManagement.cs
@@ +100,3 @@
 			}
 		}
 		

there's no need to duplicate the profiles list. And it could cause problems, at the time you have a profile name, you don't know to which list it belongs, but you still need ot work with it

::: f-spot-0.6.1.5-orig/src/Makefile.in
@@ +319,3 @@
 	$(srcdir)/Cms/Intent.cs			\
 	$(srcdir)/Cms/NativeMethods.cs		\
 	$(srcdir)/Cms/Profile.cs		\

Makefile.in files aren't under revision control.
Comment 3 Stephane Delcroix 2010-01-05 11:18:45 UTC
commit f06f5f4398aa89de50dd566e170205ced2e12872
Author: Stephane Delcroix <stephane@delcroix.org>
Date:   Tue Jan 5 12:17:42 2010 +0100

    Only list applicable ICC profiles
    
    Only list Display profiles for displaying, and Output ones for printing. Based on a patch from Pascal de Bruijn.
    
    Fixes bgo#606045