2015-05-18 19:29 GMT+02:00 Jürgen Spitzmüller <[email protected]>:
> 2015-05-18 19:24 GMT+02:00 Richard Heck:
>
>> On 05/18/2015 12:17 PM, Jean-Marc Lasgouttes wrote:
>>
>>>
>>> Since this week-end, I have compilation errors with gcc 4.6. I am not
>>> sure from where to start to diagnose this.
>>>
>>
>> This is the same error I reported earlier
>> https://www.mail-archive.com/[email protected]/msg187530.html
>> with gcc 4.9. I think QList<ColorCode> expects certain functions to be
>> defined that aren't.
>>
>
> Still with recent master?
>
And with this?
Jürgen
>
>
> Jürgen
>
>
diff --git a/src/frontends/qt4/GuiBox.cpp b/src/frontends/qt4/GuiBox.cpp
index afc6462..c76aeaf 100644
--- a/src/frontends/qt4/GuiBox.cpp
+++ b/src/frontends/qt4/GuiBox.cpp
@@ -105,13 +105,10 @@ static QList<ColorCode> colors()
namespace {
-struct ColorSorter
+bool ColorSorter(ColorCode lhs, ColorCode rhs)
{
- bool operator()(ColorCode lhs, ColorCode rhs) const {
- return
- support::compare_no_case(lcolor.getGUIName(lhs),
lcolor.getGUIName(rhs)) < 0;
- }
-};
+ return support::compare_no_case(lcolor.getGUIName(lhs),
lcolor.getGUIName(rhs)) < 0;
+}
} // namespace anon
@@ -169,7 +166,7 @@ GuiBox::GuiBox(QWidget * parent) : InsetParamsWidget(parent)
// the background can be uncolored while the frame cannot
color_codes_ = colors();
- sort(color_codes_.begin(), color_codes_.end(), ColorSorter());
+ qSort(color_codes_.begin(), color_codes_.end(), ColorSorter);
fillComboColor(backgroundColorCO, true);
fillComboColor(frameColorCO, false);
diff --git a/src/frontends/qt4/GuiCharacter.cpp
b/src/frontends/qt4/GuiCharacter.cpp
index a824df7..c673d2d 100644
--- a/src/frontends/qt4/GuiCharacter.cpp
+++ b/src/frontends/qt4/GuiCharacter.cpp
@@ -193,13 +193,10 @@ void fillComboColor(QComboBox * combo, QList<T> const &
list)
}
-struct ColorSorter
+bool ColorSorter(ColorCode lhs, ColorCode rhs)
{
- bool operator()(ColorCode lhs, ColorCode rhs) const {
- return
- support::compare_no_case(lcolor.getGUIName(lhs),
lcolor.getGUIName(rhs)) < 0;
- }
-};
+ return support::compare_no_case(lcolor.getGUIName(lhs),
lcolor.getGUIName(rhs)) < 0;
+}
} // namespace anon
@@ -230,7 +227,7 @@ GuiCharacter::GuiCharacter(GuiView & lv)
size = sizeData();
bar = barData();
color = colorData();
- sort(color.begin(), color.end(), ColorSorter());
+ qSort(color.begin(), color.end(), ColorSorter);
language = languageData();
language.prepend(LanguagePair(qt_("Reset"), "reset"));