From ec4f7212704cbdec848dbb1780851b98d1a3d833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Katzer?= Date: Wed, 6 Feb 2019 12:02:41 +0100 Subject: [PATCH] Also rename internal "utis" functions --- .travis.yml | 57 ----------------------------------- src/android/PrintManager.java | 2 +- src/android/Printer.java | 8 ++--- src/ios/APPPrinter.h | 2 +- src/ios/APPPrinter.m | 2 +- src/windows/PrinterProxy.js | 2 +- www/printer.js | 2 +- 7 files changed, 9 insertions(+), 66 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ccd6df9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright (c) 2013-2016 by appPlant GmbH. All rights reserved. -# -# @APPPLANT_LICENSE_HEADER_START@ -# -# This file contains Original Code and/or Modifications of Original Code -# as defined in and that are subject to the Apache License -# Version 2.0 (the 'License'). You may not use this file except in -# compliance with the License. Please obtain a copy of the License at -# http://opensource.org/licenses/Apache-2.0/ and read it before using this -# file. -# -# The Original Code and all software distributed under the License are -# distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER -# EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, -# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. -# Please see the License for the specific language governing rights and -# limitations under the License. -# -# @APPPLANT_LICENSE_HEADER_END@ - -language: objective-c -osx_image: xcode8.2 - -branches: - only: - - master - - /^feature\// - - /^bug\// - -node_js: -- 6 - -notifications: - email: false - -before_install: -- xcrun simctl delete 79C525D3-2383-4201-AC3A-81810F9F4E03 - -install: -- npm install -- npm install -g cordova -- brew install gradle -- brew install android-sdk -- ( sleep 5 && while [ 1 ]; do sleep 1; echo y; done ) | android update sdk -a -u -t "tools,platform-tools,build-tools-25.0.2,android-25" - -before_script: -- cordova create myApp org.apache.cordova.myApp myApp -- cd myApp -- cordova platform add ios@latest android@latest -- cordova plugin add cordova-plugin-printer --searchpath ../ -- cordova platform ls -- cordova plugin ls - -script: -- cordova build ios -- cordova build android diff --git a/src/android/PrintManager.java b/src/android/PrintManager.java index 8b96599..483cabe 100644 --- a/src/android/PrintManager.java +++ b/src/android/PrintManager.java @@ -90,7 +90,7 @@ class PrintManager { * List of all printable document types (utis). */ @NonNull - static JSONArray getPrintableUTIs() + static JSONArray getPrintableTypes() { JSONArray utis = new JSONArray(); diff --git a/src/android/Printer.java b/src/android/Printer.java index 01b0c6d..afdf666 100644 --- a/src/android/Printer.java +++ b/src/android/Printer.java @@ -65,9 +65,9 @@ public class Printer extends CordovaPlugin { { check(args.optString(0), callback); } - else if (action.equalsIgnoreCase("utis")) + else if (action.equalsIgnoreCase("types")) { - utis(callback); + types(callback); } else if (action.equalsIgnoreCase("print")) { @@ -101,10 +101,10 @@ public class Printer extends CordovaPlugin { * * @param callback The plugin function to invoke with the result. */ - private void utis (CallbackContext callback) + private void types (CallbackContext callback) { cordova.getThreadPool().execute(() -> { - JSONArray utis = PrintManager.getPrintableUTIs(); + JSONArray utis = PrintManager.getPrintableTypes(); PluginResult res = new PluginResult( Status.OK, utis); diff --git a/src/ios/APPPrinter.h b/src/ios/APPPrinter.h index 48f936e..dc8d809 100755 --- a/src/ios/APPPrinter.h +++ b/src/ios/APPPrinter.h @@ -25,7 +25,7 @@ - (void) check:(CDVInvokedUrlCommand *)command; -- (void) utis:(CDVInvokedUrlCommand *)command; +- (void) types:(CDVInvokedUrlCommand *)command; - (void) pick:(CDVInvokedUrlCommand *)command; diff --git a/src/ios/APPPrinter.m b/src/ios/APPPrinter.m index 64d5280..c671e69 100755 --- a/src/ios/APPPrinter.m +++ b/src/ios/APPPrinter.m @@ -52,7 +52,7 @@ /* * List all printable document types (utis). */ -- (void) utis:(CDVInvokedUrlCommand *)command +- (void) types:(CDVInvokedUrlCommand *)command { [self.commandDelegate runInBackground:^{ NSSet *utis = UIPrintInteractionController.printableUTIs; diff --git a/src/windows/PrinterProxy.js b/src/windows/PrinterProxy.js index e3b9a97..c42e8de 100644 --- a/src/windows/PrinterProxy.js +++ b/src/windows/PrinterProxy.js @@ -60,7 +60,7 @@ exports.check = function (success, fail, args) { * * @return [ Void ] */ -exports.utis = function (success, fail, args) { +exports.types = function (success, fail, args) { success([]); }; diff --git a/www/printer.js b/www/printer.js index fb10789..323b40e 100755 --- a/www/printer.js +++ b/www/printer.js @@ -122,7 +122,7 @@ exports.canPrintItem = function (uri, callback, scope) { exports.getPrintableTypes = function (callback, scope) { var fn = this._createCallbackFn(callback, scope); - exec(fn, null, 'Printer', 'utis', []); + exec(fn, null, 'Printer', 'types', []); }; /**