mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 08:58:37 +00:00
genbindings: fix QClipboard private dtor
This commit is contained in:
parent
e57459c5e7
commit
441d96398f
@ -343,7 +343,9 @@ extern "C" {
|
||||
}
|
||||
|
||||
// delete
|
||||
ret.WriteString(fmt.Sprintf("void %s_Delete(%s* self);\n", c.ClassName, c.ClassName))
|
||||
if AllowDelete(c) {
|
||||
ret.WriteString(fmt.Sprintf("void %s_Delete(%s* self);\n", c.ClassName, c.ClassName))
|
||||
}
|
||||
|
||||
ret.WriteString("\n")
|
||||
}
|
||||
@ -495,13 +497,15 @@ func emitBindingCpp(src *CppParsedHeader, filename string) (string, error) {
|
||||
}
|
||||
|
||||
// Delete
|
||||
ret.WriteString(fmt.Sprintf(
|
||||
"void %s_Delete(%s* self) {\n"+
|
||||
"\tdelete self;\n"+
|
||||
"}\n"+
|
||||
"\n",
|
||||
c.ClassName, c.ClassName,
|
||||
))
|
||||
if AllowDelete(c) {
|
||||
ret.WriteString(fmt.Sprintf(
|
||||
"void %s_Delete(%s* self) {\n"+
|
||||
"\tdelete self;\n"+
|
||||
"}\n"+
|
||||
"\n",
|
||||
c.ClassName, c.ClassName,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
return ret.String(), nil
|
||||
|
@ -376,11 +376,13 @@ import "C"
|
||||
`)
|
||||
}
|
||||
|
||||
ret.WriteString(`
|
||||
func (this *` + c.ClassName + `) Delete() {
|
||||
C.` + c.ClassName + `_Delete(this.h)
|
||||
if AllowDelete(c) {
|
||||
ret.WriteString(`
|
||||
func (this *` + c.ClassName + `) Delete() {
|
||||
C.` + c.ClassName + `_Delete(this.h)
|
||||
}
|
||||
`)
|
||||
}
|
||||
`)
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,13 @@
|
||||
package main
|
||||
|
||||
func AllowDelete(c CppClass) bool {
|
||||
switch c.ClassName {
|
||||
case "QClipboard":
|
||||
return false // The destructor is marked private. TODO grab this from the AST
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func CheckComplexity(p CppParameter) error {
|
||||
|
||||
if p.QMapOf() {
|
||||
|
Loading…
Reference in New Issue
Block a user