| 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...
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix focus policy: only change focus between MappingTreeWidget and
MappingTreeResultView.
Also, block updating the selection of MappingTreeWidget when removing an
item from the result view. That operation resets the result selection
and by signal changes the selection of the mapping tree. The easiest way
I could come up with was a member flag that is set in removeMapping and
checked and cleared in resultSelectionChanged. Clearing the flag right
after removing the item doesn't work, most likely because of thread
affinity (just a guess, didn't check it). If it has side effects remains to
be seen...
|
|
|
|
|
| |
While at it: They don't have to be members, so create them on the heap.
Also fix a nullptr warning.
|
|
|
|
|
|
| |
MovieWidget and PictureWidget both have filter bars on top of the left
tree, but the buttons were different. Change it to enhance user
experience :)
|
|
|
|
|
| |
Create separate files for MappingData and MappingTreeResultModel.
Hopefully no functional changes.
|
|
|
|
|
| |
Split up all the classes in mappingtreewidget into separate files to
make editing easier.
|
|
|
|
| |
Single it out to a separate file to make editing easier.
|
|
|
|
|
|
|
| |
Specifically editing mappings. Select and show the source when selecting
a mapping result. I know I worked on this a while ago, but never got it
right. IIRC I fiddled around with paths and recursion, but that was way
too complicated. Just move down the source tree. Fuck recursion :)
|
|
|
|
|
|
| |
* get rid of QModelIndex::child deprecation warnings
* replace Q_FOREACH
* use type-safe connect syntax
|
|
|
|
|
|
|
| |
Yeah! Finalling getting the hang of recursion, I hope!
Add a new Button ">>>>" to add a whole subtree. Not really useful when
archiving, but very useful when selecting Slide attributes!
|
|
|
|
|
| |
Also fix a long standing bug in MappingTreeModel: also remove item from
mCurrentData when the removed item is a parent of one of the items.
|
|
|
|
|
| |
If the actor already exists, select it and exit, otherwise create and
select it.
|
| |
|
| |
|
|
|
|
| |
Add CTRL+A for new actor to MappingTreeView
|
|
|
|
|
|
|
|
|
|
|
| |
MappingView:
* Key_Right: add mapping
* Ctrl-Key_Right: shift focus to ResultView
* Delete: clear all mappings
ResultView:
* Key_Left: remove mapping
* Ctrl-Key_Left: shift focus to MappingView
|
|
|
|
| |
A set of attributes can now be saved and loaded in NewPicsDialog.
|
|
|
|
|
|
|
| |
ResultView
Usability fix: When selecting a mapping in the result view, select it in
the source tree, too.
|
|
|
|
|
| |
removeRows and insertRows is buggy. Unfortunately I can't figure out
how... So make it easy and reset the model on inserts and removals.
|
| |
|
|
|
|
|
| |
This was a difficult one. Got lost in the Semantics of QThread once
again, but just 2 days later it works :)
|
|
|
|
|
|
| |
Fix the lookup of a new child, so it will select the right child if we
have more than one child with the same name. Do it by looking up the id
instead of the name.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Move matchRecursive from ArchiveModel to SmTreeModel so we can use it
here, too.
|
|
|
|
|
|
| |
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/
|
|
|
|
|
|
| |
SheMov crashed in MappingEditWidget::removeMapping, maybe because of
some race. So turn the selected QModelIndex into a PersistentModelIndex
and check for validity before removing the row...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Well, what started as a try to simplify QTreeView ended in a mass header
murder...
What happened:
* I searched for a way to let every QTreeView honor the
setAlternatingRowcolors() setting. Unfortunately it isn't enough to just
set the global palette and set it to true. So every QTreeView is now
derived from SmTreeView
* SmTreeView registers itself with SmGlobals, so the property is set
_after_ it's constructed. It's definitely not enough to call it in the
constructor. I guess that's a bug. But it's enough to append the
SmTreeView to a QList<QWidget*> in SmGlobals and call it _after_ the
painting is done.
* As an added Bonus we can add virt. funcs to every SmTreeView at will
While at it I realized that most of the included headers were void, so
remove them. No idea what impact it has on the bin size...
|
|
|
|
|
|
|
| |
This is more a qt5-fix than a SmDirModel fix. The global palette doesn't
propagate any more, so we have to set the palette in every QTreeView
separately. Very annoying and tedious. Maybe I missed a Widget or two,
dunno...
|
|
|
|
|
|
|
|
| |
* Change #include to qt5
* Fix missing QX11Info
* use explicit constructor for QVariant(QColor)
* use beginResetModel() and endResetModel() instead of reset(). The
latter was removed. Hopefully it still works :)
|
|
|
|
|
|
|
| |
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 enum also! _THAT_ should help, I hope!
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Try to select newly added mapping. Only try, because it will fail if we
have two children with the same name. The first will win.
|
|
|
|
|
|
|
|
|
|
| |
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... :(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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!
|
|
|
|
| |
Remember selected node in PicturesWidget.
|
|
|
|
| |
Make it possible to edit picture mappings on archived pictures.
|
|
|
|
|
| |
Catch illegal separator in value before making a database entry and
insertRows()
|
|
|
|
|
| |
Return an error if delete fails. Failure should only happen if there are
still references to other tables.
|
|
|
|
|
|
| |
Remove the QLineEdit and QPushButtons from the bottom of
MappingTreeWidget and make adding mapping items available in the context
menu.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|