[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/sdk/kdevplatform/language/duchain/navigation
From:       David Nolden <david.nolden.kde () art-master ! de>
Date:       2010-03-14 16:04:17
Message-ID: 1268582657.470180.6407.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1103200 by zwabel:

- Show the path right as the first entry of the "file" navigation-context, without \
                the "path:" prefix.
- Make the font-size in the navigation widgets equal to the standard system font \
                size.
BUG: 229918

 M  +2 -2      abstractdeclarationnavigationcontext.cpp  
 M  +6 -9      abstractincludenavigationcontext.cpp  
 M  +16 -1     abstractnavigationcontext.cpp  
 M  +5 -0      abstractnavigationcontext.h  
 M  +3 -3      usesnavigationcontext.cpp  


--- trunk/extragear/sdk/kdevplatform/language/duchain/navigation/abstractdeclarationnavigationcontext.cpp \
#1103199:1103200 @@ -63,7 +63,7 @@
 {
   clear();
   m_shorten = shorten;
-  modifyHtml()  += "<html><body><p><small><small>";
+  modifyHtml()  += "<html><body><p>" + fontSizePrefix(shorten);
 
   addExternalHtml(m_prefix);
 
@@ -282,7 +282,7 @@
 
   addExternalHtml(m_suffix);
 
-  modifyHtml() += "</small></small></p></body></html>";
+  modifyHtml() += fontSizeSuffix(shorten) + "</p></body></html>";
 
   return currentHtml();
 }
--- trunk/extragear/sdk/kdevplatform/language/duchain/navigation/abstractincludenavigationcontext.cpp \
#1103199:1103200 @@ -77,22 +77,19 @@
 QString AbstractIncludeNavigationContext::html(bool shorten)
 {
   clear();
-  modifyHtml()  += "<html><body><p><small><small>";
+  modifyHtml()  += "<html><body><p>" + fontSizePrefix(shorten);
   addExternalHtml(m_prefix);
 
   KUrl u(m_item.url());
   NavigationAction action(u, KTextEditor::Cursor(0,0));
-  makeLink(u.fileName(), u.pathOrUrl(), action);
-  QList<TopDUContext*> duchains = DUChain::self()->chainsForDocument(u);
+  makeLink(u.pathOrUrl(), u.pathOrUrl(), action);
   modifyHtml() += "<br />";
-  modifyHtml() += "path: " + u.pathOrUrl();
-
+  
+  QList<TopDUContext*> duchains = DUChain::self()->chainsForDocument(u);
   //Pick the one duchain for this document that has the most \
child-contexts/declarations.  //This prevents picking a context that is empty due to \
header-guards.  TopDUContext* duchain = pickContextWithData(duchains, 2, m_type);
 
-  modifyHtml() += "<br />";
-
   if(duchain) {
     getFileInfo(duchain);
     if(!shorten) {
@@ -106,13 +103,13 @@
 
   addExternalHtml(m_suffix);
 
-  modifyHtml() += "</small></small></p></body></html>";
+  modifyHtml() += fontSizeSuffix(shorten) + "</p></body></html>";
   return currentHtml();
 }
 
 void AbstractIncludeNavigationContext::getFileInfo(TopDUContext* duchain)
 {
-    modifyHtml() += QString("%1: %2 %3: %4").arg(labelHighlight(i18nc("Files \
included into this file", \
"Includes"))).arg(duchain->importedParentContexts().count()).arg(i18nc("Count of \
files this file was included into", "Included \
by")).arg(duchain->importers().count()); +    modifyHtml() += QString("%1: %2 %3: \
%4").arg(labelHighlight(i18nc("Files included into this file", \
"Includes"))).arg(duchain->importedParentContexts().count()).arg(labelHighlight(i18nc("Count \
of files this file was included into", "Included \
by"))).arg(duchain->importers().count());  modifyHtml() += "<br />";
 }
 
--- trunk/extragear/sdk/kdevplatform/language/duchain/navigation/abstractnavigationcontext.cpp \
#1103199:1103200 @@ -440,10 +440,25 @@
   return m_currentText;
 }
 
+QString AbstractNavigationContext::fontSizePrefix(bool shorten) const
+{
+  if(shorten)
+    return "";
+  else
+    return "";
+}
 
+QString AbstractNavigationContext::fontSizeSuffix(bool shorten) const
+{
+  if(shorten)
+    return "";
+  else
+    return "";
+}
+
 const Colorizer AbstractNavigationContext::typeHighlight("006000");
 const Colorizer AbstractNavigationContext::errorHighlight("990000");
-const Colorizer AbstractNavigationContext::labelHighlight("000035");
+const Colorizer AbstractNavigationContext::labelHighlight("000000");
 const Colorizer AbstractNavigationContext::codeHighlight("005000");
 const Colorizer AbstractNavigationContext::propertyHighlight("009900");
 const Colorizer AbstractNavigationContext::navigationHighlight("000099");
--- trunk/extragear/sdk/kdevplatform/language/duchain/navigation/abstractnavigationcontext.h \
#1103199:1103200 @@ -102,6 +102,11 @@
     
   protected:
     
+    /// Returns the html font-size prefix (aka. <small> or similar) for the given \
mode +    QString fontSizePrefix(bool shorten) const;
+    /// Returns the html font-size suffix (aka. <small> or similar) for the given \
mode +    QString fontSizeSuffix(bool shorten) const;
+    
     virtual void setPreviousContext(AbstractNavigationContext* previous);
     
     struct TextHandler {
--- trunk/extragear/sdk/kdevplatform/language/duchain/navigation/usesnavigationcontext.cpp \
#1103199:1103200 @@ -36,9 +36,9 @@
   return "Uses";
 }
 
-QString UsesNavigationContext::html(bool) {
+QString UsesNavigationContext::html(bool shorten) {
   clear();
-  modifyHtml()  += "<html><body><p><small><small>";
+  modifyHtml()  += "<html><body><p>" + fontSizePrefix(shorten);
   
   if( m_previousContext ) {
     modifyHtml() += navigationHighlight("Uses of ");
@@ -50,7 +50,7 @@
     }
   }
   
-  modifyHtml() += "</small></small></p></body></html>";
+  modifyHtml() += fontSizeSuffix(shorten) + "</p></body></html>";
 
   return currentHtml();
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic