summaryrefslogtreecommitdiffstats
path: root/smtreemodel.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix iconArno2013-03-051-1/+1
| | | | Miss-spelled foldericon (folderIcon) in mappingtablewidget.cpp model.
* More fixes to MappingTreeModelArno2012-10-061-9/+9
| | | | | | | | | | 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... :(
* Fixed adding and deleting children from MappingTreeModelArno2012-10-051-1/+4
| | | | | | | | | | | | | | | | | 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...
* Fix SmTreeModel for goodArno2012-10-031-17/+15
| | | | | | Back to the basics! Should have read the reference implementation of QAbstractItemModel::index() earlier, much earlier. Now it just works (tm)!
* Foremost a fix for SmTreeModelArno2012-09-301-33/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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...
* Make nodes with children selectable in picture widgetArno2012-03-171-5/+7
| | | | | | | | | 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.
* Make it possible to move mappingsArno2012-03-021-5/+15
| | | | | | | | | | | | | 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.
* Implement MappingTreeWidgetArno2012-02-241-2/+3
| | | | | | | | | | | | | | | 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.
* Mark items in DbAnalyzerDialogArno2011-12-281-0/+5
| | | | | | | | | It's now possible to mark items in DbAnalyzerDialog with a different color, when there are no covers or actor information available on the net. I enhanced SmTreeItem to contain a QVariant::foregroundColor, and made SmTreeModel return it when QModelIndex::data with role Qt::ForegroundRole is called. Maybe that could be useful for other things like favorites and such...
* Hmm, checking out treemodel again. This seems way too complex...Arno2011-08-231-1/+5
|
* Turn metadata display into a QTreeViewArno2011-07-081-1/+1
| | | | | | | This wasn't as easy as it sounds. I had to completely redesign the SeriesMetadataModel. Now it's a hybrid between a ListModel and a TreeModel. The actual data is held in a QList<QVariant>, the tree is only for display.
* Update IsLocal when setting DVD no.Arno2011-05-221-6/+20
| | | | | | The field IsLocal in the SeriesTreeModel is now properly updated when the DVD no. changes. It still doesn't propagate to the file view, though.
* Made all icons in qresource available for UIArno2010-12-271-1/+7
| | | | | | | | | | | | | | | | Every registered icon can be chosen as Qt::DecorationRole for all models at once. Suitable icons must be added to SmGlobals::mIcons. Key is a descriptive text, value is the icon path. To make things easier SmTreeModel got two new member functions: -QIcon decorationIcon() returning the current Icon -void setDecorationIcon() to set the current Icon The current Icon is initialized in the constructor from QSettings - ui/iconfolder To update the TreeViews connected to the FileSystemModel a little hack is needed: Just set the QFileIconProvider again. This causes the Model to update connected views.
* Selectable columns in FilesTreeViewArno2010-12-051-0/+7
| | | | | | | | | Made columns shown in FilesTreeView selectable. Also, the order of columns is saved and restored. This was a difficult one. I even had to make a debug build of qt. But I fixed a serious bug in FilesTreeModel::modeName: don't access the Hash if modeName == -1.
* Final version of NewMovieWizard::accept() (hopefully)Arno2010-07-091-1/+0
| | | | | | | | | | | | | | | | | Actually made this function work. Forgot to handle actors and genres. Also several bugfixes in other parts: -fix typo in FilesTreeModel query -commit changes ind MappingTableModel::addItem, making the genre and actor widgets work as intended -remove redundant MappingTableModel::find(), already implemented in SmTreeModel -call next() instead of exec() in SeriesTreeModel::addSeriesPart. Query is already executing if it's a select -use QModelIndex::row() instead of column() in MappingTableWidget::removeItem() -add partNo to layout in MovieInfopage::MovieInfoPage() -add convenience function setMappings() to MappingTableModel
* Fix MovieInfoPageArno2010-07-041-5/+5
| | | | | | | | | | | | | | | The first page of NewMovieWizard gave me quite a headache. It crashed with a segmentation fault because of exposing mDvdNo via registerField() without actually assigning a QCheckBox to it. The backtrace isn't very helpful in such a case. I also fixed some bugs on the way: 1. use SmTreeItem::setData in SmTreeModel::addRow instead of deleting the old item and creating a new one. This way I don't need to take care of the parent. 2. get data of old item in SmTreeModel::reparent before calling removeRows. This call deletes the item. 3. Fix column alignments in WizardTreeModel for size column
* Started NewMovieWizard for adding moviesArno2010-07-021-0/+35
| | | | | | | | Finished GUI for first page of NewMovieWizard. To make things easier I added two new member functions to SmTreeModel: -QModelIndex find() to find items by value of a column -void reparent() to remove an item from one parent and add it to another
* Created frontend for SeriesTreeModel::deleteFromSeriesArno2010-06-181-1/+1
| | | | | | | | | | | Implemented frontend for SeriesTreeModel::deleteFromSeries. I hope QPersistentModelIndexes work as advertised. From the qt-sources it seems that a QPersistentModelIndex is automatically updated by QAbstractItemModel when calling begin(Remove|Insert)Rows. Testing worked out fine. While at it I found a bug in SmTreeModel. removeRows has to be called with (i - 1) instead of (i) to remove the correct nodes.
* Partial implementation of adding new SeriesArno Moeller2010-06-171-1/+1
| | | | | | Adding an item to the TreeView works, but it doesn't get focus after inserting. Also the data is not shown. And setting the title of the new item should make the database puke.
* Treemodel DevelopmentArno2010-06-161-0/+8
| | | | | | | | | | -Changed the database schema. Attached quality to files -Subclassed SmTreeModel for SeriesTreeModel -Made SmTreeModel virtual for that Well, it seems there is a serious problem with the database schema. Curiously everything inside the model works beside the db update. Seems I have it wrong with the fks :(
* Implemented SeriesTreeWidgetArno2010-06-131-1/+8
| | | | | | | | | Implemented a widget for showing series in a tree. Also implemented filtering and sorting for this widget. Some bugfixes and enhancements: -Show dildo as DecorationRole in SeriesWidget -removed Quality from SeriesWidget
* Implemented SmTreeModel::parentArno2010-06-121-0/+14
| | | | | Forgot to implement SmTreeModel::parent. Thus it was a pure abstract class and not instantiable.
* Finished SmTreeModel, started SmUberModelArno2010-06-061-0/+144
| | | | | kinda finished the treemodel. Don't really know if it's complete yet. More programming will show :)
* Started Treemodel for ArchiveArno2010-06-031-0/+18
Implemented generic SmTreeItem, started on generic SmTreeModel.