]> git.lyx.org Git - features.git/commitdiff
Andreas' "in_show" fix to bug 1119.
authorAngus Leeming <leeming@lyx.org>
Tue, 22 Feb 2005 10:25:42 +0000 (10:25 +0000)
committerAngus Leeming <leeming@lyx.org>
Tue, 22 Feb 2005 10:25:42 +0000 (10:25 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9661 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/ChangeLog
src/frontends/Dialogs.C
src/frontends/Dialogs.h

index bbbeb2c4af86503b214df2b00e871ea3b605c372..77955ee2bbaab3cd22b8f61b8a9497d39579de49 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-21  Andreas Vox  <vox@isp.uni-luebeck.de>
+
+       * Dialogs.[hC] (show): prevent show() from getting called 
+       recursively.
+
 2005-02-11  John Levon  <levon@movementarian.org>
 
        * screen.C: clarify comment about event queue magic
index 0c222c045e5f72aa8972d83a18a3c8efc9eaae6e..5e5a42d4441cdad1acf2e7296658ec11966cdf96 100644 (file)
@@ -65,7 +65,7 @@ void Dialogs::hide(string const & name, InsetBase* inset)
 
 
 Dialogs::Dialogs(LyXView & lyxview)
-       : lyxview_(lyxview)
+       : lyxview_(lyxview), in_show_(false)
 {
        // Connect signals
        redrawGUI().connect(boost::bind(&Dialogs::redraw, this));
@@ -90,24 +90,32 @@ Dialog * Dialogs::find_or_build(string const & name)
 
 void Dialogs::show(string const & name, string const & data)
 {
-       Dialog * dialog = find_or_build(name);
-       if (!dialog)
+       if (in_show_) {
                return;
-
-       // FIXME! Should check that the dialog is NOT an inset dialog.
-       dialog->show(data);
+       }
+       in_show_ = true;
+       Dialog * dialog = find_or_build(name);
+       if (dialog) {
+               // FIXME! Should check that the dialog is NOT an inset dialog.
+               dialog->show(data);
+       }       
+       in_show_ = false;
 }
 
 
 void Dialogs::show(string const & name, string const & data, InsetBase * inset)
 {
-       Dialog * dialog = find_or_build(name);
-       if (!dialog)
+       if (in_show_) {
                return;
-
-       // FIXME! Should check that the dialog IS an inset dialog.
-       dialog->show(data);
-       open_insets_[name] = inset;
+       }
+       in_show_ = true;
+       Dialog * dialog = find_or_build(name);
+       if (dialog) {
+               // FIXME! Should check that the dialog IS an inset dialog.
+               dialog->show(data);
+               open_insets_[name] = inset;
+       }
+       in_show_ = false;
 }
 
 
index 22ab1784d6abde2f3954bb2933437a0cc0ad69f2..7817de4d0c2fffd3d0c85e2a32e7772ba2dc92f1 100644 (file)
@@ -117,6 +117,9 @@ private:
 
        ///
        std::map<std::string, DialogPtr> dialogs_;
+
+       /// flag against a race condition due to multiclicks in Qt frontend, see bug #1119
+       bool in_show_;
 };
 
 #endif