]> git.lyx.org Git - features.git/commitdiff
string optimizations.
authorAbdelrazak Younes <younes@lyx.org>
Thu, 17 Jan 2008 08:32:48 +0000 (08:32 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 17 Jan 2008 08:32:48 +0000 (08:32 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22609 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiToolbar.cpp

index e27fee2696ddc735447272bb52291c8bf00ec645..04c761754604dfad31393648a5ce1718bff16184 100644 (file)
@@ -402,13 +402,14 @@ public:
        PaletteButton(GuiToolbar * bar, ToolbarItem const & item)
                : QToolButton(bar), bar_(bar), tbitem_(item), initialized_(false)
        {
-               setToolTip(qt_(to_ascii(tbitem_.label_)));
-               setStatusTip(qt_(to_ascii(tbitem_.label_)));
-               setText(qt_(to_ascii(tbitem_.label_)));
+               QString label = qt_(to_ascii(tbitem_.label_));
+               setToolTip(label);
+               setStatusTip(label);
+               setText(label);
                connect(bar_, SIGNAL(iconSizeChanged(QSize)),
                        this, SLOT(setIconSize(QSize)));
                panel_ = new IconPalette(this);
-               panel_->setWindowTitle(qt_(to_ascii(tbitem_.label_)));
+               panel_->setWindowTitle(label);
                setCheckable(true);
                connect(this, SIGNAL(clicked(bool)), panel_, SLOT(setVisible(bool)));
                connect(panel_, SIGNAL(visible(bool)), this, SLOT(setChecked(bool)));
@@ -456,9 +457,10 @@ public:
                : QToolButton(bar), bar_(bar), tbitem_(item), initialized_(false)
        {
                setPopupMode(QToolButton::InstantPopup);
-               setToolTip(qt_(to_ascii(tbitem_.label_)));
-               setStatusTip(qt_(to_ascii(tbitem_.label_)));
-               setText(qt_(to_ascii(tbitem_.label_)));
+               QString label = qt_(to_ascii(tbitem_.label_));
+               setToolTip(label);
+               setStatusTip(label);
+               setText(label);
                setIcon(QPixmap(":images/math/" + toqstr(tbitem_.name_) + ".png"));
                connect(bar, SIGNAL(iconSizeChanged(QSize)),
                        this, SLOT(setIconSize(QSize)));
@@ -473,8 +475,9 @@ public:
 
                initialized_ = true;
 
-               ButtonMenu * m = new ButtonMenu(qt_(to_ascii(tbitem_.label_)), this);
-               m->setWindowTitle(qt_(to_ascii(tbitem_.label_)));
+               QString label = qt_(to_ascii(tbitem_.label_));
+               ButtonMenu * m = new ButtonMenu(label, this);
+               m->setWindowTitle(label);
                m->setTearOffEnabled(true);
                connect(bar_, SIGNAL(updated()), m, SLOT(updateParent()));
                ToolbarInfo const * tbinfo = 
@@ -496,6 +499,7 @@ public:
 
 }
 
+
 void GuiToolbar::add(ToolbarItem const & item)
 {
        switch (item.type_) {
@@ -516,9 +520,10 @@ void GuiToolbar::add(ToolbarItem const & item)
                QToolButton * tb = new QToolButton;
                tb->setCheckable(true);
                tb->setIcon(getIcon(FuncRequest(LFUN_TABULAR_INSERT), true));
-               tb->setToolTip(qt_(to_ascii(item.label_)));
-               tb->setStatusTip(qt_(to_ascii(item.label_)));
-               tb->setText(qt_(to_ascii(item.label_)));
+               QString label = qt_(to_ascii(item.label_));
+               tb->setToolTip(label);
+               tb->setStatusTip(label);
+               tb->setText(label);
                InsertTableWidget * iv = new InsertTableWidget(owner_, tb);
                connect(tb, SIGNAL(clicked(bool)), iv, SLOT(show(bool)));
                connect(iv, SIGNAL(visible(bool)), tb, SLOT(setChecked(bool)));