Commit 05966baf authored by acpaquette's avatar acpaquette
Browse files

Updates IException to use the exposed Preference flags

parent e3432cec
Loading
Loading
Loading
Loading
+2 −24
Original line number Diff line number Diff line
@@ -532,18 +532,7 @@ namespace Isis {
   * @return a string representation of this exception
   */
  QString IException::toString() const {
    bool reportFileLine = true;

    if (Preference::Preferences().hasGroup("ErrorFacility")) {
      PvlGroup &errorFacility =
          Preference::Preferences().findGroup("ErrorFacility");
      if (errorFacility.hasKeyword("FileLine")) {
        QString fileLine = errorFacility["FileLine"][0];
        reportFileLine = (fileLine.toUpper() == "ON");
      }
    }

    return toString(reportFileLine);
    return toString(Preference::Preferences().reportFileLine());
  }


@@ -561,18 +550,7 @@ namespace Isis {
  QString IException::toString(bool includeFileInfo) const {
    QString result;

    bool usePvlFormat = false;

    if (Preference::Preferences().hasGroup("ErrorFacility")) {
      PvlGroup &errorFacility =
          Preference::Preferences().findGroup("ErrorFacility");
      if (errorFacility.hasKeyword("Format")) {
        QString format = errorFacility["Format"][0];
        usePvlFormat = (format.toUpper() == "PVL");
      }
    }

    if (usePvlFormat) {
    if (Preference::Preferences().outputErrorAsPvl()) {
      Pvl errors = toPvl();

      if (errors.groups() != 0) {