summaryrefslogtreecommitdiffstats
path: root/archivemodel.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Show only local filesArno2013-07-281-1/+29
| | | | Only show series with files on the hd.
* Simplify icon managementArno2013-07-271-11/+5
| | | | Introduce SmGlobals::iconFor to retrieve the configured item.
* Cleanup closeEventArno2013-07-271-12/+21
| | | | | | | | | | Don't try to delete all the prepared statements manually. Get rid of the ~destructors and just close the QSqlDatabase. close() deletes all Statements. Also, quit() all QThreads on closeEvent() except CompleterProducer. When the experimental archive view gets merged, that QThread is gone. No need to bother...
* Fix window titleArno2013-07-271-0/+6
| | | | Set the main window title according to selected tab.
* Read JSON from ffprobeArno2013-07-271-1/+1
| | | | | | | | | | | | | | | | Use JSON output from ffprobe instead of string parsing to get some kind of type safety. For doing that, some changes were needed in FileView: Use delegates for displaying Duration and Bitrate instead of mangling output in Qt::Displayrole. To reuse code, move all delegates from the new Archive to a separate file. And, of course, the initial objective: Show the accumulated size and duration of selected files in the status bar from the experimental archive.
* Use new icon schemeArno2013-07-261-0/+36
| | | | | | | Use new icon configuration consistently in: * Filemanager * NewMovieWizard * Experimental view
* Make all NodeTypes editableArno2013-07-131-9/+9
| | | | | Use plpgsql functions to edit nodes. Makes the program logic much easier. Also, rename rename() to edit() :)
* Dis/enable QActions for ContextMenuArno2013-07-121-0/+1
| | | | Handle actions dependent on type node.
* Always show subtitle in ArchiveModelArno2013-07-121-8/+6
|
* Make PartNo and Subtitle editableArno2013-07-121-0/+21
|
* Get rid of useless SimpleModel againArno2013-07-101-7/+0
| | | | | QStandardItemModel is much better than a poorly derived QStringListModel...
* Make experimental view editableArno2013-07-101-1/+161
| | | | | Create new dialogs for editing actors, genres and metadata. IMHO like this it's much clearer who does what. KISS!
* Fix alignment in file treeArno2013-07-091-1/+2
|
* Show actors, genres and metadata when selecting a seriesArno2013-07-091-0/+58
| | | | We're getting there, slowly, but steadily :)
* Prevent duplicates in ArchiveTreeArno2013-07-071-3/+3
| | | | Well, select DISTINCT :)
* Implement actions for ArchiveFileViewArno2013-07-071-3/+41
| | | | | * make files double-clickable * implement edit actions for files
* Lots of Display ChangesArno2013-07-061-12/+55
| | | | | | | | | * Save header states * Implement delegates for columns * unify size and duration to 1 column * colorize View ... and lots of other things I forgot :)
* Basic ArchiveFilesModel and ArchiveControllerArno2013-07-061-0/+155
| | | | | | | | | Implement a new file model for the archive. It's quite basic at this stage, but finally something happens when clicking the archive tree. Also, implement the interaction (signal -> slot) between the views and models in an explicit controller to prevent the mess from the old archive.
* Implement destructor for ArchiveModel, get rid of 2 signalsArno2013-06-281-3/+10
| | | | | | | | | | | We need a destructor for ArchiveModel, because we have to stop the collectors first. Otherwise there will be random crashes all over the place on exit when the Threads are destroyed while they're still running. Also, get rid of the signals collectorDone and collectorAboutToBeDone. The latter was unused, and the former can be replaced with QAbstractItemModel::modelReset.
* 2 minor improvents to ArchiveViewArno2013-06-261-0/+1
| | | | | * make it sortable * change the header when changing the sort order
* Fix behavior of view when refreshingArno2013-06-261-6/+29
| | | | | Cancel the collectors if they're still running. Otherwise we may get outdated results when refreshing the view after an update or delete.
* Fix random crashes in ArchiveCollectorArno2013-06-251-9/+23
| | | | | | | | | | | | This was a hard one, actually. Since we only returned a pointer from the ArchiveCollector, it worked _most_ of the time, but crashed at random when the view was reading the tree while the collector was updating it. So create a working copy constructor for SmRootItem and return a copy of the the tree when the collector is done. I bet that's also the reason for the random crashes in the filesystem view.
* Keep state of expanded itemsArno2013-06-231-0/+3
| | | | | Well, sounds easier as it is to keep track of expanded items, but finally I got it!
* Make the archive cache usefulArno2013-06-231-40/+40
| | | | | Read the cache if there is one, if not, read it in another thread and update the view when it's done.
* Fix renaming items, protect colletor-vars with MutexesArno2013-06-231-6/+21
| | | | | | | This should be 2 commits, really... Fix: write cache after renaming an item Protect: protect the accessors of ArchiveCollector with Mutexes
* Archive CacheArno2013-06-221-4/+100
| | | | | | | | | | | | | | | | Create a caches of database archive views. Esp. gathering data for actors takes a long time, and I don't see how to optimize the queries. So write them to a QDataStream. It was much more difficult that it sounds. Once again I was lost in recursion. Did I mention that I hate recursion? The solution: When writing use the address of the SMTreeItem cast to qint64 as unique key. On reading build a hash with the address as key and use it to find the parent of the next item. I hope that makes sense...
* Fix initialization of children in ArchiveModelArno2013-06-211-3/+3
| | | | | Child items of RootItem were initialized with 9 columns instead of 8 in ArchiveModel. Loose the stray QVariant()
* Filter recursiveArno2013-06-141-0/+43
| | | | | | | | | | | Well, well... Recursion isn't that bad at all. Filter experimental ArchiveView recursive by the following rules: * check children _and_ parents for filter * if any child _or_ parent matches, accept the current row, parents and children. The column is converted to a QString and matched by QRegExp, so don't try to match numbers or anything else.
* Remove nodesArno2013-06-031-5/+43
| | | | | Implement remove nodes for ArchiveView. Only empty nodes without children can be removed. Everything else is too dangerous :)
* Fix error message for ArchiveViewArno2013-06-021-1/+1
| | | | | | | While thinking about merging items, I realized that it is not necessary. Just edit the mappings instead. However, a fallout is an error function for the TreeView.
* Implement RenameArno2013-06-021-1/+51
| | | | Rename items: spits out an error message if the new item already exists.
* Remember expanded ItemsArno2013-06-021-0/+25
| | | | | For the current SortOrder the expanded items are written to the config file and read on startup.
* Gather archive data in a threadArno2013-06-011-52/+73
| | | | | Fetching data sometimes takes a long time, so do it in a QThread and show a progress dialog. Some kludges included :)
* Make filter work in new ArchiveViewArno2013-06-011-1/+1
| | | | | | | Filter by QRegExp, but only on the first level according to the sort order. All items are expanded when filtered. Also, remember the filter and the sort order when exiting.
* Do something when SortOrder is changed in ArchiveViewArno2013-06-011-21/+39
| | | | | | | | | Actually do something when the sort order is changed. That resulted in various fixes to both model and view, since both had completely untested codepaths. Most notable fix: Only select those seriesparts which are actually mapped to the selected genre or actor.
* Fix various display issues of ArchiveModelArno2013-06-011-1/+30
| | | | | | * Show childcount * Show subtitle or part no * Resize Widget properly
* Add view for new ArchiveModelArno2013-06-011-1/+2
| | | | Display the new ArchiveModel in an experimental tab
* First draft of new ArchiveModelArno2013-06-011-0/+133
The new ArchiveModel allows sorting and display by the series name, actors and genres. Hopefully it's generic enough to easily add other sort orders like file location or file type. For now, it's just there. Not included anywhere. No view, no nothing.