Merge lp:~georgesofianosgr/switchboard-plug-pantheon-shell/fix_duplicate_wallpapers into lp:~elementary-apps/switchboard-plug-pantheon-shell/trunk

Proposed by George Sofianos
Status: Merged
Approved by: Cody Garver
Approved revision: 509
Merged at revision: 514
Proposed branch: lp:~georgesofianosgr/switchboard-plug-pantheon-shell/fix_duplicate_wallpapers
Merge into: lp:~elementary-apps/switchboard-plug-pantheon-shell/trunk
Diff against target: 25 lines (+2/-2)
2 files modified
set-wallpaper-contract/set-wallpaper.vala (+1/-1)
src/Wallpaper.vala (+1/-1)
To merge this branch: bzr merge lp:~georgesofianosgr/switchboard-plug-pantheon-shell/fix_duplicate_wallpapers
Reviewer Review Type Date Requested Status
MarkoD (community) compile and functional Approve
Zisu Andrei (community) code Approve
Review via email: mp+310013@code.launchpad.net

Commit message

Check if wallpaper is already located in local background
directory before cloning it

To post a comment you must log in.
Revision history for this message
Zisu Andrei (matzipan) wrote :

Code looks good. Haven't built and run.

review: Approve (code)
Revision history for this message
MarkoD (markodolar) wrote :

It compiles and works. Set wallpaper contract and selecting wallpaper in switchboard plug does not copy file anymore when selecting from ~/.local/share/backgrounds.

review: Approve (compile and functional)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'set-wallpaper-contract/set-wallpaper.vala'
--- set-wallpaper-contract/set-wallpaper.vala 2015-11-15 21:42:16 +0000
+++ set-wallpaper-contract/set-wallpaper.vala 2016-11-03 22:41:59 +0000
@@ -163,7 +163,7 @@
163163
164 string path = file.get_path ();164 string path = file.get_path ();
165 File append_file = file;165 File append_file = file;
166 if (!path.has_prefix (SYSTEM_BACKGROUNDS_PATH)) {166 if (!path.has_prefix (SYSTEM_BACKGROUNDS_PATH) && !path.has_prefix (get_local_bg_location ())) {
167 var local_file = copy_for_library (file);167 var local_file = copy_for_library (file);
168 if (local_file != null) {168 if (local_file != null) {
169 append_file = local_file;169 append_file = local_file;
170170
=== modified file 'src/Wallpaper.vala'
--- src/Wallpaper.vala 2015-11-17 19:24:58 +0000
+++ src/Wallpaper.vala 2016-11-03 22:41:59 +0000
@@ -206,7 +206,7 @@
206 string uri = file.get_uri ();206 string uri = file.get_uri ();
207 string path = file.get_path ();207 string path = file.get_path ();
208208
209 if (!path.has_prefix (SYSTEM_BACKGROUNDS_PATH)) {209 if (!path.has_prefix (SYSTEM_BACKGROUNDS_PATH) && !path.has_prefix (get_local_bg_location ())) {
210 var localfile = copy_for_library (file);210 var localfile = copy_for_library (file);
211 if (localfile != null) {211 if (localfile != null) {
212 uri = localfile.get_uri ();212 uri = localfile.get_uri ();

Subscribers

People subscribed via source and target branches

to all changes: