summaryrefslogtreecommitdiffstats
path: root/picfilesmodel.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make it run with Qt6Arno2022-04-151-4/+4
| | | | | | | | | This is a huge commit. Changes: * Obviously, make it compile * Make it run (only scarcely tested) * get rid of most of clang's warnings Let's see what surprises are in store...
* Increase maximum days for slide showArno2020-03-141-33/+0
| | | | Set it to 9999. While at it, remove some dead code and fix includes.
* Fix PicFilesModelArno2018-11-231-19/+19
| | | | | Don't hide another function and weed out foreach. Also fix nullptr issues.
* More code churnArno2018-07-201-1/+1
| | | | | Create separate files for MappingData and MappingTreeResultModel. Hopefully no functional changes.
* Reconnect to database after network failureArno2016-04-021-5/+8
| | | | | | | | | | | | It's more difficult than I thought. It seems you need a failed query until libpq notices that the connection is lost. Implement reconnect at the very bottom of the slide time to get it back as soon as possible. I have no idea though what it does to cloned connections. Also, if no slide show is running, it'll never reconnect. It works when I down the database, maybe create a Helper function for this...
* There goes the constness...Arno2016-03-301-5/+8
| | | | At least try to reconnect to the database after resume.
* Make the SlideDialog do somethinArno2016-03-291-0/+41
| | | | Well, implement functionality. Seems to work as intended.
* Let std::shuffle do the randomizationArno2016-03-201-2/+11
| | | | | Seems to be more random. Also, this commit introduces c++11, yay!
* Slide through recent in PictureViewer2Arno2015-08-291-1/+14
| | | | | For now, recent is hardcoded to pictures added in the last 6 months. Maybe it should be configurable...
* Implement slide through all picturesArno2015-08-121-0/+28
| | | | | Wow, that was much more complicated than I first thought, but it seems to work. Maybe it's much more convoluted than it has to be :)
* Various Bugfixes and cleanupsArno2014-12-101-2/+2
| | | | | | | | | | | | * remove debug statements from SmDirWatcher * Don't crash on parentDir when current Dir is already deleted * Fix PicFilesModel MappingQuery. It needlessly referenced the table pics in FROM causing an expensive full table scan! * Fix findRecursive in PicFilesModel: Stupid typo! * Give SmDirWatcher a separate DB-Connection. One Thread, one Connection * Remove several includes This should have been 6 commits, but that's how debugging works :(
* Sort MappingItem alphabeticallyArno2014-07-101-1/+8
|
* Bring back the nice MappingItem!Arno2014-07-091-0/+70
| | | | | | | | | | Resurrect the indented MappingItem. There's some recursion involved, but actually it ain't so hard if you have a template :) This adventure uncovered a bug in NewPicsDialog: Right now we also record the nodes (not just the leaves) for the Mappings. This bug was introduced by commit dc7cc269a4fffe43bdac2ae2dc6548fbd1e3bb5e and will be fixed in one of the next commits.
* Major rework of MappingTreeResultView + ModelArno2014-06-291-5/+24
| | | | | | | Well, I hope this fixes the crashes for good. String comparison for looking up the parents really wasn't a prudent thing to do... Use the ParentIds instead.
* Fix Style issuesArno2013-10-121-1/+1
| | | | | | * Change fixed width front from "courier" to "Monospace" * Remove foregroundcolor from SmTreeItem. Wasn't used nor needed, quite the opposite: it made SheMov deviate from the default style.
* Give Pictures some love!Arno2013-08-221-24/+32
| | | | | | * Show and archive size of pictures * Fix SqlQueries in PicFilesModel: removeFiles and changeMappings * use delegate in PictureView
* Cleanup closeEventArno2013-07-271-7/+0
| | | | | | | | | | Don't try to delete all the prepared statements manually. Get rid of the ~destructors and just close the QSqlDatabase. close() deletes all Statements. Also, quit() all QThreads on closeEvent() except CompleterProducer. When the experimental archive view gets merged, that QThread is gone. No need to bother...
* Finally { fix MappingTreeModel }!!!Arno2012-11-171-4/+3
| | | | | | | I think I did it! Fixed MappingTreeModel to make it usable, avoid all the traps with the insane column and variable names! Now we can actually have the same mapping with different parents! Yay! Hope it won't come back and bite me!
* More renaming and database cleanupArno2012-11-161-4/+4
| | | | | | | | | | | | | Rename: * drop table pics_mappings * rename pics_mappings2 to pics_mappings (no column renames) Cleanup: * drop tables and sequences: pics_attributes* * drop tables and sequences: pics_actors* * drop tables and sequences: pics_themes* Still works!
* More renaming: mappings_parentsArno2012-11-161-1/+1
| | | | | | | | | | | Rename: * drop table mappings_parents * rename mappings_parents2 to mapping_parents * drop the s after mapping on column names * rename FK imapping_id to idescription_id * rename ParentId(Role) to MappingParentId(Role) Well, it still works (tm) :)
* Renaming continued!Arno2012-11-161-2/+2
| | | | Rename enum also! _THAT_ should help, I hope!
* Fix archiving picturesArno2012-10-271-4/+6
| | | | | | Well, what can I say. Lost in recursion and parent pointers. This commit actually boils down to using the proper database tables and inserting the right values. 'Nuff said...
* More fixes to MappingTreeModelArno2012-10-061-3/+3
| | | | | | | | | | Fix move, addChild and such. Rename Fields and Roles to more speaking names, but that revealed a much deeper bug: the ParentID isn't really the parent_id, but the mapping_id. That could explain a lot. Nevertheless, it's still faster to repopulate the model after moving oder adding children instead of calling removeRows and insertRows. Another non-working commit... :(
* Fix Mappings in PictureViewer2Arno2012-10-041-0/+219
Another fix for the new MappingTreeModel database layout: Make the mappings display correctly when showing an archived picture. For performance reasons I had to make PicFilesModel global and put it into a separate file. Also clean up MappingTreeModel: remove comments and unused functions.