summaryrefslogtreecommitdiffstats
path: root/filesystemwidget.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Preview fixesArno2013-09-141-0/+1
| | | | | * Don't show the mapping item in preview, because it has none. * Use qApp->showOverrideCursor() instead of QWidget::cursor()
* Introduce Expensive OperationsArno2013-09-031-0/+2
| | | | | | | Add a configuration Option to (de-)select expensive file operations. That would be md5Summing and gathering the Bitrate/Duration. That should help the performance on networked directories...
* Switch to QRunnable + QThreadPoolArno2013-09-031-30/+5
| | | | | | | | | | | Get rid of SmDataCollector and do its job in small, QRunnable tasks and let QThreadPool manage the treads. Works well with a local Filesystem. Yet to see how it works over networked Filesystems. Ah, before I forget: NEVER, EVER USE QPixmap in THREADS -> Random crashes! (Yes, I know, it's documented...)
* Add a progress dialog to FilesystemWidget1.2.0Arno2013-08-281-0/+26
| | | | Show a progress dialog when gathering data from the filesystem.
* Another shot at the Filesystem View crashesArno2013-07-291-4/+15
| | | | | | | I think I found the bug. We need to stop the refresh timer when operating on the view, because it can reset the model while we're still holding QModelIndexes. When that happens we're working with invalid indexes and BOOM.
* Revert "Prevent datacollector from running when operating on files"Arno2013-07-291-8/+0
| | | | | | | This reverts commit 06cfadc8386aec27b9c7c43486fc0b057e9fb022. Turns out that this was not the root cause for the crashes. Still stumped.
* Prevent datacollector from running when operating on filesArno2013-07-291-0/+8
| | | | | | | This stuff was racy from the beginning. It could happen that the model got reset after we fetched the selected indexes. Add a mutex and lock it before operating on the file view. Hopefully this will many, if not all random crashes.
* Fix window titleArno2013-07-271-11/+13
| | | | Set the main window title according to selected tab.
* Read JSON from ffprobeArno2013-07-271-0/+3
| | | | | | | | | | | | | | | | 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.
* Fix setAlternatignRowColorsArno2013-04-101-11/+2
| | | | | | | | | | | | | | | | | | | | 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...
* SmDirModel: check if file already is in databaseArno2013-04-061-1/+1
| | | | | Indicate if we already have a file by coloring the filename darkGreen when browsing the filesystem.
* Put duration and size in one Field (SmDirModel)Arno2013-04-061-1/+1
| | | | | Consolidate duration and size in one Field, like in the archive, to be consistent. Also rename the Role and Field accordingly.
* Show pic size in SmDirModelArno2013-04-061-1/+1
| | | | | | If file is an image, grab the size and add it to the model. Also, remove some leftover debug statements from SmTreeView.
* Make FilesystemWidget headers configurableArno2013-04-051-1/+2
| | | | | Save headerView on exit, create a Menu for selecting headers and read headerConfig on startup.
* Remember selections on FileModel resetArno2013-03-221-2/+8
| | | | | | Since can reset the FileView through a time, remember the selections on reset and restore them after. The Timer is stopped when an item is being edited.
* Final inotify!Arno2013-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | 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...
* Use a Thread for collecting file dataArno2013-03-201-10/+6
| | | | | | blocking the GUI isn't nice, so use a separate Thread to gather all the data for SmDirModel. Populating and changing directory works, but modifying a file is most likely broken.
* Revert fix for selectAllPVArno2013-03-201-1/+1
| | | | | | 4969cdba731671df80df951543dc47c4e52d70de "fixed" QFileSystemModel::FilePathRole for that function. We're actually querying the DirModel, unfix it.
* Auto resize FileViewArno2013-03-201-5/+9
| | | | | Automatically resize FileView when it changes. I guess I was quite drunk on the first try. Fortunately I didn't commit it :)
* Remove markAsSeenArno2013-03-171-61/+1
| | | | Wasn't used anyway, dropped DB-Table seen also.
* Fix ColorsArno2013-03-171-0/+1
| | | | | | | 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...
* Fix QFileSystemModel::FilePathRole usageArno2013-03-171-1/+1
| | | | | Make NewMovieWizard work again and fix QFileSystemModel::FilePathRole usage. QFileSystemModel::FilePathRole -> SmDirModel::FullPathRole
* Icons for SmDirModelArno2013-03-171-0/+2
| | | | | Made Icons for SmDirModel configurable. For now it's folders, movies, pictures and others.
* Make SmDirModel/SmDirWatcher do somethingArno2013-03-171-0/+1
| | | | I think I got it working! It does what I want it to do :)
* First shot at SmDirModelArno2013-03-161-39/+33
| | | | | | | | Gotta take a break here. Hopefully this will end up in a custom QFilesystemModel, but I'm hitting so many bugs on the way. Some things haven't worked for ages, I guess. Anyway, the watcher doesn't do anythying right now, still fixing bugs...
* Port to Qt5Arno2013-03-031-11/+11
| | | | | | | | * 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 :)
* Move to archiveArno2013-01-271-0/+8
| | | | | Add menu entry to move files back to archive. Needed when move to burn directory copies more files than expected.
* Weed out PictureViewer in favor of PictureViewer2Arno2012-04-281-3/+15
| | | | Remove PictureViewer from everywhere and use PictureViewer2 instead.
* Indictate slide in status barArno2012-03-241-40/+0
| | | | | | Show red or green icon in status bar, depending on wether we're sliding. Removed the rename to template stuff. It was barely used code. Hopefully deleted all references and code fragments.
* Fix some severe braindamageArno2012-03-181-0/+1
| | | | | | | | | | | | | | It started as a buxfix session, but the more I dug into some ancient code, the more I had to change. Well, first and foremost, this fixes a crash in PicturesWidget. Trying to display the mappings of the selected picture in a different color never was a good idea. Show them in the statusbar instead. While looking at the statusBar code, make PictureWidget emit signals to show the total size and number of selected items. Then I noticed some really, really braindamaged connection madness in the Shemov constructor. Instead of doing all the work in SheMov itself, have the widgets emit signals. This should have been several commits, but one lead to another...
* Fix qWarnings() at startup and shutdownArno2010-12-301-1/+1
| | | | | | | | | | | | | | Fix unexpected NULL receiver on startup: Turns out this warning is issued when calling deleteLater on a NULL object. This happened in SheMov::createOpenWith*. The "database is still in use" warning was a bit harder to track down. First of all, the destructors weren't called since Qt::WA_DeleteOnClose wasn't set for SheMov, so Qt would simply exit and let the OS do the cleanup without calling the destructors. Then there were several orphan widgets/objects without a parent, so their destructor would never be called.
* Made all icons in qresource available for UIArno2010-12-271-2/+6
| | | | | | | | | | | | | | | | 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 colors configurableArno2010-12-261-0/+2
| | | | | | | | | Added a tab to ConfigurationDialog to make some colors configurable. It works somehow. The font color isn't evaluated yet, since I'm not convinced that it is a good idea. But one problem is that calling qApp->setPalette() doesn't propagate to non visible child dialogs. Dunno if it's worth fixing.
* Remove MessageDialogArno2010-12-221-1/+0
| | | | Remove all references of MessageDialog, including files :)
* Fix copy, cut and paste filesArno2010-12-211-51/+85
| | | | | | | | | | Make this options in the context and edit menu of FilesystemWidget behave a lot more as expected. Copy and cut just copies the file names to the clipboard, and paste paste moves them if they were cut and copies them when the action was copy. Still need to fix the colors when something is marked somehow. Should be configurable :)
* Fix rename files in FSWidgetArno2010-12-181-36/+11
| | | | | | Rename files inline, letting the model do all the work. Part of getting rid of MessageDialog. Maybe this broke the filename templates. We'll see...
* Code cleanupArno2010-12-051-10/+1
| | | | | | Remove debug statements from FileSystemWidget. Also remove useless helper func StringListContains. That was a goodie. I guess I was quite drunk when I wrote that...
* Implemented mark as seenArno2010-11-211-4/+85
| | | | | | | Added new action to mark files as seen. Marked files have the foreground color red. For this the database connection is needed quite early, so I had to call SmGlobals::instance() in the constructor of SheMov without using it.
* Solved update problem during mountArno2010-11-211-5/+22
| | | | | Keep FSWidget updated when mounting a dvd. It's an ugly hack involving changing the current directory several times, but it works...
* Added support for mounting cd/dvdsArno2010-11-201-0/+52
| | | | | | DVDs or CDs can be mounted under *NIX like OS now. It still eludes me how to refresh a directory from a QFileSystemModel when it's mounted. Maybe it's a qt bug...
* Added ToobarArno2010-11-071-1/+15
| | | | Implemented a toolbar with various actions. Also did some artwork :)
* Added ".." entry to FileViewArno2010-10-311-1/+5
| | | | | | Show ".." entry in FileView and make it go to the parent directory. Had to work around QT Bug 14760: NoDot doesn't work so the "." entry has to be filtered in filterAcceptsRow()
* Act on doubleClick in FileTreeWidgetArno2010-07-241-1/+2
| | | | | | | | | | | | | When doubleclicking a picture in FileTreeWidget the pictureViewer is shown. Doubleclicking a movie file launches the default movie player. Since PictureViewer is now used in FileSystemWidget and ArchiveTreeView a global instance is needed. The appropriate place for this is a singleton. Since we already had a singleton for QAbstractItemModels I renamed it to SmGlobals and added a function to return a PictureViewer object. Renaming it was quite easy thanks to QtCreator's ability to rename variable names.
* Big code cleanupArno2010-07-231-22/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hopefully removed all code connected to ArchiveViewWidget in this tree. Files removed ({h,cpp}): *archiveeditdialog *listeditor *covereditor *archivefilewidget *addmoviewizard *archivefileview *archiveproxy *sizedelegate *archivedidelegate *archiveitemeditdialog *coveritem *movieitem *moviemodel *moviemodelsingleton *listmodel *listmodelsingleton *archiveviewwidget *archiveiteminfoedit *archiveitemcoveredit *fileinfoitem *fileinfomodel See added file TODOS for stuff that needs fixes.
* Save PictureViewer positionArno2010-05-241-0/+3
| | | | Save and restore PictureViewer position on exit and startup.
* Implemented PictureViewer classArno2010-05-241-7/+5
| | | | | | | Don't call an external program for showing a picture. When an image is doubleclicked a new windows shows the picture. Pictures can still be opened in an exteral program by using the "Open with..." context menu item.
* Cleanup archive extractionArno2010-05-141-21/+0
| | | | | Removed the code for archive extraction. Never used it, never liked it and really never worked properly.
* Discard QDirModelArno2010-05-121-18/+8
| | | | QDirModel is deprecated by the Nokia guys. Use QFileSystemModel instead.
* Solved issue with mRefreshA in FilesystemWidgetArno2010-05-121-33/+6
| | | | | | | | | | FilesystemWidget needs a pointer to the QAction triggering a refresh to disable it under certain circumstances. The current solution was to search the actions() of a child widget for a specific string in QAction::data(). Don't like it. Now SheMov sets the refresh action via a member function of FilesystemWidget.
* Implemented "Open with"Arno2010-05-121-10/+18
| | | | | | The contextmenu of Fileview got an "Open with" submenu containing all configured programs. Opening files does not depend on MIME-types. That means a movie can be opened with a pictureviewer and vice versa.