1 | <!doctype html>
|
---|
2 | <html>
|
---|
3 | <head>
|
---|
4 | <title>/home/haiku/haiku/haiku/src/kits/tracker/DirMenu.cpp</title>
|
---|
5 | <style type="text/css">
|
---|
6 | body { color:#000000; background-color:#ffffff }
|
---|
7 | body { font-family:Helvetica, sans-serif; font-size:10pt }
|
---|
8 | h1 { font-size:14pt }
|
---|
9 | .code { border-collapse:collapse; width:100%; }
|
---|
10 | .code { font-family: "Monospace", monospace; font-size:10pt }
|
---|
11 | .code { line-height: 1.2em }
|
---|
12 | .comment { color: green; font-style: oblique }
|
---|
13 | .keyword { color: blue }
|
---|
14 | .string_literal { color: red }
|
---|
15 | .directive { color: darkmagenta }
|
---|
16 | .expansion { display: none; }
|
---|
17 | .macro:hover .expansion { display: block; border: 2px solid #FF0000; padding: 2px; background-color:#FFF0F0; font-weight: normal; -webkit-border-radius:5px; -webkit-box-shadow:1px 1px 7px #000; border-radius:5px; box-shadow:1px 1px 7px #000; position: absolute; top: -1em; left:10em; z-index: 1 }
|
---|
18 | .macro { color: darkmagenta; background-color:LemonChiffon; position: relative }
|
---|
19 | .num { width:2.5em; padding-right:2ex; background-color:#eeeeee }
|
---|
20 | .num { text-align:right; font-size:8pt }
|
---|
21 | .num { color:#444444 }
|
---|
22 | .line { padding-left: 1ex; border-left: 3px solid #ccc }
|
---|
23 | .line { white-space: pre }
|
---|
24 | .msg { -webkit-box-shadow:1px 1px 7px #000 }
|
---|
25 | .msg { box-shadow:1px 1px 7px #000 }
|
---|
26 | .msg { -webkit-border-radius:5px }
|
---|
27 | .msg { border-radius:5px }
|
---|
28 | .msg { font-family:Helvetica, sans-serif; font-size:8pt }
|
---|
29 | .msg { float:left }
|
---|
30 | .msg { padding:0.25em 1ex 0.25em 1ex }
|
---|
31 | .msg { margin-top:10px; margin-bottom:10px }
|
---|
32 | .msg { font-weight:bold }
|
---|
33 | .msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap }
|
---|
34 | .msgT { padding:0x; spacing:0x }
|
---|
35 | .msgEvent { background-color:#fff8b4; color:#000000 }
|
---|
36 | .msgControl { background-color:#bbbbbb; color:#000000 }
|
---|
37 | .msgNote { background-color:#ddeeff; color:#000000 }
|
---|
38 | .mrange { background-color:#dfddf3 }
|
---|
39 | .mrange { border-bottom:1px solid #6F9DBE }
|
---|
40 | .PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; }
|
---|
41 | .PathIndex { -webkit-border-radius:8px }
|
---|
42 | .PathIndex { border-radius:8px }
|
---|
43 | .PathIndexEvent { background-color:#bfba87 }
|
---|
44 | .PathIndexControl { background-color:#8c8c8c }
|
---|
45 | .PathNav a { text-decoration:none; font-size: larger }
|
---|
46 | .CodeInsertionHint { font-weight: bold; background-color: #10dd10 }
|
---|
47 | .CodeRemovalHint { background-color:#de1010 }
|
---|
48 | .CodeRemovalHint { border-bottom:1px solid #6F9DBE }
|
---|
49 | table.simpletable {
|
---|
50 | padding: 5px;
|
---|
51 | font-size:12pt;
|
---|
52 | margin:20px;
|
---|
53 | border-collapse: collapse; border-spacing: 0px;
|
---|
54 | }
|
---|
55 | td.rowname {
|
---|
56 | text-align: right;
|
---|
57 | vertical-align: top;
|
---|
58 | font-weight: bold;
|
---|
59 | color:#444444;
|
---|
60 | padding-right:2ex;
|
---|
61 | }
|
---|
62 | </style>
|
---|
63 | </head>
|
---|
64 | <body>
|
---|
65 | <!-- BUGDESC Potential leak of memory pointed to by 'menu' -->
|
---|
66 |
|
---|
67 | <!-- BUGTYPE Memory leak -->
|
---|
68 |
|
---|
69 | <!-- BUGCATEGORY Memory Error -->
|
---|
70 |
|
---|
71 | <!-- BUGFILE /home/haiku/haiku/haiku/src/kits/tracker/DirMenu.cpp -->
|
---|
72 |
|
---|
73 | <!-- FILENAME DirMenu.cpp -->
|
---|
74 |
|
---|
75 | <!-- FUNCTIONNAME Populate -->
|
---|
76 |
|
---|
77 | <!-- ISSUEHASHCONTENTOFLINEINCONTEXT 94a97281ad87c7e2848d374e3e882aa0 -->
|
---|
78 |
|
---|
79 | <!-- BUGLINE 186 -->
|
---|
80 |
|
---|
81 | <!-- BUGCOLUMN 4 -->
|
---|
82 |
|
---|
83 | <!-- BUGPATHLENGTH 51 -->
|
---|
84 |
|
---|
85 | <!-- BUGMETAEND -->
|
---|
86 | <!-- REPORTHEADER -->
|
---|
87 | <h3>Bug Summary</h3>
|
---|
88 | <table class="simpletable">
|
---|
89 | <tr><td class="rowname">File:</td><td>src/kits/tracker/DirMenu.cpp</td></tr>
|
---|
90 | <tr><td class="rowname">Warning:</td><td><a href="#EndPath">line 186, column 4</a><br />Potential leak of memory pointed to by 'menu'</td></tr>
|
---|
91 | </table>
|
---|
92 | <!-- REPORTSUMMARYEXTRA -->
|
---|
93 | <h3>Annotated Source Code</h3>
|
---|
94 | <table class="code">
|
---|
95 | <tr><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/*</span></td></tr>
|
---|
96 | <tr><td class="num" id="LN2">2</td><td class="line"><span class='comment'>Open Tracker License</span></td></tr>
|
---|
97 | <tr><td class="num" id="LN3">3</td><td class="line"> </td></tr>
|
---|
98 | <tr><td class="num" id="LN4">4</td><td class="line"><span class='comment'>Terms and Conditions</span></td></tr>
|
---|
99 | <tr><td class="num" id="LN5">5</td><td class="line"> </td></tr>
|
---|
100 | <tr><td class="num" id="LN6">6</td><td class="line"><span class='comment'>Copyright (c) 1991-2000, Be Incorporated. All rights reserved.</span></td></tr>
|
---|
101 | <tr><td class="num" id="LN7">7</td><td class="line"> </td></tr>
|
---|
102 | <tr><td class="num" id="LN8">8</td><td class="line"><span class='comment'>Permission is hereby granted, free of charge, to any person obtaining a copy of</span></td></tr>
|
---|
103 | <tr><td class="num" id="LN9">9</td><td class="line"><span class='comment'>this software and associated documentation files (the "Software"), to deal in</span></td></tr>
|
---|
104 | <tr><td class="num" id="LN10">10</td><td class="line"><span class='comment'>the Software without restriction, including without limitation the rights to</span></td></tr>
|
---|
105 | <tr><td class="num" id="LN11">11</td><td class="line"><span class='comment'>use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies</span></td></tr>
|
---|
106 | <tr><td class="num" id="LN12">12</td><td class="line"><span class='comment'>of the Software, and to permit persons to whom the Software is furnished to do</span></td></tr>
|
---|
107 | <tr><td class="num" id="LN13">13</td><td class="line"><span class='comment'>so, subject to the following conditions:</span></td></tr>
|
---|
108 | <tr><td class="num" id="LN14">14</td><td class="line"> </td></tr>
|
---|
109 | <tr><td class="num" id="LN15">15</td><td class="line"><span class='comment'>The above copyright notice and this permission notice applies to all licensees</span></td></tr>
|
---|
110 | <tr><td class="num" id="LN16">16</td><td class="line"><span class='comment'>and shall be included in all copies or substantial portions of the Software.</span></td></tr>
|
---|
111 | <tr><td class="num" id="LN17">17</td><td class="line"> </td></tr>
|
---|
112 | <tr><td class="num" id="LN18">18</td><td class="line"><span class='comment'>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span></td></tr>
|
---|
113 | <tr><td class="num" id="LN19">19</td><td class="line"><span class='comment'>IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,</span></td></tr>
|
---|
114 | <tr><td class="num" id="LN20">20</td><td class="line"><span class='comment'>FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL</span></td></tr>
|
---|
115 | <tr><td class="num" id="LN21">21</td><td class="line"><span class='comment'>BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN</span></td></tr>
|
---|
116 | <tr><td class="num" id="LN22">22</td><td class="line"><span class='comment'>AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION</span></td></tr>
|
---|
117 | <tr><td class="num" id="LN23">23</td><td class="line"><span class='comment'>WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</span></td></tr>
|
---|
118 | <tr><td class="num" id="LN24">24</td><td class="line"> </td></tr>
|
---|
119 | <tr><td class="num" id="LN25">25</td><td class="line"><span class='comment'>Except as contained in this notice, the name of Be Incorporated shall not be</span></td></tr>
|
---|
120 | <tr><td class="num" id="LN26">26</td><td class="line"><span class='comment'>used in advertising or otherwise to promote the sale, use or other dealings in</span></td></tr>
|
---|
121 | <tr><td class="num" id="LN27">27</td><td class="line"><span class='comment'>this Software without prior written authorization from Be Incorporated.</span></td></tr>
|
---|
122 | <tr><td class="num" id="LN28">28</td><td class="line"> </td></tr>
|
---|
123 | <tr><td class="num" id="LN29">29</td><td class="line"><span class='comment'>Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks</span></td></tr>
|
---|
124 | <tr><td class="num" id="LN30">30</td><td class="line"><span class='comment'>of Be Incorporated in the United States and other countries. Other brand product</span></td></tr>
|
---|
125 | <tr><td class="num" id="LN31">31</td><td class="line"><span class='comment'>names are registered trademarks or trademarks of their respective holders.</span></td></tr>
|
---|
126 | <tr><td class="num" id="LN32">32</td><td class="line"><span class='comment'>All rights reserved.</span></td></tr>
|
---|
127 | <tr><td class="num" id="LN33">33</td><td class="line"><span class='comment'>*/</span></td></tr>
|
---|
128 | <tr><td class="num" id="LN34">34</td><td class="line"> </td></tr>
|
---|
129 | <tr><td class="num" id="LN35">35</td><td class="line"><span class='comment'>// ToDo:</span></td></tr>
|
---|
130 | <tr><td class="num" id="LN36">36</td><td class="line"><span class='comment'>// get rid of fMenuBar, SetMenuBar and related mess</span></td></tr>
|
---|
131 | <tr><td class="num" id="LN37">37</td><td class="line"> </td></tr>
|
---|
132 | <tr><td class="num" id="LN38">38</td><td class="line"> </td></tr>
|
---|
133 | <tr><td class="num" id="LN39">39</td><td class="line"><span class='directive'>#include <Catalog.h></span></td></tr>
|
---|
134 | <tr><td class="num" id="LN40">40</td><td class="line"><span class='directive'>#include <Debug.h></span></td></tr>
|
---|
135 | <tr><td class="num" id="LN41">41</td><td class="line"><span class='directive'>#include <Directory.h></span></td></tr>
|
---|
136 | <tr><td class="num" id="LN42">42</td><td class="line"><span class='directive'>#include <Locale.h></span></td></tr>
|
---|
137 | <tr><td class="num" id="LN43">43</td><td class="line"><span class='directive'>#include <MenuBar.h></span></td></tr>
|
---|
138 | <tr><td class="num" id="LN44">44</td><td class="line"><span class='directive'>#include <Path.h></span></td></tr>
|
---|
139 | <tr><td class="num" id="LN45">45</td><td class="line"><span class='directive'>#include <Volume.h></span></td></tr>
|
---|
140 | <tr><td class="num" id="LN46">46</td><td class="line"><span class='directive'>#include <VolumeRoster.h></span></td></tr>
|
---|
141 | <tr><td class="num" id="LN47">47</td><td class="line"> </td></tr>
|
---|
142 | <tr><td class="num" id="LN48">48</td><td class="line"><span class='directive'>#include "Attributes.h"</span></td></tr>
|
---|
143 | <tr><td class="num" id="LN49">49</td><td class="line"><span class='directive'>#include "ContainerWindow.h"</span></td></tr>
|
---|
144 | <tr><td class="num" id="LN50">50</td><td class="line"><span class='directive'>#include "DirMenu.h"</span></td></tr>
|
---|
145 | <tr><td class="num" id="LN51">51</td><td class="line"><span class='directive'>#include "FSUtils.h"</span></td></tr>
|
---|
146 | <tr><td class="num" id="LN52">52</td><td class="line"><span class='directive'>#include "IconMenuItem.h"</span></td></tr>
|
---|
147 | <tr><td class="num" id="LN53">53</td><td class="line"><span class='directive'>#include "NavMenu.h"</span></td></tr>
|
---|
148 | <tr><td class="num" id="LN54">54</td><td class="line"><span class='directive'>#include "TrackerSettings.h"</span></td></tr>
|
---|
149 | <tr><td class="num" id="LN55">55</td><td class="line"><span class='directive'>#include "Utilities.h"</span></td></tr>
|
---|
150 | <tr><td class="num" id="LN56">56</td><td class="line"> </td></tr>
|
---|
151 | <tr><td class="num" id="LN57">57</td><td class="line"> </td></tr>
|
---|
152 | <tr><td class="num" id="LN58">58</td><td class="line"><span class='directive'>#undef <span class='macro'>B_TRANSLATION_CONTEXT<span class='expansion'>"DirMenu"</span></span></span></td></tr>
|
---|
153 | <tr><td class="num" id="LN59">59</td><td class="line"><span class='directive'>#define <span class='macro'>B_TRANSLATION_CONTEXT<span class='expansion'>"DirMenu"</span></span> "DirMenu"</span></td></tr>
|
---|
154 | <tr><td class="num" id="LN60">60</td><td class="line"> </td></tr>
|
---|
155 | <tr><td class="num" id="LN61">61</td><td class="line"> </td></tr>
|
---|
156 | <tr><td class="num" id="LN62">62</td><td class="line"><span class='comment'>// #pragma mark - BDirMenu</span></td></tr>
|
---|
157 | <tr><td class="num" id="LN63">63</td><td class="line"> </td></tr>
|
---|
158 | <tr><td class="num" id="LN64">64</td><td class="line"> </td></tr>
|
---|
159 | <tr><td class="num" id="LN65">65</td><td class="line">BDirMenu::BDirMenu(BMenuBar* bar, BMessenger target, uint32 command,</td></tr>
|
---|
160 | <tr><td class="num" id="LN66">66</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span>* entryName)</td></tr>
|
---|
161 | <tr><td class="num" id="LN67">67</td><td class="line"> :</td></tr>
|
---|
162 | <tr><td class="num" id="LN68">68</td><td class="line"> BPopUpMenu(<span class='string_literal'>"directories"</span>),</td></tr>
|
---|
163 | <tr><td class="num" id="LN69">69</td><td class="line"> fTarget(target),</td></tr>
|
---|
164 | <tr><td class="num" id="LN70">70</td><td class="line"> fMenuBar(bar),</td></tr>
|
---|
165 | <tr><td class="num" id="LN71">71</td><td class="line"> fCommand(command)</td></tr>
|
---|
166 | <tr><td class="num" id="LN72">72</td><td class="line">{</td></tr>
|
---|
167 | <tr><td class="num" id="LN73">73</td><td class="line"> SetFont(be_plain_font);</td></tr>
|
---|
168 | <tr><td class="num" id="LN74">74</td><td class="line"> <span class='keyword'>if</span> (entryName)</td></tr>
|
---|
169 | <tr><td class="num" id="LN75">75</td><td class="line"> fEntryName = entryName;</td></tr>
|
---|
170 | <tr><td class="num" id="LN76">76</td><td class="line"> <span class='keyword'>else</span></td></tr>
|
---|
171 | <tr><td class="num" id="LN77">77</td><td class="line"> fEntryName = <span class='string_literal'>"refs"</span>;</td></tr>
|
---|
172 | <tr><td class="num" id="LN78">78</td><td class="line">}</td></tr>
|
---|
173 | <tr><td class="num" id="LN79">79</td><td class="line"> </td></tr>
|
---|
174 | <tr><td class="num" id="LN80">80</td><td class="line"> </td></tr>
|
---|
175 | <tr><td class="num" id="LN81">81</td><td class="line">BDirMenu::~BDirMenu()</td></tr>
|
---|
176 | <tr><td class="num" id="LN82">82</td><td class="line">{</td></tr>
|
---|
177 | <tr><td class="num" id="LN83">83</td><td class="line">}</td></tr>
|
---|
178 | <tr><td class="num" id="LN84">84</td><td class="line"> </td></tr>
|
---|
179 | <tr><td class="num" id="LN85">85</td><td class="line"> </td></tr>
|
---|
180 | <tr><td class="num" id="LN86">86</td><td class="line"><span class='keyword'>void</span></td></tr>
|
---|
181 | <tr><td class="num" id="LN87">87</td><td class="line">BDirMenu::Populate(<span class='keyword'>const</span> BEntry* startEntry, BWindow* originatingWindow,</td></tr>
|
---|
182 | <tr><td class="num" id="LN88">88</td><td class="line"> <span class='keyword'>bool</span> includeStartEntry, <span class='keyword'>bool</span> select, <span class='keyword'>bool</span> reverse, <span class='keyword'>bool</span> addShortcuts,</td></tr>
|
---|
183 | <tr><td class="num" id="LN89">89</td><td class="line"> <span class='keyword'>bool</span> navMenuEntries)</td></tr>
|
---|
184 | <tr><td class="num" id="LN90">90</td><td class="line">{</td></tr>
|
---|
185 | <tr><td class="num" id="LN91">91</td><td class="line"> <span class='keyword'>try</span> {</td></tr>
|
---|
186 | <tr><td class="num" id="LN92">92</td><td class="line"> <span class='keyword'>if</span> (<span class="mrange">!startEntry</span>)</td></tr>
|
---|
187 | <tr><td class="num"></td><td class="line"><div id="Path1" class="msg msgEvent" style="margin-left:21ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">1</div></td><td>Assuming 'startEntry' is non-null</td><td><div class="PathNav"><a href="#Path2" title="Next event (2)">→</a></div></td></tr></table></div></td></tr>
|
---|
188 | <tr><td class="num"></td><td class="line"><div id="Path2" class="msg msgControl" style="margin-left:17ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">2</div></td><td><div class="PathNav"><a href="#Path1" title="Previous event (1)">←</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path3" title="Next event (3)">→</a></div></td></tr></table></div></td></tr>
|
---|
189 | <tr><td class="num" id="LN93">93</td><td class="line"> <span class='keyword'>throw</span> (status_t)<span class='macro'>B_ERROR<span class='expansion'>(-1)</span></span>;</td></tr>
|
---|
190 | <tr><td class="num" id="LN94">94</td><td class="line"> </td></tr>
|
---|
191 | <tr><td class="num" id="LN95">95</td><td class="line"> Model model(startEntry);</td></tr>
|
---|
192 | <tr><td class="num" id="LN96">96</td><td class="line"> ThrowOnInitCheckError(&model);</td></tr>
|
---|
193 | <tr><td class="num" id="LN97">97</td><td class="line"> </td></tr>
|
---|
194 | <tr><td class="num" id="LN98">98</td><td class="line"> ModelMenuItem* menu = <span class="mrange"><span class='keyword'>new</span> ModelMenuItem(&model, <span class='keyword'>this</span>, <span class='keyword'>true</span>, <span class='keyword'>true</span>)</span>;</td></tr>
|
---|
195 | <tr><td class="num"></td><td class="line"><div id="Path3" class="msg msgEvent" style="margin-left:39ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">3</div></td><td><div class="PathNav"><a href="#Path2" title="Previous event (2)">←</a></div></td></td><td>Memory is allocated</td><td><div class="PathNav"><a href="#Path4" title="Next event (4)">→</a></div></td></tr></table></div></td></tr>
|
---|
196 | <tr><td class="num" id="LN99">99</td><td class="line"> </td></tr>
|
---|
197 | <tr><td class="num" id="LN100">100</td><td class="line"> <span class='keyword'>if</span> (<span class="mrange">fMenuBar</span>)</td></tr>
|
---|
198 | <tr><td class="num"></td><td class="line"><div id="Path4" class="msg msgEvent" style="margin-left:21ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">4</div></td><td><div class="PathNav"><a href="#Path3" title="Previous event (3)">←</a></div></td></td><td>Assuming the condition is false</td><td><div class="PathNav"><a href="#Path5" title="Next event (5)">→</a></div></td></tr></table></div></td></tr>
|
---|
199 | <tr><td class="num"></td><td class="line"><div id="Path5" class="msg msgControl" style="margin-left:17ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">5</div></td><td><div class="PathNav"><a href="#Path4" title="Previous event (4)">←</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path6" title="Next event (6)">→</a></div></td></tr></table></div></td></tr>
|
---|
200 | <tr><td class="num" id="LN101">101</td><td class="line"> fMenuBar->AddItem(menu);</td></tr>
|
---|
201 | <tr><td class="num" id="LN102">102</td><td class="line"> </td></tr>
|
---|
202 | <tr><td class="num" id="LN103">103</td><td class="line"> BEntry entry(*startEntry);</td></tr>
|
---|
203 | <tr><td class="num" id="LN104">104</td><td class="line"> </td></tr>
|
---|
204 | <tr><td class="num" id="LN105">105</td><td class="line"> <span class='keyword'>bool</span> showDesktop, showDisksIcon;</td></tr>
|
---|
205 | <tr><td class="num" id="LN106">106</td><td class="line"> {</td></tr>
|
---|
206 | <tr><td class="num" id="LN107">107</td><td class="line"> TrackerSettings settings;</td></tr>
|
---|
207 | <tr><td class="num" id="LN108">108</td><td class="line"> showDesktop = settings.DesktopFilePanelRoot();</td></tr>
|
---|
208 | <tr><td class="num" id="LN109">109</td><td class="line"> showDisksIcon = settings.ShowDisksIcon();</td></tr>
|
---|
209 | <tr><td class="num" id="LN110">110</td><td class="line"> }</td></tr>
|
---|
210 | <tr><td class="num" id="LN111">111</td><td class="line"> </td></tr>
|
---|
211 | <tr><td class="num" id="LN112">112</td><td class="line"> <span class='comment'>// might start one level above startEntry</span></td></tr>
|
---|
212 | <tr><td class="num" id="LN113">113</td><td class="line"> <span class='keyword'>if</span> (<span class="mrange">!includeStartEntry</span>) {</td></tr>
|
---|
213 | <tr><td class="num"></td><td class="line"><div id="Path6" class="msg msgEvent" style="margin-left:21ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">6</div></td><td><div class="PathNav"><a href="#Path5" title="Previous event (5)">←</a></div></td></td><td>Assuming 'includeStartEntry' is not equal to 0</td><td><div class="PathNav"><a href="#Path7" title="Next event (7)">→</a></div></td></tr></table></div></td></tr>
|
---|
214 | <tr><td class="num"></td><td class="line"><div id="Path7" class="msg msgControl" style="margin-left:17ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">7</div></td><td><div class="PathNav"><a href="#Path6" title="Previous event (6)">←</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path8" title="Next event (8)">→</a></div></td></tr></table></div></td></tr>
|
---|
215 | <tr><td class="num" id="LN114">114</td><td class="line"> BDirectory parent;</td></tr>
|
---|
216 | <tr><td class="num" id="LN115">115</td><td class="line"> BDirectory dir(&entry);</td></tr>
|
---|
217 | <tr><td class="num" id="LN116">116</td><td class="line"> </td></tr>
|
---|
218 | <tr><td class="num" id="LN117">117</td><td class="line"> <span class='keyword'>if</span> (!showDesktop && dir.InitCheck() == <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span></td></tr>
|
---|
219 | <tr><td class="num" id="LN118">118</td><td class="line"> && dir.IsRootDirectory()) {</td></tr>
|
---|
220 | <tr><td class="num" id="LN119">119</td><td class="line"> <span class='comment'>// if we're at the root directory skip "mnt" and</span></td></tr>
|
---|
221 | <tr><td class="num" id="LN120">120</td><td class="line"> <span class='comment'>// go straight to "/"</span></td></tr>
|
---|
222 | <tr><td class="num" id="LN121">121</td><td class="line"> parent.SetTo(<span class='string_literal'>"/"</span>);</td></tr>
|
---|
223 | <tr><td class="num" id="LN122">122</td><td class="line"> parent.GetEntry(&entry);</td></tr>
|
---|
224 | <tr><td class="num" id="LN123">123</td><td class="line"> } <span class='keyword'>else</span></td></tr>
|
---|
225 | <tr><td class="num" id="LN124">124</td><td class="line"> FSGetParentVirtualDirectoryAware(entry, entry);</td></tr>
|
---|
226 | <tr><td class="num" id="LN125">125</td><td class="line"> }</td></tr>
|
---|
227 | <tr><td class="num" id="LN126">126</td><td class="line"> </td></tr>
|
---|
228 | <tr><td class="num" id="LN127">127</td><td class="line"> BDirectory desktopDir;</td></tr>
|
---|
229 | <tr><td class="num" id="LN128">128</td><td class="line"> FSGetDeskDir(&desktopDir);</td></tr>
|
---|
230 | <tr><td class="num" id="LN129">129</td><td class="line"> BEntry desktopEntry;</td></tr>
|
---|
231 | <tr><td class="num" id="LN130">130</td><td class="line"> desktopDir.GetEntry(&desktopEntry);</td></tr>
|
---|
232 | <tr><td class="num" id="LN131">131</td><td class="line"> </td></tr>
|
---|
233 | <tr><td class="num" id="LN132">132</td><td class="line"> <span class='keyword'>for</span> (;;) {</td></tr>
|
---|
234 | <tr><td class="num"></td><td class="line"><div id="Path8" class="msg msgControl" style="margin-left:17ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">8</div></td><td><div class="PathNav"><a href="#Path7" title="Previous event (7)">←</a></div></td></td><td>Loop condition is true. Entering loop body</td><td><div class="PathNav"><a href="#Path9" title="Next event (9)">→</a></div></td></tr></table></div></td></tr>
|
---|
235 | <tr><td class="num"></td><td class="line"><div id="Path22" class="msg msgControl" style="margin-left:17ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">22</div></td><td><div class="PathNav"><a href="#Path21" title="Previous event (21)">←</a></div></td></td><td>Loop condition is true. Entering loop body</td><td><div class="PathNav"><a href="#Path23" title="Next event (23)">→</a></div></td></tr></table></div></td></tr>
|
---|
236 | <tr><td class="num"></td><td class="line"><div id="Path35" class="msg msgControl" style="margin-left:17ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">35</div></td><td><div class="PathNav"><a href="#Path34" title="Previous event (34)">←</a></div></td></td><td>Loop condition is true. Entering loop body</td><td><div class="PathNav"><a href="#Path36" title="Next event (36)">→</a></div></td></tr></table></div></td></tr>
|
---|
237 | <tr><td class="num" id="LN133">133</td><td class="line"> BNode node(&entry);</td></tr>
|
---|
238 | <tr><td class="num" id="LN134">134</td><td class="line"> ThrowOnInitCheckError(&node);</td></tr>
|
---|
239 | <tr><td class="num" id="LN135">135</td><td class="line"> </td></tr>
|
---|
240 | <tr><td class="num" id="LN136">136</td><td class="line"> PoseInfo info;</td></tr>
|
---|
241 | <tr><td class="num" id="LN137">137</td><td class="line"> ReadAttrResult result = ReadAttr(&node, <span class='macro'>kAttrPoseInfo<span class='expansion'>"_trk/pinfo_le"</span></span>,</td></tr>
|
---|
242 | <tr><td class="num" id="LN138">138</td><td class="line"> <span class='macro'>kAttrPoseInfoForeign<span class='expansion'>"_trk/pinfo"</span></span>, B_RAW_TYPE, 0, &info, <span class='keyword'>sizeof</span>(PoseInfo),</td></tr>
|
---|
243 | <tr><td class="num" id="LN139">139</td><td class="line"> &PoseInfo::EndianSwap);</td></tr>
|
---|
244 | <tr><td class="num" id="LN140">140</td><td class="line"> </td></tr>
|
---|
245 | <tr><td class="num" id="LN141">141</td><td class="line"> BEntry parentEntry;</td></tr>
|
---|
246 | <tr><td class="num" id="LN142">142</td><td class="line"> <span class='keyword'>bool</span> hitRoot = <span class='keyword'>false</span>;</td></tr>
|
---|
247 | <tr><td class="num" id="LN143">143</td><td class="line"> </td></tr>
|
---|
248 | <tr><td class="num" id="LN144">144</td><td class="line"> BDirectory dir(&entry);</td></tr>
|
---|
249 | <tr><td class="num" id="LN145">145</td><td class="line"> <span class='keyword'>if</span> (<span class="mrange">!showDesktop</span> && dir.InitCheck() == <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span></td></tr>
|
---|
250 | <tr><td class="num"></td><td class="line"><div id="Path9" class="msg msgEvent" style="margin-left:29ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">9</div></td><td><div class="PathNav"><a href="#Path8" title="Previous event (8)">←</a></div></td></td><td>Assuming 'showDesktop' is not equal to 0</td><td><div class="PathNav"><a href="#Path10" title="Next event (10)">→</a></div></td></tr></table></div></td></tr>
|
---|
251 | <tr><td class="num" id="LN146">146</td><td class="line"> && dir.IsRootDirectory()) {</td></tr>
|
---|
252 | <tr><td class="num" id="LN147">147</td><td class="line"> <span class='comment'>// if we're at the root directory skip "mnt" and</span></td></tr>
|
---|
253 | <tr><td class="num" id="LN148">148</td><td class="line"> <span class='comment'>// go straight to "/"</span></td></tr>
|
---|
254 | <tr><td class="num" id="LN149">149</td><td class="line"> hitRoot = <span class='keyword'>true</span>;</td></tr>
|
---|
255 | <tr><td class="num" id="LN150">150</td><td class="line"> parentEntry.SetTo(<span class='string_literal'>"/"</span>);</td></tr>
|
---|
256 | <tr><td class="num" id="LN151">151</td><td class="line"> } <span class='keyword'>else</span></td></tr>
|
---|
257 | <tr><td class="num" id="LN152">152</td><td class="line"> FSGetParentVirtualDirectoryAware(entry, parentEntry);</td></tr>
|
---|
258 | <tr><td class="num" id="LN153">153</td><td class="line"> </td></tr>
|
---|
259 | <tr><td class="num" id="LN154">154</td><td class="line"> <span class='keyword'>if</span> (showDesktop) {</td></tr>
|
---|
260 | <tr><td class="num"></td><td class="line"><div id="Path10" class="msg msgControl" style="margin-left:25ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">10</div></td><td><div class="PathNav"><a href="#Path9" title="Previous event (9)">←</a></div></td></td><td>Taking true branch</td><td><div class="PathNav"><a href="#Path11" title="Next event (11)">→</a></div></td></tr></table></div></td></tr>
|
---|
261 | <tr><td class="num"></td><td class="line"><div id="Path23" class="msg msgControl" style="margin-left:25ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">23</div></td><td><div class="PathNav"><a href="#Path22" title="Previous event (22)">←</a></div></td></td><td>Taking true branch</td><td><div class="PathNav"><a href="#Path24" title="Next event (24)">→</a></div></td></tr></table></div></td></tr>
|
---|
262 | <tr><td class="num"></td><td class="line"><div id="Path36" class="msg msgControl" style="margin-left:25ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">36</div></td><td><div class="PathNav"><a href="#Path35" title="Previous event (35)">←</a></div></td></td><td>Taking true branch</td><td><div class="PathNav"><a href="#Path37" title="Next event (37)">→</a></div></td></tr></table></div></td></tr>
|
---|
263 | <tr><td class="num" id="LN155">155</td><td class="line"> BEntry root(<span class='string_literal'>"/"</span>);</td></tr>
|
---|
264 | <tr><td class="num" id="LN156">156</td><td class="line"> <span class='comment'>// warp from "/" to Desktop properly</span></td></tr>
|
---|
265 | <tr><td class="num" id="LN157">157</td><td class="line"> <span class='keyword'>if</span> (<span class="mrange"><span class="mrange"><span class="mrange">entry == root</span></span></span>) {</td></tr>
|
---|
266 | <tr><td class="num"></td><td class="line"><div id="Path11" class="msg msgEvent" style="margin-left:37ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">11</div></td><td><div class="PathNav"><a href="#Path10" title="Previous event (10)">←</a></div></td></td><td>Assuming the condition is false</td><td><div class="PathNav"><a href="#Path12" title="Next event (12)">→</a></div></td></tr></table></div></td></tr>
|
---|
267 | <tr><td class="num"></td><td class="line"><div id="Path12" class="msg msgControl" style="margin-left:33ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">12</div></td><td><div class="PathNav"><a href="#Path11" title="Previous event (11)">←</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path13" title="Next event (13)">→</a></div></td></tr></table></div></td></tr>
|
---|
268 | <tr><td class="num"></td><td class="line"><div id="Path24" class="msg msgEvent" style="margin-left:37ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">24</div></td><td><div class="PathNav"><a href="#Path23" title="Previous event (23)">←</a></div></td></td><td>Assuming the condition is false</td><td><div class="PathNav"><a href="#Path25" title="Next event (25)">→</a></div></td></tr></table></div></td></tr>
|
---|
269 | <tr><td class="num"></td><td class="line"><div id="Path25" class="msg msgControl" style="margin-left:33ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">25</div></td><td><div class="PathNav"><a href="#Path24" title="Previous event (24)">←</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path26" title="Next event (26)">→</a></div></td></tr></table></div></td></tr>
|
---|
270 | <tr><td class="num"></td><td class="line"><div id="Path37" class="msg msgEvent" style="margin-left:37ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">37</div></td><td><div class="PathNav"><a href="#Path36" title="Previous event (36)">←</a></div></td></td><td>Assuming the condition is false</td><td><div class="PathNav"><a href="#Path38" title="Next event (38)">→</a></div></td></tr></table></div></td></tr>
|
---|
271 | <tr><td class="num"></td><td class="line"><div id="Path38" class="msg msgControl" style="margin-left:33ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">38</div></td><td><div class="PathNav"><a href="#Path37" title="Previous event (37)">←</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path39" title="Next event (39)">→</a></div></td></tr></table></div></td></tr>
|
---|
272 | <tr><td class="num" id="LN158">158</td><td class="line"> <span class='keyword'>if</span> (showDisksIcon)</td></tr>
|
---|
273 | <tr><td class="num" id="LN159">159</td><td class="line"> AddDisksIconToMenu(reverse);</td></tr>
|
---|
274 | <tr><td class="num" id="LN160">160</td><td class="line"> entry = desktopEntry;</td></tr>
|
---|
275 | <tr><td class="num" id="LN161">161</td><td class="line"> }</td></tr>
|
---|
276 | <tr><td class="num" id="LN162">162</td><td class="line"> </td></tr>
|
---|
277 | <tr><td class="num" id="LN163">163</td><td class="line"> <span class='keyword'>if</span> (<span class="mrange"><span class="mrange"><span class="mrange">entry == desktopEntry</span></span></span>)</td></tr>
|
---|
278 | <tr><td class="num"></td><td class="line"><div id="Path13" class="msg msgEvent" style="margin-left:37ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">13</div></td><td><div class="PathNav"><a href="#Path12" title="Previous event (12)">←</a></div></td></td><td>Assuming the condition is false</td><td><div class="PathNav"><a href="#Path14" title="Next event (14)">→</a></div></td></tr></table></div></td></tr>
|
---|
279 | <tr><td class="num"></td><td class="line"><div id="Path14" class="msg msgControl" style="margin-left:33ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">14</div></td><td><div class="PathNav"><a href="#Path13" title="Previous event (13)">←</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path15" title="Next event (15)">→</a></div></td></tr></table></div></td></tr>
|
---|
280 | <tr><td class="num"></td><td class="line"><div id="Path26" class="msg msgEvent" style="margin-left:37ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">26</div></td><td><div class="PathNav"><a href="#Path25" title="Previous event (25)">←</a></div></td></td><td>Assuming the condition is false</td><td><div class="PathNav"><a href="#Path27" title="Next event (27)">→</a></div></td></tr></table></div></td></tr>
|
---|
281 | <tr><td class="num"></td><td class="line"><div id="Path27" class="msg msgControl" style="margin-left:33ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">27</div></td><td><div class="PathNav"><a href="#Path26" title="Previous event (26)">←</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path28" title="Next event (28)">→</a></div></td></tr></table></div></td></tr>
|
---|
282 | <tr><td class="num"></td><td class="line"><div id="Path39" class="msg msgEvent" style="margin-left:37ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">39</div></td><td><div class="PathNav"><a href="#Path38" title="Previous event (38)">←</a></div></td></td><td>Assuming the condition is false</td><td><div class="PathNav"><a href="#Path40" title="Next event (40)">→</a></div></td></tr></table></div></td></tr>
|
---|
283 | <tr><td class="num"></td><td class="line"><div id="Path40" class="msg msgControl" style="margin-left:33ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">40</div></td><td><div class="PathNav"><a href="#Path39" title="Previous event (39)">←</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path41" title="Next event (41)">→</a></div></td></tr></table></div></td></tr>
|
---|
284 | <tr><td class="num" id="LN164">164</td><td class="line"> hitRoot = <span class='keyword'>true</span>;</td></tr>
|
---|
285 | <tr><td class="num" id="LN165">165</td><td class="line"> }</td></tr>
|
---|
286 | <tr><td class="num" id="LN166">166</td><td class="line"> </td></tr>
|
---|
287 | <tr><td class="num" id="LN167">167</td><td class="line"> <span class='keyword'>if</span> (<span class="mrange"><span class="mrange"><span class="mrange">result == kReadAttrFailed</span></span></span> || <span class="mrange"><span class="mrange"><span class="mrange">!info.fInvisible</td></tr>
|
---|
288 | <tr><td class="num"></td><td class="line"><div id="Path15" class="msg msgEvent" style="margin-left:29ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">15</div></td><td><div class="PathNav"><a href="#Path14" title="Previous event (14)">←</a></div></td></td><td>Assuming 'result' is not equal to kReadAttrFailed</td><td><div class="PathNav"><a href="#Path16" title="Next event (16)">→</a></div></td></tr></table></div></td></tr></span>
|
---|
289 | <tr><td class="num"></td><td class="line"><div id="Path16" class="msg msgEvent" style="margin-left:58ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">16</div></td><td><div class="PathNav"><a href="#Path15" title="Previous event (15)">←</a></div></td></td><td>Assuming the condition is false</td><td><div class="PathNav"><a href="#Path17" title="Next event (17)">→</a></div></td></tr></table></div></td></tr>
|
---|
290 | <tr><td class="num"></td><td class="line"><div id="Path18" class="msg msgControl" style="margin-left:25ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">18</div></td><td><div class="PathNav"><a href="#Path17" title="Previous event (17)">←</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path19" title="Next event (19)">→</a></div></td></tr></table></div></td></tr>
|
---|
291 | <tr><td class="num"></td><td class="line"><div id="Path28" class="msg msgEvent" style="margin-left:29ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">28</div></td><td><div class="PathNav"><a href="#Path27" title="Previous event (27)">←</a></div></td></td><td>Assuming 'result' is not equal to kReadAttrFailed</td><td><div class="PathNav"><a href="#Path29" title="Next event (29)">→</a></div></td></tr></table></div></td></tr></span>
|
---|
292 | <tr><td class="num"></td><td class="line"><div id="Path29" class="msg msgEvent" style="margin-left:58ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">29</div></td><td><div class="PathNav"><a href="#Path28" title="Previous event (28)">←</a></div></td></td><td>Assuming the condition is false</td><td><div class="PathNav"><a href="#Path30" title="Next event (30)">→</a></div></td></tr></table></div></td></tr>
|
---|
293 | <tr><td class="num"></td><td class="line"><div id="Path31" class="msg msgControl" style="margin-left:25ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">31</div></td><td><div class="PathNav"><a href="#Path30" title="Previous event (30)">←</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path32" title="Next event (32)">→</a></div></td></tr></table></div></td></tr>
|
---|
294 | <tr><td class="num"></td><td class="line"><div id="Path41" class="msg msgEvent" style="margin-left:29ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">41</div></td><td><div class="PathNav"><a href="#Path40" title="Previous event (40)">←</a></div></td></td><td>Assuming 'result' is not equal to kReadAttrFailed</td><td><div class="PathNav"><a href="#Path42" title="Next event (42)">→</a></div></td></tr></table></div></td></tr></span>
|
---|
295 | <tr><td class="num"></td><td class="line"><div id="Path42" class="msg msgEvent" style="margin-left:58ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">42</div></td><td><div class="PathNav"><a href="#Path41" title="Previous event (41)">←</a></div></td></td><td>Assuming the condition is false</td><td><div class="PathNav"><a href="#Path43" title="Next event (43)">→</a></div></td></tr></table></div></td></tr>
|
---|
296 | <tr><td class="num"></td><td class="line"><div id="Path44" class="msg msgControl" style="margin-left:25ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">44</div></td><td><div class="PathNav"><a href="#Path43" title="Previous event (43)">←</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path45" title="Next event (45)">→</a></div></td></tr></table></div></td></tr>
|
---|
297 | <tr><td class="num" id="LN168">168</td><td class="line"> || (showDesktop && <span class="mrange"><span class="mrange"><span class="mrange">desktopEntry == entry</span></span></span>)) {</td></tr>
|
---|
298 | <tr><td class="num"></td><td class="line"><div id="Path17" class="msg msgEvent" style="margin-left:52ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">17</div></td><td><div class="PathNav"><a href="#Path16" title="Previous event (16)">←</a></div></td></td><td>Assuming the condition is false</td><td><div class="PathNav"><a href="#Path18" title="Next event (18)">→</a></div></td></tr></table></div></td></tr>
|
---|
299 | <tr><td class="num"></td><td class="line"><div id="Path30" class="msg msgEvent" style="margin-left:52ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">30</div></td><td><div class="PathNav"><a href="#Path29" title="Previous event (29)">←</a></div></td></td><td>Assuming the condition is false</td><td><div class="PathNav"><a href="#Path31" title="Next event (31)">→</a></div></td></tr></table></div></td></tr>
|
---|
300 | <tr><td class="num"></td><td class="line"><div id="Path43" class="msg msgEvent" style="margin-left:52ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">43</div></td><td><div class="PathNav"><a href="#Path42" title="Previous event (42)">←</a></div></td></td><td>Assuming the condition is false</td><td><div class="PathNav"><a href="#Path44" title="Next event (44)">→</a></div></td></tr></table></div></td></tr>
|
---|
301 | <tr><td class="num" id="LN169">169</td><td class="line"> AddItemToDirMenu(&entry, originatingWindow, reverse,</td></tr>
|
---|
302 | <tr><td class="num" id="LN170">170</td><td class="line"> addShortcuts, navMenuEntries);</td></tr>
|
---|
303 | <tr><td class="num" id="LN171">171</td><td class="line"> }</td></tr>
|
---|
304 | <tr><td class="num" id="LN172">172</td><td class="line"> </td></tr>
|
---|
305 | <tr><td class="num" id="LN173">173</td><td class="line"> <span class='keyword'>if</span> (hitRoot) {</td></tr>
|
---|
306 | <tr><td class="num"></td><td class="line"><div id="Path19" class="msg msgControl" style="margin-left:25ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">19</div></td><td><div class="PathNav"><a href="#Path18" title="Previous event (18)">←</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path20" title="Next event (20)">→</a></div></td></tr></table></div></td></tr>
|
---|
307 | <tr><td class="num"></td><td class="line"><div id="Path32" class="msg msgControl" style="margin-left:25ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">32</div></td><td><div class="PathNav"><a href="#Path31" title="Previous event (31)">←</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path33" title="Next event (33)">→</a></div></td></tr></table></div></td></tr>
|
---|
308 | <tr><td class="num"></td><td class="line"><div id="Path45" class="msg msgControl" style="margin-left:25ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">45</div></td><td><div class="PathNav"><a href="#Path44" title="Previous event (44)">←</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path46" title="Next event (46)">→</a></div></td></tr></table></div></td></tr>
|
---|
309 | <tr><td class="num" id="LN174">174</td><td class="line"> <span class='keyword'>if</span> (!showDesktop && showDisksIcon && *startEntry != <span class='string_literal'>"/"</span>)</td></tr>
|
---|
310 | <tr><td class="num" id="LN175">175</td><td class="line"> AddDisksIconToMenu(reverse);</td></tr>
|
---|
311 | <tr><td class="num" id="LN176">176</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
|
---|
312 | <tr><td class="num" id="LN177">177</td><td class="line"> }</td></tr>
|
---|
313 | <tr><td class="num" id="LN178">178</td><td class="line"> </td></tr>
|
---|
314 | <tr><td class="num" id="LN179">179</td><td class="line"> entry = parentEntry;</td></tr>
|
---|
315 | <tr><td class="num" id="LN180">180</td><td class="line"> <span class='keyword'>if</span> (<span class="mrange"><span class="mrange"><span class="mrange">entry.InitCheck() != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span></span></span></span>)</td></tr>
|
---|
316 | <tr><td class="num"></td><td class="line"><div id="Path20" class="msg msgEvent" style="margin-left:29ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">20</div></td><td><div class="PathNav"><a href="#Path19" title="Previous event (19)">←</a></div></td></td><td>Assuming the condition is false</td><td><div class="PathNav"><a href="#Path21" title="Next event (21)">→</a></div></td></tr></table></div></td></tr>
|
---|
317 | <tr><td class="num"></td><td class="line"><div id="Path21" class="msg msgControl" style="margin-left:25ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">21</div></td><td><div class="PathNav"><a href="#Path20" title="Previous event (20)">←</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path22" title="Next event (22)">→</a></div></td></tr></table></div></td></tr>
|
---|
318 | <tr><td class="num"></td><td class="line"><div id="Path33" class="msg msgEvent" style="margin-left:29ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">33</div></td><td><div class="PathNav"><a href="#Path32" title="Previous event (32)">←</a></div></td></td><td>Assuming the condition is false</td><td><div class="PathNav"><a href="#Path34" title="Next event (34)">→</a></div></td></tr></table></div></td></tr>
|
---|
319 | <tr><td class="num"></td><td class="line"><div id="Path34" class="msg msgControl" style="margin-left:25ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">34</div></td><td><div class="PathNav"><a href="#Path33" title="Previous event (33)">←</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path35" title="Next event (35)">→</a></div></td></tr></table></div></td></tr>
|
---|
320 | <tr><td class="num"></td><td class="line"><div id="Path46" class="msg msgEvent" style="margin-left:29ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">46</div></td><td><div class="PathNav"><a href="#Path45" title="Previous event (45)">←</a></div></td></td><td>Assuming the condition is true</td><td><div class="PathNav"><a href="#Path47" title="Next event (47)">→</a></div></td></tr></table></div></td></tr>
|
---|
321 | <tr><td class="num"></td><td class="line"><div id="Path47" class="msg msgControl" style="margin-left:25ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">47</div></td><td><div class="PathNav"><a href="#Path46" title="Previous event (46)">←</a></div></td></td><td>Taking true branch</td><td><div class="PathNav"><a href="#Path48" title="Next event (48)">→</a></div></td></tr></table></div></td></tr>
|
---|
322 | <tr><td class="num" id="LN181">181</td><td class="line"> <span class='keyword'>break</span>;</td></tr>
|
---|
323 | <tr><td class="num"></td><td class="line"><div id="Path48" class="msg msgControl" style="margin-left:33ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">48</div></td><td><div class="PathNav"><a href="#Path47" title="Previous event (47)">←</a></div></td></td><td> Execution continues on line 185</td><td><div class="PathNav"><a href="#Path49" title="Next event (49)">→</a></div></td></tr></table></div></td></tr>
|
---|
324 | <tr><td class="num" id="LN182">182</td><td class="line"> }</td></tr>
|
---|
325 | <tr><td class="num" id="LN183">183</td><td class="line"> </td></tr>
|
---|
326 | <tr><td class="num" id="LN184">184</td><td class="line"> <span class='comment'>// select last item in menu</span></td></tr>
|
---|
327 | <tr><td class="num" id="LN185">185</td><td class="line"> <span class='keyword'>if</span> (<span class="mrange">!select</span>)</td></tr>
|
---|
328 | <tr><td class="num"></td><td class="line"><div id="Path49" class="msg msgEvent" style="margin-left:21ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">49</div></td><td><div class="PathNav"><a href="#Path48" title="Previous event (48)">←</a></div></td></td><td>Assuming 'select' is 0</td><td><div class="PathNav"><a href="#Path50" title="Next event (50)">→</a></div></td></tr></table></div></td></tr>
|
---|
329 | <tr><td class="num"></td><td class="line"><div id="Path50" class="msg msgControl" style="margin-left:17ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">50</div></td><td><div class="PathNav"><a href="#Path49" title="Previous event (49)">←</a></div></td></td><td>Taking true branch</td><td><div class="PathNav"><a href="#EndPath" title="Next event (51)">→</a></div></td></tr></table></div></td></tr>
|
---|
330 | <tr><td class="num" id="LN186">186</td><td class="line"> <span class='keyword'>return</span>;</td></tr>
|
---|
331 | <tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:25ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">51</div></td><td><div class="PathNav"><a href="#Path50" title="Previous event (50)">←</a></div></td></td><td>Potential leak of memory pointed to by 'menu'</td></tr></table></div></td></tr>
|
---|
332 | <tr><td class="num" id="LN187">187</td><td class="line"> </td></tr>
|
---|
333 | <tr><td class="num" id="LN188">188</td><td class="line"> ModelMenuItem* item</td></tr>
|
---|
334 | <tr><td class="num" id="LN189">189</td><td class="line"> = <span class='keyword'>dynamic_cast</span><ModelMenuItem*>(ItemAt(CountItems() - 1));</td></tr>
|
---|
335 | <tr><td class="num" id="LN190">190</td><td class="line"> <span class='keyword'>if</span> (item != <span class='macro'>NULL<span class='expansion'>__null</span></span>) {</td></tr>
|
---|
336 | <tr><td class="num" id="LN191">191</td><td class="line"> item->SetMarked(<span class='keyword'>true</span>);</td></tr>
|
---|
337 | <tr><td class="num" id="LN192">192</td><td class="line"> <span class='keyword'>if</span> (menu) {</td></tr>
|
---|
338 | <tr><td class="num" id="LN193">193</td><td class="line"> entry.SetTo(item->TargetModel()->EntryRef());</td></tr>
|
---|
339 | <tr><td class="num" id="LN194">194</td><td class="line"> <span class='macro'>ThrowOnError(menu->SetEntry(&entry))<span class='expansion'>_ThrowOnError(menu->SetEntry(&entry), "/home/haiku/haiku/haiku/src/kits/tracker/DirMenu.cpp"<br>, 194)</span></span>;</td></tr>
|
---|
340 | <tr><td class="num" id="LN195">195</td><td class="line"> }</td></tr>
|
---|
341 | <tr><td class="num" id="LN196">196</td><td class="line"> }</td></tr>
|
---|
342 | <tr><td class="num" id="LN197">197</td><td class="line"> } <span class='keyword'>catch</span> (status_t err) {</td></tr>
|
---|
343 | <tr><td class="num" id="LN198">198</td><td class="line"> <span class='macro'>PRINT((<span class='string_literal'>"BDirMenu::Populate: caught error %s\n"</span>, strerror(err)))<span class='expansion'>_debugPrintf ("BDirMenu::Populate: caught error %s\n", strerror<br>(err))</span></span>;</td></tr>
|
---|
344 | <tr><td class="num" id="LN199">199</td><td class="line"> <span class='keyword'>if</span> (!CountItems()) {</td></tr>
|
---|
345 | <tr><td class="num" id="LN200">200</td><td class="line"> BString error;</td></tr>
|
---|
346 | <tr><td class="num" id="LN201">201</td><td class="line"> error << <span class='string_literal'>"Error ["</span> << strerror(err) << <span class='string_literal'>"] populating menu"</span>;</td></tr>
|
---|
347 | <tr><td class="num" id="LN202">202</td><td class="line"> AddItem(<span class='keyword'>new</span> BMenuItem(error.String(), 0));</td></tr>
|
---|
348 | <tr><td class="num" id="LN203">203</td><td class="line"> }</td></tr>
|
---|
349 | <tr><td class="num" id="LN204">204</td><td class="line"> }</td></tr>
|
---|
350 | <tr><td class="num" id="LN205">205</td><td class="line">}</td></tr>
|
---|
351 | <tr><td class="num" id="LN206">206</td><td class="line"> </td></tr>
|
---|
352 | <tr><td class="num" id="LN207">207</td><td class="line"> </td></tr>
|
---|
353 | <tr><td class="num" id="LN208">208</td><td class="line"><span class='keyword'>void</span></td></tr>
|
---|
354 | <tr><td class="num" id="LN209">209</td><td class="line">BDirMenu::AddItemToDirMenu(<span class='keyword'>const</span> BEntry* entry, BWindow* originatingWindow,</td></tr>
|
---|
355 | <tr><td class="num" id="LN210">210</td><td class="line"> <span class='keyword'>bool</span> atEnd, <span class='keyword'>bool</span> addShortcuts, <span class='keyword'>bool</span> navMenuEntries)</td></tr>
|
---|
356 | <tr><td class="num" id="LN211">211</td><td class="line">{</td></tr>
|
---|
357 | <tr><td class="num" id="LN212">212</td><td class="line"> Model model(entry);</td></tr>
|
---|
358 | <tr><td class="num" id="LN213">213</td><td class="line"> <span class='keyword'>if</span> (model.InitCheck() != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>)</td></tr>
|
---|
359 | <tr><td class="num" id="LN214">214</td><td class="line"> <span class='keyword'>return</span>;</td></tr>
|
---|
360 | <tr><td class="num" id="LN215">215</td><td class="line"> </td></tr>
|
---|
361 | <tr><td class="num" id="LN216">216</td><td class="line"> BMessage* message = <span class='keyword'>new</span> BMessage(fCommand);</td></tr>
|
---|
362 | <tr><td class="num" id="LN217">217</td><td class="line"> message->AddRef(fEntryName.String(), model.EntryRef());</td></tr>
|
---|
363 | <tr><td class="num" id="LN218">218</td><td class="line"> </td></tr>
|
---|
364 | <tr><td class="num" id="LN219">219</td><td class="line"> <span class='comment'>// add reference to the container windows model so that we can</span></td></tr>
|
---|
365 | <tr><td class="num" id="LN220">220</td><td class="line"> <span class='comment'>// close the window if</span></td></tr>
|
---|
366 | <tr><td class="num" id="LN221">221</td><td class="line"> BContainerWindow* window = originatingWindow ?</td></tr>
|
---|
367 | <tr><td class="num" id="LN222">222</td><td class="line"> <span class='keyword'>dynamic_cast</span><BContainerWindow*>(originatingWindow) : 0;</td></tr>
|
---|
368 | <tr><td class="num" id="LN223">223</td><td class="line"> <span class='keyword'>if</span> (window != <span class='macro'>NULL<span class='expansion'>__null</span></span>) {</td></tr>
|
---|
369 | <tr><td class="num" id="LN224">224</td><td class="line"> message->AddData(<span class='string_literal'>"nodeRefsToClose"</span>, B_RAW_TYPE,</td></tr>
|
---|
370 | <tr><td class="num" id="LN225">225</td><td class="line"> window->TargetModel()->NodeRef(), <span class='keyword'>sizeof</span> (node_ref));</td></tr>
|
---|
371 | <tr><td class="num" id="LN226">226</td><td class="line"> }</td></tr>
|
---|
372 | <tr><td class="num" id="LN227">227</td><td class="line"> ModelMenuItem* item;</td></tr>
|
---|
373 | <tr><td class="num" id="LN228">228</td><td class="line"> <span class='keyword'>if</span> (navMenuEntries) {</td></tr>
|
---|
374 | <tr><td class="num" id="LN229">229</td><td class="line"> BNavMenu* subMenu = <span class='keyword'>new</span> BNavMenu(model.Name(), B_REFS_RECEIVED,</td></tr>
|
---|
375 | <tr><td class="num" id="LN230">230</td><td class="line"> fTarget, window);</td></tr>
|
---|
376 | <tr><td class="num" id="LN231">231</td><td class="line"> entry_ref ref;</td></tr>
|
---|
377 | <tr><td class="num" id="LN232">232</td><td class="line"> entry->GetRef(&ref);</td></tr>
|
---|
378 | <tr><td class="num" id="LN233">233</td><td class="line"> subMenu->SetNavDir(&ref);</td></tr>
|
---|
379 | <tr><td class="num" id="LN234">234</td><td class="line"> item = <span class='keyword'>new</span> ModelMenuItem(&model, subMenu);</td></tr>
|
---|
380 | <tr><td class="num" id="LN235">235</td><td class="line"> item->SetLabel(model.Name());</td></tr>
|
---|
381 | <tr><td class="num" id="LN236">236</td><td class="line"> item->SetMessage(message);</td></tr>
|
---|
382 | <tr><td class="num" id="LN237">237</td><td class="line"> } <span class='keyword'>else</span> {</td></tr>
|
---|
383 | <tr><td class="num" id="LN238">238</td><td class="line"> item = <span class='keyword'>new</span> ModelMenuItem(&model, model.Name(), message);</td></tr>
|
---|
384 | <tr><td class="num" id="LN239">239</td><td class="line"> }</td></tr>
|
---|
385 | <tr><td class="num" id="LN240">240</td><td class="line"> </td></tr>
|
---|
386 | <tr><td class="num" id="LN241">241</td><td class="line"> <span class='keyword'>if</span> (addShortcuts) {</td></tr>
|
---|
387 | <tr><td class="num" id="LN242">242</td><td class="line"> <span class='keyword'>if</span> (model.IsDesktop())</td></tr>
|
---|
388 | <tr><td class="num" id="LN243">243</td><td class="line"> item->SetShortcut('D', B_COMMAND_KEY);</td></tr>
|
---|
389 | <tr><td class="num" id="LN244">244</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (FSIsHomeDir(entry))</td></tr>
|
---|
390 | <tr><td class="num" id="LN245">245</td><td class="line"> item->SetShortcut('H', B_COMMAND_KEY);</td></tr>
|
---|
391 | <tr><td class="num" id="LN246">246</td><td class="line"> }</td></tr>
|
---|
392 | <tr><td class="num" id="LN247">247</td><td class="line"> </td></tr>
|
---|
393 | <tr><td class="num" id="LN248">248</td><td class="line"> <span class='keyword'>if</span> (atEnd)</td></tr>
|
---|
394 | <tr><td class="num" id="LN249">249</td><td class="line"> AddItem(item);</td></tr>
|
---|
395 | <tr><td class="num" id="LN250">250</td><td class="line"> <span class='keyword'>else</span></td></tr>
|
---|
396 | <tr><td class="num" id="LN251">251</td><td class="line"> AddItem(item, 0);</td></tr>
|
---|
397 | <tr><td class="num" id="LN252">252</td><td class="line"> </td></tr>
|
---|
398 | <tr><td class="num" id="LN253">253</td><td class="line"> item->SetTarget(fTarget);</td></tr>
|
---|
399 | <tr><td class="num" id="LN254">254</td><td class="line"> </td></tr>
|
---|
400 | <tr><td class="num" id="LN255">255</td><td class="line"> <span class='keyword'>if</span> (fMenuBar != <span class='macro'>NULL<span class='expansion'>__null</span></span>) {</td></tr>
|
---|
401 | <tr><td class="num" id="LN256">256</td><td class="line"> ModelMenuItem* menu</td></tr>
|
---|
402 | <tr><td class="num" id="LN257">257</td><td class="line"> = <span class='keyword'>dynamic_cast</span><ModelMenuItem*>(fMenuBar->ItemAt(0));</td></tr>
|
---|
403 | <tr><td class="num" id="LN258">258</td><td class="line"> <span class='keyword'>if</span> (menu != <span class='macro'>NULL<span class='expansion'>__null</span></span>) {</td></tr>
|
---|
404 | <tr><td class="num" id="LN259">259</td><td class="line"> <span class='macro'>ThrowOnError(menu->SetEntry(entry))<span class='expansion'>_ThrowOnError(menu->SetEntry(entry), "/home/haiku/haiku/haiku/src/kits/tracker/DirMenu.cpp"<br>, 259)</span></span>;</td></tr>
|
---|
405 | <tr><td class="num" id="LN260">260</td><td class="line"> item->SetMarked(<span class='keyword'>true</span>);</td></tr>
|
---|
406 | <tr><td class="num" id="LN261">261</td><td class="line"> }</td></tr>
|
---|
407 | <tr><td class="num" id="LN262">262</td><td class="line"> }</td></tr>
|
---|
408 | <tr><td class="num" id="LN263">263</td><td class="line">}</td></tr>
|
---|
409 | <tr><td class="num" id="LN264">264</td><td class="line"> </td></tr>
|
---|
410 | <tr><td class="num" id="LN265">265</td><td class="line"> </td></tr>
|
---|
411 | <tr><td class="num" id="LN266">266</td><td class="line"><span class='keyword'>void</span></td></tr>
|
---|
412 | <tr><td class="num" id="LN267">267</td><td class="line">BDirMenu::AddDisksIconToMenu(<span class='keyword'>bool</span> atEnd)</td></tr>
|
---|
413 | <tr><td class="num" id="LN268">268</td><td class="line">{</td></tr>
|
---|
414 | <tr><td class="num" id="LN269">269</td><td class="line"> BEntry entry(<span class='string_literal'>"/"</span>);</td></tr>
|
---|
415 | <tr><td class="num" id="LN270">270</td><td class="line"> Model model(&entry);</td></tr>
|
---|
416 | <tr><td class="num" id="LN271">271</td><td class="line"> <span class='keyword'>if</span> (model.InitCheck() != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>)</td></tr>
|
---|
417 | <tr><td class="num" id="LN272">272</td><td class="line"> <span class='keyword'>return</span>;</td></tr>
|
---|
418 | <tr><td class="num" id="LN273">273</td><td class="line"> </td></tr>
|
---|
419 | <tr><td class="num" id="LN274">274</td><td class="line"> BMessage* message = <span class='keyword'>new</span> BMessage(fCommand);</td></tr>
|
---|
420 | <tr><td class="num" id="LN275">275</td><td class="line"> message->AddRef(fEntryName.String(), model.EntryRef());</td></tr>
|
---|
421 | <tr><td class="num" id="LN276">276</td><td class="line"> </td></tr>
|
---|
422 | <tr><td class="num" id="LN277">277</td><td class="line"> ModelMenuItem* item = <span class='keyword'>new</span> ModelMenuItem(&model,</td></tr>
|
---|
423 | <tr><td class="num" id="LN278">278</td><td class="line"> <span class='macro'>B_TRANSLATE(B_DISKS_DIR_NAME)<span class='expansion'>BLocaleRoster::Default()->GetCatalog()->GetString(("Disks"<br>), "DirMenu")</span></span>, message);</td></tr>
|
---|
424 | <tr><td class="num" id="LN279">279</td><td class="line"> <span class='keyword'>if</span> (atEnd)</td></tr>
|
---|
425 | <tr><td class="num" id="LN280">280</td><td class="line"> AddItem(item);</td></tr>
|
---|
426 | <tr><td class="num" id="LN281">281</td><td class="line"> <span class='keyword'>else</span></td></tr>
|
---|
427 | <tr><td class="num" id="LN282">282</td><td class="line"> AddItem(item, 0);</td></tr>
|
---|
428 | <tr><td class="num" id="LN283">283</td><td class="line">}</td></tr>
|
---|
429 | </table></body></html>
|
---|