Hi Rainer et al, sorting is not that easy as there are several opinions on how to sort stuff.
In QLGT you could sort items by name, time or distance to a given point. For artificial items used to plan tours, name and distance are options of interest. For real recordings the timestamp is important. Another option might be sorting waypoints and caches along a track. In general the correct order of the items is a product of the user's taste and of the item's nature. The result is hard to predict. And especially with the project oriented data handling the desired result will change from project to project. That is why I skipped all sorting so far. And sorting by name will not satisfy the other half of users. Probably the trick is to save the order of items for each project in a table and to keep track of each change, e.g. new items, removing items, changing the order. The main classes for this are CDBProject and IDBFolder. CDBProject is the project in the workspace. With CDBProject::save() it's content is written to the database. IDBFolder is the base class for all folders in the database view. IDBFolder::addChildren() is the core method to create/update all items in the folder. Both views, workspace and database, are synchronizing each other via events, handled in CGisListWks::event() and CGisListDB::event(). Now you can fix it yourself or open an issue on BitBucket, filing all the stuff we have discussed so far and wait for someone interested in taking the challenge. Oliver Am 16.02.2015 um 09:43 schrieb rainerU: > Hi all, > > Am 07.02.2015 um 12:07 schrieb teiwaz: >> I never dealed with SQL database stuff but I looked a bit around and >> found a suggestion (Answer from Mike Lewis >> <http://stackoverflow.com/users/99121/mike-lewis>) in the given Link >> which sounds very simple and reasonable for me. >> May be its worthy for you. >> >> http://stackoverflow.com/questions/812630/how-can-i-reorder-rows-in-sql-database > From my limited experience with SQL databases this solution seems > straightforward. Rows in the database are not ordered, so one has to use > columns for sorting on query. > > In QLGT, database items are displayed in alphanumerical order. This > allows to force the order the items by prefixing the name by a one or > two digits. Apparently this is not the case in QMS. I propose to order > items in the project window in alphanumerical order. A simple "order by > name" clause in the query should do the job. > > Rainer > > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk > _______________________________________________ > Qlandkartegt-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/qlandkartegt-users ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk _______________________________________________ Qlandkartegt-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qlandkartegt-users
