| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
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...
|
|
|
|
|
| |
Mostly nullptr, one missing include that wasn't really missed, and a
stray ;
|
|
|
|
|
|
| |
If we already have an actor, get all mappings for all pics and fill the
result view. This only makes sense for actors, but should also work for
other items.
|
|
|
|
|
| |
Create separate files for MappingData and MappingTreeResultModel.
Hopefully no functional changes.
|
|
|
|
| |
A set of attributes can now be saved and loaded in NewPicsDialog.
|
|
|
|
|
|
|
|
| |
Since that commit we not only recorded leaves for Mappings, but also the
nodes. This is plain wrong, since we build the path/tree ourselves where
it matters (e.g. MappingTreeItem).
Fix it by checking recursively if the MappingItem has children.
|
|
|
|
|
| |
removeRows and insertRows is buggy. Unfortunately I can't figure out
how... So make it easy and reset the model on inserts and removals.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
MappingTreeModel::treeFromPath() never worked as intended, so replace it
by displaying mappings in a QTextTable.
|
|
|
|
|
|
| |
With some GNOME themes the edit trigger for SmTreeModel is borked. The
current name is mixed with the new one, and one can't recognize
anything. Use a QInputDialog instead.
|
|
|
|
|
|
|
| |
* Again: remove the transaction madness besides almost everywhere
leaving one instance where it is actually useful.
* Hide the buttons to add and delete mapping types. Haven't thought that
through complete. What should be deleted on cascade? Do we really want/
|
|
|
|
|
|
|
| |
* remove some of the Transaction madness
* make it possible to archive pics again
It's far from finished....
|
|
|
|
|
|
|
|
|
|
| |
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...
|
|
|
|
|
|
| |
Renaming/Editing of an item didn't work, because database restrictions
hadn't been taken into account. tdescription_name is unique, so update
the description_id if it already exists.
|
|
|
|
|
| |
Forgot to fix/rename MappingTreeResultModel... Adding pictures works
again :)
|
|
|
|
|
|
|
| |
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!
|
|
|
|
|
|
|
|
|
|
|
| |
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) :)
|
|
|
|
| |
Rename enum also! _THAT_ should help, I hope!
|
|
|
|
|
|
|
|
|
|
|
|
| |
Well, many errors are a result of the very confusing naming scheme. We
have tables:
* mappings, more correctly mapping_descriptions
* mapping_parents2, mapping_parents will be eliminated
* mapping_types, maybe right, not sure.
This commit renames mappings (_the_ mapping table) to
mapping_descriptions. Hope I didn't miss anything. No functional change,
BTW.
|
|
|
|
|
|
|
| |
Only select files when archiving pics from filemanager. While at it, I
noticed a crash on close when no item is selected in PicturesWidget. So
check if MappingData is valid on writing settings. Best way is
MappingData::isValid(), and for that I needed a explicit constructor.
|
|
|
|
|
|
| |
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...
|
|
|
|
|
|
|
|
|
| |
* Don't recurse ad infinitum when having nodes with the same name.
* Add all relevant data to the model.
There's still one quirk left: you can't do something like this blub ->
blub2 if bla -> blub ->blub2 already exists, but that's something I can
live with.
|
|
|
|
|
|
|
|
|
|
| |
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... :(
|
|
|
|
| |
Remove unused functions, members and queries.
|
|
|
|
|
| |
Deleting children tried to remove it from mappings instead of
mappings_parents2. The mapping itself should not be deleted.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Not working again, but I eventually have to commit the changes. Fixes to
SmTreeModel:
* Fix SmTreeModel::index(). The previous comment was quite valid. I'm
surprised that it worked at all. I have no clue why to return an invalid
QModelIndex if the column isn't 0. Now an index with any valid column
number can be created.
* Fix SmTreeModel::parent(). Again, why shouldn't we create a parent
index with a column other than 0? No idea...
* Fix SmTreeModel::headerData(). Add some sanity checks.
* Fix SmTreeModel::findRecursive(). Well, what is there to say. It never
worked for models with a depth > 1, but obviously it didn't really
matter until now. To make it work I had to change SmTreeItem as well.
SmTreeItem::next() returns the next valid parent/sibling, or 0 if there
isn't one.
There may be some fallout from these changes, but they're yet to be
seen.
Changes to PictureView:
* fix selecting an item according to the new datasbase layout
* same goes for editing items. If an update actually works has to be
checked.
Overall, it's an intermediate commit that should have been a sane series
of commits. Can't be changed now...
|
|
|
|
|
| |
Select pictures referencing pics_mappings2 instead of broken
pics_mappings. This just fixes the selection, nothing else!
|
|
|
|
|
|
|
|
|
|
|
|
| |
Warning: this commit seems to work, but it doesn't!
Introduce two new tables: mappings_parents2 and pics_mappings2 to create
a real parent-child relationship. The pics_mappings need to reference a
unique mappings_parents_id so the same mapping can be a child of
different parents.
For now only the MappingTree references the new tables. Everything else
uses the old ones. Hence the warning!
|
|
|
|
|
|
|
|
|
|
|
| |
Hell, this was one heck of a bitch. Lots of changes just to show the
mapping tree in PictureViewer2. Did I mention that I hate recursion?
Added a function for fetching a SmTreeItem * from MappingTreeModel for
paths, just to turn it into a QTextDocument in PictureViewer2. Of course
everything is recursive. Did I say that I hate recursion?
Well, as said in the comments, one recursion function seems fishy, but
it works (tm).
|
|
|
|
| |
Remember selected node in PicturesWidget.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It started as a buxfix session, but the more I dug into some ancient
code, the more I had to change.
Well, first and foremost, this fixes a crash in PicturesWidget. Trying
to display the mappings of the selected picture in a different color
never was a good idea. Show them in the statusbar instead.
While looking at the statusBar code, make PictureWidget emit signals to
show the total size and number of selected items. Then I noticed some
really, really braindamaged connection madness in the Shemov
constructor. Instead of doing all the work in SheMov itself, have the
widgets emit signals.
This should have been several commits, but one lead to another...
|
|
|
|
|
|
|
|
|
| |
This was a tough one. Lost in recursion. When selecting nodes with
children in the picture widget, all files having this node as mapping
parent are shown.
Had to make some changes to SmTreeModel::findRecursive for this. I hope
I didn't break anything. If I did, I'll fix it :)
Also disposed of some comments and unused member variables.
|
|
|
|
|
| |
Don't brute force coloring MappingTree by calling (begin|
it keeps the focus.
|
|
|
|
| |
Make it possible to edit picture mappings on archived pictures.
|
|
|
|
|
| |
Catch illegal separator in value before making a database entry and
insertRows()
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move mappings by context menu. Select new parent by QComboBox with
available paths, items separated by "/". Note that hell will break loose
if a mapping name contains "/". Will be fixed later.
Since mapping views don't have setSortingEnabled(), make
SmTreeModel::addRow() sort items.
This fixes a long standing bug in SmTreeModel::reparent(): Since it
alters the model, newParent has to be a QPersistentModelIndex to stay
consistent.
|
|
|
|
|
| |
When selecting pictures, mark the active mappings with a different
color.
|
|
|
|
|
|
|
|
| |
Create a tab to show the archived pictures. It's far from complete, but
it already does:
* show pictures
* hover
* delete pictures from archive
|
|
|
|
|
|
| |
Finally NewPicsDialog actually does something. Added another parameter
to Helper::moveToArchive. If set to true, files will only be copied
instead of moved. Default is false, not changing the expected behavior.
|
|
|
|
|
|
|
| |
Make it possible to add mappings to new pictures. This actually was a
tough one. Maybe I shouldn't drink and code.
Next: make NewPicsDialog actually do something.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a rather large commit. It implements MappingTreeWidget using
MappingTreeModel unsurprisingly this uncovered some exciting bugs.
Fixes the following bugs in MappingTreeModel:
* use insertRows() and removeRows() when addings children, because
dataChanged() won't do it.
* don't use a prepared QSqlQuery when fetching children recursively.
This won't work because the query is still active when we invoke
ourselves again. Put the query on the stack instead
* Keep the model sorted.
Also add an entry for a MappingTreeEditor to the File-Menu.
|
|
MappingTreeModel is a generic approach at mappings files to generic
data, eg atttributes, actors or themes. It compiles, but nothing more.
So expect many exciting bugs and SegFaults.
|