On Thu, Jan 16, 2014 at 19:24 (-0400), Jim wrote:
Consider this:
cd
<top-level-dir-of-the-files-you-want-to-search>
find . -type f | while read f
...
Better yet, add a ; to the first [] expression
find . -type f | while read f
do
if tr $'\n' ' ' < $f \
| sed 's/"[ \t][ \t]*"/ /g' \
| grep -o
'TQWhatsThis[^";]*"[^"]*[kK][Dd][Ee][^"]*"'
then
echo THE ABOVE CAME FROM $f ; echo
fi
done
The regexp may still not be as specific as possible, but it might get
things down to a manageable level.
By the way, are you only looking for those in .cpp files? If so, the
first line wants to be
find . -type f -name \*.cpp | while read f
which speeds things up considerably. (It only finds 10 matches in total.)
Not <string> and </string> ??
If <string> is always after <property ...> in the strings you want,
and there is no other <tag>, you could give this a whirl:
find . -type f | while read f
do
if tr $'\n' ' ' < $f \
sed 's/"[ \t][ \t]*"/ /g' \
| grep -o '<property name="whatsThis"[^>]*>
*<string>[^<]*[kK][Dd][Ee][^>]*>'
then
echo THE ABOVE CAME FROM $f
echo
fi
done
Changing that to only look in .ui files
find . -name \*.ui | while read f
do
if tr $'\n' ' ' < $f \
| sed 's/"[ \t][ \t]*"/ /g' \
| grep -o '<property name="whatsThis"[^>]*>
*<string>[^<]*[kK][Dd][Ee][^>]*>'
then
echo THE ABOVE CAME FROM $f ; echo
fi
done
I get
<property name="whatsThis" stdset="0">
<string>This information points to the the ftp server. HOST can either be a
standard ip adress like 192.168.2.1 or a domain name. PORT is the port number on which the
ftp server listens. In most cases this is 21. Both are seperated by a ":"
character. A legit input would be "ftp.kde.org:21".</string>
THE ABOVE CAME FROM ./main/applications/kasablanca/src/Q_bookmarkdialog.ui
<property name="whatsThis" stdset="0">
<string>This information points to the the ftp server. HOST can either be a
standard ip adress like "192.168.2.1" or a domain name. PORT is the port number
on which the ftp server listens. In most cases this is 21. Both are seperated by a
":" character. A legit input would be
"ftp.kde.org:21".</string>
THE ABOVE CAME FROM ./main/applications/kasablanca/src/Q_customconnectdialog.ui
<property name="whatsThis" stdset="0">
<string>Pressing the button will launch konqueror and go to
the KBFX Themes Section on
www.kde-look.org</string>
THE ABOVE CAME FROM ./main/applications/kbfx/configdialog/kbfxconfigdlgthemes.ui
<property name="whatsThis" stdset="0">
<string>In Gtk, the list that is attached to a combo-box appears in the same style
as a popup-menu. KDE4 has the ability to mimic this look.</string>
THE ABOVE CAME FROM ./main/applications/tde-style-qtcurve/config/qtcurveconfigbase.ui
<property name="whatsThis" stdset="0">
<string>Storing passwords is often a security problem. Kdesvn itself doesn't
store any passwords, but the subversion itself inside the configuration area of
subversion. If this area is readable from others you should not set it, but you may select
for single non critical accounts inside the authentication dialog.</string>
<property name="whatsThis" stdset="0">
<string><p>Tells if your passwords set in tdesvn should stored into
kde wallet instead of simple cleartext storage of subversion.</p>
<p>This would be a little bit more secure because TDE wallet is (mostly)
encrypted with a password. On other hand you must re-enter your passwords with other
subversion clients not accessing TDE wallet (eg. svn commandline itself, rapidsvn and so
on).</p> <p>If you're HOME storage eg. subversions
configfolder is on a network drive you should hard think about not storing passwords in a
plain text file like subversion does but put it into an encrypted storage like kde wallet
or don't save passwords.</p></string>
THE ABOVE CAME FROM ./main/applications/tdesvn/src/settings/subversion_settings.ui
<property name="whatsThis" stdset="0">
<string><p align="left"> Enter an external program for
opening file on doubleclick in form <br>
<tt>&lt;program&gt;</tt> </p>
<p> When kde-default is wanted for opening on double click, enter
&quot;default&quot; and kde selects action.
</p></string>
THE ABOVE CAME FROM ./main/applications/tdesvn/src/settings/display_settings.ui
<property name="whatsThis" stdset="0">
<string>This dialog provides you with notification and details of scripting errors
that occur on web pages. In many cases it is due to an error in the web site as designed
by its author. In other cases it is the result of a programming error in Konqueror. If
you suspect the former, please contact the webmaster of the site in question. Conversely
if you suspect an error in Konqueror, please file a bug report at
http://bugs.kde.org/. A
test case which illustrates the problem will be appreciated.</string>
THE ABOVE CAME FROM ./main/tdelibs/tdehtml/kjserrordlg.ui
<property name="whatsThis" stdset="0">
<string><p>Not all editors are well suited for inverse search. For
instance, many editors have no command like 'If the file is not yet loaded, load it.
Otherwise, bring the window with the file to the front'. If you are using an editor
like this, clicking into the DVI file will always open a new editor, even if the TeX file
is already open. Likewise, many editors have no command line argument that would allow
KDVI to specify the exact line which you wish to edit.</p>
<p>If you feel that KDVI's support for a certain editor is inadequate,
please write to kebekus(a)kde.org.&lt;/p&gt;</string>
THE ABOVE CAME FROM ./main/tdegraphics/kdvi/optionDialogSpecialWidget_base.ui
<property name="whatsThis" stdset="0">
<string><qt> Here you can modify the default browser-identification
text or set a site <code>(eg.
www.kde.org)</code> or a domain
<code>(eg. kde.org)</code> specific identification
text.<p> To add a new site specific identification text, click the
<code>New</code> button and supply the necessary information.
To change an existing site specific entry, click on the
<code>Change</code> button. The
<code>Delete</code> button will remove the selected site
specific identification text, causing the setting to be used for that site or domain.
</qt></string>
THE ABOVE CAME FROM ./main/tdebase/kcontrol/tdeio/useragentdlg_ui.ui
<property name="whatsThis" stdset="0">
<string><qt> Enter the site or domain name where a fake browser
identification should be used.<p> <u>NOTE:</u>
Wildcard syntax such as \"*,?\" is NOT allowed: instead, use the top level
address of a site to make generic matches; for example, if you want all TDE sites to
receive a fake browser identification, you would enter
<code>.kde.org</code> - the fake identity would then be sent
to any TDE site that ends with <code>.kde.org</code>.
</qt></string>
<property name="whatsThis" stdset="0">
<string><qt> Enter the site or domain name where a fake browser
identification should be used.<p> <u>NOTE:</u>
Wildcard syntax such as \"*,?\" is NOT allowed: instead, use the top level
address of a site to make generic matches; for example, if you want all TDE sites to
receive a fake browser identification, you would enter
<code>.kde.org</code> - the fake identity would then be sent
to any TDE site that ends with <code>.kde.org</code>.
</qt></string>
THE ABOVE CAME FROM ./main/tdebase/kcontrol/tdeio/uagentproviderdlg_ui.ui
<property name="whatsThis" stdset="0">
<string><qt> Automatically detect and configure the proxy
settings.<p> Automatic detection is performed using the <b>Web
Proxy Auto-Discovery Protocol (WPAD)</b>.<p>
<b>NOTE:</b> This option might not work properly or not work
at all in some UNIX/Linux distributions. If you encounter a problem when using this
option, please check the FAQ section at
http://konqueror.kde.org.
</qt></string>
THE ABOVE CAME FROM ./main/tdebase/kcontrol/tdeio/kproxydlg_ui.ui
<property name="whatsThis" stdset="0">
<string><qt> Enter the host or domain to which this policy applies,
e.g. <b>www.kde.org</b> or
<b>.kde.org</b>. </qt></string>
<property name="whatsThis" stdset="0">
<string><qt> Enter the host or domain to which this policy applies,
e.g. <b>www.kde.org</b> or
<b>.kde.org</b>. </qt></string>
THE ABOVE CAME FROM ./main/tdebase/kcontrol/tdeio/policydlg_ui.ui
<property name="whatsThis" stdset="0">
<string>Enter the command you wish to execute or the address of the resource you
want to open. This can be a remote URL like "www.kde.org" or a local one like
"~/.tderc".</string>
<property name="whatsThis" stdset="0">
<string>Enter the command you wish to execute or the address of the resource you
want to open. This can be a remote URL like "www.kde.org" or a local one like
"~/.tderc".</string>
THE ABOVE CAME FROM ./main/tdebase/kdesktop/minicli_ui.ui
Having said that, I also see things like (in
./main/dependencies/tqt3/tools/designer/designer/previewwidget.ui)
<property name="text">
<string><p>
<a
href="http://www.trolltech.com/">http://www.trolltech.com&…
</p>
<p>
<a
href="http://www.kde.org/">http://www.kde.org</a&am…
</p></string>
Is it safe to assume you also want to catch those?
Jim