View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0001560||SkyChart||1-Software||public||16-10-30 08:25||16-11-24 17:48|
|Reporter||Sasa||Assigned To||Patrick Chevalley|
|Platform||Linux 64-bit||OS||Kubuntu||OS Version||14.04|
|Summary||0001560: Search objects history|
|Description||Currently, only first 3 searched objects are stored when close and reopen CDC.|
Perhaps to keep at least last 5 searched object?
|Steps To Reproduce||1. Open CDC and search for Mars, Jupiter, Venus, Sun etc.|
2. Exit from CDC and reopen
Only Mars, Jupiter and Venus would be listed in drop-down list.
|Tags||No tags attached.|
The list must save the last 15 objects without duplicate. It is saved when you close the program even if you not save the config.
You can check in file ~/.skychart/skychart.ini :
If the ini file is right, trace the load when the program start at pu_main line 6135.
Also check in main form that quicksearch combobox dropdowncount property is 15.
And maybe your Gtk theme add a hidden scrollbar to the list if the length is more than 3, try to move the mouse on the right of the list.
It seem this is the problematic line (6990):
it should be replaced with something as:
j := quicksearch.Items.count;
if (j > MaxQuickSearch) then
j := MaxQuickSearch;
And as well this (line 6139):
if (j > MaxQuickSearch) then
j := MaxQuickSearch;
I can make this change but there is something I not understand as min() is implemented in FPC simply as:
if a < b then
Result := a
Result := b;
Maybe parameter alignment with your processor? as 3 = 15 shr 2
But you may have problem at other place where I use constant integer parameters.
I tested on my 32bit Atom processor and I have the full 15 object list.
Well, it seems it is not enough.
1. Keep only 3 items in ini,
2. Open cdc add 4-th
3. Exit without saving config.
Only first three will stay.
I do not know, min() have inline specifier, maybe thus is broken something.
But still, with the above replacements only 3 items exists saving config or not.
So replacing min() do not solve the problem?
I tested your sequence of note 3412 on 32bit and 64bit computer, adding the fourth element with the search bar or the advanced search, and in all case I have the fourth after restarting the program.
Can you confirm you can have more than 3 in the list before you restart the program?
Something is really broken here...
I can see the 4-th search in ini and loaded from it only if unconditionally save the search inside TMain.Close
||can you look if you not have two [quicksearch] section in the .ini?|
||I see only one section with that key.|
||BTW, what version of FPC and Lazarus you using?|
At the time you submit the issue it was FPC 3.0 and Lazarus 1.6.0.
I recently change for Lazarus 1.6.2.
You have the details for a specific binary in Help/About.
Thank you. I will upgrade to newer Lazarus.
I have briefly examine Tmain.FormClose...
What could be following:
if (not NeedRestart)and(not cfgm.KioskMode) then SaveQuickSearch(configfile);
NeedRestart is set in two case:
- when you ask to reset the configuration, so not save in this case
- if you change the database from sqlite to mysql in the config, something you not do every day.
KioskMode is a startup option to help to run skychart on a public kiosk in an event. No config can be changed in this mode.
I have deleted ini and start the CDC. Non of search is saved (config not saved)
I have fix it by:
if SaveConfigOnExit.checked and Application.ShowMainForm then
if ConfirmSaveConfig then
// else - REMOVE THIS!
if (not NeedRestart)and(not cfgm.KioskMode) then
You have "Save config on exit" checked and you alway reply No.
Personally I do so many weird testing that I alway uncheck "Save config on exit" in the menu, so I go after the "else".
But if you simply remove the else you save the quicksearch two time if you save the config because SaveDefault include SaveQuickSearch.
Have to save quicksearch if form modalresult is mrNo.
I make this fix in rev 3323:
please confirm this work.
||Yes it works correctly now. Thank you.|
And tank you to find this 15 year old bug!
|16-10-30 08:25||Sasa||New Issue|
|16-11-24 13:30||Patrick Chevalley||Note Added: 0003405|
|16-11-24 13:30||Patrick Chevalley||Assigned To||=> Patrick Chevalley|
|16-11-24 13:30||Patrick Chevalley||Status||new => feedback|
|16-11-24 14:20||Sasa||Note Added: 0003408|
|16-11-24 14:20||Sasa||Status||feedback => assigned|
|16-11-24 14:42||Sasa||Note Added: 0003410|
|16-11-24 14:46||Patrick Chevalley||Note Added: 0003411|
|16-11-24 14:48||Sasa||Note Added: 0003412|
|16-11-24 14:50||Sasa||Note Edited: 0003412||View Revisions|
|16-11-24 15:06||Sasa||Note Added: 0003413|
|16-11-24 15:24||Patrick Chevalley||Note Added: 0003415|
|16-11-24 15:30||Sasa||Note Added: 0003416|
|16-11-24 15:31||Patrick Chevalley||Note Added: 0003417|
|16-11-24 15:35||Sasa||Note Added: 0003418|
|16-11-24 15:51||Sasa||Note Added: 0003419|
|16-11-24 15:58||Patrick Chevalley||Note Added: 0003420|
|16-11-24 16:06||Sasa||Note Added: 0003421|
|16-11-24 16:28||Patrick Chevalley||Note Added: 0003422|
|16-11-24 16:39||Sasa||Note Added: 0003423|
|16-11-24 16:39||Sasa||Note Edited: 0003423||View Revisions|
|16-11-24 16:43||Sasa||Note Edited: 0003423||View Revisions|
|16-11-24 17:27||Patrick Chevalley||Note Added: 0003426|
|16-11-24 17:27||Patrick Chevalley||Target Version||=> 4.0|
|16-11-24 17:39||Sasa||Note Added: 0003428|
|16-11-24 17:48||Patrick Chevalley||Note Added: 0003429|
|16-11-24 17:48||Patrick Chevalley||Status||assigned => resolved|
|16-11-24 17:48||Patrick Chevalley||Resolution||open => fixed|