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
1=== modified file 'set-wallpaper-contract/set-wallpaper.vala'
2--- set-wallpaper-contract/set-wallpaper.vala 2015-11-15 21:42:16 +0000
3+++ set-wallpaper-contract/set-wallpaper.vala 2016-11-03 22:41:59 +0000
4@@ -163,7 +163,7 @@
5
6 string path = file.get_path ();
7 File append_file = file;
8- if (!path.has_prefix (SYSTEM_BACKGROUNDS_PATH)) {
9+ if (!path.has_prefix (SYSTEM_BACKGROUNDS_PATH) && !path.has_prefix (get_local_bg_location ())) {
10 var local_file = copy_for_library (file);
11 if (local_file != null) {
12 append_file = local_file;
13
14=== modified file 'src/Wallpaper.vala'
15--- src/Wallpaper.vala 2015-11-17 19:24:58 +0000
16+++ src/Wallpaper.vala 2016-11-03 22:41:59 +0000
17@@ -206,7 +206,7 @@
18 string uri = file.get_uri ();
19 string path = file.get_path ();
20
21- if (!path.has_prefix (SYSTEM_BACKGROUNDS_PATH)) {
22+ if (!path.has_prefix (SYSTEM_BACKGROUNDS_PATH) && !path.has_prefix (get_local_bg_location ())) {
23 var localfile = copy_for_library (file);
24 if (localfile != null) {
25 uri = localfile.get_uri ();

Subscribers

People subscribed via source and target branches

to all changes: