mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-10 22:15:34 +08:00
refactor: clang format line length
This commit is contained in:
@@ -33,13 +33,17 @@ using namespace swift::misc::db;
|
||||
namespace swift::gui::models
|
||||
{
|
||||
template <typename T, typename K, bool UseCompare>
|
||||
CListModelDbObjects<T, K, UseCompare>::CListModelDbObjects(const QString &translationContext, QObject *parent) : CListModelBase<ContainerType, UseCompare>(translationContext, parent)
|
||||
CListModelDbObjects<T, K, UseCompare>::CListModelDbObjects(const QString &translationContext, QObject *parent)
|
||||
: CListModelBase<ContainerType, UseCompare>(translationContext, parent)
|
||||
{
|
||||
CListModelBaseNonTemplate::m_sortTieBreakers.push_front(ObjectType::keyIndex());
|
||||
|
||||
constexpr bool hasIntegerKey = std::is_base_of_v<IDatastoreObjectWithIntegerKey, ObjectType> && std::is_same_v<int, KeyType>;
|
||||
constexpr bool hasStringKey = std::is_base_of_v<IDatastoreObjectWithStringKey, ObjectType> && std::is_base_of_v<QString, KeyType>;
|
||||
static_assert(hasIntegerKey || hasStringKey, "ObjectType needs to implement IDatastoreObjectWithXXXXKey and have appropriate KeyType");
|
||||
constexpr bool hasIntegerKey =
|
||||
std::is_base_of_v<IDatastoreObjectWithIntegerKey, ObjectType> && std::is_same_v<int, KeyType>;
|
||||
constexpr bool hasStringKey =
|
||||
std::is_base_of_v<IDatastoreObjectWithStringKey, ObjectType> && std::is_base_of_v<QString, KeyType>;
|
||||
static_assert(hasIntegerKey || hasStringKey,
|
||||
"ObjectType needs to implement IDatastoreObjectWithXXXXKey and have appropriate KeyType");
|
||||
}
|
||||
|
||||
template <typename T, typename K, bool UseCompare>
|
||||
@@ -66,7 +70,8 @@ namespace swift::gui::models
|
||||
}
|
||||
|
||||
template <typename T, typename K, bool UseCompare>
|
||||
COrderableListModelDbObjects<T, K, UseCompare>::COrderableListModelDbObjects(const QString &translationContext, QObject *parent)
|
||||
COrderableListModelDbObjects<T, K, UseCompare>::COrderableListModelDbObjects(const QString &translationContext,
|
||||
QObject *parent)
|
||||
: CListModelDbObjects<ContainerType, KeyType, UseCompare>(translationContext, parent)
|
||||
{}
|
||||
|
||||
@@ -76,10 +81,7 @@ namespace swift::gui::models
|
||||
if (items.isEmpty()) { return; }
|
||||
ContainerType container(this->container());
|
||||
int order = 0;
|
||||
if (position >= 0 && position < container.size())
|
||||
{
|
||||
order = container[position].getOrder();
|
||||
}
|
||||
if (position >= 0 && position < container.size()) { order = container[position].getOrder(); }
|
||||
this->setSortColumnToOrder();
|
||||
container.moveTo(items, order);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user