<commit_before>//
// This file is part of the Marble Desktop Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2006-2007 <NAME> <<EMAIL>>"
// Copyright 2007      <NAME>  <<EMAIL>>"
//


#include "PlacemarkContainer.h"

using namespace Marble;

PlacemarkContainer::PlacemarkContainer()
{
}

PlacemarkContainer::PlacemarkContainer( const QString& name )
    : m_name( name )
{
}

PlacemarkContainer::PlacemarkContainer( const PlacemarkContainer& container )
    : QVector<GeoDataPlacemark*>( container ), m_name( container.name() )
{
}

PlacemarkContainer::PlacemarkContainer( const QVector<GeoDataPlacemark*>& container,
                                        const QString& name )
    : QVector<GeoDataPlacemark*>( container ), m_name( name )
{
}

inline bool populationLessThan( GeoDataPlacemark* mark1, GeoDataPlacemark* mark2 )
{ 
    // If compared items do not differ in terms of being selected,
    // compare them based on population numbers.
    if ( mark1->popularityIndex() != mark2->popularityIndex() )
        return ( mark1->popularityIndex() > mark2->popularityIndex() );
    else
        return ( mark1->popularity() > mark2->popularity() );
}


void PlacemarkContainer::setName( const QString& name )
{
    m_name = name;
}

QString PlacemarkContainer::name() const
{
    return m_name;
}

void PlacemarkContainer::sort( Qt::SortOrder order )
{
    // FIXME: use order
    Q_UNUSED( order )

    qStableSort( begin(), end(), populationLessThan );
}<commit_msg>Remove unjustified "Q_UNUSED" since we want a warning here.<commit_after>//
// This file is part of the Marble Desktop Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2006-2007 <NAME> <<EMAIL>>"
// Copyright 2007      <NAME>  <<EMAIL>>"
//


#include "PlacemarkContainer.h"

using namespace Marble;

PlacemarkContainer::PlacemarkContainer()
{
}

PlacemarkContainer::PlacemarkContainer( const QString& name )
    : m_name( name )
{
}

PlacemarkContainer::PlacemarkContainer( const PlacemarkContainer& container )
    : QVector<GeoDataPlacemark*>( container ), m_name( container.name() )
{
}

PlacemarkContainer::PlacemarkContainer( const QVector<GeoDataPlacemark*>& container,
                                        const QString& name )
    : QVector<GeoDataPlacemark*>( container ), m_name( name )
{
}

inline bool populationLessThan( GeoDataPlacemark* mark1, GeoDataPlacemark* mark2 )
{ 
    // If compared items do not differ in terms of being selected,
    // compare them based on population numbers.
    if ( mark1->popularityIndex() != mark2->popularityIndex() )
        return ( mark1->popularityIndex() > mark2->popularityIndex() );
    else
        return ( mark1->popularity() > mark2->popularity() );
}


void PlacemarkContainer::setName( const QString& name )
{
    m_name = name;
}

QString PlacemarkContainer::name() const
{
    return m_name;
}

void PlacemarkContainer::sort( Qt::SortOrder order )
{
    // FIXME: use order
    qStableSort( begin(), end(), populationLessThan );
}
{'fraction_non_alphanumeric': 0.1172668513388735, 'fraction_numerical': 0.012311480455524777, 'mean_word_length': 3.5903954802259888, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4714928', 'n_tokens_mistral': 1020, 'n_tokens_neox': 1008, 'n_words': 278}