Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-19470

"nasty" output on stderr if closed project is in workspace

    XMLWordPrintable

Details

    • Bug
    • Resolution: Moved
    • P3: Somewhat important
    • None
    • 4.6.1
    • None

    Description

      The following code in QtUtils creates "nasty" output on stderr if you have a closed
      project in your workspace

      public static boolean isQtProject(IProject project) {
      if (project == null)
      return false;
      try

      { return project.hasNature(QtNature.QT_NATURE_ID); } catch (CoreException e) { e.printStackTrace(); }
      return false;
      }

      Since hasNature will create an exception if called on a closed project
      A possible fix would be to add a check for project.isOpen

      public static boolean isQtProject(IProject project) {
      if (project == null)
      return false;
      if(!project.isOpen()){ return false; }
      try { return project.hasNature(QtNature.QT_NATURE_ID); }

      catch (CoreException e)

      { e.printStackTrace(); }

      return false;
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jkobus Jarek Kobus
            maxwen Max Weninger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes