Sort templates in "Natural" order.
This commit is contained in:
@@ -24,12 +24,22 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "Config.h"
|
||||
#include "StrUtil.h"
|
||||
#include "XmlPaperParser.h"
|
||||
#include "XmlCategoryParser.h"
|
||||
#include "XmlVendorParser.h"
|
||||
#include "XmlTemplateParser.h"
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
bool partNameLessThan( const libglabels::Template *a, const libglabels::Template *b )
|
||||
{
|
||||
return libglabels::StrUtil::comparePartNames( a->name(), b->name() ) < 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace libglabels
|
||||
{
|
||||
|
||||
@@ -573,6 +583,8 @@ namespace libglabels
|
||||
readTemplatesFromDir( systemTemplatesDir() );
|
||||
|
||||
// TODO: Read user directories
|
||||
|
||||
qStableSort( mTemplates.begin(), mTemplates.end(), partNameLessThan );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user