<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>76663</bug_id>
          
          <creation_ts>2004-03-03 17:20:36 +0000</creation_ts>
          <short_desc>Insert tag from Files tree does not respect attribute quotation setting</short_desc>
          <delta_ts>2004-03-03 19:12:43 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>quanta</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Dennis Hansen">dennis</reporter>
          <assigned_to name="András Manţia">amantia</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>211920</commentid>
    <comment_count>0</comment_count>
    <who name="Dennis Hansen">dennis</who>
    <bug_when>2004-03-03 17:20:36 +0000</bug_when>
    <thetext>Version:           3.3 Bleeding Edge (2004-03-01) (using KDE 3.2.0, compiled sources)
Compiler:          gcc version 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)
OS:          Linux (i686) release 2.4.21-0.27mdk

If I right RMB click a file in the Files Tree and choose &quot;Insert Tag&quot; it does not respect my single quote attribute setting from quanta, it will always insert in double quotes,
I get for example this
&lt;a href=&quot;file.php&quot;&gt;&lt;/a&gt;
instead of
&lt;a href=&apos;file.php&apos;&gt;&lt;/a&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>211944</commentid>
    <comment_count>1</comment_count>
    <who name="Dennis Hansen">dennis</who>
    <bug_when>2004-03-03 18:28:18 +0000</bug_when>
    <thetext>Attached is a patch that fixes this.
Should be good untill someone complains about it not respecting the 
tag case - uppercase/lowercase :-)

This patch take cares of the quote attribute for &lt;a&gt; and &lt;img&gt; tags
they both had the same problem.


Created an attachment (id=5003)
quote-tag-attribute.patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>211950</commentid>
    <comment_count>2</comment_count>
    <who name="András Manţia">amantia</who>
    <bug_when>2004-03-03 18:49:44 +0000</bug_when>
    <thetext>I&apos;m on my way to create a patch that takes care also of tag/attribute 
case. ;-) It&apos;s compiling right now here.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>211953</commentid>
    <comment_count>3</comment_count>
    <who name="Dennis Hansen">dennis</who>
    <bug_when>2004-03-03 18:58:12 +0000</bug_when>
    <thetext>Sounds good !
Next time I won&apos;t bug report before I got the fix made myself if I can - 
you&apos;re so quick :-)

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>211959</commentid>
    <comment_count>4</comment_count>
    <who name="András Manţia">amantia</who>
    <bug_when>2004-03-03 19:12:42 +0000</bug_when>
    <thetext>CVS commit by amantia: 

Use the correct quotation and case when inserting a link to a file from the treeviews [#76663]

Don&apos;t you want to subscribe to our devel list? See https://mail.kde.org/mailman/listinfo/quanta-devel.

CCMAIL: 76663-done@bugs.kde.org


  M +1 -0      ChangeLog   1.238
  M +18 -4     src/quanta.cpp   1.437
  M +8 -0      utility/quantacommon.cpp   1.80
  M +3 -0      utility/quantacommon.h   1.64


--- kdewebdev/quanta/ChangeLog  #1.237:1.238
@@ -44,4 +44,5 @@
         - background parsing: allow user input while parsing [#63000 and its duplicates]
         - load DTEPs only on demand: improves startup performance, uses less memory
+        - use the correct quotation and case when inserting a link to a file from the treeviews [#76663]
     - behavioral changes:
     - new features:

--- kdewebdev/quanta/src/quanta.cpp  #1.436:1.437
@@ -762,7 +762,17 @@ void QuantaApp::slotInsertTag(const KURL
         {
           QString width,height;
-          width.setNum( img.width () );
-          height.setNum( img.height() );
-          w-&gt;insertTag(&quot;&lt;img src=\&quot;&quot;+urlStr+&quot;\&quot; width=\&quot;&quot;+width+&quot;\&quot; height=\&quot;&quot;+height+&quot;\&quot; border=\&quot;0\&quot;&gt;&quot;);
+          width.setNum(img.width());
+          height.setNum(img.height());
+          QString imgTag = QuantaCommon::tagCase(&quot;&lt;img &quot;);        
+          imgTag += QuantaCommon::attrCase(&quot;src=&quot;);
+          imgTag += QuantaCommon::quoteAttributeValue(urlStr);
+          imgTag += QuantaCommon::attrCase(&quot; width=&quot;);
+          imgTag += QuantaCommon::quoteAttributeValue(width);
+          imgTag += QuantaCommon::attrCase(&quot; height=&quot;);
+          imgTag += QuantaCommon::quoteAttributeValue(height);
+          imgTag += QuantaCommon::attrCase(&quot; border=&quot;);
+          imgTag += QuantaCommon::quoteAttributeValue(QString(&quot;%1&quot;).arg(0));
+          imgTag += &quot;&gt;&quot;;
+          w-&gt;insertTag(imgTag);
           isImage = true;
         }
@@ -770,5 +780,9 @@ void QuantaApp::slotInsertTag(const KURL
       if (!isImage)
       {
-        w-&gt;insertTag( &quot;&lt;a href=\&quot;&quot;+urlStr+&quot;\&quot;&gt;&quot;,&quot;&lt;/a&gt;&quot;);
+        QString tag = QuantaCommon::tagCase(&quot;&lt;a &quot;);
+        tag += QuantaCommon::attrCase(&quot;href=&quot;);
+        tag += QuantaCommon::quoteAttributeValue(urlStr);
+        tag += &quot;&gt;&quot;;
+        w-&gt;insertTag(tag, QuantaCommon::tagCase(&quot;&lt;/a&gt;&quot;));
       }
     }

--- kdewebdev/quanta/utility/quantacommon.cpp  #1.79:1.80
@@ -101,4 +101,12 @@ QString QuantaCommon::attrCase( const QS
 }
 
+/** returns the attribute value in quoted form, by taking care of the
+quotation setting*/
+QString QuantaCommon::quoteAttributeValue(const QString&amp; value)
+{
+  QString quote = qConfig.attrValueQuotation;
+  return quote + value + quote;
+}
+
 /** Set&apos;s up the url correctly from urlString. */
 void QuantaCommon::setUrl(KURL &amp;url, const QString&amp; urlString)

--- kdewebdev/quanta/utility/quantacommon.h  #1.63:1.64
@@ -127,4 +127,7 @@ public:
   /** convert tag to upper or lower case */
   static QString attrCase( const QString&amp; attr);
+/** returns the attribute value in quoted form, by taking care of the
+quotation setting*/
+  static QString quoteAttributeValue(const QString&amp; value);
   /** Set&apos;s up the url correctly from urlString. */
   static void setUrl(KURL &amp;url, const QString&amp; urlString);


</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>5003</attachid>
            <date>2004-03-03 18:28:18 +0000</date>
            <delta_ts>2004-03-03 18:28:18 +0000</delta_ts>
            <desc>quote-tag-attribute.patch</desc>
            <filename>quote-tag-attribute.patch</filename>
            <type>text/x-diff</type>
            <size>1301</size>
            <attacher name="Dennis Hansen">dennis</attacher>
            
              <data encoding="base64">SW5kZXg6IHNyYy9xdWFudGEuY3BwCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6IC9ob21lL2tkZS9rZGV3
ZWJkZXYvcXVhbnRhL3NyYy9xdWFudGEuY3BwLHYKcmV0cmlldmluZyByZXZpc2lvbiAxLjQzNgpk
aWZmIC11IC1yMS40MzYgcXVhbnRhLmNwcAotLS0gc3JjL3F1YW50YS5jcHAJMiBNYXIgMjAwNCAx
MDo0ODoyMSAtMDAwMAkxLjQzNgorKysgc3JjL3F1YW50YS5jcHAJMyBNYXIgMjAwNCAxNzoxNjox
NCAtMDAwMApAQCAtNzU1LDYgKzc1NSw3IEBACiAgICAgICB3LT5pbnNlcnRUYWcoZGlySW5mby5w
cmVUZXh0K3VybFN0citkaXJJbmZvLnBv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ggIjxhIGhyZWY9
IithdHRyaWJ1dGVRdW90YXRpb24rdXJsU3RyK2F0dHJpYnV0ZVF1b3RhdGlvbisiPiIsIjwvYT4i
KTsKICAgICAgIH0KICAgICB9CiAgICAgdy0+dmlldygpLT5zZXRGb2N1cygpOwo=
</data>

          </attachment>
      

    </bug>

</bugzilla>