[bt-devel] (no subject)

Joachim Ansorg nospam+bt-devel at joachim-ansorg.de
Sun Aug 7 15:33:23 MST 2005


Hi,
> Are there pre-existing methods to perform these operations? (I've surfed
> through the files of BibleTime, but didnt find any that seemed right.)

The sync* methods are all very similair. I suggest to add a general method 
like syncWindowsByType(QString key, CSwordModuleInfo::ModuleType modType) and 
to call this in the sync* methods.

The code of syncWindowsByType should be similair to this:

 QWidgetList windows = m_mdi->windowList();

 for (windows.first(); windows.current(); windows.next()) {
  CDisplayWindow* w = dynamic_cast<CDisplayWindow*>(windows.current());

  // Check the mod type by iterating the windows module list and checking the 
  // mods
  if (hasRightType)
   w->lookup( key()->key() );
 }

This is just a suggestion, feel free to use it or not.

About the search methods:
 CDisplayWindow::slotSearchInModules
is similair to the code you need. I suggest to open the search dialog, set the 
text, start the search and return the string list.
I don't know if this method needs to be declared as asynchronous.

Thank you for doing the coding,
Joachim


More information about the bt-devel mailing list