Review Request 122197: Fixes to .ods import

Jarosław Staniek staniek at kde.org
Sat Jan 24 21:04:41 GMT 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/122197/#review74673
-----------------------------------------------------------


Thanks, many suggestions below, some inspired by your changes.


kexi/core/kexiproject.cpp
<https://git.reviewboard.kde.org/r/122197/#comment51771>

    I don't think these two changes in semantics are proper here. Names are case-insensitive for Kexi object -- IIRC this has been inherited from databases.



kexi/migration/AlterSchemaWidget.cpp
<https://git.reviewboard.kde.org/r/122197/#comment51769>

    While we're at this topic, how about changing the replace to exiUtils::stringToIdentifier(m_originalSchema->name())?



kexi/migration/AlterSchemaWidget.cpp
<https://git.reviewboard.kde.org/r/122197/#comment51753>

    nameChanged() isn't a signal



kexi/migration/AlterSchemaWidget.cpp
<https://git.reviewboard.kde.org/r/122197/#comment51758>

    Looks like KexiDB::isIdentifier() is a simple way to perform the two latter checks and more.
    
    See also notes below to see that maybe this method won't be needed.



kexi/migration/AlterSchemaWidget.cpp
<https://git.reviewboard.kde.org/r/122197/#comment51756>

    While we're at this: we're about to create table with desired name. 
    
    So why wouldn't this check work:
    
    KexiMainWindowIface::global()->project()->itemsForClass("org.kexi-project.table", baseName) ?
    
    Thus, we allow other types of objects of the same name, e.g. a form.



kexi/migration/importtablewizard.cpp
<https://git.reviewboard.kde.org/r/122197/#comment51767>

    1. We could rather perform single check using KexiDB::isIdentifier(), if fails, show 
    
    i18nc("@info",
    "Entered name <resource>%1</resource> is not a valid identifier.<nl/>"
    "<nl/><note>Identifiers cannot be empty, should start with a latin letter or '_' character, should contain only latin letters, numbers and '_' characters.</note>", ...)
    
    2. BUT IDEAL solution is to use a KexiNameWidget instance embedded here instead of line edit, like used on table creation:
    http://i.imgur.com/ko7WTPi.png
    
    3. Thus we'd use a principle of allowing users to enter only valid data, and have full control over caption _and_ name.
    
    4. And like in the table caption/name dialog, in this approach one thing still needs to be handled: empty indentifiers. Instead of displaying error messages as below I'd propose to use react on KexiNameWIdget::textChanged() and depending the result of KexiNameWIdget::checkValidity() enable/disable the Next button of the assistant.
    
    5. So the only message that we needed is the one about name already used by another table.
    
    6. Based on the new behaviour of the Next button, the OK/Cancel icon and updating it in nameChanged() wouldn't be needed - user will be given a more natural feedback instead.



kexi/migration/importtablewizard.cpp
<https://git.reviewboard.kde.org/r/122197/#comment51765>

    Try to reuse my suggestion to improve AlterSchemaWidget::nameExists() here too.



kexi/migration/importtablewizard.cpp
<https://git.reviewboard.kde.org/r/122197/#comment51768>

    object -> table



kexi/widget/KexiConnectionSelectorWidget.cpp
<https://git.reviewboard.kde.org/r/122197/#comment51770>

    This looks good!


- Jarosław Staniek


On Jan. 22, 2015, 9:58 a.m., Roman Shtemberko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/122197/
> -----------------------------------------------------------
> 
> (Updated Jan. 22, 2015, 9:58 a.m.)
> 
> 
> Review request for Calligra, Adam Pigg, Jarosław Staniek, Radosław Wicik, and Wojciech Kosowicz.
> 
> 
> Bugs: 336815
>     http://bugs.kde.org/show_bug.cgi?id=336815
> 
> 
> Repository: calligra
> 
> 
> Description
> -------
> 
> Fix 336815 (path issue)
> Also have fixed with this patch:
> Check for an empty name.
> Names are no more converted to the lower case (there is some conflicts with this behavior, imported tables can not be opened after this (only after restarting an app (!?)))
> Check if name is not starting with a digit (conflicts with '_' at the begining as well).
> Default name is added based on sheet selected.
> 
> 
> Diffs
> -----
> 
>   kexi/core/kexiproject.cpp c07fb36 
>   kexi/migration/AlterSchemaWidget.h b29e7f9 
>   kexi/migration/AlterSchemaWidget.cpp ea7fedd 
>   kexi/migration/importtablewizard.cpp f3d02b9 
>   kexi/widget/KexiConnectionSelectorWidget.cpp 48d3f7e 
> 
> Diff: https://git.reviewboard.kde.org/r/122197/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Roman Shtemberko
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20150124/5b41b4f6/attachment.htm>


More information about the calligra-devel mailing list