]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/dlg/checkinitorder.pl
The KDE monster patch from John
[lyx.git] / src / frontends / kde / dlg / checkinitorder.pl
1 #! /usr/bin/perl -w
2
3 # this is a corny script to check that qtarch hasn't fscked up
4 # the initialisation order of the widgets. perl hackers are free
5 # to improve this
6
7 # usage: dlg/checkinitorder.pl *data.C
8
9 $found{"this"} = 1;
10 $found{"FALSE"} = 1; 
11 while (<>) {
12         # yes, this is a broken regexp, but the sources are machine generated 
13         if (/= new / && ! /Layout/) {
14                 ( $varname, $parent) = split('=');
15                 # print "$varname: $parent"; 
16                 $varname =~ s/^\s*//;
17                 $varname =~ s/\s*$//;
18                 $found{$varname} = 1;
19                 $parent =~ s/^.*\(\s*//;
20                 $parent =~ s/\s*,.*$//;
21                 chomp($parent);
22                 if (!defined($found{$parent})) {
23                         print "Widget $varname constructed with ",
24                               "uninitialised parent $parent !\n";
25                 }
26         }
27 };