|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.Project.ProjectBrowserModel</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body><a NAME="top" ID="top"></a> |
|
22 <h1>eric6.Project.ProjectBrowserModel</h1> |
|
23 <p> |
|
24 Module implementing the browser model. |
|
25 </p> |
|
26 <h3>Global Attributes</h3> |
|
27 <table> |
|
28 <tr><td>ProjectBrowserFormType</td></tr><tr><td>ProjectBrowserInterfaceType</td></tr><tr><td>ProjectBrowserItemDirectory</td></tr><tr><td>ProjectBrowserItemFile</td></tr><tr><td>ProjectBrowserItemSimpleDirectory</td></tr><tr><td>ProjectBrowserNoType</td></tr><tr><td>ProjectBrowserOthersType</td></tr><tr><td>ProjectBrowserResourceType</td></tr><tr><td>ProjectBrowserSourceType</td></tr><tr><td>ProjectBrowserTranslationType</td></tr> |
|
29 </table> |
|
30 <h3>Classes</h3> |
|
31 <table> |
|
32 <tr> |
|
33 <td><a href="#ProjectBrowserDirectoryItem">ProjectBrowserDirectoryItem</a></td> |
|
34 <td>Class implementing the data structure for project browser directory items.</td> |
|
35 </tr><tr> |
|
36 <td><a href="#ProjectBrowserFileItem">ProjectBrowserFileItem</a></td> |
|
37 <td>Class implementing the data structure for project browser file items.</td> |
|
38 </tr><tr> |
|
39 <td><a href="#ProjectBrowserItemMixin">ProjectBrowserItemMixin</a></td> |
|
40 <td>Class implementing common methods of project browser items.</td> |
|
41 </tr><tr> |
|
42 <td><a href="#ProjectBrowserModel">ProjectBrowserModel</a></td> |
|
43 <td>Class implementing the project browser model.</td> |
|
44 </tr><tr> |
|
45 <td><a href="#ProjectBrowserSimpleDirectoryItem">ProjectBrowserSimpleDirectoryItem</a></td> |
|
46 <td>Class implementing the data structure for project browser simple directory items.</td> |
|
47 </tr> |
|
48 </table> |
|
49 <h3>Functions</h3> |
|
50 <table> |
|
51 <tr><td>None</td></tr> |
|
52 </table> |
|
53 <hr /><hr /> |
|
54 <a NAME="ProjectBrowserDirectoryItem" ID="ProjectBrowserDirectoryItem"></a> |
|
55 <h2>ProjectBrowserDirectoryItem</h2> |
|
56 <p> |
|
57 Class implementing the data structure for project browser directory items. |
|
58 </p> |
|
59 <h3>Derived from</h3> |
|
60 BrowserDirectoryItem, ProjectBrowserItemMixin |
|
61 <h3>Class Attributes</h3> |
|
62 <table> |
|
63 <tr><td>None</td></tr> |
|
64 </table> |
|
65 <h3>Class Methods</h3> |
|
66 <table> |
|
67 <tr><td>None</td></tr> |
|
68 </table> |
|
69 <h3>Methods</h3> |
|
70 <table> |
|
71 <tr> |
|
72 <td><a href="#ProjectBrowserDirectoryItem.__init__">ProjectBrowserDirectoryItem</a></td> |
|
73 <td>Constructor</td> |
|
74 </tr> |
|
75 </table> |
|
76 <h3>Static Methods</h3> |
|
77 <table> |
|
78 <tr><td>None</td></tr> |
|
79 </table> |
|
80 <a NAME="ProjectBrowserDirectoryItem.__init__" ID="ProjectBrowserDirectoryItem.__init__"></a> |
|
81 <h4>ProjectBrowserDirectoryItem (Constructor)</h4> |
|
82 <b>ProjectBrowserDirectoryItem</b>(<i>parent, dinfo, projectType, full=True, bold=False</i>) |
|
83 <p> |
|
84 Constructor |
|
85 </p><dl> |
|
86 <dt><i>parent</i></dt> |
|
87 <dd> |
|
88 parent item |
|
89 </dd><dt><i>dinfo</i></dt> |
|
90 <dd> |
|
91 dinfo is the string for the directory (string) |
|
92 </dd><dt><i>projectType</i></dt> |
|
93 <dd> |
|
94 type of file/directory in the project |
|
95 </dd><dt><i>full</i></dt> |
|
96 <dd> |
|
97 flag indicating full pathname should be displayed (boolean) |
|
98 </dd><dt><i>bold</i></dt> |
|
99 <dd> |
|
100 flag indicating a highlighted font (boolean) |
|
101 </dd> |
|
102 </dl> |
|
103 <div align="right"><a href="#top">Up</a></div> |
|
104 <hr /><hr /> |
|
105 <a NAME="ProjectBrowserFileItem" ID="ProjectBrowserFileItem"></a> |
|
106 <h2>ProjectBrowserFileItem</h2> |
|
107 <p> |
|
108 Class implementing the data structure for project browser file items. |
|
109 </p> |
|
110 <h3>Derived from</h3> |
|
111 BrowserFileItem, ProjectBrowserItemMixin |
|
112 <h3>Class Attributes</h3> |
|
113 <table> |
|
114 <tr><td>None</td></tr> |
|
115 </table> |
|
116 <h3>Class Methods</h3> |
|
117 <table> |
|
118 <tr><td>None</td></tr> |
|
119 </table> |
|
120 <h3>Methods</h3> |
|
121 <table> |
|
122 <tr> |
|
123 <td><a href="#ProjectBrowserFileItem.__init__">ProjectBrowserFileItem</a></td> |
|
124 <td>Constructor</td> |
|
125 </tr> |
|
126 </table> |
|
127 <h3>Static Methods</h3> |
|
128 <table> |
|
129 <tr><td>None</td></tr> |
|
130 </table> |
|
131 <a NAME="ProjectBrowserFileItem.__init__" ID="ProjectBrowserFileItem.__init__"></a> |
|
132 <h4>ProjectBrowserFileItem (Constructor)</h4> |
|
133 <b>ProjectBrowserFileItem</b>(<i>parent, finfo, projectType, full=True, bold=False, sourceLanguage=""</i>) |
|
134 <p> |
|
135 Constructor |
|
136 </p><dl> |
|
137 <dt><i>parent</i></dt> |
|
138 <dd> |
|
139 parent item |
|
140 </dd><dt><i>finfo</i></dt> |
|
141 <dd> |
|
142 the string for the file (string) |
|
143 </dd><dt><i>projectType</i></dt> |
|
144 <dd> |
|
145 type of file/directory in the project |
|
146 </dd><dt><i>full</i></dt> |
|
147 <dd> |
|
148 flag indicating full pathname should be displayed (boolean) |
|
149 </dd><dt><i>bold</i></dt> |
|
150 <dd> |
|
151 flag indicating a highlighted font (boolean) |
|
152 </dd><dt><i>sourceLanguage</i></dt> |
|
153 <dd> |
|
154 source code language of the project (string) |
|
155 </dd> |
|
156 </dl> |
|
157 <div align="right"><a href="#top">Up</a></div> |
|
158 <hr /><hr /> |
|
159 <a NAME="ProjectBrowserItemMixin" ID="ProjectBrowserItemMixin"></a> |
|
160 <h2>ProjectBrowserItemMixin</h2> |
|
161 <p> |
|
162 Class implementing common methods of project browser items. |
|
163 </p><p> |
|
164 It is meant to be used as a mixin class. |
|
165 </p> |
|
166 <h3>Derived from</h3> |
|
167 object |
|
168 <h3>Class Attributes</h3> |
|
169 <table> |
|
170 <tr><td>None</td></tr> |
|
171 </table> |
|
172 <h3>Class Methods</h3> |
|
173 <table> |
|
174 <tr><td>None</td></tr> |
|
175 </table> |
|
176 <h3>Methods</h3> |
|
177 <table> |
|
178 <tr> |
|
179 <td><a href="#ProjectBrowserItemMixin.__init__">ProjectBrowserItemMixin</a></td> |
|
180 <td>Constructor</td> |
|
181 </tr><tr> |
|
182 <td><a href="#ProjectBrowserItemMixin.addProjectType">addProjectType</a></td> |
|
183 <td>Public method to add a type to the list.</td> |
|
184 </tr><tr> |
|
185 <td><a href="#ProjectBrowserItemMixin.addVcsStatus">addVcsStatus</a></td> |
|
186 <td>Public method to add the VCS status.</td> |
|
187 </tr><tr> |
|
188 <td><a href="#ProjectBrowserItemMixin.getProjectTypes">getProjectTypes</a></td> |
|
189 <td>Public method to get the project type.</td> |
|
190 </tr><tr> |
|
191 <td><a href="#ProjectBrowserItemMixin.getTextColor">getTextColor</a></td> |
|
192 <td>Public method to get the items text color.</td> |
|
193 </tr><tr> |
|
194 <td><a href="#ProjectBrowserItemMixin.setVcsState">setVcsState</a></td> |
|
195 <td>Public method to set the items VCS state.</td> |
|
196 </tr><tr> |
|
197 <td><a href="#ProjectBrowserItemMixin.setVcsStatus">setVcsStatus</a></td> |
|
198 <td>Public method to set the VCS status.</td> |
|
199 </tr> |
|
200 </table> |
|
201 <h3>Static Methods</h3> |
|
202 <table> |
|
203 <tr><td>None</td></tr> |
|
204 </table> |
|
205 <a NAME="ProjectBrowserItemMixin.__init__" ID="ProjectBrowserItemMixin.__init__"></a> |
|
206 <h4>ProjectBrowserItemMixin (Constructor)</h4> |
|
207 <b>ProjectBrowserItemMixin</b>(<i>type_, bold=False</i>) |
|
208 <p> |
|
209 Constructor |
|
210 </p><dl> |
|
211 <dt><i>type_</i></dt> |
|
212 <dd> |
|
213 type of file/directory in the project |
|
214 </dd><dt><i>bold</i></dt> |
|
215 <dd> |
|
216 flag indicating a highlighted font |
|
217 </dd> |
|
218 </dl><a NAME="ProjectBrowserItemMixin.addProjectType" ID="ProjectBrowserItemMixin.addProjectType"></a> |
|
219 <h4>ProjectBrowserItemMixin.addProjectType</h4> |
|
220 <b>addProjectType</b>(<i>type_</i>) |
|
221 <p> |
|
222 Public method to add a type to the list. |
|
223 </p><dl> |
|
224 <dt><i>type_</i></dt> |
|
225 <dd> |
|
226 type to add to the list |
|
227 </dd> |
|
228 </dl><a NAME="ProjectBrowserItemMixin.addVcsStatus" ID="ProjectBrowserItemMixin.addVcsStatus"></a> |
|
229 <h4>ProjectBrowserItemMixin.addVcsStatus</h4> |
|
230 <b>addVcsStatus</b>(<i>vcsStatus</i>) |
|
231 <p> |
|
232 Public method to add the VCS status. |
|
233 </p><dl> |
|
234 <dt><i>vcsStatus</i></dt> |
|
235 <dd> |
|
236 VCS status text (string) |
|
237 </dd> |
|
238 </dl><a NAME="ProjectBrowserItemMixin.getProjectTypes" ID="ProjectBrowserItemMixin.getProjectTypes"></a> |
|
239 <h4>ProjectBrowserItemMixin.getProjectTypes</h4> |
|
240 <b>getProjectTypes</b>(<i></i>) |
|
241 <p> |
|
242 Public method to get the project type. |
|
243 </p><dl> |
|
244 <dt>Returns:</dt> |
|
245 <dd> |
|
246 project type |
|
247 </dd> |
|
248 </dl><a NAME="ProjectBrowserItemMixin.getTextColor" ID="ProjectBrowserItemMixin.getTextColor"></a> |
|
249 <h4>ProjectBrowserItemMixin.getTextColor</h4> |
|
250 <b>getTextColor</b>(<i></i>) |
|
251 <p> |
|
252 Public method to get the items text color. |
|
253 </p><dl> |
|
254 <dt>Returns:</dt> |
|
255 <dd> |
|
256 text color (QColor) |
|
257 </dd> |
|
258 </dl><a NAME="ProjectBrowserItemMixin.setVcsState" ID="ProjectBrowserItemMixin.setVcsState"></a> |
|
259 <h4>ProjectBrowserItemMixin.setVcsState</h4> |
|
260 <b>setVcsState</b>(<i>state</i>) |
|
261 <p> |
|
262 Public method to set the items VCS state. |
|
263 </p><dl> |
|
264 <dt><i>state</i></dt> |
|
265 <dd> |
|
266 VCS state (one of A, C, M, U or " ") (string) |
|
267 </dd> |
|
268 </dl><a NAME="ProjectBrowserItemMixin.setVcsStatus" ID="ProjectBrowserItemMixin.setVcsStatus"></a> |
|
269 <h4>ProjectBrowserItemMixin.setVcsStatus</h4> |
|
270 <b>setVcsStatus</b>(<i>vcsStatus</i>) |
|
271 <p> |
|
272 Public method to set the VCS status. |
|
273 </p><dl> |
|
274 <dt><i>vcsStatus</i></dt> |
|
275 <dd> |
|
276 VCS status text (string) |
|
277 </dd> |
|
278 </dl> |
|
279 <div align="right"><a href="#top">Up</a></div> |
|
280 <hr /><hr /> |
|
281 <a NAME="ProjectBrowserModel" ID="ProjectBrowserModel"></a> |
|
282 <h2>ProjectBrowserModel</h2> |
|
283 <p> |
|
284 Class implementing the project browser model. |
|
285 </p><h3>Signals</h3> |
|
286 <dl> |
|
287 <dt>vcsStateChanged(str)</dt> |
|
288 <dd> |
|
289 emitted after the VCS state has changed |
|
290 </dd> |
|
291 </dl> |
|
292 <h3>Derived from</h3> |
|
293 BrowserModel |
|
294 <h3>Class Attributes</h3> |
|
295 <table> |
|
296 <tr><td>None</td></tr> |
|
297 </table> |
|
298 <h3>Class Methods</h3> |
|
299 <table> |
|
300 <tr><td>None</td></tr> |
|
301 </table> |
|
302 <h3>Methods</h3> |
|
303 <table> |
|
304 <tr> |
|
305 <td><a href="#ProjectBrowserModel.__init__">ProjectBrowserModel</a></td> |
|
306 <td>Constructor</td> |
|
307 </tr><tr> |
|
308 <td><a href="#ProjectBrowserModel.__addVCSStatus">__addVCSStatus</a></td> |
|
309 <td>Private method used to set the vcs status of a node.</td> |
|
310 </tr><tr> |
|
311 <td><a href="#ProjectBrowserModel.__changeParentsVCSState">__changeParentsVCSState</a></td> |
|
312 <td>Private method to recursively change the parents VCS state.</td> |
|
313 </tr><tr> |
|
314 <td><a href="#ProjectBrowserModel.__updateVCSStatus">__updateVCSStatus</a></td> |
|
315 <td>Private method used to update the vcs status of a node.</td> |
|
316 </tr><tr> |
|
317 <td><a href="#ProjectBrowserModel.addNewItem">addNewItem</a></td> |
|
318 <td>Public method to add a new item to the model.</td> |
|
319 </tr><tr> |
|
320 <td><a href="#ProjectBrowserModel.changeVCSStates">changeVCSStates</a></td> |
|
321 <td>Public slot to record the (non normal) VCS states.</td> |
|
322 </tr><tr> |
|
323 <td><a href="#ProjectBrowserModel.data">data</a></td> |
|
324 <td>Public method to get data of an item.</td> |
|
325 </tr><tr> |
|
326 <td><a href="#ProjectBrowserModel.directoryChanged">directoryChanged</a></td> |
|
327 <td>Public slot to handle the directoryChanged signal of the watcher.</td> |
|
328 </tr><tr> |
|
329 <td><a href="#ProjectBrowserModel.findChildItem">findChildItem</a></td> |
|
330 <td>Public method to find a child item given some text.</td> |
|
331 </tr><tr> |
|
332 <td><a href="#ProjectBrowserModel.findItem">findItem</a></td> |
|
333 <td>Public method to find an item given its name.</td> |
|
334 </tr><tr> |
|
335 <td><a href="#ProjectBrowserModel.findParentItemByName">findParentItemByName</a></td> |
|
336 <td>Public method to find an item given its name.</td> |
|
337 </tr><tr> |
|
338 <td><a href="#ProjectBrowserModel.itemIndexByName">itemIndexByName</a></td> |
|
339 <td>Public method to find an item's index given its name.</td> |
|
340 </tr><tr> |
|
341 <td><a href="#ProjectBrowserModel.itemIndexByNameAndLine">itemIndexByNameAndLine</a></td> |
|
342 <td>Public method to find an item's index given its name.</td> |
|
343 </tr><tr> |
|
344 <td><a href="#ProjectBrowserModel.populateItem">populateItem</a></td> |
|
345 <td>Public method to populate an item's subtree.</td> |
|
346 </tr><tr> |
|
347 <td><a href="#ProjectBrowserModel.populateProjectDirectoryItem">populateProjectDirectoryItem</a></td> |
|
348 <td>Public method to populate a directory item's subtree.</td> |
|
349 </tr><tr> |
|
350 <td><a href="#ProjectBrowserModel.preferencesChanged">preferencesChanged</a></td> |
|
351 <td>Public method used to handle a change in preferences.</td> |
|
352 </tr><tr> |
|
353 <td><a href="#ProjectBrowserModel.projectClosed">projectClosed</a></td> |
|
354 <td>Public method called after a project has been closed.</td> |
|
355 </tr><tr> |
|
356 <td><a href="#ProjectBrowserModel.projectOpened">projectOpened</a></td> |
|
357 <td>Public method used to populate the model after a project has been opened.</td> |
|
358 </tr><tr> |
|
359 <td><a href="#ProjectBrowserModel.projectPropertiesChanged">projectPropertiesChanged</a></td> |
|
360 <td>Public method to react on a change of the project properties.</td> |
|
361 </tr><tr> |
|
362 <td><a href="#ProjectBrowserModel.removeItem">removeItem</a></td> |
|
363 <td>Public method to remove a named item.</td> |
|
364 </tr><tr> |
|
365 <td><a href="#ProjectBrowserModel.renameItem">renameItem</a></td> |
|
366 <td>Public method to rename an item.</td> |
|
367 </tr><tr> |
|
368 <td><a href="#ProjectBrowserModel.repopulateItem">repopulateItem</a></td> |
|
369 <td>Public method to repopulate an item.</td> |
|
370 </tr><tr> |
|
371 <td><a href="#ProjectBrowserModel.updateVCSStatus">updateVCSStatus</a></td> |
|
372 <td>Public method used to update the vcs status of a node.</td> |
|
373 </tr> |
|
374 </table> |
|
375 <h3>Static Methods</h3> |
|
376 <table> |
|
377 <tr><td>None</td></tr> |
|
378 </table> |
|
379 <a NAME="ProjectBrowserModel.__init__" ID="ProjectBrowserModel.__init__"></a> |
|
380 <h4>ProjectBrowserModel (Constructor)</h4> |
|
381 <b>ProjectBrowserModel</b>(<i>parent</i>) |
|
382 <p> |
|
383 Constructor |
|
384 </p><dl> |
|
385 <dt><i>parent</i></dt> |
|
386 <dd> |
|
387 reference to parent object (Project.Project) |
|
388 </dd> |
|
389 </dl><a NAME="ProjectBrowserModel.__addVCSStatus" ID="ProjectBrowserModel.__addVCSStatus"></a> |
|
390 <h4>ProjectBrowserModel.__addVCSStatus</h4> |
|
391 <b>__addVCSStatus</b>(<i>item, name</i>) |
|
392 <p> |
|
393 Private method used to set the vcs status of a node. |
|
394 </p><dl> |
|
395 <dt><i>item</i></dt> |
|
396 <dd> |
|
397 item to work on |
|
398 </dd><dt><i>name</i></dt> |
|
399 <dd> |
|
400 filename belonging to this item (string) |
|
401 </dd> |
|
402 </dl><a NAME="ProjectBrowserModel.__changeParentsVCSState" ID="ProjectBrowserModel.__changeParentsVCSState"></a> |
|
403 <h4>ProjectBrowserModel.__changeParentsVCSState</h4> |
|
404 <b>__changeParentsVCSState</b>(<i>path, itemCache</i>) |
|
405 <p> |
|
406 Private method to recursively change the parents VCS state. |
|
407 </p><dl> |
|
408 <dt><i>path</i></dt> |
|
409 <dd> |
|
410 pathname of parent item (string) |
|
411 </dd><dt><i>itemCache</i></dt> |
|
412 <dd> |
|
413 reference to the item cache used to store |
|
414 references to named items |
|
415 </dd> |
|
416 </dl><a NAME="ProjectBrowserModel.__updateVCSStatus" ID="ProjectBrowserModel.__updateVCSStatus"></a> |
|
417 <h4>ProjectBrowserModel.__updateVCSStatus</h4> |
|
418 <b>__updateVCSStatus</b>(<i>item, name, recursive=True</i>) |
|
419 <p> |
|
420 Private method used to update the vcs status of a node. |
|
421 </p><dl> |
|
422 <dt><i>item</i></dt> |
|
423 <dd> |
|
424 item to work on |
|
425 </dd><dt><i>name</i></dt> |
|
426 <dd> |
|
427 filename belonging to this item (string) |
|
428 </dd><dt><i>recursive=</i></dt> |
|
429 <dd> |
|
430 flag indicating a recursive update (boolean) |
|
431 </dd> |
|
432 </dl><a NAME="ProjectBrowserModel.addNewItem" ID="ProjectBrowserModel.addNewItem"></a> |
|
433 <h4>ProjectBrowserModel.addNewItem</h4> |
|
434 <b>addNewItem</b>(<i>typeString, name, additionalTypeStrings=[]</i>) |
|
435 <p> |
|
436 Public method to add a new item to the model. |
|
437 </p><dl> |
|
438 <dt><i>typeString</i></dt> |
|
439 <dd> |
|
440 string denoting the type of the new item (string) |
|
441 </dd><dt><i>name</i></dt> |
|
442 <dd> |
|
443 name of the new item (string) |
|
444 </dd><dt><i>additionalTypeStrings</i></dt> |
|
445 <dd> |
|
446 names of additional types (list of string) |
|
447 </dd> |
|
448 </dl><a NAME="ProjectBrowserModel.changeVCSStates" ID="ProjectBrowserModel.changeVCSStates"></a> |
|
449 <h4>ProjectBrowserModel.changeVCSStates</h4> |
|
450 <b>changeVCSStates</b>(<i>statesList</i>) |
|
451 <p> |
|
452 Public slot to record the (non normal) VCS states. |
|
453 </p><dl> |
|
454 <dt><i>statesList</i></dt> |
|
455 <dd> |
|
456 list of VCS state entries (list of strings) giving |
|
457 the states in the first column and the path relative to the project |
|
458 directory starting with the third column. The allowed status flags |
|
459 are: |
|
460 <ul> |
|
461 <li>"A" path was added but not yet comitted</li> |
|
462 <li>"M" path has local changes</li> |
|
463 <li>"O" path was removed</li> |
|
464 <li>"R" path was deleted and then re-added</li> |
|
465 <li>"U" path needs an update</li> |
|
466 <li>"Z" path contains a conflict</li> |
|
467 <li>" " path is back at normal</li> |
|
468 </ul> |
|
469 </dd> |
|
470 </dl><a NAME="ProjectBrowserModel.data" ID="ProjectBrowserModel.data"></a> |
|
471 <h4>ProjectBrowserModel.data</h4> |
|
472 <b>data</b>(<i>index, role</i>) |
|
473 <p> |
|
474 Public method to get data of an item. |
|
475 </p><dl> |
|
476 <dt><i>index</i></dt> |
|
477 <dd> |
|
478 index of the data to retrieve (QModelIndex) |
|
479 </dd><dt><i>role</i></dt> |
|
480 <dd> |
|
481 role of data (Qt.ItemDataRole) |
|
482 </dd> |
|
483 </dl><dl> |
|
484 <dt>Returns:</dt> |
|
485 <dd> |
|
486 requested data |
|
487 </dd> |
|
488 </dl><a NAME="ProjectBrowserModel.directoryChanged" ID="ProjectBrowserModel.directoryChanged"></a> |
|
489 <h4>ProjectBrowserModel.directoryChanged</h4> |
|
490 <b>directoryChanged</b>(<i>path</i>) |
|
491 <p> |
|
492 Public slot to handle the directoryChanged signal of the watcher. |
|
493 </p><dl> |
|
494 <dt><i>path</i></dt> |
|
495 <dd> |
|
496 path of the directory (string) |
|
497 </dd> |
|
498 </dl><a NAME="ProjectBrowserModel.findChildItem" ID="ProjectBrowserModel.findChildItem"></a> |
|
499 <h4>ProjectBrowserModel.findChildItem</h4> |
|
500 <b>findChildItem</b>(<i>text, column, parentItem=None</i>) |
|
501 <p> |
|
502 Public method to find a child item given some text. |
|
503 </p><dl> |
|
504 <dt><i>text</i></dt> |
|
505 <dd> |
|
506 text to search for (string) |
|
507 </dd><dt><i>column</i></dt> |
|
508 <dd> |
|
509 column to search in (integer) |
|
510 </dd><dt><i>parentItem</i></dt> |
|
511 <dd> |
|
512 reference to parent item |
|
513 </dd> |
|
514 </dl><dl> |
|
515 <dt>Returns:</dt> |
|
516 <dd> |
|
517 reference to the item found |
|
518 </dd> |
|
519 </dl><a NAME="ProjectBrowserModel.findItem" ID="ProjectBrowserModel.findItem"></a> |
|
520 <h4>ProjectBrowserModel.findItem</h4> |
|
521 <b>findItem</b>(<i>name</i>) |
|
522 <p> |
|
523 Public method to find an item given its name. |
|
524 </p><dl> |
|
525 <dt><i>name</i></dt> |
|
526 <dd> |
|
527 name of the item (string) |
|
528 </dd> |
|
529 </dl><dl> |
|
530 <dt>Returns:</dt> |
|
531 <dd> |
|
532 reference to the item found |
|
533 </dd> |
|
534 </dl><a NAME="ProjectBrowserModel.findParentItemByName" ID="ProjectBrowserModel.findParentItemByName"></a> |
|
535 <h4>ProjectBrowserModel.findParentItemByName</h4> |
|
536 <b>findParentItemByName</b>(<i>type_, name, dontSplit=False</i>) |
|
537 <p> |
|
538 Public method to find an item given its name. |
|
539 </p><p> |
|
540 <b>Note</b>: This method creates all necessary parent items, if they |
|
541 don't exist. |
|
542 </p><dl> |
|
543 <dt><i>type_</i></dt> |
|
544 <dd> |
|
545 type of the item |
|
546 </dd><dt><i>name</i></dt> |
|
547 <dd> |
|
548 name of the item (string) |
|
549 </dd><dt><i>dontSplit</i></dt> |
|
550 <dd> |
|
551 flag indicating the name should not be split (boolean) |
|
552 </dd> |
|
553 </dl><dl> |
|
554 <dt>Returns:</dt> |
|
555 <dd> |
|
556 reference to the item found and the new display name (string) |
|
557 </dd> |
|
558 </dl><a NAME="ProjectBrowserModel.itemIndexByName" ID="ProjectBrowserModel.itemIndexByName"></a> |
|
559 <h4>ProjectBrowserModel.itemIndexByName</h4> |
|
560 <b>itemIndexByName</b>(<i>name</i>) |
|
561 <p> |
|
562 Public method to find an item's index given its name. |
|
563 </p><dl> |
|
564 <dt><i>name</i></dt> |
|
565 <dd> |
|
566 name of the item (string) |
|
567 </dd> |
|
568 </dl><dl> |
|
569 <dt>Returns:</dt> |
|
570 <dd> |
|
571 index of the item found (QModelIndex) |
|
572 </dd> |
|
573 </dl><a NAME="ProjectBrowserModel.itemIndexByNameAndLine" ID="ProjectBrowserModel.itemIndexByNameAndLine"></a> |
|
574 <h4>ProjectBrowserModel.itemIndexByNameAndLine</h4> |
|
575 <b>itemIndexByNameAndLine</b>(<i>name, lineno</i>) |
|
576 <p> |
|
577 Public method to find an item's index given its name. |
|
578 </p><dl> |
|
579 <dt><i>name</i></dt> |
|
580 <dd> |
|
581 name of the item (string) |
|
582 </dd><dt><i>lineno</i></dt> |
|
583 <dd> |
|
584 one based line number of the item (integer) |
|
585 </dd> |
|
586 </dl><dl> |
|
587 <dt>Returns:</dt> |
|
588 <dd> |
|
589 index of the item found (QModelIndex) |
|
590 </dd> |
|
591 </dl><a NAME="ProjectBrowserModel.populateItem" ID="ProjectBrowserModel.populateItem"></a> |
|
592 <h4>ProjectBrowserModel.populateItem</h4> |
|
593 <b>populateItem</b>(<i>parentItem, repopulate=False</i>) |
|
594 <p> |
|
595 Public method to populate an item's subtree. |
|
596 </p><dl> |
|
597 <dt><i>parentItem</i></dt> |
|
598 <dd> |
|
599 reference to the item to be populated |
|
600 </dd><dt><i>repopulate</i></dt> |
|
601 <dd> |
|
602 flag indicating a repopulation (boolean) |
|
603 </dd> |
|
604 </dl><a NAME="ProjectBrowserModel.populateProjectDirectoryItem" ID="ProjectBrowserModel.populateProjectDirectoryItem"></a> |
|
605 <h4>ProjectBrowserModel.populateProjectDirectoryItem</h4> |
|
606 <b>populateProjectDirectoryItem</b>(<i>parentItem, repopulate=False</i>) |
|
607 <p> |
|
608 Public method to populate a directory item's subtree. |
|
609 </p><dl> |
|
610 <dt><i>parentItem</i></dt> |
|
611 <dd> |
|
612 reference to the directory item to be populated |
|
613 </dd><dt><i>repopulate</i></dt> |
|
614 <dd> |
|
615 flag indicating a repopulation (boolean) |
|
616 </dd> |
|
617 </dl><a NAME="ProjectBrowserModel.preferencesChanged" ID="ProjectBrowserModel.preferencesChanged"></a> |
|
618 <h4>ProjectBrowserModel.preferencesChanged</h4> |
|
619 <b>preferencesChanged</b>(<i></i>) |
|
620 <p> |
|
621 Public method used to handle a change in preferences. |
|
622 </p><a NAME="ProjectBrowserModel.projectClosed" ID="ProjectBrowserModel.projectClosed"></a> |
|
623 <h4>ProjectBrowserModel.projectClosed</h4> |
|
624 <b>projectClosed</b>(<i></i>) |
|
625 <p> |
|
626 Public method called after a project has been closed. |
|
627 </p><a NAME="ProjectBrowserModel.projectOpened" ID="ProjectBrowserModel.projectOpened"></a> |
|
628 <h4>ProjectBrowserModel.projectOpened</h4> |
|
629 <b>projectOpened</b>(<i></i>) |
|
630 <p> |
|
631 Public method used to populate the model after a project has been |
|
632 opened. |
|
633 </p><a NAME="ProjectBrowserModel.projectPropertiesChanged" ID="ProjectBrowserModel.projectPropertiesChanged"></a> |
|
634 <h4>ProjectBrowserModel.projectPropertiesChanged</h4> |
|
635 <b>projectPropertiesChanged</b>(<i></i>) |
|
636 <p> |
|
637 Public method to react on a change of the project properties. |
|
638 </p><a NAME="ProjectBrowserModel.removeItem" ID="ProjectBrowserModel.removeItem"></a> |
|
639 <h4>ProjectBrowserModel.removeItem</h4> |
|
640 <b>removeItem</b>(<i>name</i>) |
|
641 <p> |
|
642 Public method to remove a named item. |
|
643 </p><dl> |
|
644 <dt><i>name</i></dt> |
|
645 <dd> |
|
646 file or directory name of the item (string). |
|
647 </dd> |
|
648 </dl><a NAME="ProjectBrowserModel.renameItem" ID="ProjectBrowserModel.renameItem"></a> |
|
649 <h4>ProjectBrowserModel.renameItem</h4> |
|
650 <b>renameItem</b>(<i>name, newFilename</i>) |
|
651 <p> |
|
652 Public method to rename an item. |
|
653 </p><dl> |
|
654 <dt><i>name</i></dt> |
|
655 <dd> |
|
656 the old display name (string) |
|
657 </dd><dt><i>newFilename</i></dt> |
|
658 <dd> |
|
659 new filename of the item (string) |
|
660 </dd> |
|
661 </dl><a NAME="ProjectBrowserModel.repopulateItem" ID="ProjectBrowserModel.repopulateItem"></a> |
|
662 <h4>ProjectBrowserModel.repopulateItem</h4> |
|
663 <b>repopulateItem</b>(<i>name</i>) |
|
664 <p> |
|
665 Public method to repopulate an item. |
|
666 </p><dl> |
|
667 <dt><i>name</i></dt> |
|
668 <dd> |
|
669 name of the file relative to the project root (string) |
|
670 </dd> |
|
671 </dl><a NAME="ProjectBrowserModel.updateVCSStatus" ID="ProjectBrowserModel.updateVCSStatus"></a> |
|
672 <h4>ProjectBrowserModel.updateVCSStatus</h4> |
|
673 <b>updateVCSStatus</b>(<i>name, recursive=True</i>) |
|
674 <p> |
|
675 Public method used to update the vcs status of a node. |
|
676 </p><dl> |
|
677 <dt><i>name</i></dt> |
|
678 <dd> |
|
679 filename belonging to this item (string) |
|
680 </dd><dt><i>recursive</i></dt> |
|
681 <dd> |
|
682 flag indicating a recursive update (boolean) |
|
683 </dd> |
|
684 </dl> |
|
685 <div align="right"><a href="#top">Up</a></div> |
|
686 <hr /><hr /> |
|
687 <a NAME="ProjectBrowserSimpleDirectoryItem" ID="ProjectBrowserSimpleDirectoryItem"></a> |
|
688 <h2>ProjectBrowserSimpleDirectoryItem</h2> |
|
689 <p> |
|
690 Class implementing the data structure for project browser simple directory |
|
691 items. |
|
692 </p> |
|
693 <h3>Derived from</h3> |
|
694 BrowserItem, ProjectBrowserItemMixin |
|
695 <h3>Class Attributes</h3> |
|
696 <table> |
|
697 <tr><td>None</td></tr> |
|
698 </table> |
|
699 <h3>Class Methods</h3> |
|
700 <table> |
|
701 <tr><td>None</td></tr> |
|
702 </table> |
|
703 <h3>Methods</h3> |
|
704 <table> |
|
705 <tr> |
|
706 <td><a href="#ProjectBrowserSimpleDirectoryItem.__init__">ProjectBrowserSimpleDirectoryItem</a></td> |
|
707 <td>Constructor</td> |
|
708 </tr><tr> |
|
709 <td><a href="#ProjectBrowserSimpleDirectoryItem.dirName">dirName</a></td> |
|
710 <td>Public method returning the directory name.</td> |
|
711 </tr><tr> |
|
712 <td><a href="#ProjectBrowserSimpleDirectoryItem.lessThan">lessThan</a></td> |
|
713 <td>Public method to check, if the item is less than the other one.</td> |
|
714 </tr><tr> |
|
715 <td><a href="#ProjectBrowserSimpleDirectoryItem.name">name</a></td> |
|
716 <td>Public method to return the name of the item.</td> |
|
717 </tr><tr> |
|
718 <td><a href="#ProjectBrowserSimpleDirectoryItem.setName">setName</a></td> |
|
719 <td>Public method to set the directory name.</td> |
|
720 </tr> |
|
721 </table> |
|
722 <h3>Static Methods</h3> |
|
723 <table> |
|
724 <tr><td>None</td></tr> |
|
725 </table> |
|
726 <a NAME="ProjectBrowserSimpleDirectoryItem.__init__" ID="ProjectBrowserSimpleDirectoryItem.__init__"></a> |
|
727 <h4>ProjectBrowserSimpleDirectoryItem (Constructor)</h4> |
|
728 <b>ProjectBrowserSimpleDirectoryItem</b>(<i>parent, projectType, text, path=""</i>) |
|
729 <p> |
|
730 Constructor |
|
731 </p><dl> |
|
732 <dt><i>parent</i></dt> |
|
733 <dd> |
|
734 parent item |
|
735 </dd><dt><i>projectType</i></dt> |
|
736 <dd> |
|
737 type of file/directory in the project |
|
738 </dd><dt><i>text</i></dt> |
|
739 <dd> |
|
740 text to be displayed (string) |
|
741 </dd><dt><i>path</i></dt> |
|
742 <dd> |
|
743 path of the directory (string) |
|
744 </dd> |
|
745 </dl><a NAME="ProjectBrowserSimpleDirectoryItem.dirName" ID="ProjectBrowserSimpleDirectoryItem.dirName"></a> |
|
746 <h4>ProjectBrowserSimpleDirectoryItem.dirName</h4> |
|
747 <b>dirName</b>(<i></i>) |
|
748 <p> |
|
749 Public method returning the directory name. |
|
750 </p><dl> |
|
751 <dt>Returns:</dt> |
|
752 <dd> |
|
753 directory name (string) |
|
754 </dd> |
|
755 </dl><a NAME="ProjectBrowserSimpleDirectoryItem.lessThan" ID="ProjectBrowserSimpleDirectoryItem.lessThan"></a> |
|
756 <h4>ProjectBrowserSimpleDirectoryItem.lessThan</h4> |
|
757 <b>lessThan</b>(<i>other, column, order</i>) |
|
758 <p> |
|
759 Public method to check, if the item is less than the other one. |
|
760 </p><dl> |
|
761 <dt><i>other</i></dt> |
|
762 <dd> |
|
763 reference to item to compare against (BrowserItem) |
|
764 </dd><dt><i>column</i></dt> |
|
765 <dd> |
|
766 column number to use for the comparison (integer) |
|
767 </dd><dt><i>order</i></dt> |
|
768 <dd> |
|
769 sort order (Qt.SortOrder) (for special sorting) |
|
770 </dd> |
|
771 </dl><dl> |
|
772 <dt>Returns:</dt> |
|
773 <dd> |
|
774 true, if this item is less than other (boolean) |
|
775 </dd> |
|
776 </dl><a NAME="ProjectBrowserSimpleDirectoryItem.name" ID="ProjectBrowserSimpleDirectoryItem.name"></a> |
|
777 <h4>ProjectBrowserSimpleDirectoryItem.name</h4> |
|
778 <b>name</b>(<i></i>) |
|
779 <p> |
|
780 Public method to return the name of the item. |
|
781 </p><dl> |
|
782 <dt>Returns:</dt> |
|
783 <dd> |
|
784 name of the item (string) |
|
785 </dd> |
|
786 </dl><a NAME="ProjectBrowserSimpleDirectoryItem.setName" ID="ProjectBrowserSimpleDirectoryItem.setName"></a> |
|
787 <h4>ProjectBrowserSimpleDirectoryItem.setName</h4> |
|
788 <b>setName</b>(<i>dinfo, full=True</i>) |
|
789 <p> |
|
790 Public method to set the directory name. |
|
791 </p><dl> |
|
792 <dt><i>dinfo</i></dt> |
|
793 <dd> |
|
794 dinfo is the string for the directory (string) |
|
795 </dd><dt><i>full</i></dt> |
|
796 <dd> |
|
797 flag indicating full pathname should be displayed (boolean) |
|
798 </dd> |
|
799 </dl> |
|
800 <div align="right"><a href="#top">Up</a></div> |
|
801 <hr /> |
|
802 </body></html> |