| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
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.
|
|
|
|
|
| |
Put mapping editor into a seperate class to make it easier using it for
changing mappings later.
|
|
|
|
|
|
|
|
| |
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.
|