head	1.2;
access;
symbols;
locks; strict;
comment	@# @;


1.2
date	2004.02.11.07.16.17;	author marcus;	state dead;
branches;
next	1.1;

1.1
date	2004.02.08.19.37.12;	author marcus;	state Exp;
branches;
next	;


desc
@@


1.2
log
@Add Firefox after a repo copy from mozilla-firebird.  Firefox is the next
release of the Firebird web browser with a new name to avoid conflicts with
the Firebird database.  This is version 0.8.

http://www.mozilla.org/products/firefox/releases/

* Update to 0.8 and change name to firefox [1]
* Make PLIST from a fake installation [1]
* Restore original credit and portname in Makefile [1]
* Optionally install headers and IDL files [2]
* Use PERL instead of REINPLACE_CMD in a few places [1]
* Use OPTIONS
* Enable the Inspector extension
* Fix another possible esound related problem
* Enable basic optimizations if WITH_DEBUG is not specified

PR:		62631 [2]
Submitted by:	trevor [1] [2]
@
text
@--- extensions/typeaheadfind/src/nsTypeAheadFind.cpp.orig	Sun Feb  8 01:13:31 2004
+++ extensions/typeaheadfind/src/nsTypeAheadFind.cpp	Sun Feb  8 01:19:17 2004
@@@@ -323,11 +323,11 @@@@
   prefBranch->GetBoolPref("accessibility.typeaheadfind.startlinksonly",
                           &mStartLinksOnlyPref);
 
-  PRBool isSoundEnabled = PR_TRUE;
+  mIsSoundEnabled = PR_TRUE;
   prefBranch->GetBoolPref("accessibility.typeaheadfind.enablesound",
-                           &isSoundEnabled);
+                           &mIsSoundEnabled);
   nsXPIDLCString soundStr;
-  if (isSoundEnabled) {
+  if (mIsSoundEnabled) {
     prefBranch->GetCharPref("accessibility.typeaheadfind.soundURL",
                              getter_Copies(soundStr));
   }
@@@@ -612,7 +612,7 @@@@
     return NS_OK;
   }
 
-  if (!mIsSoundInitialized) {
+  if (!mIsSoundInitialized && mIsSoundEnabled) {
     // This makes sure system sound library is loaded so that
     // there's no lag before the first sound is played
     // by waiting for the first keystroke, we still get the startup time benefits.
@@@@ -760,11 +760,13 @@@@
         // It keeps us from accidentally hitting backspace too many times and
         // going back in history when we really just wanted to clear 
         // the find string.
+	if (mIsSoundEnabled) {
         nsCOMPtr<nsISound> soundInterface =
           do_CreateInstance("@@mozilla.org/sound;1");
         if (soundInterface) {
           soundInterface->Beep(); // beep to warn
         }
+	}
         mIsBackspaceProtectOn = PR_FALSE;
       }
       else {
@@@@ -1009,7 +1011,9 @@@@
 
     // Error sound (don't fire when backspace is pressed, they're 
     // trying to correct the mistake!)
-    PlayNotFoundSound();
+    if (mIsSoundEnabled) {
+      PlayNotFoundSound();
+    }
 
     // Remove bad character from buffer, so we can continue typing from
     // last matched character
@@@@ -1056,7 +1060,7 @@@@
 void
 nsTypeAheadFind::PlayNotFoundSound()
 {
-  if (mNotFoundSoundURL.IsEmpty())    // no sound
+  if (mNotFoundSoundURL.IsEmpty() || !mIsSoundEnabled)    // no sound
     return;
   if (!mSoundInterface) {
     mSoundInterface = do_CreateInstance("@@mozilla.org/sound;1");
--- extensions/typeaheadfind/src/nsTypeAheadFind.h.orig	Sun Feb  8 01:11:53 2004
+++ extensions/typeaheadfind/src/nsTypeAheadFind.h	Sun Feb  8 01:19:29 2004
@@@@ -194,6 +194,9 @@@@
 
   nsCString mNotFoundSoundURL;
 
+  // Move the sound enabled boolean out for all methods to access.
+  PRBool mIsSoundEnabled;
+
   // PRBool's are used instead of PRPackedBool's where the address of the
   // boolean variable is getting passed into a method. For example:
   // GetBoolPref("accessibility.typeaheadfind.linksonly", &mLinksOnlyPref);
@


1.1
log
@* Fix a bug where Firebird would lock up after typing any text.  This had to
  do with esound being installed, but not being used (e.g. when not running
  under the GNOME Desktop).  What happens now is sound support is disabled by
  default.  If you wish to enable Type Ahead Find sound support, edit your
  prefs.js file, and add:

  user_pref("accessibility.typeaheadfind.enablesound", true);

* Make portlint happy by not including anything after bsd.port.post.mk
* Clean up the pkg-message a bit to reflect reality with respect to Perl

Thanks to casaveli on BSDForums for finding it was esound causing the lock up
as well as testing the patch mentioned above.
@
text
@@

