Bug 425337 - The sql query and custom DateTime format are not saved in Import dialog
Summary: The sql query and custom DateTime format are not saved in Import dialog
Status: RESOLVED FIXED
Alias: None
Product: LabPlot2
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Alexander Semke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-14 08:50 UTC by Rok
Modified: 2020-08-24 11:58 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 2.8
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rok 2020-08-14 08:50:02 UTC
SUMMARY

When importing SQL data the query is not saved.

STEPS TO REPRODUCE
1. Import from database with custom query and custom DateTime format
2. Try to import again

OBSERVED RESULT
There is Empty query and empty DateTime format

EXPECTED RESULT
The values should be saved between each import
It would be great if query is saved into each spreadsheet to enable quick
re-import on live data.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu focal
Qt Version: 5.12

ADDITIONAL INFORMATION
System: Ubuntu 20.04.1 LTS
Locale: Slovenian,Slovenia (Decimal point ',', Group separator '.')
Number settings: Decimal point ',', Group separator '.', Exponential 'e', Zero digit '0', Percent '%', Positive/Negative sign '+'/'−' (Updated on restart)
Architecture: x86_64-little_endian-lp64
Kernel: linux 5.4.0-42-generic
C++ Compiler: GNU 9.3.0
Comment 1 Alexander Semke 2020-08-15 08:07:04 UTC
(In reply to Rok from comment #0)
> SUMMARY
> 
> When importing SQL data the query is not saved.
> 
> STEPS TO REPRODUCE
> 1. Import from database with custom query and custom DateTime format
> 2. Try to import again
> 
> OBSERVED RESULT
> There is Empty query and empty DateTime format
> 
> EXPECTED RESULT
> The values should be saved between each import
> It would be great if query is saved into each spreadsheet to enable quick
> re-import on live data.
Yes, we should also save the query. Thanks for reporting this.

The query is specific to the database. I'd suggest to save the last use query for every database. So, if you work with multiple databases and switch between the differnt database connections, the last used query for the database connection should be shown. Ok?

I cannot reproduce the problem with the DateTime format. For me it's saved. It's empty in the beginning if you open the import dialog for the first time, but if you select a format and close the dialog it's saved. Can you please double check this?
Comment 2 Alexander Semke 2020-08-17 06:26:44 UTC
Git commit 2df9703d23557e7f2d7e966987c89ffcfb916ee1 by Alexander Semke.
Committed on 17/08/2020 at 06:25.
Pushed by asemke into branch 'master'.

Save and show the last used SQL query for every connection in the
database import dialow.
FIXED-IN: 2.8

M  +12   -1    src/kdefrontend/datasources/ImportSQLDatabaseWidget.cpp

https://invent.kde.org/education/labplot/commit/2df9703d23557e7f2d7e966987c89ffcfb916ee1
Comment 3 Rok 2020-08-20 07:32:00 UTC
I forgot to state that custom DateTime format is not saved. If I choose predefined format it is saved, But if I write following format "yyyy-MM-ddThh:mm:ss.zzz" - note T in the middle then the DateTime is parsed correctly for this import, but when I reopen import dialog the combo box is cleared.
Comment 4 Alexander Semke 2020-08-24 11:58:15 UTC
(In reply to Rok from comment #3)
> I forgot to state that custom DateTime format is not saved. If I choose
> predefined format it is saved, But if I write following format
> "yyyy-MM-ddThh:mm:ss.zzz" - note T in the middle then the DateTime is parsed
> correctly for this import, but when I reopen import dialog the combo box is
> cleared.
I fixed this. Please check the current master. Thanks for reporting this.