comments
This commit is contained in:
parent
872b4ffc5d
commit
a230705bbd
|
@ -57,8 +57,10 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
TISInputSourceRef inputSource = [OVInputSourceHelper inputSourceForInputSourceID:bundleID];
|
TISInputSourceRef inputSource = [OVInputSourceHelper inputSourceForInputSourceID:bundleID];
|
||||||
|
|
||||||
|
// if this IME name is not found in the list of available IMEs
|
||||||
if (!inputSource) {
|
if (!inputSource) {
|
||||||
NSLog(@"Registering input source %@ at %@.", bundleID, [bundleURL absoluteString]);
|
NSLog(@"Registering input source %@ at %@.", bundleID, [bundleURL absoluteString]);
|
||||||
|
// then register
|
||||||
BOOL status = [OVInputSourceHelper registerInputSource:bundleURL];
|
BOOL status = [OVInputSourceHelper registerInputSource:bundleURL];
|
||||||
|
|
||||||
if (!status) {
|
if (!status) {
|
||||||
|
@ -68,6 +70,7 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
inputSource = [OVInputSourceHelper inputSourceForInputSourceID:bundleID];
|
inputSource = [OVInputSourceHelper inputSourceForInputSourceID:bundleID];
|
||||||
|
// if it still doesn't register successfully, bail.
|
||||||
if (!inputSource) {
|
if (!inputSource) {
|
||||||
NSLog(@"Fatal error: Cannot find input source %@ after registration.", bundleID);
|
NSLog(@"Fatal error: Cannot find input source %@ after registration.", bundleID);
|
||||||
[pool drain];
|
[pool drain];
|
||||||
|
@ -75,6 +78,7 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if it's not enabled, just enabled it
|
||||||
if (inputSource && ![OVInputSourceHelper inputSourceEnabled:inputSource]) {
|
if (inputSource && ![OVInputSourceHelper inputSourceEnabled:inputSource]) {
|
||||||
NSLog(@"Enabling input source %@ at %@.", bundleID, [bundleURL absoluteString]);
|
NSLog(@"Enabling input source %@ at %@.", bundleID, [bundleURL absoluteString]);
|
||||||
BOOL status = [OVInputSourceHelper enableInputSource:inputSource];
|
BOOL status = [OVInputSourceHelper enableInputSource:inputSource];
|
||||||
|
@ -84,6 +88,11 @@ int main(int argc, char *argv[])
|
||||||
[pool drain];
|
[pool drain];
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (![OVInputSourceHelper inputSourceEnabled:inputSource]){
|
||||||
|
NSLog(@"Fatal error: Cannot enable input source %@.", bundleID);
|
||||||
|
[pool drain];
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue