Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/language/duchain/dumpdotgraph.cpp
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Line(s) | 119 | if( topCtx->parsingEnvironmentFile() ) { | |||
---|---|---|---|---|---|
134 | label = file; | 134 | label = file; | ||
135 | 135 | | |||
136 | if( topCtx->importers().count() != 0 ) | 136 | if( topCtx->importers().count() != 0 ) | ||
137 | label += QStringLiteral(" imported by %1").arg(topCtx->importers().count()); | 137 | label += QStringLiteral(" imported by %1").arg(topCtx->importers().count()); | ||
138 | } else { | 138 | } else { | ||
139 | label = QStringLiteral("unknown file"); | 139 | label = QStringLiteral("unknown file"); | ||
140 | } | 140 | } | ||
141 | if(topCtx->parsingEnvironmentFile() && topCtx->parsingEnvironmentFile()->isProxyContext()) | 141 | if(topCtx->parsingEnvironmentFile() && topCtx->parsingEnvironmentFile()->isProxyContext()) | ||
142 | label = "Proxy-context " + label; | 142 | label = QLatin1String("Proxy-context ") + label; | ||
143 | }else{ | 143 | }else{ | ||
144 | label = /*"context " + */context->localScopeIdentifier().toString(); | 144 | label = /*"context " + */context->localScopeIdentifier().toString(); | ||
145 | label += ' ' + rangeToString(context->range().castToSimpleRange()); | 145 | label += QLatin1Char(' ') + rangeToString(context->range().castToSimpleRange()); | ||
146 | } | 146 | } | ||
147 | 147 | | |||
148 | //label = QStringLiteral("%1 ").arg((size_t)context) + label; | 148 | //label = QStringLiteral("%1 ").arg((size_t)context) + label; | ||
149 | 149 | | |||
150 | if( isMaster && !dynamic_cast<TopDUContext*>(context) ) { | 150 | if( isMaster && !dynamic_cast<TopDUContext*>(context) ) { | ||
151 | //Also draw contexts that import this one | 151 | //Also draw contexts that import this one | ||
152 | foreach( DUContext* ctx, context->importers() ) | 152 | foreach( DUContext* ctx, context->importers() ) | ||
153 | stream << dotGraphInternal(ctx, false, true); | 153 | stream << dotGraphInternal(ctx, false, true); | ||
154 | } | 154 | } | ||
155 | 155 | | |||
156 | foreach (const DUContext::Import &parent, context->importedParentContexts()) { | 156 | foreach (const DUContext::Import &parent, context->importedParentContexts()) { | ||
157 | if( parent.context(m_topContext) ) { | 157 | if( parent.context(m_topContext) ) { | ||
158 | stream << dotGraphInternal(parent.context(m_topContext), false, true); | 158 | stream << dotGraphInternal(parent.context(m_topContext), false, true); | ||
159 | QString label = QStringLiteral("imports"); | 159 | QString label = QStringLiteral("imports"); | ||
160 | if( (!dynamic_cast<TopDUContext*>(parent.context(m_topContext)) || !dynamic_cast<TopDUContext*>(context)) && !(parent.context(m_topContext)->url() == context->url()) ) { | 160 | if( (!dynamic_cast<TopDUContext*>(parent.context(m_topContext)) || !dynamic_cast<TopDUContext*>(context)) && !(parent.context(m_topContext)->url() == context->url()) ) { | ||
161 | label += " from " + parent.context(m_topContext)->url().toUrl().fileName() | 161 | label += QLatin1String(" from ") + parent.context(m_topContext)->url().toUrl().fileName() | ||
162 | + " to " + context->url().toUrl().fileName(); | 162 | + QLatin1String(" to ") + context->url().toUrl().fileName(); | ||
163 | } | 163 | } | ||
164 | 164 | | |||
165 | stream << shortLabel(context) << " -> " << shortLabel(parent.context(m_topContext)) << "[style=dotted,label=\"" << label << "\"];\n"; | 165 | stream << shortLabel(context) << QLatin1String(" -> ") << shortLabel(parent.context(m_topContext)) << QLatin1String("[style=dotted,label=\"") << label << QLatin1String("\"];\n"); | ||
166 | } | 166 | } | ||
167 | } | 167 | } | ||
168 | 168 | | |||
169 | if( !context->childContexts().isEmpty() ) | 169 | if( !context->childContexts().isEmpty() ) | ||
170 | label += QStringLiteral(", %1 C.").arg(context->childContexts().count()); | 170 | label += QStringLiteral(", %1 C.").arg(context->childContexts().count()); | ||
171 | 171 | | |||
172 | if( !shortened ) { | 172 | if( !shortened ) { | ||
173 | foreach (DUContext* child, context->childContexts()) { | 173 | foreach (DUContext* child, context->childContexts()) { | ||
174 | stream << dotGraphInternal(child, false, false); | 174 | stream << dotGraphInternal(child, false, false); | ||
175 | stream << shortLabel(context) << " -> " << shortLabel(child) << "[style=dotted,color=green];\n"; | 175 | stream << shortLabel(context) << QLatin1String(" -> ") << shortLabel(child) << QLatin1String("[style=dotted,color=green];\n"); | ||
176 | } | 176 | } | ||
177 | } | 177 | } | ||
178 | 178 | | |||
179 | if( !context->localDeclarations().isEmpty() ) | 179 | if( !context->localDeclarations().isEmpty() ) | ||
180 | label += QStringLiteral(", %1 D.").arg(context->localDeclarations().count()); | 180 | label += QStringLiteral(", %1 D.").arg(context->localDeclarations().count()); | ||
181 | 181 | | |||
182 | if(!shortened ) | 182 | if(!shortened ) | ||
183 | { | 183 | { | ||
Show All 16 Lines |