<?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>60616</bug_id>
          
          <creation_ts>2003-07-02 09:24:05 +0000</creation_ts>
          <short_desc>Cannot open file &apos;%1&apos; for writing, code templates will be lost when you close quanta</short_desc>
          <delta_ts>2003-07-04 09:36:48 +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>Compiled Sources</rep_platform>
          <op_sys>FreeBSD</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="Melvyn Sopacua">melvyn</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>143382</commentid>
    <comment_count>0</comment_count>
    <who name="Melvyn Sopacua">melvyn</who>
    <bug_when>2003-07-02 09:24:05 +0000</bug_when>
    <thetext>Version:           3.2-CVS-1 (using KDE 3.1.2)
Installed from:    compiled sources
Compiler:          gcc version 2.95.4 20020320 [FreeBSD]
OS:          FreeBSD (i386) release 4.8-STABLE

When adding an abbreviation, the above error message is generated. This *might* be due to the fact that I have 2 installations (one release and one CVS), since I also have 2 sets of each dtd.

It happens with the CVS version.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>143496</commentid>
    <comment_count>1</comment_count>
    <who name="András Manţia">amantia</who>
    <bug_when>2003-07-02 17:14:17 +0000</bug_when>
    <thetext>Subject: Re:  New: Cannot open file &apos;%1&apos; for writing, code templates will be lost when you close quanta

I just remembered: this may be an access right problem. If the Quanta DTD 
files (quanta/tags) directory for the DTD you are trying to create 
abbreviations for is in a directory writable only for root (like usually the 
global KDEDIRS is), writing it as a user will fail. A solution is to start 
Quanta as root when you create the abbreviations. Please try it, and if it&apos;s 
working, let me know. In that case the fix might be easy.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/AvbETQdfac6L/08RAsX7AJ4y5lvrJtDxFBy7kfZiqfuzLpKpHQCcDAZl
TtVa7XSSu4vqyGb26+tXXOQ=
=iEvU
-----END PGP SIGNATURE-----

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>143502</commentid>
    <comment_count>2</comment_count>
    <who name="András Manţia">amantia</who>
    <bug_when>2003-07-02 17:41:11 +0000</bug_when>
    <thetext>Subject: quanta

CVS commit by amantia: 

Change conflicting shortcut for Misc. Tag to Ctrl-Shift-T [#60616]. 
Clear the code field in the abbreviation settings on DTD change.

CCMAIL: 60616-done@bugs.kde.org


  M +1 -0      ChangeLog   1.185
  M +1 -0      quanta/dialogs/abbreviation.cpp   1.6
  M +1 -1      quanta/quantaview.cpp   1.27


--- quanta/ChangeLog  #1.184:1.185
@@ -18,4 +18,5 @@
     - opening project views or multiple files on startup is much faster
     - don&apos;t close quanta, if the user cancelled the toolbar saving [#59952]
+    - shortcut to Misc. Tag changed to Ctrl-Shift-T [#60616]
 
   - new features:

--- quanta/quanta/quantaview.cpp  #1.26:1.27
@@ -168,5 +168,5 @@ void QuantaView::initActions()
                         actionCollection, &quot;tag_mail&quot; );
 
-    (void) new KAction( i18n( &quot;Misc. Tag...&quot; ), &quot;tag_misc&quot;, CTRL+Key_T,
+    (void) new KAction( i18n( &quot;Misc. Tag...&quot; ), &quot;tag_misc&quot;, CTRL+SHIFT+Key_T,
                         this, SLOT( slotTagMisc() ),
                         actionCollection, &quot;tag_misc&quot; );

--- quanta/quanta/dialogs/abbreviation.cpp  #1.5:1.6
@@ -49,4 +49,5 @@ void Abbreviation::slotDTDChanged(const 
   saveTemplates();
   templatesList-&gt;clear();
+  codeEdit-&gt;clear();
   oldItem = 0L;
   QString dtdName = QuantaCommon::getDTDNameFromNickName(newDTDName);


</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>143516</commentid>
    <comment_count>3</comment_count>
    <who name="András Manţia">amantia</who>
    <bug_when>2003-07-02 18:18:34 +0000</bug_when>
    <thetext>Sorry, closed by mistake. ;-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>143771</commentid>
    <comment_count>4</comment_count>
    <who name="Melvyn Sopacua">melvyn</who>
    <bug_when>2003-07-03 22:34:47 +0000</bug_when>
    <thetext>Patch for saving works, but the same needs to be done for loading, because now on 
startup only $INSTALL_PREFIX/share/quanta/tags/$DTD_NAME/abbreviations is 
loaded. 
 
When you then save, the $KDEHOME/share/quanta/tags/$DTD_NAME/abbreviations 
file is overwritten. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>143840</commentid>
    <comment_count>5</comment_count>
    <who name="András Manţia">amantia</who>
    <bug_when>2003-07-04 09:36:48 +0000</bug_when>
    <thetext>Subject: quanta/quanta

CVS commit by amantia: 

Fix namespace editing in the attribute tree.
Load the abbreviations file from $KDEHOME if it&apos;s present there, even when multiple $KDEDIRS are defined. (part of bug 60616).

CCMAIL: 60616-done@bugs.kde.org


  M +1 -1      dialogs/abbreviation.cpp   1.11
  M +5 -2      document.cpp   1.176
  M +14 -3     quanta_init.cpp   1.301


--- quanta/quanta/document.cpp  #1.175:1.176
@@ -213,6 +213,9 @@ void Document::changeTagNamespace(Tag *t
     tag-&gt;namePos(nl, nc);
     reparseEnabled = false;
-    editIf-&gt;removeText(bl, bc+1, nl, nc-1);
+    editIf-&gt;removeText(bl, bc+1, nl, nc);
     reparseEnabled = true;
+  } else
+  {
+    tag-&gt;beginPos(bl, bc);
   }
   if (nameSpace.isEmpty())
@@ -222,5 +225,5 @@ void Document::changeTagNamespace(Tag *t
   {
     viewCursorIf-&gt;setCursorPositionReal((uint)bl, (uint)(bc+1));
-    insertText(nameSpace);
+    insertText(nameSpace+&quot;:&quot;);
   }
   quantaApp-&gt;slotNewLineColumn();

--- quanta/quanta/quanta_init.cpp  #1.300:1.301
@@ -1423,8 +1423,19 @@ void QuantaApp::readTagDir(QString &amp;dirN
  //read the abbreviations files
   QString abbrevFile = dirName;
-  if (dirName.startsWith(qConfig.globalDataDir))
+  tmpStr = dirName;
+  QStringList resourceDirs = KGlobal::dirs()-&gt;resourceDirs(&quot;data&quot;);
+  bool dirFound = false;
+  for (uint i = 0; i &lt; resourceDirs.count(); i++)
   {
-    abbrevFile = dirName.right(dirName.length() - qConfig.globalDataDir.length());
-    abbrevFile = KGlobal::dirs()-&gt;saveLocation(&quot;data&quot;, abbrevFile) +&quot;/&quot;;
+    if (tmpStr.startsWith(resourceDirs[i]))
+    {
+      dirFound = true;
+      tmpStr = tmpStr.right(tmpStr.length() - resourceDirs[i].length());
+      break;
+    }
+  }
+  if (dirFound)
+  {
+    abbrevFile = KGlobal::dirs()-&gt;saveLocation(&quot;data&quot;, tmpStr) +&quot;/&quot;;
   }
   abbrevFile.append(&quot;abbreviations&quot;);

--- quanta/quanta/dialogs/abbreviation.cpp  #1.10:1.11
@@ -188,5 +188,5 @@ void Abbreviation::saveTemplates()
 
     QFile f(s);
-    if (f.open(IO_WriteOnly))
+    if (f.open(IO_WriteOnly | IO_Truncate))
     {
       QTextStream str(&amp;f);


</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>