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

List:       kde-commits
Subject:    branches/work/klinkstatus_proceed
From:       Paulo Moura Guedes <moura () kdewebdev ! org>
Date:       2005-11-01 1:48:27
Message-ID: 1130809707.163219.7780.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 476283 by mojo:

- Fix logic mistake with the "broken" attribute.
- Display url of broken links with color red (when exporting).

 M  +14 -2     data/styles/results_stylesheet.xsl  
 M  +3 -1      src/engine/linkstatus.cpp  
 M  +2 -1      src/ui/sessionwidget.cpp  
 M  +1 -1      src/utils/xsl.cpp  


--- branches/work/klinkstatus_proceed/data/styles/results_stylesheet.xsl #476282:476283
@@ -25,7 +25,7 @@
                     <br/>            
                 </xsl:if>               
                 <br/>            
-
+                
                 <table border="1">
                     <thead>
                         <tr>
@@ -60,7 +60,19 @@
     
     
     <xsl:template match="url">
-        <xsl:value-of select="."/>
+        <xsl:variable name="isBroken">
+            <xsl:value-of select="../status/@broken"/>
+        </xsl:variable>
+        <xsl:choose>
+            <xsl:when test="$isBroken='true'">
+                <span style="color: red;"> 
+                    <xsl:value-of select="."/>
+                </span> 
+            </xsl:when>
+            <xsl:otherwise>              
+                <xsl:value-of select="."/>
+            </xsl:otherwise>
+        </xsl:choose>      
     </xsl:template>
     
     <xsl:template match="status">
--- branches/work/klinkstatus_proceed/src/engine/linkstatus.cpp #476282:476283
@@ -182,7 +182,9 @@
     
     // <status>
     tmp_1 = element.ownerDocument().createElement("status");
-    tmp_1.setAttribute("broken", errorOccurred() ? "false" : "true"); // FIXME check if this is correct
+    tmp_1.setAttribute("broken", 
+                       ResultView::displayableWithStatus(this, ResultView::bad) ? 
+                               "true" : "false");
     tmp_1.appendChild(element.ownerDocument().createTextNode(status()));
     child_element.appendChild(tmp_1);
 
--- branches/work/klinkstatus_proceed/src/ui/sessionwidget.cpp #476282:476283
@@ -687,7 +687,8 @@
         outputStream->setEncoding(QTextStream::UnicodeUTF8);
 
         QString xslt_doc = FileManager::read(locate("appdata", "styles/results_stylesheet.xsl"));
-        XSLT xslt(xslt_doc);
+        XSLT xslt(xslt_doc);        
+//         kdDebug(23100) << search_manager_->toXML() << endl;
         QString html_ouptut = xslt.transform(search_manager_->toXML());
         (*outputStream) << html_ouptut << endl;
 
--- branches/work/klinkstatus_proceed/src/utils/xsl.cpp #476282:476283
@@ -167,7 +167,7 @@
         }
         else
         {
-            errorMsg = i18n( "The selected chat style is invalid." );
+            errorMsg = i18n( "The selected stylesheet is invalid." );
         }
 
         xmlFreeDoc( xmlDoc );
[prev in list] [next in list] [prev in thread] [next in thread] 

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