<?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>144924</bug_id>
          
          <creation_ts>2007-05-01 16:29:57 +0000</creation_ts>
          <short_desc>Umbrello creates massive duplications of UMLStereotype &lt;&lt;folder&gt;&gt; et al. internally</short_desc>
          <delta_ts>2022-02-15 15:10:45 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>umbrello</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>Gentoo Packages</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>1</everconfirmed>
          <reporter name="Baldo Davide">baldosoft</reporter>
          <assigned_to name="Umbrello Development Group">umbrello-devel</assigned_to>
          <cc>okellogg</cc>
          
          <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>523593</commentid>
    <comment_count>0</comment_count>
    <who name="Baldo Davide">baldosoft</who>
    <bug_when>2007-05-01 16:29:57 +0000</bug_when>
    <thetext>Version:            (using KDE KDE 3.5.6)
Installed from:    Gentoo Packages
Compiler:          gcc version 4.1.1, Target: i686-pc-linux-gnu 
OS:                Linux

There is always a clear overuse of cpu when I open a file or when I move something on the &apos;class diagram&apos;, please do something, it took me over 20 seconds for open a file or undo a change.

My cpu is: AMD Athlon(TM) XP 2600+
gcc flags: -O2 -march=athlon-xp -pipe -fomit-frame-pointer</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>523622</commentid>
    <comment_count>1</comment_count>
    <who name="Oliver Kellogg">okellogg</who>
    <bug_when>2007-05-01 19:41:52 +0000</bug_when>
    <thetext>1) Please update to 1.5.7-beta1, this bug has been fixed.

2) In your XMI files, you will see massive repetitions of lines like this:

&lt;UML:Stereotype isSpecification=&quot;false&quot; isLeaf=&quot;false&quot; visibility=&quot;public&quot; namespace=&quot;m1&quot; xmi.id=&quot;2&quot; isRoot=&quot;false&quot; isAbstract=&quot;false&quot; name=&quot;folder&quot; /&gt;

In a text editor, remove all the duplicated &lt;UML:Stereotype&gt;s for &quot;folder&quot;.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>525087</commentid>
    <comment_count>2</comment_count>
    <who name="Oliver Kellogg">okellogg</who>
    <bug_when>2007-05-10 07:33:30 +0000</bug_when>
    <thetext>&gt; 1) Please update to 1.5.7-beta1, this bug has been fixed.

Unfortunately, I again was too quick closing this PR.
After working on a model for a while, I found that the duplicated
&lt;UML:Stereotype&gt;s are still present in branches/KDE/3.5/kdesdk r663030.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>525088</commentid>
    <comment_count>3</comment_count>
    <who name="Oliver Kellogg">okellogg</who>
    <bug_when>2007-05-10 07:38:59 +0000</bug_when>
    <thetext>SVN commit 663112 by okellogg:

UMLDoc::saveToXMI(): While I haven&apos;t been able to find the cause of the bug,
as a workaround check against the duplicated entries in m_stereoList on saving.
CCBUG:144924


 M  +14 -1     umldoc.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umldoc.cpp #663111:663112
@@ -1287,8 +1287,21 @@
 
     // Save stereotypes and toplevel datatypes first so that upon loading
     // they are known first.
+    // There is a bug causing duplication of the same stereotype in m_stereoList.
+    // As a workaround, we use a string list to memorize which stereotype has been saved.
+    QStringList stereoNames;
+    QValueList&lt;Uml::IDType&gt; stereoIDs;
     for (UMLStereotype *s = m_stereoList.first(); s; s = m_stereoList.next() ) {
-        s-&gt;saveToXMI(doc, ownedNS);
+        QString stName = s-&gt;getName();
+        Uml::IDType stID = s-&gt;getID();
+        if (!stereoNames.contains(stName) &amp;&amp; !stereoIDs.contains(stID)) {
+            s-&gt;saveToXMI(doc, ownedNS);
+            stereoNames.append(stName);
+            stereoIDs.append(stID);
+        } else {
+            kDebug() &lt;&lt; &quot;UMLDoc::saveToXMI: encountered duplicated stereotype &quot;
+                &lt;&lt; stName &lt;&lt; &quot; (id &quot; &lt;&lt; ID2STR(stID) &lt;&lt; &quot;), see bug 144924&quot; &lt;&lt; endl;
+        }
     }
     for (int i = 0; i &lt; Uml::N_MODELTYPES; i++) {
         m_root[i]-&gt;saveToXMI(doc, ownedNS);
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>525090</commentid>
    <comment_count>4</comment_count>
    <who name="Oliver Kellogg">okellogg</who>
    <bug_when>2007-05-10 07:43:19 +0000</bug_when>
    <thetext>Ah. It looks as though the duplications have something to do with using &quot;Undo&quot;.
To be further investigated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>529271</commentid>
    <comment_count>5</comment_count>
    <who name="Oliver Kellogg">okellogg</who>
    <bug_when>2007-06-01 20:47:48 +0000</bug_when>
    <thetext>I am tempted to close this but will keep it open
since only the symptom is fixed, not the cause.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2011980</commentid>
    <comment_count>6</comment_count>
    <who name="Justin Zobel">justin.zobel</who>
    <bug_when>2021-03-09 07:00:32 +0000</bug_when>
    <thetext>Thank you for the bug report.

As this report hasn&apos;t seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2104914</commentid>
    <comment_count>7</comment_count>
    <who name="Oliver Kellogg">okellogg</who>
    <bug_when>2022-02-15 15:10:45 +0000</bug_when>
    <thetext>(In reply to Oliver Kellogg from comment #5)
&gt; I am tempted to close this but will keep it open
&gt; since only the symptom is fixed, not the cause.

After years of use without problem, I hereby change my mind to &quot;symptom fix is good enough&quot;.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>