Commit c1acca28 authored by Jarosław Staniek's avatar Jarosław Staniek
Browse files

Kexi: Add sorting in Forms

Summary:
BUG:150372
FIXED-IN:2.9.11

Test Plan:
Open any form with nontrivial sortable data. Use sorting a->z, z->a.
Current record is unchanged but its index most likely changes, what can be observed in the record navigator.

Reviewers: piggz, wicik, wkosowicz

Subscribers: Kexi-Devel-list

Projects: #kexi, #calligra:_3.0

Differential Revision: https://phabricator.kde.org/D881
parent 3ba81865
/* This file is part of the KDE project
Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
Copyright (C) 2004-2015 Jarosław Staniek <staniek@kde.org>
Copyright (C) 2004-2016 Jarosław Staniek <staniek@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
......@@ -131,8 +131,6 @@ KexiFormScrollView::KexiFormScrollView(QWidget *parent, bool preview)
}
m_contextMenu = new KMenu(this);
m_contextMenu->setObjectName("m_contextMenu");
//! @todo sorting temporarily disabled because not it's not implemented in forms (bug 150372)
setSortingEnabled(false);
}
KexiFormScrollView::~KexiFormScrollView()
......@@ -229,7 +227,6 @@ void KexiFormScrollView::clearColumnsInternal(bool repaint)
Qt::SortOrder KexiFormScrollView::currentLocalSortOrder() const
{
//! @todo
return d->localSortOrder;
}
......@@ -240,22 +237,18 @@ int KexiFormScrollView::currentLocalSortColumn() const
void KexiFormScrollView::setLocalSortOrder(int column, Qt::SortOrder order)
{
//! @todo
d->currentLocalSortColumn = column;
d->localSortOrder = order;
}
void KexiFormScrollView::sortColumnInternal(int col, int order)
{
Q_UNUSED(col);
Q_UNUSED(order);
//! @todo
KexiDataAwareObjectInterface::sortColumnInternal(col, order);
}
void KexiFormScrollView::updateGUIAfterSorting(int previousRow)
{
Q_UNUSED(previousRow);
//! @todo
}
void KexiFormScrollView::createEditor(int row, int col, const QString& addText,
......
/* This file is part of the KDE project
Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
Copyright (C) 2004-2015 Jarosław Staniek <staniek@kde.org>
Copyright (C) 2004-2016 Jarosław Staniek <staniek@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
......@@ -251,13 +251,16 @@ protected:
//! Implementation for KexiDataAwareObjectInterface
virtual int currentLocalSortColumn() const;
//! Implementation for KexiDataAwareObjectInterface
//! Implementation for KexiDataAwareObjectInterface. Visually does nothing
//! but remembers index of the currently sorted column and order.
virtual void setLocalSortOrder(int column, Qt::SortOrder order);
//! Implementation for KexiDataAwareObjectInterface
//! Implementation for KexiDataAwareObjectInterface.
//! Just calls KexiDataAwareObjectInterface's implementation.
void sortColumnInternal(int col, int order = 0);
//! Implementation for KexiDataAwareObjectInterface
//! Implementation for KexiDataAwareObjectInterface.
//! Nothing to do here. Record navigator is already updated.
virtual void updateGUIAfterSorting(int previousRow);
//! Implementation for KexiDataAwareObjectInterface
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment