Changeset View
Changeset View
Standalone View
Standalone View
krusader/DiskUsage/radialMap/builder.cpp
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Line(s) | 71 | if (dir == m_root) { | |||
---|---|---|---|---|---|
73 | *m_depth = 0; | 73 | *m_depth = 0; | ||
74 | } | 74 | } | ||
75 | 75 | | |||
76 | if (*m_depth < depth) *m_depth = depth; | 76 | if (*m_depth < depth) *m_depth = depth; | ||
77 | if (*m_depth >= stopDepth) return; | 77 | if (*m_depth >= stopDepth) return; | ||
78 | 78 | | |||
79 | for (ConstIterator<File> it = dir->constIterator(); it != dir->end(); ++it) | 79 | for (ConstIterator<File> it = dir->constIterator(); it != dir->end(); ++it) | ||
80 | if ((*it)->isDir() && (*it)->size() > m_minSize) | 80 | if ((*it)->isDir() && (*it)->size() > m_minSize) | ||
81 | findVisibleDepth((Directory *)*it, depth + 1); //if no files greater than min size the depth is still recorded | 81 | findVisibleDepth(dynamic_cast<const Directory *>(*it), depth + 1); //if no files greater than min size the depth is still recorded | ||
82 | } | 82 | } | ||
83 | 83 | | |||
84 | void | 84 | void | ||
85 | RadialMap::Builder::setLimits(const uint &b) //b = breadth? | 85 | RadialMap::Builder::setLimits(const uint &b) //b = breadth? | ||
86 | { | 86 | { | ||
87 | double size3 = m_root->size() * 3; | 87 | double size3 = m_root->size() * 3; | ||
88 | double pi2B = PI * 2 * b; | 88 | double pi2B = PI * 2 * b; | ||
89 | 89 | | |||
Show All 22 Lines | 110 | if ((*it)->size() > m_limits[depth]) { | |||
112 | 112 | | |||
113 | auto *s = new Segment(*it, a_start, a_len); | 113 | auto *s = new Segment(*it, a_start, a_len); | ||
114 | 114 | | |||
115 | (m_signature + depth)->append(s); | 115 | (m_signature + depth)->append(s); | ||
116 | 116 | | |||
117 | if ((*it)->isDir()) { | 117 | if ((*it)->isDir()) { | ||
118 | if (depth != *m_depth) { | 118 | if (depth != *m_depth) { | ||
119 | //recurse | 119 | //recurse | ||
120 | s->m_hasHiddenChildren = build((Directory*) * it, depth + 1, a_start, a_start + a_len); | 120 | s->m_hasHiddenChildren = build(dynamic_cast<const Directory *>(*it), depth + 1, a_start, a_start + a_len); | ||
121 | } else s->m_hasHiddenChildren = true; | 121 | } else s->m_hasHiddenChildren = true; | ||
122 | } | 122 | } | ||
123 | 123 | | |||
124 | a_start += a_len; //**** should we add 1? | 124 | a_start += a_len; //**** should we add 1? | ||
125 | 125 | | |||
126 | } else { | 126 | } else { | ||
127 | 127 | | |||
128 | hiddenSize += (*it)->size(); | 128 | hiddenSize += (*it)->size(); | ||
Show All 21 Lines |