]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt2/QDelimiterDialog.C
Some string(widget->text()) fixes. Weirdness
[lyx.git] / src / frontends / qt2 / QDelimiterDialog.C
index f4f84666ca649146583c07f41f401443b95b63ab..8de79d376dddf08b7a49a9c3c764b947dd3818fd 100644 (file)
@@ -19,6 +19,7 @@
 #include "debug.h"
 
 #include "QMath.h"
+#include "ControlMath.h"
 #include "QDelimiterDialog.h"
 
 #include "iconpalette.h"
@@ -80,40 +81,38 @@ QDelimiterDialog::QDelimiterDialog(QMath * form)
        setCaption(_("LyX: Delimiters"));
 
        for (int i = 0; *delim[i]; ++i) {
-               string xpm_name = LibFileSearch("images/math/", delim[i], "xpm");
-               leftIP->add(QPixmap(xpm_name.c_str()), delim[i], delim[i]);
+               string xpm(find_xpm(delim[i]));
+               leftIP->add(QPixmap(xpm.c_str()), delim[i], delim[i]);
+               rightIP->add(QPixmap(xpm.c_str()), delim[i], delim[i]);
        }
-       leftIP->add(QPixmap(LibFileSearch("images/math/", "empty", "xpm").c_str()), "empty", "empty");
-       connect(leftIP, SIGNAL(button_clicked(string)), this, SLOT(ldelim_clicked(string)));
-       ldelim_clicked("(");
 
-       for (int i = 0; *delim[i]; ++i) {
-               string xpm_name = LibFileSearch("images/math/", delim[i], "xpm");
-               rightIP->add(QPixmap(xpm_name.c_str()), delim[i], delim[i]);
-       }
-       rightIP->add(QPixmap(LibFileSearch("images/math/", "empty", "xpm").c_str()), "empty", "empty");
-       connect(rightIP, SIGNAL(button_clicked(string)), this, SLOT(rdelim_clicked(string)));
+       string empty_xpm(find_xpm("empty"));
+
+       leftIP->add(QPixmap(empty_xpm.c_str()), "empty", "empty");
+       rightIP->add(QPixmap(empty_xpm.c_str()), "empty", "empty");
+       connect(leftIP, SIGNAL(button_clicked(string const &)), this, SLOT(ldelim_clicked(string const &)));
+       connect(rightIP, SIGNAL(button_clicked(string const &)), this, SLOT(rdelim_clicked(string const &)));
+       ldelim_clicked("(");
        rdelim_clicked(")");
 }
 
 
 void QDelimiterDialog::insertClicked()
 {
-       form_->insertDelim(fix_name(left_) + " " + fix_name(right_));
+       form_->insertDelim(fix_name(left_) + ' ' + fix_name(right_));
 }
 
 
 void QDelimiterDialog::set_label(QLabel * label, string const & str)
 {
-       string xpm_name = LibFileSearch("images/math/", str, "xpm");
        label->setUpdatesEnabled(false);
-       label->setPixmap(QPixmap(xpm_name.c_str()));
+       label->setPixmap(QPixmap(find_xpm(str).c_str()));
        label->setUpdatesEnabled(true);
        label->update();
 }
 
 
-void QDelimiterDialog::ldelim_clicked(string str)
+void QDelimiterDialog::ldelim_clicked(string const & str)
 {
        left_ = str;
 
@@ -125,7 +124,7 @@ void QDelimiterDialog::ldelim_clicked(string str)
 }
 
 
-void QDelimiterDialog::rdelim_clicked(string str)
+void QDelimiterDialog::rdelim_clicked(string const & str)
 {
        right_ = str;