Review Request 123586: Improvements to outline view

Alex Richardson arichardson.kde at gmail.com
Tue Aug 4 10:49:43 UTC 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/123586/
-----------------------------------------------------------

(Updated Aug. 4, 2015, 10:49 a.m.)


Status
------

This change has been marked as submitted.


Review request for KDevelop.


Changes
-------

Submitted with commit 6d678cfc4c6380888f8e80d443c812298ecad9ec by Alex Richardson to branch master.


Repository: kdevplatform


Description
-------

This patch adds the following improvements:
- Contexts without a matching declaration (DUContext::owner()) now also show up in the outline view
- Outline view can be sorted alphabetically
- Nodes in the outline will now always appear in the order that the matching declaration appears in the source
- Reduce code duplication between OutlineNode and OutlineModel

---

Simplify outlineview by reusing code from OutlineNode in the model

Instead of storing a std::vector<OutlineNode> we now store a single
OutlineNode* which means the model no longer iterates over the decls of
the TopDUContext but rather we reuse OutlineNode::appendChildContext()

---

Fix not showing Contexts without declarations in outline view

For example in the following code the members of N::C would not show up:

namespace N {
    class C;
}

class N::C {
    char c;
}

int main(int, char**) {}

There is still the problem that N::C gets listed after main(), but there
are also other ordering problems. This will require sorting based on the
declaration location of the OulineNode

---

Outline view: show icons also for contexts without a declaration

----

Sort outlineview base on where the elements appear in the source

The outline view is mostly correct. However, in cases where there are
contexts that don't have an associated declaration these will be added
to the end of the list regardless of where they are in the source. For
example the following code

namespace N { class C; }
class N::C {
   int f(double);
};
void foo()

would previously result in an outline like this:

+-+- N
| \-- C
+-- foo(): void
+-+- N
   \-+- C
      \-- f(double): int

now it correctly renders as:

+-+- N
| \-- C
+-+- N
|  \-+- C
|     \-- f(double): int
+-- foo(): void

Allow sorting the outline alphabetically

This adds a button next to the filter field to toggle sorting. By
default it will be sorted based on the source location, but for a quick
overview of a source file an alphabetical list can be very useful.


Diffs
-----

  plugins/outlineview/outlinewidget.cpp 56c1e4436f0b02d6071d14586326d0b332606d49 
  plugins/outlineview/outlinewidget.h 3535ac8fce2e6c2fbc95a970496951b00ef84a9b 
  plugins/outlineview/outlinenode.cpp fedcbd87cc8dc6e9e18bad1336e912a643af6722 
  plugins/outlineview/outlinenode.h 0e8d3f536322478d84c13141a4e9fbebe09ede66 
  plugins/outlineview/outlinemodel.cpp 8f4f8fbc3c97365e223ca7cb45e685f2dcf96c0f 
  plugins/outlineview/CMakeLists.txt 8c25c4ede920b492f8e38db68013640673cfc504 
  plugins/outlineview/outlinemodel.h b54ab04acf089ce9e046e2f274b2d019a036ab93 

Diff: https://git.reviewboard.kde.org/r/123586/diff/


Testing
-------

Appears to work flawlessly in testing so far, but I would appreciate it if someone else could have a look at the code.


Thanks,

Alex Richardson

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20150804/f27bfc7a/attachment.html>


More information about the KDevelop-devel mailing list