Merge lp://staging/~angeloc/unity-lens-files/fix-for-773841 into lp://staging/unity-lens-files

Proposed by Mikkel Kamstrup Erlandsen
Status: Superseded
Proposed branch: lp://staging/~angeloc/unity-lens-files/fix-for-773841
Merge into: lp://staging/unity-lens-files
Diff against target: 201 lines (+73/-35)
3 files modified
src/daemon.vala (+33/-15)
src/folder.vala (+1/-1)
src/url-checker.vala (+39/-19)
To merge this branch: bzr merge lp://staging/~angeloc/unity-lens-files/fix-for-773841
Reviewer Review Type Date Requested Status
Michal Hruby (community) Needs Fixing
Unity Bugs Pending
Review via email: mp+95591@code.staging.launchpad.net

This proposal has been superseded by a proposal from 2012-03-06.

Description of the change

Fixes activation of remotely mountable volumes.

I am merge proposing this on behalf of Angelo since there appears to be some LP hiccups...

To post a comment you must log in.
Revision history for this message
Michal Hruby (mhr3) wrote :

Nice work, thanks for the contribution!

A couple of comments:

7 private UrlChecker urls;
8 + private UrlMountChecker murls;

Wouldn't it make sense to extend the UrlChecker class to do this instead of adding yet another class that has almost the same semantics?

130 + regexes.prepend (new Regex ("\\\\.+"));
131 + regexes.prepend (new Regex ("ftp://.+"));
132 + regexes.prepend (new Regex ("ssh://.+"));
133 + regexes.prepend (new Regex ("sftp://.+"));
134 + regexes.prepend (new Regex ("smb://.+"));
135 + regexes.prepend (new Regex ("dav://.+"));

There's no need to use this many regexes - instead you can first preprocess the query by replacing \\ with smb:// (if it has \\ prefix), and then you can use a single regex "(ftp|ssh|sftp|smb|dav)://.+".

review: Needs Fixing
Revision history for this message
Angelo Compagnucci (angeloc) wrote :

+1 for grouping regexes, I'll make it!

Unifying UrlChecker and UrlMountChecker could be coumbersone, because we need to switch icon dinamically in case you have an url or a mountable volume. We have to add some sort of side effect and a discrete amount of ifs.

Furthermore we should have a way to distinguish between url or remote location in activate method and I thought using different check_urls method be the most straightforward way to go.

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

Btw Angelo, have you signed the contributor agreement? We need that in order to be able to take your branch http://www.canonical.com/contributors

On merging of the url checker classes I think Michal meant to have two different instances of the same class, but being able to define which regexes they use in the constructor or something. Michal?

214. By Angelo Compagnucci

Collapsed wasteful regexes.
Added url-mount-checker to makefile.

Revision history for this message
Angelo Compagnucci (angeloc) wrote :

OK, like adding a flag that switch between url and remotes, think it could be done!
Please wait!

Revision history for this message
Michal Hruby (mhr3) wrote :

We cleared that on IRC already, I wanted the same instance and an enum defining what is what.

215. By Angelo Compagnucci

Unified url-checker, with url-mount-checker, url-mount-checker removed.
Collapsed regexes as much as possible.
Using an enum to identify url_types.
Chenged check_url to return the url type.

Revision history for this message
Angelo Compagnucci (angeloc) wrote :

Done!

Unified url-checker, with url-mount-checker, url-mount-checker removed.
Collapsed regexes as much as possible.
Using an enum to identify url_types.
Chenged check_url to return the url type.

It's ok?

216. By Angelo Compagnucci

Merging changes for bug 921665 because of commons.

217. By Angelo Compagnucci

Fixed indentation
Fixed wrong enum type name

218. By Angelo Compagnucci

Changed NORMAL -> WEB for url enum type.
Fixed wrong parenthesis position.
Fixed code style.

Revision history for this message
Angelo Compagnucci (angeloc) wrote :

Done!

Merged with fix for bug 921665.
Changed code to naming conventions requirements and code style.

219. By Angelo Compagnucci

Code cleanup

220. By Angelo Compagnucci

Added UrlType.UNKNOWN

Revision history for this message
Angelo Compagnucci (angeloc) wrote :

Added UrlType.UNKNOWN as requested.

221. By Angelo Compagnucci

Code cleanup, fixing codestyle.

222. By Angelo Compagnucci

Merged with trunk, fix for bug 773841

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches