diff options
Diffstat (limited to 'platform/bb10')
-rw-r--r-- | platform/bb10/bbutil.h | 28 | ||||
-rw-r--r-- | platform/bb10/export/export.cpp | 150 | ||||
-rw-r--r-- | platform/bb10/export/export.h | 30 |
3 files changed, 119 insertions, 89 deletions
diff --git a/platform/bb10/bbutil.h b/platform/bb10/bbutil.h index bc422cd9b9..c2a4c5a7f5 100644 --- a/platform/bb10/bbutil.h +++ b/platform/bb10/bbutil.h @@ -1,31 +1,3 @@ -/*************************************************************************/ -/* bbutil.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ #ifndef _UTILITY_H_INCLUDED #define _UTILITY_H_INCLUDED diff --git a/platform/bb10/export/export.cpp b/platform/bb10/export/export.cpp index da3a958a56..7cb0aa3607 100644 --- a/platform/bb10/export/export.cpp +++ b/platform/bb10/export/export.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* export.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "version.h" #include "export.h" #include "tools/editor/editor_settings.h" @@ -532,95 +560,99 @@ void EditorExportPlatformBB10::_device_poll_thread(void *ud) { if (windows) bb_deploy+=".bat"; - if (!FileAccess::exists(bb_deploy)) { - OS::get_singleton()->delay_usec(3000000); - continue; //adb not configured - } + if (FileAccess::exists(bb_deploy)) { - Vector<Device> devices; + Vector<Device> devices; - for (int i=0;i<MAX_DEVICES;i++) { + for (int i=0;i<MAX_DEVICES;i++) { - String host = EditorSettings::get_singleton()->get("blackberry/device_"+itos(i+1)+"/host"); - if (host==String()) - continue; - String pass = EditorSettings::get_singleton()->get("blackberry/device_"+itos(i+1)+"/password"); - if (pass==String()) - continue; + String host = EditorSettings::get_singleton()->get("blackberry/device_"+itos(i+1)+"/host"); + if (host==String()) + continue; + String pass = EditorSettings::get_singleton()->get("blackberry/device_"+itos(i+1)+"/password"); + if (pass==String()) + continue; - List<String> args; - args.push_back("-listDeviceInfo"); - args.push_back(host); - args.push_back("-password"); - args.push_back(pass); + List<String> args; + args.push_back("-listDeviceInfo"); + args.push_back(host); + args.push_back("-password"); + args.push_back(pass); - int ec; - String dp; + int ec; + String dp; - Error err = OS::get_singleton()->execute(bb_deploy,args,true,NULL,&dp,&ec); + Error err = OS::get_singleton()->execute(bb_deploy,args,true,NULL,&dp,&ec); - if (err==OK && ec==0) { + if (err==OK && ec==0) { - Device dev; - dev.index=i; - String descr; - Vector<String> ls=dp.split("\n"); + Device dev; + dev.index=i; + String descr; + Vector<String> ls=dp.split("\n"); - for(int i=0;i<ls.size();i++) { + for(int i=0;i<ls.size();i++) { + + String l = ls[i].strip_edges(); + if (l.begins_with("modelfullname::")) { + dev.name=l.get_slice("::",1); + descr+="Model: "+dev.name+"\n"; + } + if (l.begins_with("modelnumber::")) { + String s = l.get_slice("::",1); + dev.name+=" ("+s+")"; + descr+="Model Number: "+s+"\n"; + } + if (l.begins_with("scmbundle::")) + descr+="OS Version: "+l.get_slice("::",1)+"\n"; + if (l.begins_with("[n]debug_token_expiration::")) + descr+="Debug Token Expires:: "+l.get_slice("::",1)+"\n"; - String l = ls[i].strip_edges(); - if (l.begins_with("modelfullname::")) { - dev.name=l.get_slice("::",1); - descr+="Model: "+dev.name+"\n"; - } - if (l.begins_with("modelnumber::")) { - String s = l.get_slice("::",1); - dev.name+=" ("+s+")"; - descr+="Model Number: "+s+"\n"; } - if (l.begins_with("scmbundle::")) - descr+="OS Version: "+l.get_slice("::",1)+"\n"; - if (l.begins_with("[n]debug_token_expiration::")) - descr+="Debug Token Expires:: "+l.get_slice("::",1)+"\n"; + dev.description=descr; + devices.push_back(dev); } - dev.description=descr; - devices.push_back(dev); } - } - - bool changed=false; + bool changed=false; - ea->device_lock->lock(); + ea->device_lock->lock(); - if (ea->devices.size()!=devices.size()) { - changed=true; - } else { + if (ea->devices.size()!=devices.size()) { + changed=true; + } else { - for(int i=0;i<ea->devices.size();i++) { + for(int i=0;i<ea->devices.size();i++) { - if (ea->devices[i].index!=devices[i].index) { - changed=true; - break; + if (ea->devices[i].index!=devices[i].index) { + changed=true; + break; + } } } - } - if (changed) { + if (changed) { - ea->devices=devices; - ea->devices_changed=true; - } + ea->devices=devices; + ea->devices_changed=true; + } - ea->device_lock->unlock(); + ea->device_lock->unlock(); + } - OS::get_singleton()->delay_usec(3000000); + uint64_t wait = 3000000; + uint64_t time = OS::get_singleton()->get_ticks_usec(); + while(OS::get_singleton()->get_ticks_usec() - time < wait ) { + OS::get_singleton()->delay_usec(1000); + if (ea->quit_request) + break; + } } } diff --git a/platform/bb10/export/export.h b/platform/bb10/export/export.h index 06c7a681be..bd9cad5cb3 100644 --- a/platform/bb10/export/export.h +++ b/platform/bb10/export/export.h @@ -1,3 +1,29 @@ - - +/*************************************************************************/ +/* export.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ void register_bb10_exporter(); |