1. 12 Feb, 2016 2 commits
    • Carlos Soriano Sánchez's avatar
      preferences: rework preferences window · 27c62f29
      Carlos Soriano Sánchez authored
      With designers guidance, rework the preferences window to a better state.
      Also, do few improvement on the way, like converting it to a GtkWindow.
      27c62f29
    • Carlos Soriano Sánchez's avatar
      search: use a separate view setting for search · a88310dd
      Carlos Soriano Sánchez authored
      So we can select what type of view do we want for search independently
      of what we normally use.
      
      This is needed since we default to switch to list view for search, but
      we would like to allow users to select a different view. However,
      instead of adding a preference in the preference dialog, we can do it
      more straightforward and change the setting when we are in search.
      
      On the way, rework all the enums and views id for a saner code...
      a88310dd
  2. 10 Feb, 2016 1 commit
    • Razvan Chitu's avatar
      file-undo-operations: change trashed files matching condition · d1fdc58b
      Razvan Chitu authored
      In Nautilus, undoing trash operations relies on the original path of deleted
      files and their deletion time. This time value is obtained after the operation
      is performed, which can lead to a mismatch. This mismatch would cause deleted
      files to not be restored by an undo operation, as they would not be recognised
      as being the originals.
      
      Compare the deletion time from the file in trash with the value stored in the
      undo information. If the difference is less or equal than an epsilon value,
      consider the files as matching.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=761819
      d1fdc58b
  3. 08 Feb, 2016 3 commits
    • Razvan Chitu's avatar
      file-operations: replace io_scheduler with GTask API · 1913ec02
      Razvan Chitu authored
      Nautilus file operations are implemented as asynchronous jobs scheduled using
      g_io_scheduler. Since g_io_scheduler has been deprecated, these operations
      should be using the simpler GTask API. The helper functions used in the
      operations have been changed in a previous patch so it is now possible to port
      the jobs themselves to the new API.
      
      The job structures are now data for tasks, which are handled by the existing
      functions in separate threads. For finalizing the operations, the existing
      "job_done" functions are now used as callbacks.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=761549
      1913ec02
    • Razvan Chitu's avatar
      file-operations: replace io_scheduler in helper functions · 5a6f8694
      Razvan Chitu authored
      Nautilus file operations are implemented as asynchronous jobs scheduled using
      g_io_scheduler. Since g_io_scheduler has been deprecated, these operations
      should be using the simpler GTask API. In order to make this change possible, a
      first step would be to replace the scheduler in the helper functions called
      during the jobs.
      
      Replace g_io_scheduler_send_to_mainloop with g_main_context_invoke in helper
      functions. Since g_main_context_invoke is not blocking, add a mutex and a
      condition so the current thread is blocked until the operation is completed in
      the main loop.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=761549
      5a6f8694
    • Piotr Drąg's avatar
      4c1e57dc
  4. 03 Feb, 2016 7 commits
    • Carlos Soriano Sánchez's avatar
      gschema: delete accidental committed file · 88c56da6
      Carlos Soriano Sánchez authored
      In commit ae55fec1 I added a wrong gschema file in a wrong
      directory, probably fallout of some local file when switching branches.
      
      However, what it doesn't make sense is how it got added, since I never
      use git add -A or similar, and I didn't add any new file. Maybe rebase?
      
      Anyway, remove it since it was accidental.
      88c56da6
    • Carlos Soriano Sánchez's avatar
      search-popover: merge and clean up date formatting · 1e447d8d
      Carlos Soriano Sánchez authored
      So we use the same function all over.
      1e447d8d
    • Carlos Soriano Sánchez's avatar
      7fbe809f
    • Carlos Soriano Sánchez's avatar
      preferences: add remote and local recursive search · ae55fec1
      Carlos Soriano Sánchez authored
      Instead of using a switch in the search popover.
      
      The search popover is meant to be as a temporary filter. That means
      that the "Search subfolders" switch that was present there was reset
      every time a new search was performed.
      
      Even if the nature of the popover is temporary and therefore should be
      understandable that the switch is also temporary, this can bring
      confusion in such a sensible matter.
      
      To avoid confusion, add two preferences, one for remote file systems
      and one for local file systems to allow the choice to make a recursive
      or non recursive search, and remove the switch to avoid frustration.
      
      Also, I expect this choice to be more a permanent one than a temporary
      one, as in, I expect users to what they really want is to make a
      permanent choice whether they want recursive search or not.
      
      For local file systems, on what I can gather, either wants to emulate
      the type-ahead search, because it's file system is slow to perform
      a recursive search and will always be, therefore a permanent choice,
      or the opposite where the file system of the user is fast enough to
      perform a recursive search, which will most of the cases be like that,
      and therefore also a permanent choice.
      
      For remote file systems is similar. Either the internet connection of
      the user is fast enough for the whole session or use, therefore wants
      recursive search always enabled, or it's not, and therefore it doesn't
      want recursive search enabled.
      ae55fec1
    • Carlos Soriano Sánchez's avatar
      search: rename recursive to local and remote · a256967e
      Carlos Soriano Sánchez authored
      For clarity.
      a256967e
    • Carlos Soriano Sánchez's avatar
      query: make date range retrieval thread safe · c12ffc6e
      Carlos Soriano Sánchez authored
      We are accessing it from multiple threads of the search, so we need
      to make sure we don't free it in the middle.
      c12ffc6e
    • Carlos Soriano Sánchez's avatar
      search: use range of dates · 54377172
      Carlos Soriano Sánchez authored
      This was not implemented. We want to differenciate between a range of
      days we want to search for and a specific date, as set on the mockups.
      
      The calendar selector will be specific dates, whether the days selector
      will be a "since".
      
      Also on the way fix various things and code preferences.
      54377172
  5. 02 Feb, 2016 13 commits
  6. 01 Feb, 2016 1 commit
    • Carlos Soriano Sánchez's avatar
      canvas-container: fix desktop snapping · 984438f1
      Carlos Soriano Sánchez authored
      To snap an icon to the closest grid cell, we were trying to round
      the x position with an offset of 0.5. However, cells are not
      normalized, so that 0.5 is actually doing little to round the
      position.
      
      This is making the icons to snap to the right closest cell once the
      user drags more the icon left to the current cell.
      
      The actual size of the cell is SNAP_SIZE_*, so to fix this use half
      of the SNAP_SIZE to "round" the number.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=750446
      984438f1
  7. 22 Jan, 2016 2 commits
    • Carlos Soriano Sánchez's avatar
      search-directory: don't mark as all_files_seen on hits ready · 47a09986
      Carlos Soriano Sánchez authored
      We were marking as all_files_seen when hits were added, so the view
      will react on it and display the files that were recently added.
      
      However, that's not consistent, and the view calls done_loading
      if all files are seen. This has, as a UI effect, removing the floating
      bar, and therefore any hint that the view is still loading/searching.
      
      So let's be consistent here and in the upcoming patch we will fix
      this issue with the search.
      47a09986
    • Carlos Soriano Sánchez's avatar
      monitor: don't check for FAM · 1dad6d6f
      Carlos Soriano Sánchez authored
      There is code that is used in case FAM is not available. But
      we use inotify since 2006, so I'm confident we are fine without
      checking for it.
      
      This remove some not needed code.
      1dad6d6f
  8. 18 Jan, 2016 2 commits
  9. 12 Jan, 2016 2 commits
    • Razvan Chitu's avatar
      file-undo-manager: rename undo_redo_flag · 0a907637
      Razvan Chitu authored
      Nautilus undo manager previously relied on a stack-like implementation of its
      operating state. The stack operations (pushing and popping) were removed in a
      previous commit due to possible unexpected behavior and errors. The flag alone
      now has an inadequate name for what it represents.
      
      Rename the flag to "is_operating", since it is set when the manager is
      performing an undo / redo operation and unset otherwise. Rename the associated
      getter function accordingly.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=759850
      0a907637
    • Razvan Chitu's avatar
      file-undo-manager: handle undo_redo_flag internally · d52c5234
      Razvan Chitu authored
      Nautilus undo manager reuses undo information based on a flag that marks whether
      an undo / redo operation is currently being performed. Previously, the flag was
      managed both internally and externally. This proved to be unnecessary and even
      harmful, as it led to an unexpected behavior.
      
      Remove push and pop functions and handle the flag explicitly, at the start and
      at the end of an undo / redo operation. Replace external use of pop with the use
      of a getter function, also introduced in this patch.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=759850
      d52c5234
  10. 11 Jan, 2016 1 commit
    • Carlos Soriano Sánchez's avatar
      thumbnails: avoid crash with jp2 images · 050d0312
      Carlos Soriano Sánchez authored
      When thumbnailing a directory with jp2 some times nautilus
      was crashing.
      However tests on gdk_pixbuf were successful and gnome-desktop-thumbnails
      generation tests were also working.
      
      Also, nautilus is using raw pthreads in the thumbnail generation
      code, and seems the crash was actually only happening when inside the
      pthread and when using gdk-pixbuf, not only the gnome-desktop-thumbnail.
      
      Looking at the implementation of glib in threads and nautilus, one of
      the differences is that nautilus sets a stack size.
      The crash is happening because, unluckely, libjasper with some big
      images is using more stack size than the one nautilus is setting, which
      leads to a crash in libjasper.
      
      To fix it, remove the stack size set by nautilus, similarly to what glib
      does, not setting an actual stack size.
      
      Obviously the right thing to do is rewrite nautilus code to use the
      glib threads, but I want to let that as a newcomer bug to do.
      050d0312
  11. 24 Dec, 2015 1 commit
    • Razvan Chitu's avatar
      file-operations: always pop undo manager flag · c9135ce6
      Razvan Chitu authored
      Nautilus undo manager reuses undo information based on a flag that is pushed
      when an undo operation begins and popped during the operation itself. In the
      case of trashing / deleting files, the flag was not popped in some situations,
      which caused the next operations to not be undoable.
      
      Flip operands of a logical operator so the flag is always popped, avoiding
      issues caused by lazy evaluation.
      
      A better solution would be to always update the flag internally in the manager,
      and only peek its value externally.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=759850
      c9135ce6
  12. 22 Dec, 2015 2 commits
    • Razvan Chitu's avatar
      preferences: add preference for create a link in context menu · 2dec1b3f
      Razvan Chitu authored
      Following the "Delete Permanently" option, add a preference to show the context
      menu item for creating links.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=745575
      2dec1b3f
    • Razvan Chitu's avatar
      files-view: add optional menu item for creating links · 0eef0868
      Razvan Chitu authored
      The menu item for creating links was removed in previous versions of nautilus
      since it exposes a concept of the file system that is not really clear.
      However, we don't have a working solution yet for the use cases that creating
      links is a workaround, so we didn't remove the functionality altogether.
      
      We were allowing link creation with a shortcut and with the middle button while
      performing a drag and drop operation. However, some users would need to use a
      context menu action instead of a drag and drop operation, which usually is less
      convenient and prone to errors.
      
      Since this is demanded, implement the menu action for it and add a gsetting
      preference to show it in the context menu for those users who like to have it
      there.
      
      Also the new implementation uses the code that is already used for other
      operations, improving the implementation compared to the previous one.
      
      In an upcoming patch we add the UI for the preference dialog.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=745575
      0eef0868
  13. 18 Dec, 2015 1 commit
    • Carlos Soriano Sánchez's avatar
      directory-async: don't modify priv data on cancelled · ec05b0a2
      Carlos Soriano Sánchez authored
      What we are doing:
      Directory starts io.
      It cancels the cancellables associated to each async operation.
      It starts new operations.
      When the new operation finishes, either because it's cancelled or
      because it successfully finished, it modifies the directory private
      data and sets its associated cancellable as NULL to indicate the
      directory that it's all done, so the directory just checks for the
      cancellables in its private data to know if there is some operation
      going on.
      
      However, what can happens is:
      Directory starts io.
      It cancels the cancellables and sets as null to start a new operation.
      It starts a new operation.
      The old operation finishes cancelled, and sets as null the private
      cancellable of the directory.
      Now the directory thinks there is no operation going on, but actually
      the new operation is still going on.
      The directory starts io and checks if there is something to stop, but
      sees there is no cancellable and keeps going.
      Then the new operation finishes and hits an assert when realizes that
      the directory state is inconsistent.
      
      To fix this, don't set as null the cancellable in the private data of
      the directory when the operation has been cancelled.
      
      It's okay to set as null when the operation finishes succesfully, since
      it's ensured that only one operation can be running withouth being
      cancelled.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=759608
      ec05b0a2
  14. 17 Dec, 2015 2 commits
    • Carlos Soriano Sánchez's avatar
      search-engine-model: fix infinity waiting · 95cadccf
      Carlos Soriano Sánchez authored
      How search works:
      The main engine starts.
      It starts in order all the search providers which start one
      or more threads.
      Then the owner of the engine can decide to stop, and therefore
      requesting the providers to stop.
      Then the providers take their time in the different threads to cancel
      and to report to the engine, which is the main thread, that they
      finished.
      At that point the engine signals that the engine is stopped and
      finished.
      
      However, if one of the search providers fail to report it's finalization
      the engine is hanging forever, making everything stopping to work.
      
      This was the issue when the engine requests the model provider to stop,
      and then start again before it got time to request the directory info,
      since we add the iddle but never rested it's id, so never signal a finish.
      
      This was working most of the times because, this idle is only requested
      when we stop the model provider and it's still running, but usually the
      work the model has to do is so little that always gets finished before
      stopping it.
      
      So to fix this issue, reset the idle id when finished.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=756183
      95cadccf
    • Carlos Soriano Sánchez's avatar
      search-engine: better debug info · e345fd9b
      Carlos Soriano Sánchez authored
      e345fd9b