[Kde-bindings] KDE/kdebindings

Richard Dale Richard_Dale at tipitina.demon.co.uk
Tue Jun 24 12:59:01 UTC 2008


SVN commit 823885 by rdale:

* Make both the smoke lib and the kimono bindings use non-const methods
  in preference to const ones. This is because KConfigBase::group() 
  behaves differently according to whether the const on non-const
  version is called via overloading in C++. The non-const variant
  will now be called in C#, otherwise it appears that the KConfigGroup 
  returned would silently fail to write anything to disc.

CCMAIL: kde-bindings at kde.org


 M  +10 -0     csharp/kimono/ChangeLog  
 M  +4 -0      csharp/kimono/kde/KComboBox.cs  
 M  +8 -4      csharp/kimono/kde/KConfigBase.cs  
 M  +1 -1      csharp/kimono/kde/KDE.cs  
 M  +7 -0      csharp/kimono/kde/KLineEdit.cs  
 M  +7 -35     csharp/kimono/kde/KXmlGuiWindow.cs  
 M  +0 -2      csharp/kimono/tutorials/p7/p7.cs  
 M  +0 -2      csharp/kimono/tutorials/p9/p9.cs  
 M  +5 -5      kalyptus/kalyptusCxxToKimono.pm  
 M  +20 -8     kalyptus/kalyptusCxxToSmoke.pm  


--- trunk/KDE/kdebindings/csharp/kimono/ChangeLog #823884:823885
@@ -1,4 +1,14 @@
+2008-06-24  Richard Dale  <richard.j.dale at gmail.com>
+
+	* Make both the smoke lib and the kimono bindings use non-const methods
+	  in preference to const ones. This is because KConfigBase::group() 
+	  behaves differently according to whether the const on non-const
+	  version is called via overloading in C++. The non-const variant
+	  will now be called in C#, otherwise it appears that the KConfigGroup 
+	  returned would silently fail to write anything to disc.
+
 2008-06-18  Richard Dale  <richard.j.dale at gmail.com>
+
 	* Change some namespaces to classes as calling the methods via 'Global'
 	  looked a bit clumsy. For instance, KConfig.Global.Config() or
 	  KStandardAction.Global.Quit() looked wrong.
--- trunk/KDE/kdebindings/csharp/kimono/kde/KComboBox.cs #823884:823885
@@ -357,6 +357,10 @@
 		protected override void WheelEvent(QWheelEvent ev) {
 			interceptor.Invoke("wheelEvent#", "wheelEvent(QWheelEvent*)", typeof(void), typeof(QWheelEvent), ev);
 		}
+		[SmokeMethod("minimumSizeHint() const")]
+		protected new virtual QSize MinimumSizeHint() {
+			return (QSize) interceptor.Invoke("minimumSizeHint", "minimumSizeHint() const", typeof(QSize));
+		}
 		/// <remarks>
 		///  Completes text according to the completion mode.
 		///  Note: this method is <code>not</code> invoked if the completion mode is
--- trunk/KDE/kdebindings/csharp/kimono/kde/KConfigBase.cs #823884:823885
@@ -51,13 +51,17 @@
 			return (bool) interceptor.Invoke("hasGroup#", "hasGroup(const QByteArray&) const", typeof(bool), typeof(QByteArray), group);
 		}
 		/// <remarks>
-		///  @overload
-		/// </remarks>		<short>    @overload </short>
+		///  Returns an object for the named subgroup.
+		/// <param> name="group" the group to open. Pass a null string on to the KConfig
+		///    object to obtain a handle on the root group.
+		/// </param></remarks>		<return> The list of groups.
+		/// </return>
+		/// 		<short>    Returns an object for the named subgroup.</short>
 		public KConfigGroup Group(QByteArray group) {
-			return (KConfigGroup) interceptor.Invoke("group#", "group(const QByteArray&) const", typeof(KConfigGroup), typeof(QByteArray), group);
+			return (KConfigGroup) interceptor.Invoke("group#", "group(const QByteArray&)", typeof(KConfigGroup), typeof(QByteArray), group);
 		}
 		public KConfigGroup Group(string group) {
-			return (KConfigGroup) interceptor.Invoke("group$", "group(const QString&) const", typeof(KConfigGroup), typeof(string), group);
+			return (KConfigGroup) interceptor.Invoke("group$", "group(const QString&)", typeof(KConfigGroup), typeof(string), group);
 		}
 		/// <remarks>
 		///  Delete <code>aGroup.</code> This marks <code>aGroup</code> as <b>deleted</b> in the config object. This effectively
--- trunk/KDE/kdebindings/csharp/kimono/kde/KDE.cs #823884:823885
@@ -17,7 +17,7 @@
 		// QDataStream& operator<<(QDataStream& arg1,const KProtocolInfo::ExtraField& arg2); >>>> NOT CONVERTED
 		/// <remarks>
 		///  @brief Returns the encoded number of KDE's version, see the KDE_VERSION macro.
-		///  In contrary to the macro KDE_VERSION
+		///  In contrast to the macro KDE_VERSION
 		///  this function returns the number of the actually
 		///  installed KDE version, not the number of the KDE version that was
 		///  installed when the program was compiled.
--- trunk/KDE/kdebindings/csharp/kimono/kde/KLineEdit.cs #823884:823885
@@ -235,6 +235,13 @@
 			interceptor.Invoke("setCompletionBox#", "setCompletionBox(KCompletionBox*)", typeof(void), typeof(KCompletionBox), box);
 		}
 		/// <remarks>
+		/// </remarks>		<return> the size used by the clear button
+		/// </return>
+		/// 		<short>   </short>
+		public QSize ClearButtonUsedSize() {
+			return (QSize) interceptor.Invoke("clearButtonUsedSize", "clearButtonUsedSize() const", typeof(QSize));
+		}
+		/// <remarks>
 		///  Re-implemented for internal reasons. API not changed.
 		///      </remarks>		<short>    Re-implemented for internal reasons.</short>
 		[Q_SLOT("void setReadOnly(bool)")]
--- trunk/KDE/kdebindings/csharp/kimono/kde/KXmlGuiWindow.cs #823884:823885
@@ -5,43 +5,15 @@
 	using System.Text;
 	using System.Collections.Generic;
 	/// <remarks>
-	///  Top level widget that provides toolbars, a status line and a frame.
-	///  It should be used as a top level (parent-less) widget.
-	///  It manages the geometry for all its children, including your
-	///  main widget.
-	///  Normally, you will inherit from KMainWindow,
-	///  then construct (or use some existing) widget as
-	///  your main view. You can set only one main view.
-	///  You can add as many toolbars as you like. There can be only one menubar
-	///  and only one statusbar.
-	///  The toolbars, menubar, and statusbar can be created by the
-	///  KMainWindow and - unlike the old KMainWindow - may, but do not
-	///  have to, be deleted by you. KMainWindow will handle that internally.
-	///  Height and width can be operated independently from each other. Simply
-	///  define the minimum/maximum height/width of your main widget and
-	///  KMainWindow will take this into account. For fixed size windows set
-	///  your main widget to a fixed size.
-	///  Fixed aspect ratios (heightForWidth()) and fixed width widgets are
-	///  not supported.
-	///  KMainWindow will set icon, mini icon and caption, which it gets
-	///  from KApplication. It provides full session management, and
-	///  will save its position, geometry and positions of toolbars and
-	///  menubar on logout. If you want to save additional data, reimplement
-	///  saveProperties() and (to read them again on next login)
-	///  readProperties(). To save special data about your data, reimplement
-	///  saveGlobalProperties(). To warn user that application or
-	///  windows have unsaved data on close or logout, reimplement
-	///  queryClose() and/or queryExit().
-	///  There are also kRestoreMainWindows convenience functions which
-	///  can restore all your windows on next login.
-	///   Note that a KMainWindow per-default is created with the
-	///   WDestructiveClose flag, i.e. it is automatically destroyed when the
-	///   window is closed. If you do not want this behavior, specify 0 as
-	///   widget flag in the constructor.
+	///  Instead of creating a KMainWindow manually and assigning menus, menu entries,
+	///  toolbar buttons and actions to it by hand, this class can be used to load an
+	///  rc file to manage the main window's actions.
+	///  See http://techbase.kde.org/Development/Tutorials/Using_KActions#XMLGUI
+	///  for essential information on the XML file format and usage of this class.
 	///  </remarks>		<author> Reginald Stadlbauer (reggie at kde.org) Stephan Kulow (coolo at kde.org), Matthias Ettrich (ettrich at kde.org), Chris Schlaeger (cs at kde.org), Sven Radej (radej at kde.org). Maintained by Sven Radej (radej at kde.org)
 	/// </author>
-	/// 		<short> %KDE top level main window.</short>
-	/// 		<see> KApplication</see>
+	/// 		<short> %KDE top level main window with predefined action layout.</short>
+	/// 		<see> KMainWindow</see>
 	[SmokeClass("KXmlGuiWindow")]
 	public class KXmlGuiWindow : KMainWindow, IKXMLGUIBuilder, IKXMLGUIClient, IDisposable {
  		protected KXmlGuiWindow(Type dummy) : base((Type) null) {}
--- trunk/KDE/kdebindings/csharp/kimono/tutorials/p7/p7.cs #823884:823885
@@ -51,8 +51,6 @@
         StandardToolBarMenuEnabled = true;
  
         location = new QLineEdit();
-        location.Text = "http://localhost";
-
         config = new KConfigGroup(KGlobal.Config(), "Settings");
         location.Text = config.ReadEntry("defaultPage", "http://localhost");
 
--- trunk/KDE/kdebindings/csharp/kimono/tutorials/p9/p9.cs #823884:823885
@@ -51,8 +51,6 @@
         StandardToolBarMenuEnabled = true;
  
         location = new QLineEdit();
-        location.Text = "http://localhost";
-
         config = new KConfigGroup(KGlobal.Config(), "Settings");
         location.Text = config.ReadEntry("defaultPage", "http://localhost");
 
--- trunk/KDE/kdebindings/kalyptus/kalyptusCxxToKimono.pm #823884:823885
@@ -2950,7 +2950,7 @@
 	}
 				}, undef );
 
-	my %const_methods = ();
+	my %non_const_methods = ();
 	
 	# build const-methods table
      Iter::MembersByType ( $classNode, undef,
@@ -2959,8 +2959,8 @@
 		next unless $m->{NodeType} eq 'method';
 		my @args = @{ $m->{ParamList} };
 	    my $sig = methodSignature( $m, $#args );
-		if ( $sig =~ /(.*) const$/ ) {
-			$const_methods{$1} = 1;
+		if ( $sig !~ /(.*) const$/ ) {
+			$non_const_methods{"$sig const"} = 1;
 		}
 		
 		      }, undef );
@@ -2972,8 +2972,8 @@
         if ( $methodNode->{NodeType} eq 'method' ) {
 	    	my @args = @{ $methodNode->{ParamList} };
 	    	my $sig = methodSignature( $methodNode, $#args );
-	    	# prefer const methods over non-const methods, same as in the smoke lib
-	    	return if ( $const_methods{$sig} && $methodNode->{Flags} !~ "v" );
+	    	# prefer non-const methods over const methods, same as in the smoke lib
+	    	return if ( $non_const_methods{$sig} && $methodNode->{Flags} !~ "v" );
 
 	    	my ($meth, $static, $interface, $proxyInterface, $signals, $notconv) = generateMethod( \%virtualMethods, \%overridenMethods, $classNode, $methodNode, $addImport, $ancestorCount, $csharpMethods, $mainClassNode, $generateConstructors );
 	    	$methodCode .= $meth;
--- trunk/KDE/kdebindings/kalyptus/kalyptusCxxToSmoke.pm #823884:823885
@@ -379,7 +379,6 @@
 			|| $className eq 'KDevelop::DUContext::SearchItem'
 			|| $className eq 'KDevelop::DUChainObserver'
 			|| $className eq 'KDevelop::QuickOpenFileSetInterface'
-
 			|| $className eq 'KDirOperator'
 			|| $className eq 'KDirSelectDialog'
 			|| $className eq 'KEditListBox::CustomEditor'
@@ -616,10 +615,22 @@
 			|| ($className eq 'KDevelop::EditorIntegrator' and $name eq 'createCursor')
 			|| ($className eq 'KDevelop::EditorIntegrator' and $name eq 'initialise')
 			|| ($className eq 'KDevelop::EditorIntegrator' and $name eq 'removeDocument')
+			|| ($className eq 'KDevelop::EditorIntegrator' and $name eq 'documentLoaded')
 			|| ($className eq 'KDevelop::DUContext' and $name eq 'scopeIdentifierInternal')
 			|| ($className eq 'KDevelop::IOutputView' and $name eq 'outputRemoved')
 			|| ($className eq 'KDevelop::IOutputView' and $name eq 'toolViewRemoved')
+			|| ($className eq 'KDevelop::EditorIntegrator::documentLoaded')
+			|| ($className eq 'KDevelop::DocumentRangeObject' and $name eq 'setRangeOwning')
+			|| ($className eq 'KDevelop::DocumentRangeObject' and $name eq 'ownsRange')
+			|| ($className eq 'KDevelop::IProjectBuilder' and $name eq 'built')
+			|| ($className eq 'KDevelop::IProjectBuilder' and $name eq 'installed')
+			|| ($className eq 'KDevelop::IProjectBuilder' and $name eq 'cleaned')
+			|| ($className eq 'KDevelop::IProjectBuilder' and $name eq 'failed')
+			|| ($className eq 'KDevelop::IProjectBuilder' and $name eq 'configured')
+			|| ($className eq 'KDevelop::IProjectBuilder' and $name eq 'pruned')
+			|| ($className eq 'KDevelop::UiController' and $name eq 'defaultArea')
 			|| ($className eq 'Sublime::ViewWidgetCreator' and $name eq 'createViewWidget')
+
 			|| ($className eq 'KTextEditor::Range' and $name =~ /operator/)
 			|| ($className eq 'KTextEditor::Range' and $name eq 'boundaryOnColumn')
 			|| ($className eq 'KTextEditor::Cursor' and $name =~ /operator/)
@@ -2003,17 +2014,17 @@
 
 		      }, undef );
 
-	 my %const_methods = ();
-     # Now look at all const methods for this class, in order to use
-	 # them in preference to any otherwise identical non-const method
+	 my %non_const_methods = ();
+     # Now look at all non-const methods for this class, in order to use
+	 # them in preference to any otherwise identical const method
      Iter::MembersByType ( $classNode, undef,
 		sub {	my ($classNode, $m ) = @_;
 	
 		next unless $m->{NodeType} eq 'method';
 		my @args = @{ $m->{ParamList} };
 	    my $sig = methodSignature( $m, $#args );
-		if ( $sig =~ /(.*) const$/ ) {
-			$const_methods{$1} = 1;
+		if ( $sig !~ /(.*) const$/ ) {
+			$non_const_methods{"$sig const"} = 1;
 		}
 		
 		      }, undef );
@@ -2052,9 +2063,10 @@
 
 	my @args = @{ $m->{ParamList} };
 	my $sig = methodSignature( $m, $#args );
-	if ( $const_methods{$sig} && $m->{Flags} !~ "v" ) {
+	if ( $non_const_methods{$sig} && $m->{Flags} !~ "v" ) {
 		# If there is a method which just differs from another by 'constness',
-		# then ignore the non-const version
+		# then ignore the const version
+		# print("method overloaded on constness ignored: $className\::$sig\n");
 	    $m->{SkipFromSwitch} = 1;
 	    next;
 	}



More information about the Kde-bindings mailing list