<?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>85553</bug_id>
          
          <creation_ts>2004-07-20 13:32:05 +0000</creation_ts>
          <short_desc>accessor methods are private instead of public</short_desc>
          <delta_ts>2006-10-13 06:40:39 +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>1.2.1</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>1</everconfirmed>
          <reporter name="Florian Hackenberger">f.hackenberger</reporter>
          <assigned_to name="Umbrello Development Group">umbrello-devel</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>250672</commentid>
    <comment_count>0</comment_count>
    <who name="Florian Hackenberger">f.hackenberger</who>
    <bug_when>2004-07-20 13:32:05 +0000</bug_when>
    <thetext>Version:           1.2.1 (using KDE 3.2.1, Gentoo)
Compiler:          gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r1, propolice)
OS:                Linux (i686) release 2.6.7-gentoo-r5

When generating c++ code, accessors of protected or private members are set to protected/private too. They should be public, otherwise they are useless.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>258360</commentid>
    <comment_count>1</comment_count>
    <who name="Sebastian Stein">seb.kde</who>
    <bug_when>2004-08-13 09:16:07 +0000</bug_when>
    <thetext>I already looked a little bit into this problem. Accessor methods are generated from the attributes and get the scope of the attribute. So if you have a public attribute, you will also get a public accessor method. Nevertheless, I didn&apos;t found a way how to fix this yet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>303600</commentid>
    <comment_count>2</comment_count>
    <who name="Henrik Steffien">henrik.steffien</who>
    <bug_when>2005-01-16 22:01:51 +0000</bug_when>
    <thetext>The problem still exists in version 1.4.0-beta1. (compiled from source tarball from 2005-01-15 05:07).
With this behaviour accessor methods are completely useless.
Please try to fix it.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>342224</commentid>
    <comment_count>3</comment_count>
    <who name="march">marc.71</who>
    <bug_when>2005-05-15 17:38:40 +0000</bug_when>
    <thetext>There is also a problem if you don&apos;t want accessor method, it is not possible. If you select it in the umbrello configuration menu it takes no effect. 
So please try to fix the accesor bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>476047</commentid>
    <comment_count>4</comment_count>
    <who name="">chenpuning</who>
    <bug_when>2006-10-11 11:30:37 +0000</bug_when>
    <thetext>This bug is still present in 1.5.4. A similar bug in Java code generator has been fixed according to #59049 more than 3 years ago. Can we have this C++ code generation bug fixed also?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>476164</commentid>
    <comment_count>5</comment_count>
    <who name="Oliver Kellogg">okellogg</who>
    <bug_when>2006-10-11 20:42:54 +0000</bug_when>
    <thetext>SVN commit 594617 by okellogg:

writeHeaderAttributeAccessorMethods(): Switch to public if need be.
BUG:85553


 M  +5 -0      ChangeLog  
 M  +7 -2      umbrello/codegenerators/cppwriter.cpp  


--- trunk/KDE/kdesdk/umbrello/ChangeLog #594616:594617
@@ -1,3 +1,8 @@
+Version 2.0
+
+* Bugs/wishes from http://bugs.kde.org:
+* Accessor methods are private instead of public (85553)
+
 Version 1.5.5
 
 * PHP5 generator creates stub methods for all interfaces a class implements (C. Brunsdon)
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/cppwriter.cpp #594616:594617
@@ -552,8 +552,6 @@
 
     }
 
-    return;
-
 }
 
 void CppWriter::writeHeaderAttributeAccessorMethods (Uml::Visibility visibility, bool writeStatic, QTextStream &amp;stream )
@@ -585,9 +583,16 @@
         break;
     }
 
+    // switch to public
+    if (visibility != Uml::Visibility::Public)
+        stream &lt;&lt; &quot;public:&quot; &lt;&lt; m_endl &lt;&lt; m_endl;
+
     // write accessor methods for attribs we found
     writeAttributeMethods(list, visibility, true, false, INLINE_ATTRIBUTE_METHODS, stream);
 
+    // switch back to previous vis.
+    if (visibility != Uml::Visibility::Public)
+        stream &lt;&lt; visibility.toString() &lt;&lt; &quot;:&quot; &lt;&lt; m_endl &lt;&lt; m_endl;
 }
 
 // this is for writing *source* or *header* file attribute methods
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>476485</commentid>
    <comment_count>6</comment_count>
    <who name="Oliver Kellogg">okellogg</who>
    <bug_when>2006-10-13 06:40:38 +0000</bug_when>
    <thetext>&gt; Comment #4 From chenpuning@gmail.com  
&gt; [...] A similar bug in Java code generator has been fixed [...]
&gt; more than 3 years ago. Can we have this C++ code generation bug
&gt; fixed also?

The bug fixing is so slow because there aren&apos;t enough contributors.
I&apos;ve said this many times: Please everybody consider contributing!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>