OSDN Git Service

Correct problem with tag tree reloading incorrectly after a sync.
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / gui / TagTreeWidget.java
index 9ca9c34..0633557 100644 (file)
@@ -66,6 +66,7 @@ public class TagTreeWidget extends QTreeWidget {
        public Signal0 selectionSignal;\r
        public String selectedTag;\r
        private boolean rightButtonClicked;\r
+       private List<TagCounter> lastCount;\r
        \r
        \r
        public TagTreeWidget(DatabaseConnection d) {\r
@@ -244,23 +245,18 @@ public class TagTreeWidget extends QTreeWidget {
        sortItems(0, SortOrder.AscendingOrder);\r
        \r
        expandTags(invisibleRootItem(), expandedTags);\r
+       if (lastCount != null)\r
+               updateCounts(lastCount);\r
        }\r
        // Show (unhide) all tags\r
        public void showAllTags(boolean value) {\r
                showAllTags = value;\r
        }\r
-       public void unhideAllTags() {\r
-               MatchFlags flags = new MatchFlags();\r
-               flags.set(MatchFlag.MatchWildcard);\r
-               flags.set(MatchFlag.MatchRecursive);\r
-               List <QTreeWidgetItem>  children = findItems("*", flags);\r
-               for (int i=0; i<children.size(); i++) {\r
-                       children.get(i).setHidden(false);\r
-               }\r
-       }\r
+\r
        // update the display with the current number of notes\r
        public void updateCounts(List<TagCounter> counts) {\r
                                \r
+               lastCount = counts;\r
                MatchFlags flags = new MatchFlags();\r
                flags.set(MatchFlag.MatchWildcard);\r
                flags.set(MatchFlag.MatchRecursive);\r