[qt] clean: remove unused code

This code is never runned. So it is not maintained and probly buggy.

authorAlain Leufroy <alain.leufroy@logilab.fr>
changesetb5ece8a50c03
branchdefault
phasepublic
hiddenno
parent revision#fc542bd01f56 [qt] add an action to export changeset metadata to clipboard (closes #101945)
child revision#bfc7647be8d2 [qt] clean: remove legacy old mercurial api support
files modified by this revision
hgviewlib/qt4/blockmatcher.py
hgviewlib/qt4/hgmanifestdialog.py
hgviewlib/qt4/hgrepomodel.py
hgviewlib/qt4/hgrepoview.py
hgviewlib/qt4/quickbar.py
# HG changeset patch
# User Alain Leufroy <alain.leufroy@logilab.fr>
# Date 1350674484 -7200
# Fri Oct 19 21:21:24 2012 +0200
# Node ID b5ece8a50c032d04ea0316c13f427823c4837fea
# Parent fc542bd01f56993d9c7e55c1a977badc1a46a23f
[qt] clean: remove unused code

This code is never runned. So it is not maintained and probly buggy.

diff --git a/hgviewlib/qt4/blockmatcher.py b/hgviewlib/qt4/blockmatcher.py
@@ -306,56 +306,5 @@
1                       lambda v, s: side==s and sb.setValue(v))
2          self.connect(self, SIGNAL('rangeChanged(int, int, const QString )'),
3                       lambda v1, v2, s: side==s and sb.setRange(v1, v2))
4          self.connect(self, SIGNAL('pageStepChanged(int, const QString )'),
5                       lambda v, s: side==s and sb.setPageStep(v))
6 -
7 -if __name__ == '__main__':
8 -    a = QtGui.QApplication([])
9 -    f = QtGui.QFrame()
10 -    l = QtGui.QHBoxLayout(f)
11 -
12 -    sb1 = QtGui.QScrollBar()
13 -    sb2 = QtGui.QScrollBar()
14 -
15 -    w0 = BlockList()
16 -    w0.addBlock('-', 200, 300)
17 -    w0.addBlock('-', 450, 460)
18 -    w0.addBlock('x', 500, 501)
19 -    w0.linkScrollBar(sb1)
20 -
21 -    w1 = BlockMatch()
22 -    w1.addBlock('+', 12, 42)
23 -    w1.addBlock('+', 55, 142)
24 -    w1.addBlock('-', 200, 300)
25 -    w1.addBlock('-', 330, 400, 450, 460)
26 -    w1.addBlock('x', 420, 450, 500, 501)
27 -    w1.linkScrollBar(sb1, 'left')
28 -    w1.linkScrollBar(sb2, 'right')
29 -
30 -    w2 = BlockList()
31 -    w2.addBlock('+', 12, 42)
32 -    w2.addBlock('+', 55, 142)
33 -    w2.addBlock('x', 420, 450)
34 -    w2.linkScrollBar(sb2)
35 -
36 -    l.addWidget(sb1)
37 -    l.addWidget(w0)
38 -    l.addWidget(w1)
39 -    l.addWidget(w2)
40 -    l.addWidget(sb2)
41 -
42 -    w0.setRange(0, 1200)
43 -    w0.setPageStep(100)
44 -    w1.setRange(0, 1200, 'left')
45 -    w1.setRange(0, 1200, 'right')
46 -    w1.setPageStep(100, 'left')
47 -    w1.setPageStep(100, 'right')
48 -    w2.setRange(0, 1200)
49 -    w2.setPageStep(100)
50 -
51 -    print "sb1=", sb1.minimum(), sb1.maximum(), sb1.pageStep()
52 -    print "sb2=", sb2.minimum(), sb2.maximum(), sb2.pageStep()
53 -
54 -    f.show()
55 -    a.exec_()
56 -
diff --git a/hgviewlib/qt4/hgmanifestdialog.py b/hgviewlib/qt4/hgmanifestdialog.py
@@ -128,29 +128,5 @@
57                  newindex = self.treemodel.index(row, 0, index)
58                  if newindex.internalPointer().data(0) == p:
59                      index = newindex
60                      break
61          self.treeView.setCurrentIndex(index)
62 -
63 -
64 -if __name__ == '__main__':
65 -    from mercurial import ui, hg
66 -    from optparse import OptionParser
67 -    opt = OptionParser()
68 -    opt.add_option('-R', '--repo',
69 -                   dest='repo',
70 -                   default='.',
71 -                   help='Hg repository')
72 -
73 -    options, args = opt.parse_args()
74 -    if len(args) != 1:
75 -        opt.error('Please specify a revision number')
76 -    rev = args[0]
77 -
78 -    u = ui.ui()
79 -    repo = hg.repository(u, options.repo)
80 -    app = QtGui.QApplication([])
81 -
82 -    view = ManifestViewer(repo, int(rev))
83 -    view.show()
84 -    sys.exit(app.exec_())
85 -
diff --git a/hgviewlib/qt4/hgrepomodel.py b/hgviewlib/qt4/hgrepomodel.py
@@ -846,41 +846,5 @@
86          while index.isValid():
87              idxs.insert(0, index)
88              index = self.parent(index)
89          return osp.sep.join([index.internalPointer().data(0) for index in idxs])
90 
91 -
92 -if __name__ == "__main__":
93 -    from mercurial import ui, hg
94 -    from optparse import OptionParser
95 -    p = OptionParser()
96 -    p.add_option('-R', '--root', default='.',
97 -                 dest='root',
98 -                 help="Repository main directory")
99 -    p.add_option('-f', '--file', default=None,
100 -                 dest='filename',
101 -                 help="display the revision graph of this file (if not given, display the whole rev graph)")
102 -
103 -    opt, args = p.parse_args()
104 -
105 -    u = ui.ui()
106 -    repo = hg.repository(u, opt.root)
107 -    app = QtGui.QApplication(sys.argv)
108 -    if opt.filename is not None:
109 -        model = FileRevModel(repo, opt.filename)
110 -    else:
111 -        model = HgRepoListModel(repo)
112 -
113 -    view = QtGui.QTableView()
114 -    #delegate = GraphDelegate()
115 -    #view.setItemDelegateForColumn(1, delegate)
116 -    view.setShowGrid(False)
117 -    view.verticalHeader().hide()
118 -    view.verticalHeader().setDefaultSectionSize(20)
119 -    view.setSelectionMode(QtGui.QAbstractItemView.SingleSelection)
120 -    view.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
121 -    view.setModel(model)
122 -    view.setWindowTitle("Simple Hg List Model")
123 -    view.show()
124 -    view.setAlternatingRowColors(True)
125 -    #view.resizeColumnsToContents()
126 -    sys.exit(app.exec_())
diff --git a/hgviewlib/qt4/hgrepoview.py b/hgviewlib/qt4/hgrepoview.py
@@ -624,46 +624,5 @@
127                 '<span class="short_desc"><i>%(descr)s</i></span>' % locals()
128          if isdiffrev:
129              out += '</b>'
130          out += '</td></tr>\n'
131          return out
132 -
133 -
134 -if __name__ == "__main__":
135 -    from mercurial import ui, hg
136 -    from optparse import OptionParser
137 -    from hgviewlib.qt4.hgrepomodel import FileRevModel, HgRepoListModel
138 -    p = OptionParser()
139 -    p.add_option('-R', '--root', default='.',
140 -                 dest='root',
141 -                 help="Repository main directory")
142 -    p.add_option('-f', '--file', default=None,
143 -                 dest='filename',
144 -                 help="display the revision graph of this file (if not given, display the whole rev graph)")
145 -
146 -    opt, args = p.parse_args()
147 -
148 -    u = ui.ui()
149 -    repo = hg.repository(u, opt.root)
150 -    app = QtGui.QApplication(sys.argv)
151 -    if opt.filename is not None:
152 -        model = FileRevModel(repo, opt.filename)
153 -    else:
154 -        model = HgRepoListModel(repo)
155 -    root = QtGui.QMainWindow()
156 -    w = QtGui.QWidget()
157 -    root.setCentralWidget(w)
158 -    l = QtGui.QVBoxLayout(w)
159 -
160 -    view = HgRepoView(w)
161 -    view.setModel(model)
162 -    view.setWindowTitle("Simple Hg List Model")
163 -
164 -    disp = RevDisplay(w)
165 -    connect(view, SIGNAL('revisionSelected'), lambda rev: disp.displayRevision(repo.changectx(rev)))
166 -    connect(disp, SIGNAL('revisionSelected'), view.goto)
167 -    #connect(view, SIGNAL('revisionActivated'), rev_act)
168 -
169 -    l.addWidget(view, 2)
170 -    l.addWidget(disp)
171 -    root.show()
172 -    sys.exit(app.exec_())
diff --git a/hgviewlib/qt4/quickbar.py b/hgviewlib/qt4/quickbar.py
@@ -319,17 +319,5 @@
173                            'Hit "Find next" button to start searching '
174                            'in the repository', 2000)
175              else:
176                  self.on_findnext()
177 
178 -if __name__ == "__main__":
179 -    import sys
180 -    import hgviewlib.qt4 # to force importation of resource module w/ icons
181 -    app = QtGui.QApplication(sys.argv)
182 -    root = QtGui.QMainWindow()
183 -    w = QtGui.QFrame()
184 -    root.setCentralWidget(w)
185 -
186 -    qbar = QuickBar("test", "Ctrl+G", "toto", w)
187 -    root.show()
188 -    app.exec_()
189 -