Bug 193685 - Set permissions on a per-photo base [patch]
Summary: Set permissions on a per-photo base [patch]
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-WebService-Flickr (show other bugs)
Version: 5.6.0
Platform: Unlisted Binaries Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-22 22:00 UTC by Pieter Edelman
Modified: 2018-03-23 11:25 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 0.7.0
Sentry Crash Report:


Attachments
Enable per-photo permissions (25.55 KB, patch)
2009-05-22 22:01 UTC, Pieter Edelman
Details
Enable per-photo permissions (27.39 KB, patch)
2009-06-03 23:04 UTC, Pieter Edelman
Details
Patch to allow for fine grained upload permissions (29.25 KB, patch)
2009-07-09 01:04 UTC, Pieter Edelman
Details
Allow per photo permissions when uploading to Flickr (27.77 KB, patch)
2009-09-08 20:57 UTC, Pieter Edelman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pieter Edelman 2009-05-22 22:00:39 UTC
Version:           0.2.0 (using KDE 4.2.3)
OS:                Linux
Installed from:    Unspecified Linux

Currently it is possible to set the Public, Family and Friends flags of photos in the Flickr uploader (or just the Public flag for 23) for all the images selected for uploading. However, I usually have different levels of permissions for different photos in the same run (the photo of the nicely coloured bridge arches should be public, but the next photo in line where a friend of mine makes a funny face should only be accessible to my friends, for example).

I hereby send in a patch proposal which implements this functionality. It provides three checkboxes (or just one for 23) in the list view of the images: Public, Family and Friends. The Public, Family and Friends checkboxes on the Upload options tab act as "main switches": when they are toggled, the corresponding boxes for each individual picture is toggled to the indicated state. When the individual photo options don't all agree, the corresponding checkboxes on the Upload options tab are set to the intermediate state.
When the Public checkbox next to an image is clicked, the Family and Friends checkboxes disappear to make the difference more clear. I actually would have prepared to disable them, but I couldn't figure out how to do that.

This patch adds the extra flickrlist.h/.cpp files, which subclasses Kipi's ImagesList and ImagesListViewItem classes:
- The derived FlickrListViewItem specifies is an ImagesListViewItem object for showing in the list, with the extra three checkboxes and methods to get and set the public, family and friends states.
- The derived FlickrList class holds these items and has methods and signals to get and set the global permission states.

Other than that, the patch adds some housekeeping functions to FlickrWindow and FlickrWidget for when the various checkboxes are clicked.
Comment 1 Pieter Edelman 2009-05-22 22:01:25 UTC
Created attachment 33927 [details]
Enable per-photo permissions
Comment 2 caulier.gilles 2009-05-23 21:03:12 UTC
Thanks pieter for your patch.

Another patch to review before 0.4.0 release...

Gilles Caulier
Comment 3 Pieter Edelman 2009-05-25 19:10:12 UTC
I was also thinking, maybe it's better to not show the text labels only in the header and not in the columns, to reduce the clutter.
Comment 4 Vardhman 2009-05-31 16:31:50 UTC
I have few suggestions/questions regarding the patch, I also wonder what is the standard procedure for patch acceptance/submission. Is it that once I approve the change patch submitter will submit the same or should I submit this patch ?

comments:flickrlist.cpp/.h is a file added by you, so you should add your name in the Copyright(c), since this file is pretty much all new you should not need to write name of the authors of the original files from where this class is derived.

Please split the line which are > 80/100 columns to wrap them to 80/100 for better readability 
+    setToolTip (KIPIPlugins::ImagesListView::User1, i18n("Check if photo should be publicly visible or use Upload options tab to specify this for all images"));
question: In slotAddImages, if all the image have is_family selected you are setting is_family to false, I am not sure I understand that, could you explain ?
Comment 5 Pieter Edelman 2009-05-31 18:10:58 UTC
Ok, thanks for the feedback. I can supply a new patch.

I screwed up in slotAddImages, the 2 should have been 1 (intermediate) and the settings for is_family and is_friends should have been true. The meaning of this it of code is to provide a sensible default for when the photos in the list don't have uniform access levels. So for example, if one photo has the public box checked and the next one doesn't, there apparently is a default policy for adding new photos. In this case, the plugin should default to the most public setting. This is of course chosen completely arbitrarily, but there should be some standard behaviour.
I actually think it's best to change the absolute numbering for the checked states to the Qt::CheckState enums, since that's the convention followed anyway.

Could you please explain what you mean (or point me to the FM, I'm new to KDE development) about the 80/100 columns remark? When looking through the existing code, I see quite a lot of places where lines run longer than 80 or 100 chars, so I assumed there's no official coding standard.
Comment 6 Pieter Edelman 2009-06-03 23:04:23 UTC
Created attachment 34252 [details]
Enable per-photo permissions

Ok, here's a new patch with the following changes compared to the last one:
- Credits are changed for flickrlist.cpp/.h
- Lines are wrapped at 80 columns for all changes I made
- Absolute state values are changed to Qt::Checked, Qt::Unchecked and Qt::PartiallyChecked
- slotAddImages defaults to the most public option if the checkboxes for the photos already in the list are not consitent
- Removed the Public, Family and Friends labels in the columns
Comment 7 caulier.gilles 2009-06-28 09:31:40 UTC
targeted to 0.5.0 release.
Comment 8 caulier.gilles 2009-06-28 09:37:10 UTC
Please let assignement to kde-imaging mailing list, else no developper will see this entry

Gilles Caulier
Comment 9 Pieter Edelman 2009-06-28 10:47:08 UTC
Gilles, thanks for the tip, but regular users like me don't have the permissions to edit these settings.

Pieter
Comment 10 Pieter Edelman 2009-07-09 01:04:23 UTC
Created attachment 35172 [details]
Patch to allow for fine grained upload permissions
Comment 11 Pieter Edelman 2009-07-09 01:06:40 UTC
Here's a somewhat improved version of the patch, which confirms better to the coding standards and replaces some hard-coded numbers with enums.
Comment 12 Pieter Edelman 2009-09-08 20:57:35 UTC
Created attachment 36800 [details]
Allow per photo permissions when uploading to Flickr

Update against current SVN.
Comment 13 caulier.gilles 2009-09-08 22:18:37 UTC
Vardhman,

You still assigned to check patch from Pieter (thanks for update)

Do you available to review this new version ?

Gilles Caulier
Comment 14 caulier.gilles 2009-09-09 09:08:45 UTC
SVN commit 1021426 by cgilles:

apply patch from Pieter Edelman to be able to set image visibility properties one by one (public, family, friends)
Tested here with my Flickr Account. it work very well. Thanks for this great patch. Good job. 
BUGS: 193685


 M  +1 -0      CMakeLists.txt  
 M  +120 -2    flickrwidget.cpp  
 M  +13 -7     flickrwidget.h  
 M  +12 -9     flickrwindow.cpp  
 M  +3 -3      flickrwindow.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1021426
Comment 15 Pieter Edelman 2009-09-09 20:26:13 UTC
Hi Gilles,

Thanks for applying this patch, but for some reason I don't see the new flickrlist.h/cpp files applied. I can see that they are present in the patch though.
Did I screw up the patch again?
Comment 16 caulier.gilles 2009-09-09 21:33:11 UTC
SVN commit 1021668 by cgilles:

forget to add new file to svn
CCBUGS: 193685


 AM            flickrlist.cpp   [License: GPL (v2+)]
 AM            flickrlist.h   [License: GPL (v2+)]


WebSVN link: http://websvn.kde.org/?view=rev&revision=1021668
Comment 17 Pieter Edelman 2009-09-09 22:58:36 UTC
Perfect, thanks!