summaryrefslogtreecommitdiffstats
path: root/filesystemwidget.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Good riddance Filesystem Widget!Arno2018-04-031-807/+0
| | | | | | Get rid of FilesystemWidget and helper classes. The SmDirWatcher was useful, once, I guess, nice to implement it by foot, but with the current workflow it isn't needed any more.
* Add untar actionArno2018-03-301-0/+14
| | | | | tries to tar xf selected files. If tar was successful, the archive is deleted. Should make archiving pics a bit easier.
* Massive code churn in shemov.cppArno2017-12-291-0/+4
| | | | | | | | | | | Converted everything to the type-safe connect syntax. That unearthed two minor problems with filesystemwidget.cpp: 1. We called a private SLOT in there from class SheMov. Dunno if it works with the old syntax. Anyway, I fixed it. 2. With the new syntax you can't call SLOTS with default arguments, so I had to introduce a helper slot playSelectedWithDefault Since I was already at it, I also replaced Q_FOREACH.
* Get rid of FilesystemWidget::getRecursiveArno2017-12-271-17/+7
| | | | | Use QDirIterator instead. It compiles, but it's *not* tested! So it might not work as expected!
* Get rid of homebrewed deleteRecursiveArno2017-12-271-18/+6
| | | | | | | Since Qt 5.0 QDir has the member removeRecursively, so use it. Just be careful what you feed it. Don't use QFileInfo::dir, because that's the *containing* directory. That would delete everything *including* the parent directory!
* Modernize filesystemwidget.cppArno2017-12-271-29/+29
| | | | | | * replace Q_FOREACH, except in the recursive functions. Those will be removed in a later commit * use type-safe connect syntax
* Make unpack directory configurableArno2017-12-271-3/+14
| | | | | Add option and use it. Warn if the directory is not accessible and bail out. Initialize mFilesCtr to 0 so we don't crash if it's < 0
* Remove IN_MODIFY from inotify maskArno2016-02-061-1/+0
| | | | | | | | When copying a file to a watched directory, this leads to excessive inotify events. I'm guessing that's the source for the deadlock when encoding files on othalla. Anyway, it's worth a try. Also remove a stray qApp->processEvents()
* Remember selections between dir changesArno2015-11-271-6/+15
| | | | Select all items previously selected when going back()
* Fix crash in deleteFilesArno2015-08-131-2/+9
| | | | | | This was a hard one. SmDirWatcher raced against the model. Stop and quit the watcher before actually deleting files. That can take a while if file operations are in progress, so show the busy cursor.
* Usability fixesArno2015-06-071-0/+17
| | | | | | | | | | * start maximized * focus MappingTree when showing NewPicsDialog * Keyboard Shortcuts for FilesystemWidget: CTRL+UP: go to parent dir CTRL+LEFT: go back CTRL+U: unpack * close UnpackDialog when done
* Move NewPicsDialog to topLeft + selectAllArno2015-03-211-0/+2
| | | | | | When calling NewPicsDialog from PictureViewer, move it to the top left corner to not cover the pic itself. Also, select all pics from current directory when no files are marked.
* Fixed and beefed up "Move to archive"Arno2015-03-211-2/+55
| | | | | | It crashed when used on directories, because naturally md5sum was empty. So recurse through directories, collect files and check if we have a DB- Entry. If so, move the files back to archive. If not, skip them.
* Center QFileDialogArno2015-02-141-0/+4
| | | | | Center Filedialog in NewMovieWizard::infoPage when adding source files. Also switch to the directory from FSWidget.
* Implement play several timesArno2015-02-141-0/+24
| | | | Add context menu entry for playing movies in a loop or 2..5 times.
* Center on selected directory on startupArno2015-02-131-1/+6
| | | | | | Center on the selected dir in Filemanager on startup. Unfortunately it's not as straight as one would think. scrollTo doesn't work until the widget is painted, so we have to take a little detour...
* Various Bugfixes and cleanupsArno2014-12-101-3/+10
| | | | | | | | | | | | * remove debug statements from SmDirWatcher * Don't crash on parentDir when current Dir is already deleted * Fix PicFilesModel MappingQuery. It needlessly referenced the table pics in FROM causing an expensive full table scan! * Fix findRecursive in PicFilesModel: Stupid typo! * Give SmDirWatcher a separate DB-Connection. One Thread, one Connection * Remove several includes This should have been 6 commits, but that's how debugging works :(
* Select child dir when going up in directory hierarchyArno2014-11-081-0/+3
| | | | | Select the previously selected dir in FileView when going up in the directory hierarchy.
* Clear command Queue before unpacking archivesArno2014-07-081-0/+1
|
* Display unpack output in DialogArno2014-07-081-17/+15
| | | | | This was a difficult one. Got lost in the Semantics of QThread once again, but just 2 days later it works :)
* Go to unpack dir after unpackingArno2014-06-071-0/+4
|
* UnpackArno2014-06-071-0/+23
| | | | Added entry for unpacking archives. For now zip and rar are recognized.
* Fix Rename in FilesystemWidgetArno2013-10-121-1/+11
| | | | | Use a dialog for renaming files. Craptastic. Dunno why just calling the editor doesn't work any more, but that's life...
* Improve PictureViewer2Arno2013-10-121-0/+1
| | | | | | | | | * implement Mark Files * always show all pictures from context * change navigation: N -> next P -> previous M -> mark/unmark file
* Fix show/hide events for PictureViewer2Arno2013-10-121-1/+2
| | | | check and uncheck the show/hide QAction on showEvent/hideEvent.
* Add Splitter in FilesystemWidgetArno2013-09-141-5/+13
| | | | | Add a Splitter between icons and the directory editbox. Save state on exit and restore it at startup.
* Add toolbars to tabsArno2013-09-141-0/+4
| | | | Remove global toolbar and add a toolbar to each tab instead.
* Add preview to FilesystemWidgetArno2013-09-141-0/+19
|
* Code cleanupArno2013-09-141-3/+2
| | | | | | | Fix FileView + FilesystemWidget. * Get rid of useless qobject_casts * Remove hover over movies and directories * Fix shortcut for (de-)selecting files
* 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...