Merge lp:~elementary-dev-community/switchboard-plug-pantheon-shell/bug-1182413 into lp:~elementary-apps/switchboard-plug-pantheon-shell/trunk

Proposed by Richard Stromer on 2013-08-27
Status: Merged
Merged at revision: 219
Proposed branch: lp:~elementary-dev-community/switchboard-plug-pantheon-shell/bug-1182413
Merge into: lp:~elementary-apps/switchboard-plug-pantheon-shell/trunk
Diff against target: 90 lines (+37/-3)
1 file modified
src/Wallpaper.vala (+37/-3)
To merge this branch: bzr merge lp:~elementary-dev-community/switchboard-plug-pantheon-shell/bug-1182413
Reviewer Review Type Date Requested Status
Daniel Fore 2013-08-27 Needs Fixing on 2014-05-11
David Gomes 2013-09-22 Needs Fixing on 2013-12-02
Review via email: mp+182417@code.launchpad.net

Description of the change

Search recursively for images in all sub-folders (does not cover loops)

To post a comment you must log in.
David Gomes (davidgomes) wrote :

Diff line 41 should be:
    plug.switchboard_controller.progress_bar_set_text (_("Importing wallpapers from %s.").printf (basefolder));

Diff lines 58-60 should be:

    if (info.get_file_type () == FileType.DIRECTORY) {
        load_wallpapers (basefolder + "/" + info.get_name ());
    } else if (!IOHelper.is_valid_file_type (info)) {

review: Needs Fixing
174. By Richard Stromer <email address hidden> on 2014-02-04

add some missing spaces after function names

Daniel Fore (danrabbit) wrote :

OP, can you update this branch to fix the text conflicts please?

review: Needs Fixing
Richard Stromer (noxan) wrote :

Got some other stuff to be done first, but I will have a look at it next week.

175. By Richard Stromer on 2014-07-21

Merged upstream changes

Richard Stromer (noxan) wrote :

sorry, the merge with bzr does somehow not work as intended (I'm more some kind of git user) and furthermore I do not get the right versions of the required dependencies (switchboard-2.0, gtk+-3.0). I guess I got to wait till the beta release or submit some untested diff/patch files if those do help in any way.

Cameron Norman (cameronnemo) wrote :

I have worked on this and rebased it. Merge request here.

This is how the conflicts text is formatted:

    conflict-free code
<<<<<<< TREE
    pre-merge code
=======
    code from where you were trying to merge from
>>>>>>> MERGE-SOURCE
    conflict-free code

Once you merge the code from all of those types of sections in a file, you just use `bzr resolve FileName.vala`.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Wallpaper.vala'
--- src/Wallpaper.vala 2013-11-24 00:08:31 +0000
+++ src/Wallpaper.vala 2014-07-21 19:39:36 +0000
@@ -216,16 +216,28 @@
216 void update_wallpaper_folder () {216 void update_wallpaper_folder () {
217 if (folder_combo.get_active () == 0) {217 if (folder_combo.get_active () == 0) {
218 clean_wallpapers ();218 clean_wallpapers ();
219<<<<<<< TREE
220 WALLPAPER_DIR = GLib.Environment.get_user_special_dir (GLib.UserDirectory.PICTURES);
221 load_wallpapers (WALLPAPER_DIR);
222=======
219 var picture_file = GLib.File.new_for_path (GLib.Environment.get_user_special_dir (GLib.UserDirectory.PICTURES));223 var picture_file = GLib.File.new_for_path (GLib.Environment.get_user_special_dir (GLib.UserDirectory.PICTURES));
220 WALLPAPER_DIR = picture_file.get_uri ();224 WALLPAPER_DIR = picture_file.get_uri ();
221 load_wallpapers.begin ();225 load_wallpapers.begin ();
226>>>>>>> MERGE-SOURCE
222 } else if (folder_combo.get_active () == 1) {227 } else if (folder_combo.get_active () == 1) {
223 clean_wallpapers ();228 clean_wallpapers ();
229<<<<<<< TREE
230 WALLPAPER_DIR = "/usr/share/backgrounds";
231 load_wallpapers.begin (WALLPAPER_DIR, () => {
232 WALLPAPER_DIR = Environment.get_user_data_dir () + "/backgrounds";
233 load_wallpapers (WALLPAPER_DIR);
234=======
224 WALLPAPER_DIR = "file:///usr/share/backgrounds";235 WALLPAPER_DIR = "file:///usr/share/backgrounds";
225 load_wallpapers.begin (() => {236 load_wallpapers.begin (() => {
226 var backgrounds_file = GLib.File.new_for_path (GLib.Environment.get_user_data_dir () + "/backgrounds");237 var backgrounds_file = GLib.File.new_for_path (GLib.Environment.get_user_data_dir () + "/backgrounds");
227 WALLPAPER_DIR = backgrounds_file.get_uri ();238 WALLPAPER_DIR = backgrounds_file.get_uri ();
228 load_wallpapers.begin ();239 load_wallpapers.begin ();
240>>>>>>> MERGE-SOURCE
229 });241 });
230 } else if (folder_combo.get_active () == 2) {242 } else if (folder_combo.get_active () == 2) {
231 var dialog = new Gtk.FileChooserDialog (_("Select a folder"), null, FileChooserAction.SELECT_FOLDER);243 var dialog = new Gtk.FileChooserDialog (_("Select a folder"), null, FileChooserAction.SELECT_FOLDER);
@@ -235,8 +247,13 @@
235247
236 if (dialog.run () == ResponseType.ACCEPT) {248 if (dialog.run () == ResponseType.ACCEPT) {
237 clean_wallpapers ();249 clean_wallpapers ();
250<<<<<<< TREE
251 WALLPAPER_DIR = dialog.get_filename ();
252 load_wallpapers (WALLPAPER_DIR);
253=======
238 WALLPAPER_DIR = dialog.get_file ().get_uri ();254 WALLPAPER_DIR = dialog.get_file ().get_uri ();
239 load_wallpapers.begin ();255 load_wallpapers.begin ();
256>>>>>>> MERGE-SOURCE
240 dialog.destroy ();257 dialog.destroy ();
241 } else {258 } else {
242 dialog.destroy ();259 dialog.destroy ();
@@ -244,10 +261,21 @@
244 }261 }
245 }262 }
246263
247 async void load_wallpapers () {264 async void load_wallpapers (string basefolder) {
248 folder_combo.set_sensitive (false);265 folder_combo.set_sensitive (false);
249266
267<<<<<<< TREE
268 // Make the progress bar visible, since we're gonna be using it.
269 try {
270 plug.switchboard_controller.progress_bar_set_text (_("Importing wallpapers from %s").printf(basefolder));
271 } catch (Error e) {
272 warning (e.message);
273 }
274
275 var directory = File.new_for_path (basefolder);
276=======
250 var directory = File.new_for_uri (WALLPAPER_DIR);277 var directory = File.new_for_uri (WALLPAPER_DIR);
278>>>>>>> MERGE-SOURCE
251 // The number of wallpapers we've added so far279 // The number of wallpapers we've added so far
252 double done = 0.0;280 double done = 0.0;
253281
@@ -272,12 +300,18 @@
272 foreach (var info in files) {300 foreach (var info in files) {
273 // We're going to add another wallpaper301 // We're going to add another wallpaper
274 done++;302 done++;
275 // Skip the file if it's not a picture303 // Skip the file if it's not a picture and continue search for directories
276 if (!IOHelper.is_valid_file_type(info)) {304 if (info.get_file_type () == FileType.DIRECTORY) {
305 load_wallpapers (basefolder + "/" + info.get_name());
306 } else if (!IOHelper.is_valid_file_type (info)) {
277 continue;307 continue;
278 }308 }
309<<<<<<< TREE
310 string filename = basefolder + "/" + info.get_name ();
311=======
279 var file = File.new_for_uri (WALLPAPER_DIR + "/" + info.get_name ());312 var file = File.new_for_uri (WALLPAPER_DIR + "/" + info.get_name ());
280 string filename = file.get_path ();313 string filename = file.get_path ();
314>>>>>>> MERGE-SOURCE
281 // Skip the default_wallpaper as seen in the description of the315 // Skip the default_wallpaper as seen in the description of the
282 // default_link variable316 // default_link variable
283 if (filename == default_link) {317 if (filename == default_link) {

Subscribers

People subscribed via source and target branches