From 8fc637103fde2d864c2104a2f491aa1fd91006c9 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sun, 17 May 2015 16:47:40 +0200 Subject: [PATCH] Factor out ColorSorter to qt_helpers, to make it available to other dialogs as well. --- src/frontends/qt4/GuiPrefs.cpp | 11 ----------- src/frontends/qt4/qt_helpers.h | 8 ++++++++ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index a9917e43a6..fd1b70e1e6 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -1095,17 +1095,6 @@ void PrefScreenFonts::selectTypewriter(const QString & name) // ///////////////////////////////////////////////////////////////////// -namespace { - -struct ColorSorter -{ - bool operator()(ColorCode lhs, ColorCode rhs) const { - return - compare_no_case(lcolor.getGUIName(lhs), lcolor.getGUIName(rhs)) < 0; - } -}; - -} // namespace anon PrefColors::PrefColors(GuiPreferences * form) : PrefModule(catLookAndFeel, N_("Colors"), form) diff --git a/src/frontends/qt4/qt_helpers.h b/src/frontends/qt4/qt_helpers.h index defd1a827f..4b4796777b 100644 --- a/src/frontends/qt4/qt_helpers.h +++ b/src/frontends/qt4/qt_helpers.h @@ -13,7 +13,9 @@ #ifndef QTHELPERS_H #define QTHELPERS_H +#include "ColorSet.h" #include "Length.h" +#include "support/lstrings.h" #include "support/qstring_helpers.h" #include "support/filetools.h" #include "qt_i18n.h" @@ -37,6 +39,12 @@ namespace frontend { class LengthCombo; +struct ColorSorter { + bool operator()(ColorCode lhs, ColorCode rhs) const { + return support::compare_no_case(lcolor.getGUIName(lhs), lcolor.getGUIName(rhs)) < 0; + } +}; + /// method to get a Length from widgets (LengthCombo) std::string widgetsToLength(QLineEdit const * input, LengthCombo const * combo); /// method to get a Length from widgets (QComboBox) -- 2.39.5