[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Visibility tag support for kconfig_compiler
From:       Jakub Stachowski <stachowski () hypair ! net>
Date:       2004-12-04 22:06:28
Message-ID: 200412042306.29104.stachowski () hypair ! net
[Download RAW message or body]

Hello,

I made a little patch that makes possible to specify visibility tag like 
KDE_EXPORT for generated class. I need this in dnssd lib because it uses  
settings class generated by kconfig_compiler and there is  kcm module that 
has to be able to access it. However I'm not sure if 'Visibility' is good 
name for this option.

["kcfg.patch" (text/x-diff)]

diff -urd kconfig_compiler/kconfig_compiler.cpp kconfig_compiler-new/kconfig_compiler.cpp
--- kconfig_compiler/kconfig_compiler.cpp	2004-11-24 17:25:52.000000000 +0100
+++ kconfig_compiler-new/kconfig_compiler.cpp	2004-12-04 22:47:33.000000000 +0100
@@ -811,6 +811,8 @@
   QString nameSpace = codegenConfig.readEntry("NameSpace");
   QString className = codegenConfig.readEntry("ClassName");
   QString inherits = codegenConfig.readEntry("Inherits");
+  QString visibility = codegenConfig.readEntry("Visibility");
+  if (!visibility.isEmpty()) visibility+=" ";
   bool singleton = codegenConfig.readBoolEntry("Singleton", false);
   bool staticAccessors = singleton;
   bool customAddons = codegenConfig.readBoolEntry("CustomAdditions");
@@ -963,7 +965,7 @@
     h << "namespace " << nameSpace << " {" << endl << endl;
 
   // Class declaration header
-  h << "class " << className << " : public " << inherits << endl;
+  h << "class " << visibility << className << " : public " << inherits << endl;
   h << "{" << endl;
   h << "  public:" << endl;
 
diff -urd kconfig_compiler/README.dox kconfig_compiler-new/README.dox
--- kconfig_compiler/README.dox	2003-12-27 19:25:39.000000000 +0100
+++ kconfig_compiler-new/README.dox	2004-12-04 22:49:49.000000000 +0100
@@ -101,6 +101,13 @@
   KConfigSkeleton.</td>
 </tr>
 <tr>
+  <td><b>Visibility</b></td>
+  <td>string</td>
+  <td>-</td>
+  <td>Inserts visibility tag (for example KDE_EXPORT) between "class" keyword and class 
+  name in header file</td>
+</tr>
+<tr>
   <td><b>Singleton</b></td>
   <td>bool</td>
   <td>false</td>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic