Пример #1
0
boolByte errorReporterCopyPlugins(ErrorReporter self, PluginChain pluginChain) {
  CharString pluginAbsolutePath = NULL;
  Plugin currentPlugin = NULL;
  boolByte failed = false;
  unsigned int i;
  PlatformInfo platform = newPlatformInfo();

  for (i = 0; i < pluginChain->numPlugins; i++) {
    currentPlugin = pluginChain->plugins[i];
    pluginAbsolutePath = currentPlugin->pluginAbsolutePath;

    if (charStringIsEmpty(pluginAbsolutePath)) {
      logInfo(
          "Plugin '%s' does not have an absolute path and could not be copied",
          currentPlugin->pluginName->data);
    } else if (platform->type == PLATFORM_MACOSX) {
      failed |= !_copyDirectoryToErrorReportDir(self, pluginAbsolutePath);
    } else {
      failed |= !errorReportCopyFileToReport(self, pluginAbsolutePath);
    }
  }

  freePlatformInfo(platform);
  return (boolByte)!failed;
}
Пример #2
0
static void _remapFileToErrorReport(ErrorReporter errorReporter, ProgramOption option, boolByte copyFile) {
  if(option->enabled) {
    if(copyFile) {
      // TODO: Slight abuse of private field, probably should avoid doing that...
      if(!errorReportCopyFileToReport(errorReporter, option->_data.string)) {
        logWarn("Failed copying '%s' to error report directory, please include this file manually",
          option->_data.string->data);
      }
    }
    errorReporterRemapPath(errorReporter, option->_data.string);
  }
}
Пример #3
0
boolByte errorReporterCopyPlugins(ErrorReporter self, PluginChain pluginChain) {
  CharString pluginAbsolutePath;
  Plugin currentPlugin;
  boolByte failed = false;
  unsigned int i;

  pluginAbsolutePath = newCharString();
  for(i = 0; i < pluginChain->numPlugins; i++) {
    currentPlugin = pluginChain->plugins[i];
    currentPlugin->getAbsolutePath(currentPlugin, pluginAbsolutePath);
    if(getPlatformType() == PLATFORM_MACOSX) {
      failed |= !_copyDirectoryToErrorReportDir(self, pluginAbsolutePath);
    }
    else {
      failed |= !errorReportCopyFileToReport(self, pluginAbsolutePath);
    }
  }

  freeCharString(pluginAbsolutePath);
  return !failed;
}