You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by spirann <gi...@git.apache.org> on 2015/07/08 17:56:39 UTC

[GitHub] cordova-android pull request: CB-9334 loop on CordovaPlugins befor...

GitHub user spirann opened a pull request:

    https://github.com/apache/cordova-android/pull/195

    CB-9334 loop on CordovaPlugins before returning remapped Uri

    This is a fix for  https://issues.apache.org/jira/browse/CB-9334
    
    Because sometimes you need more than one plugin to handle your Uri's.
    Looping on all plugins before returning the remapped Uri.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/spirann/cordova-android 3.7.x

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-android/pull/195.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #195
    
----
commit 2a2c8b4fbacc4707104f3f2740b1f80e1fbf8d42
Author: Simon Pireyn <sp...@gmail.com>
Date:   2015-07-08T15:34:21Z

    CB-9334 loop on CordovaPlugins before returning remapped Uri

commit f72f6cd30dbab153e33e625d2ae1d2ac04a0cc0c
Author: Simon Pireyn <sp...@gmail.com>
Date:   2015-07-08T15:51:57Z

    CB-9334 loop on CordovaPlugins before returning remapped Uri

commit 3e8948650c6a42487c980b7ee396c966a9533878
Author: Simon Pireyn <sp...@gmail.com>
Date:   2015-07-08T15:54:52Z

    Check is not bitwise

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android pull request #195: CB-9334 loop on CordovaPlugins before ret...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-android/pull/195


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android issue #195: CB-9334 loop on CordovaPlugins before returning ...

Posted by infil00p <gi...@git.apache.org>.
Github user infil00p commented on the issue:

    https://github.com/apache/cordova-android/pull/195
  
    This is a pull request into a deprecated branch of Cordova.  I'm going to close the Pull Request.  Can you see if this issue still exists in the latest, and if so, open a new PR? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android pull request: CB-9334 loop on CordovaPlugins befor...

Posted by spirann <gi...@git.apache.org>.
Github user spirann commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/195#discussion_r34771734
  
    --- Diff: framework/src/org/apache/cordova/PluginManager.java ---
    @@ -381,15 +374,16 @@ public void onReset() {
         }
     
         Uri remapUri(Uri uri) {
    +        Uri remap = uri;
             for (CordovaPlugin plugin : this.pluginMap.values()) {
                 if (plugin != null) {
    -                Uri ret = plugin.remapUri(uri);
    +                Uri ret = plugin.remapUri(remap);
                     if (ret != null) {
    -                    return ret;
    +                    remap = ret;
                     }
                 }
             }
    -        return null;
    +        return uri.equals(remap) ? null : remap;
    --- End diff --
    
    It was the default behavior to return null if no plugins ends up remapping the uri. The only change is that it also return null if a plugin remap the uri to the same uri, because there's no need to act like there's a change when there's not (some plugins like JsHybuggerPlugin for example always remap every uri, to the same when no action is needed)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android pull request: CB-9334 loop on CordovaPlugins befor...

Posted by omefire <gi...@git.apache.org>.
Github user omefire commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/195#discussion_r34760070
  
    --- Diff: framework/src/org/apache/cordova/PluginManager.java ---
    @@ -381,15 +374,16 @@ public void onReset() {
         }
     
         Uri remapUri(Uri uri) {
    +        Uri remap = uri;
             for (CordovaPlugin plugin : this.pluginMap.values()) {
                 if (plugin != null) {
    -                Uri ret = plugin.remapUri(uri);
    +                Uri ret = plugin.remapUri(remap);
                     if (ret != null) {
    -                    return ret;
    +                    remap = ret;
                     }
                 }
             }
    -        return null;
    +        return uri.equals(remap) ? null : remap;
    --- End diff --
    
    I suppose this returns null if no plugins ends up remapping the uri. However, a comment as to why this is being done would be great !



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org