]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt2/QThesaurusDialog.C
Some string(widget->text()) fixes. Weirdness
[lyx.git] / src / frontends / qt2 / QThesaurusDialog.C
index 580272ad5f6c45a8b25baa9d2601409424468000..a4c195f2482d2b74aeb00d02f0976413eeba8074 100644 (file)
@@ -1,24 +1,31 @@
 /**
  * \file QThesaurusDialog.C
- * Copyright 2001 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author John Levon <moz@compsoc.man.ac.uk>
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
-#include <vector>
 
-#include "LString.h" 
-#include "ControlThesaurus.h" 
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include "LString.h"
+
+#include "ControlThesaurus.h"
 #include "QThesaurusDialog.h"
-#include "Dialogs.h"
 #include "QThesaurus.h"
 
 #include <qpushbutton.h>
 #include <qlistview.h>
-#include <qlineedit.h> 
+#include <qlineedit.h>
+
+#include <vector>
+
 
 QThesaurusDialog::QThesaurusDialog(QThesaurus * form)
        : QThesaurusDialogBase(0, 0, false, 0),
@@ -28,13 +35,13 @@ QThesaurusDialog::QThesaurusDialog(QThesaurus * form)
                form, SLOT(slotClose()));
 }
 
+
 void QThesaurusDialog::change_adaptor()
 {
        form_->changed();
 }
 
+
 void QThesaurusDialog::closeEvent(QCloseEvent * e)
 {
        form_->slotWMHide();
@@ -47,25 +54,25 @@ void QThesaurusDialog::entryChanged()
        updateLists();
 }
 
+
 void QThesaurusDialog::replaceClicked()
 {
        form_->replace();
 }
 
+
 void QThesaurusDialog::selectionChanged(QListViewItem * item)
 {
        if (form_->readOnly())
                return;
+
        string const entry(item->text(0).latin1());
        replaceED->setText(entry.c_str());
        replacePB->setEnabled(true);
        form_->changed();
 }
 
+
 void QThesaurusDialog::selectionClicked(QListViewItem * item)
 {
        entryED->setText(item->text(0));
@@ -73,17 +80,17 @@ void QThesaurusDialog::selectionClicked(QListViewItem * item)
        updateLists();
 }
 
+
 void QThesaurusDialog::updateLists()
 {
        meaningsLV->clear();
+
        std::vector<string> matches;
 
        meaningsLV->setUpdatesEnabled(false);
+
        Thesaurus::Meanings meanings = form_->controller().getMeanings(entryED->text().latin1());
+
        for (Thesaurus::Meanings::const_iterator cit = meanings.begin();
                cit != meanings.end(); ++cit) {
                QListViewItem * i = new QListViewItem(meaningsLV);
@@ -96,7 +103,7 @@ void QThesaurusDialog::updateLists()
                                i2->setOpen(true);
                        }
        }
+
        meaningsLV->setUpdatesEnabled(true);
        meaningsLV->update();
 }