| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A huge commit, I know, but it was definitely worth it! It makes the
homebrew FilesystemModel work! It's divided up into two threads:
1. The Watcher: it reacts on inotify events and dispatches them to:
2. The Collector: this thread gathers the data and emits the SIGNALS to
the the view.
Now we can actually refresh the View, not possible with
QFileSystemModel, and the data reloads in almost real time without
blocking the GUI.
Unfortunately this uncovered some bugs I had to fix:
1. Helper::md5sum: Don't crash if read fails with -1
2. SmTreeModel::addRow is broken. Even after 5h I couldn't figure out
how or why, so I brute forced it. Reset the moded when a file is added.
3. Get rid of a lot of unneeded #include's
I guess that's about it...
|
|
|
|
| |
Miss-spelled foldericon (folderIcon) in mappingtablewidget.cpp model.
|
|
|
|
|
|
|
|
|
|
| |
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...
|
|
|
|
|
|
| |
Back to the basics! Should have read the reference implementation of
QAbstractItemModel::index() earlier, much earlier. Now it just works
(tm)!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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...
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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...
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
-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 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
|
|
|
|
|
| |
Forgot to implement SmTreeModel::parent. Thus it was a pure abstract
class and not instantiable.
|
|
|
|
|
| |
kinda finished the treemodel. Don't really know if it's complete yet.
More programming will show :)
|
|
Implemented generic SmTreeItem, started on generic SmTreeModel.
|