예제 #1
0
    def fill(self):
        '''Parse all the paths (['Lcom/example/myclass/MyActivity$1;', ...])
           and build a tree using the QTreeWidgetItem insertion method.'''
        androconf.debug("Fill classes tree")

        for idx, filename, digest, classes in self.session.get_classes():
            for c in sorted(classes, key=lambda c: c.name):
                sig = Signature(c)
                path_node = self.root_path_node

                # Namespaces
                for path in sig.class_path:
                    if path not in path_node[0]:
                        path_node[0][path] = ({},
                                              QtGui.QTreeWidgetItem(
                                                  path_node[1]))
                        path_node[0][path][1].setText(0, path)
                    path_node = path_node[0][path]
                # Class
                path_node[0][path] = ({}, QtGui.QTreeWidgetItem(path_node[1]))

                class_name = sig.class_name

                if idx > 0:
                    class_name += "@%d" % idx

                c.current_title = class_name
                self._reverse_cache[path_node[0][path][1]] = (c, filename,
                                                              digest)

                path_node[0][path][1].setText(0, class_name)
예제 #2
0
    def fill(self, classes):
        '''Parse all the paths (['Lcom/sogeti/example/myclass/MyActivity$1;', ...])
           and build a tree using the QTreeWidgetItem insertion method.'''

        root_path_node = ({}, self)
        for c in sorted(classes, key=lambda c: c.name):
            sig = Signature(c)
            path_node = root_path_node
            # Namespaces
            for path in sig.class_path:
                if path not in path_node[0]:
                    path_node[0][path] = ({},
                                          QtGui.QTreeWidgetItem(path_node[1]))
                    path_node[0][path][1].setText(0, path)
                path_node = path_node[0][path]
            # Class
            path_node[0][path] = ({}, QtGui.QTreeWidgetItem(path_node[1]))
            path_node[0][path][1].setText(0, sig.class_name)