am_edit / unsermake patches

Frerich Raabe raabe at kde.org
Wed Jan 28 12:42:40 GMT 2004


Moin,

the attached patches should make am_edit / unsermake include kdialog.h in
addition to klocale.h in the .cpp files generated from .ui files. That way
one does not have to hardcodethe margin & spacing in .ui files but can
specify the KDialog::marginHint and KDialog::spacingHint functions instead.

It'd be nice if one of the build-system luminaries could have a look at
the attached patches and tell me whether/what I broke, and apply the stuff
if it's ok. Thank you. :-)

- Frerich

-------------- next part --------------
Index: am_edit
===================================================================
RCS file: /home/kde/kde-common/admin/am_edit,v
retrieving revision 1.408
diff -u -3 -p -r1.408 am_edit
--- am_edit	19 Jan 2004 20:30:46 -0000	1.408
+++ am_edit	28 Jan 2004 11:41:02 -0000
@@ -1360,7 +1360,8 @@ sub tag_UIFILES ()
                 my $dep_lines = "$source.$cxxsuffix: $sourcedir$source.ui $source.h $source.moc\n";
                 $dep_lines .= "\trm -f $source.$cxxsuffix\n";
                 if (!$kdeopts{"qtonly"}) {
-                    $dep_lines .= "\techo '#include <klocale.h>' > $source.$cxxsuffix\n";
+                    $dep_lines .= "\techo '#include <kdialog.h>' > $source.$cxxsuffix\n";
+                    $dep_lines .= "\techo '#include <klocale.h>' >> $source.$cxxsuffix\n";
                     my ($mangled_source) = $source;
                     $mangled_source =~ s/[^A-Za-z0-9]/_/g;  # get rid of garbage
                     $dep_lines .= "\t\$(UIC) -tr \${UIC_TR} -i $source.h $sourcedir$source.ui > $source.$cxxsuffix.temp ; ret=\$\$?; \\\n";
-------------- next part --------------
Index: designer.um
===================================================================
RCS file: /home/kde/kdenonbeta/unsermake/designer.um,v
retrieving revision 1.10
diff -u -3 -p -r1.10 designer.um
--- designer.um	7 Sep 2003 16:41:20 -0000	1.10
+++ designer.um	28 Jan 2004 11:40:31 -0000
@@ -23,7 +23,8 @@ class DesignerHandler(handlerbase.Handle
 		rules = ["@echo 'creating %s.cpp'" % (rulef.build + base)]
 		if not base in program.ui_files:
 			if not program.amfile.get_opt("qtonly"):
-				rules.append("@echo '#include <klocale.h>' > %s%s.cpp" % (rulef.build, base))
+				rules.append("@echo '#include <kdialog.h>' > %s%s.cpp" % (rulef.build, base))
+				rules.append("@echo '#include <klocale.h>' >> %s%s.cpp" % (rulef.build, base))
 				canon_source = utilities.canon_name(base)
 				rules.append("@adir=`cd %s && pwd` ;\\" % sourcedir)
 				rules.append("$(UIC) -tr ${UIC_TR} -i %s.h $$adir/%s.ui > %s%s.cpp.temp ; ret=$$?; \\" % (base, base, rulef.build, base))


More information about the kde-core-devel mailing list