[Kexi] Re: [Calligra] 5423314: Display the object caption if possible

Jaroslaw Staniek staniek at kde.org
Mon Dec 20 20:31:58 CET 2010


On 20 December 2010 16:27, Adam Pigg <adam at piggz.co.uk> wrote:
> commit 5423314f59a1f4c9e2941ef55f5082bf60ecb752
> branch master
> Author: Adam Pigg <adam at piggz.co.uk>
> Date:   Mon Dec 20 15:26:03 2010 +0000
>
>    Display the object caption if possible
>
> diff --git a/kexi/widget/KexiProjectModelItem.cpp b/kexi/widget/KexiProjectModelItem.cpp
> index 8085efd..1ecdafc 100644
> --- a/kexi/widget/KexiProjectModelItem.cpp
> +++ b/kexi/widget/KexiProjectModelItem.cpp
> @@ -100,7 +100,7 @@ QVariant KexiProjectModelItem::data(int column) const
>  {
>     Q_UNUSED(column);
>     if (m_item) {
> -        return m_item->name() + (m_dirty ? "*" : "");
> +        return m_item->captionOrName() + (m_dirty ? "*" : "");
>     } else if (m_info) {
>         return m_info->groupName();
>     } else   {
>

Thanks for the commit.

However I did not explained the topic well. So I'll try now:
This behaviour is needed for non-design mode of kexi.
The question is how is that defined.

1. Definitely it's true for mobile mode.
2. For user mode it makes sense too. Check that using bool
KexiMainWindowIface::global()->userMode().

For edit mode on desktop it's not that useful _by default_ users need
to know exact name (not just caption) of objects on order to:
- reference them in SQL query view
- reference them in forms and reports, scripts, and lookup fields of tables

In theory they could use the caption in SQL too and in forms, reports.
But as soon as we support translations it'll be more complicated.

Important issue with using of the captions in pace of names, e.g. in
SQL is that captions are not forced to be unique.
That means that there can be table1 and table2 names having both "My
Table" caption. We do not enforce uniqueness here so in SQL, meaning
of the "SELECT foo from [My Table]" statement would not be strictly
defined.

I would think about enabling the User Mode on the mobile target but I
am not sure why we would have to give up with, e.g. creating queries
using special UX on the mobile target.

So for now I propose to use the m_item->captionOrName() when on mobile
(check this using #ifdef) and in the User Mode.

-- 
regards / pozdrawiam, Jaroslaw Staniek
 http://www.linkedin.com/in/jstaniek
 Kexi & Calligra (kexi-project.org, identi.ca/kexi, calligra-suite.org)
 KDE Software Development Platform on MS Windows (windows.kde.org)


More information about the Kexi mailing list