Changeset View
Changeset View
Standalone View
Standalone View
krusader/DiskUsage/radialMap/labels.cpp
Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Line(s) | 99 | { | |||
---|---|---|---|---|---|
100 | //we are a friend of RadialMap::Map | 100 | //we are a friend of RadialMap::Map | ||
101 | 101 | | |||
102 | LabelList list; | 102 | LabelList list; | ||
103 | unsigned int startLevel = 0; | 103 | unsigned int startLevel = 0; | ||
104 | 104 | | |||
105 | 105 | | |||
106 | //1. Create list of labels sorted in the order they will be rendered | 106 | //1. Create list of labels sorted in the order they will be rendered | ||
107 | 107 | | |||
108 | if (m_focus != NULL && m_focus->file() != m_tree) { //separate behavior for selected vs unselected segments | 108 | if (m_focus != nullptr && m_focus->file() != m_tree) { //separate behavior for selected vs unselected segments | ||
109 | //don't bother with files | 109 | //don't bother with files | ||
110 | if (m_focus->file() == 0 || !m_focus->file()->isDir()) return; | 110 | if (m_focus->file() == nullptr || !m_focus->file()->isDir()) return; | ||
111 | 111 | | |||
112 | //find the range of levels we will be potentially drawing labels for | 112 | //find the range of levels we will be potentially drawing labels for | ||
113 | for (const Directory *p = (const Directory *)m_focus->file(); | 113 | for (const auto *p = (const Directory *)m_focus->file(); | ||
114 | p != m_tree; | 114 | p != m_tree; | ||
115 | ++startLevel) { //startLevel is the level above whatever m_focus is in | 115 | ++startLevel) { //startLevel is the level above whatever m_focus is in | ||
116 | p = p->parent(); | 116 | p = p->parent(); | ||
117 | } | 117 | } | ||
118 | 118 | | |||
119 | //range=2 means 2 levels to draw labels for | 119 | //range=2 means 2 levels to draw labels for | ||
120 | 120 | | |||
121 | unsigned int a1, a2, minAngle; | 121 | unsigned int a1, a2, minAngle; | ||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 162 | while (jtn < list.count()) { | |||
179 | ++jtn; | 179 | ++jtn; | ||
180 | } | 180 | } | ||
181 | 181 | | |||
182 | LabelList::iterator it = list.begin(); | 182 | LabelList::iterator it = list.begin(); | ||
183 | 183 | | |||
184 | //used in next two steps | 184 | //used in next two steps | ||
185 | bool varySizes; | 185 | bool varySizes; | ||
186 | //**** should perhaps use doubles | 186 | //**** should perhaps use doubles | ||
187 | int *sizes = new int [ m_map.m_visibleDepth + 1 ]; //**** make sizes an array of floats I think instead (or doubles) | 187 | auto *sizes = new int [ m_map.m_visibleDepth + 1 ]; //**** make sizes an array of floats I think instead (or doubles) | ||
188 | 188 | | |||
189 | do { | 189 | do { | ||
190 | //3. Calculate font sizes | 190 | //3. Calculate font sizes | ||
191 | 191 | | |||
192 | { | 192 | { | ||
193 | //determine current range of levels to draw for | 193 | //determine current range of levels to draw for | ||
194 | unsigned int range = 0; | 194 | unsigned int range = 0; | ||
195 | 195 | | |||
▲ Show 20 Lines • Show All 171 Lines • Show Last 20 Lines |