Bug 141876 - C++ code generator does not correctly define namespaces
Summary: C++ code generator does not correctly define namespaces
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-18 19:07 UTC by Brad Markel
Modified: 2007-02-19 22:15 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brad Markel 2007-02-18 19:07:09 UTC
Version:           1.5.61 (using KDE 3.5.5, Kubuntu (edgy) 4:3.5.5-0ubuntu3.1)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.17-10-generic

The code generator for C++ doesn't put the namespace declaration before the class declaration or definition for classes included in a package, the result being that the classes end up in the global namespace.  For example, for a class B in package A, the declaration should look like:

namespace A
{
  class B { };
};

But umbrello only generates

class B { };
Comment 1 Oliver Kellogg 2007-02-19 22:15:37 UTC
SVN commit 635340 by okellogg:

Constructor: Let WRITE_PACKAGE_NAMESPACE default to true,
 at least until http://bugs.kde.org/141875 is resolved.
BUG:141876


 M  +1 -0      ChangeLog  
 M  +1 -1      umbrello/codegenerators/cppwriter.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #635339:635340
@@ -14,6 +14,7 @@
 * Ada95 Code Generation Errors for Aggregation (141644)
 * Unable to delete multiplicity information or lable from an association
   (141813)
+* C++ code generator does not correctly define namespaces (141876)
 
 Version 1.5.61
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/codegenerators/cppwriter.cpp #635339:635340
@@ -74,7 +74,7 @@
     WRITE_EMPTY_DESTRUCTOR = true;
     WRITE_VIRTUAL_DESTRUCTORS = true;
     WRITE_ATTRIBUTE_ACCESSOR_METHODS = true;
-    WRITE_PACKAGE_NAMESPACE = false;
+    WRITE_PACKAGE_NAMESPACE = true;
 
     // should this go away?? Not currently used.. but might be by new code generator
     /// to specifically 'tag' virtual classes and fields and methods.