| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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...
|
|
|
|
|
|
|
| |
Try to get the position of the current picture after adding and clearing
the file list of PictureViewer2. While thinking of using std::find for
this I realized that the operator()-functions in Helper:: weren't used
any more, so remove them and the <algorithm> includes.
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Another fix to MappingTreeModel's new database layout. I think we're
getting there...
Insert the mappings into mapping_parents2 and add the MapParentId to the
newly created index in the model. For now, the added date remains
invalid. Make it possible (again?) to add root items to
MappingTreeModel. For this I had to design a new QDialog with a
checkbox.
This one fixes another bug in SmTreeModel: Don't call parent() on a null
pointer.
Sometimes I'm getting random SIGBUS-Signals, but maybe that's because of
the debug build of qt I'm using. Couldn't track it down yet...
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Convert to new mapping DB layout. Return the parent ID where necessary
instead of the mapping ID.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
* Added 4 new icons for PictureView-actions.
* simplified SheMov::tabChanged(int)
* fix long standing bug with QActionGroups in SheMov. Enable and disable
all actions according to the active tab
|
|
|
|
| |
Make it possible to edit picture mappings on archived pictures.
|
|
|
|
|
| |
Catch illegal separator in value before making a database entry and
insertRows()
|
|
|
|
|
|
| |
Remove the QLineEdit and QPushButtons from the bottom of
MappingTreeWidget and make adding mapping items available in the context
menu.
|
|
|
|
|
| |
Since "/" is used as path separator, reject any SmTreeModel::Name
containing it.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Version 1 of NewPicsDialog. Just one single tab for adding files. Does
nothing yet besides adding and removing files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|