Re-defactor ColorSorter.

This hopefully cures Richard's compilation woes.
This commit is contained in:
Juergen Spitzmueller 2015-05-18 11:11:45 +02:00
parent 496dba4532
commit 7f1d33efc1
3 changed files with 25 additions and 9 deletions

View File

@ -23,12 +23,14 @@
#include "BufferView.h" #include "BufferView.h"
#include "Color.h" #include "Color.h"
#include "ColorCache.h" #include "ColorCache.h"
#include "ColorSet.h"
#include "Cursor.h" #include "Cursor.h"
#include "FuncRequest.h" #include "FuncRequest.h"
#include "Language.h" #include "Language.h"
#include "Paragraph.h" #include "Paragraph.h"
#include "support/gettext.h" #include "support/gettext.h"
#include "support/lstrings.h"
#include <QAbstractItemModel> #include <QAbstractItemModel>
#include <QComboBox> #include <QComboBox>
@ -190,7 +192,16 @@ void fillComboColor(QComboBox * combo, QList<T> const & list)
combo->addItem(qt_("Reset"), "inherit"); combo->addItem(qt_("Reset"), "inherit");
} }
}
struct ColorSorter
{
bool operator()(ColorCode lhs, ColorCode rhs) const {
return
support::compare_no_case(lcolor.getGUIName(lhs), lcolor.getGUIName(rhs)) < 0;
}
};
} // namespace anon
GuiCharacter::GuiCharacter(GuiView & lv) GuiCharacter::GuiCharacter(GuiView & lv)
: GuiDialog(lv, "character", qt_("Text Style")), font_(ignore_font, ignore_language), : GuiDialog(lv, "character", qt_("Text Style")), font_(ignore_font, ignore_language),

View File

@ -1096,6 +1096,19 @@ 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) PrefColors::PrefColors(GuiPreferences * form)
: PrefModule(catLookAndFeel, N_("Colors"), form) : PrefModule(catLookAndFeel, N_("Colors"), form)
{ {

View File

@ -13,9 +13,7 @@
#ifndef QTHELPERS_H #ifndef QTHELPERS_H
#define QTHELPERS_H #define QTHELPERS_H
#include "ColorSet.h"
#include "Length.h" #include "Length.h"
#include "support/lstrings.h"
#include "support/qstring_helpers.h" #include "support/qstring_helpers.h"
#include "support/filetools.h" #include "support/filetools.h"
#include "qt_i18n.h" #include "qt_i18n.h"
@ -39,12 +37,6 @@ namespace frontend {
class LengthCombo; 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) /// method to get a Length from widgets (LengthCombo)
std::string widgetsToLength(QLineEdit const * input, LengthCombo const * combo); std::string widgetsToLength(QLineEdit const * input, LengthCombo const * combo);
/// method to get a Length from widgets (QComboBox) /// method to get a Length from widgets (QComboBox)