mirror of
https://gitee.com/openharmony/print_print_fwk
synced 2024-11-26 18:40:40 +00:00
显示两台一样的打印机 Signed-off-by:baozewei@huawei.com
Signed-off-by: b30052170 <baozewei@huawei.com>
This commit is contained in:
parent
9f7b864317
commit
3104d02926
@ -13,11 +13,13 @@
|
||||
import("//base/print/print_fwk/print.gni")
|
||||
import("//build/ohos.gni")
|
||||
|
||||
cflags_cc = []
|
||||
|
||||
config("print_interfaces_kits_napi_config") {
|
||||
visibility = [ ":*" ]
|
||||
include_dirs = [ "include" ]
|
||||
|
||||
cflags_cc = [ "-fno-exceptions" ]
|
||||
cflags_cc += [ "-fno-exceptions" ]
|
||||
}
|
||||
ohos_shared_library("print_helper") {
|
||||
include_dirs = [
|
||||
|
@ -13,11 +13,13 @@
|
||||
import("//base/print/print_fwk/print.gni")
|
||||
import("//build/ohos.gni")
|
||||
|
||||
cflags_cc = []
|
||||
|
||||
config("scan_interfaces_kits_napi_config") {
|
||||
visibility = [ ":*" ]
|
||||
include_dirs = [ "include" ]
|
||||
|
||||
cflags_cc = [ "-fno-exceptions" ]
|
||||
cflags_cc += [ "-fno-exceptions" ]
|
||||
}
|
||||
ohos_shared_library("scan_helper") {
|
||||
include_dirs = [
|
||||
|
@ -13,11 +13,13 @@
|
||||
import("//base/print/print_fwk/print.gni")
|
||||
import("//build/ohos.gni")
|
||||
|
||||
cflags_cc = []
|
||||
|
||||
config("scan_interfaces_kits_napi_config") {
|
||||
visibility = [ ":*" ]
|
||||
include_dirs = [ "include" ]
|
||||
|
||||
cflags_cc = [ "-fno-exceptions" ]
|
||||
cflags_cc += [ "-fno-exceptions" ]
|
||||
}
|
||||
|
||||
ohos_shared_library("scan_client") {
|
||||
|
@ -14,6 +14,8 @@
|
||||
import("//base/print/print_fwk/print.gni")
|
||||
import("//build/ohos.gni")
|
||||
|
||||
cflags_cc = []
|
||||
|
||||
config("ability_config") {
|
||||
visibility = [ ":*" ]
|
||||
include_dirs = [
|
||||
@ -42,7 +44,7 @@ config("ability_public_config") {
|
||||
"//third_party/json/include",
|
||||
]
|
||||
|
||||
cflags_cc = [ "-fno-exceptions" ]
|
||||
cflags_cc += [ "-fno-exceptions" ]
|
||||
}
|
||||
|
||||
ohos_shared_library("print_extension_framework") {
|
||||
|
@ -13,11 +13,13 @@
|
||||
import("//base/print/print_fwk/print.gni")
|
||||
import("//build/ohos.gni")
|
||||
|
||||
cflags_cc = []
|
||||
|
||||
config("print_models_config") {
|
||||
visibility = [ ":*" ]
|
||||
include_dirs = [ "include" ]
|
||||
|
||||
cflags_cc = [ "-fexceptions" ]
|
||||
cflags_cc += [ "-fexceptions" ]
|
||||
}
|
||||
ohos_shared_library("print_models") {
|
||||
include_dirs = [ "${print_utils_path}/include" ]
|
||||
|
@ -13,11 +13,13 @@
|
||||
import("//base/print/print_fwk/print.gni")
|
||||
import("//build/ohos.gni")
|
||||
|
||||
cflags_cc = []
|
||||
|
||||
config("print_ndk_config") {
|
||||
visibility = [ ":*" ]
|
||||
include_dirs = []
|
||||
|
||||
cflags_cc = [ "-fno-exceptions" ]
|
||||
cflags_cc += [ "-fno-exceptions" ]
|
||||
}
|
||||
ohos_shared_library("ohprint") {
|
||||
include_dirs = [
|
||||
|
@ -13,11 +13,13 @@
|
||||
import("//base/print/print_fwk/print.gni")
|
||||
import("//build/ohos.gni")
|
||||
|
||||
cflags_cc = []
|
||||
|
||||
config("scan_ndk_config") {
|
||||
visibility = [ ":*" ]
|
||||
include_dirs = []
|
||||
|
||||
cflags_cc = [ "-fno-exceptions" ]
|
||||
cflags_cc += [ "-fno-exceptions" ]
|
||||
}
|
||||
|
||||
ohos_shared_library("ohscan") {
|
||||
|
@ -55,7 +55,7 @@ ohos_shared_library("printextensionability_napi") {
|
||||
external_deps = [ "napi:ace_napi" ]
|
||||
|
||||
if (build_variant == "user") {
|
||||
cflags_cc += [ "-DIS_RELEASE_VERSION" ]
|
||||
cflags_cc = [ "-DIS_RELEASE_VERSION" ]
|
||||
}
|
||||
|
||||
relative_install_dir = "module/app/ability"
|
||||
|
@ -55,7 +55,7 @@ ohos_shared_library("printextensioncontext_napi") {
|
||||
external_deps = [ "napi:ace_napi" ]
|
||||
|
||||
if (build_variant == "user") {
|
||||
cflags_cc += [ "-DIS_RELEASE_VERSION" ]
|
||||
cflags_cc = [ "-DIS_RELEASE_VERSION" ]
|
||||
}
|
||||
|
||||
relative_install_dir = "module"
|
||||
|
@ -398,7 +398,7 @@ napi_value NapiPrintExt::QueryPrinterCapabilityByUri(napi_env env, napi_callback
|
||||
PRINT_ASSERT_BASE(env, valuetype == napi_string, "printerId is not a string", napi_string_expected);
|
||||
|
||||
std::string printerId = NapiPrintUtils::GetStringFromValueUtf8(env, argv[NapiPrintUtils::INDEX_ONE]);
|
||||
PRINT_HILOGD("printerId : %{private}s", printerUri.c_str());
|
||||
PRINT_HILOGD("printerId : %{private}s", printerId.c_str());
|
||||
context->printerId = printerId;
|
||||
}
|
||||
return napi_ok;
|
||||
|
@ -13,11 +13,13 @@
|
||||
import("//base/print/print_fwk/print.gni")
|
||||
import("//build/ohos.gni")
|
||||
|
||||
cflags_cc = []
|
||||
|
||||
config("scan_interfaces_kits_napi_config") {
|
||||
visibility = [ ":*" ]
|
||||
include_dirs = [ "include" ]
|
||||
|
||||
cflags_cc = [ "-fexceptions" ]
|
||||
cflags_cc += [ "-fexceptions" ]
|
||||
}
|
||||
|
||||
ohos_shared_library("scan_napi") {
|
||||
|
@ -1544,6 +1544,12 @@ bool PrintServiceAbility::UpdatePrinterCapability(const std::string &printerId,
|
||||
info.GetCapability(printerCaps);
|
||||
WriteEprinterPreference(printerId, printerCaps);
|
||||
}
|
||||
|
||||
if (printSystemData_.IsPrinterAdded(printerId)) {
|
||||
PRINT_HILOGE("This printer has been added.");
|
||||
return false;
|
||||
}
|
||||
|
||||
CupsPrinterInfo cupsPrinterInfo;
|
||||
auto output = info;
|
||||
cupsPrinterInfo.name = info.GetPrinterName();
|
||||
|
Loading…
Reference in New Issue
Block a user