summaryrefslogtreecommitdiffstats
path: root/filewidget.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Another round of Clang fixes...Arno2022-04-161-11/+11
|
* Make it compile with qt6Arno2022-04-161-9/+9
| | | | | | | *BIG FAT WARNING* Took me a while to figure it out, but the database connection only works with MINGW64 instead of MINGW32! With the latter loading the SQL Plugin fails! That said, off to brighter shores :)
* Use foreground color for copied indicatorArno2019-11-231-3/+1
| | | | With a dark theme darkBlue doesn't please the eye :)
* Add paths to delete confirmation dialogArno2019-06-081-1/+4
| | | | | | | 2 times now I lost files because deleteFiles emptied the whole directory instead of just the selected files. I guess because the view was not updated before. To make sure, show full paths of all files/directories to be deleted.
* Some more second fixesArno2018-12-091-3/+3
|
* Fix clang warnings in FileWidgetArno2018-12-091-3/+3
| | | | | | use nullptr instead of 0, and add a static_cast to document that we don't need floating point. QVariant::toLongLong() doesn't work with 1234.1234.
* Improve subject guessingArno2018-12-091-13/+18
| | | | | | | | | | Use QRegularExpression instead of QRegExp, since the former is recommended. Escape the filename, so we don't have to worry about special chars and then match line by line. If there is a number at the end of the found subject, remove it. The former logic with QRegExp, indexOf and no escape wouldn't match files with whitespaces and special chars...
* Update free space after deleting filesArno2018-07-301-0/+3
|
* Speed up file copyArno2018-06-131-40/+6
| | | | | | | | | | | | | | | | Hmm, as it turns out QFile does a much better, e.g. faster, job than my open-coded file copy with a progress dialog. I always wondered why it only did 150-170Mbit. I thought that it was just the calculation, but now I have 400 Mbit, and it still stalls at 150 Mbit. QFile::copy maxes out the line, so get rid of the ProgressDialog and show a status message instead. Copy can be canceled by the context menu, but FileCopier will always finish the current file, because I don't want to lock and unlock the CancelMutex during copy. Besides, QFile::copy doesn't admit that :)
* Refresh descript.ion before guessing subjectArno2018-02-191-0/+1
|
* Try to improve subject matchingArno2018-02-191-2/+3
| | | | Not sure if this is the way to go, but it works for now...
* Don't cache copied statusArno2018-02-031-0/+3
| | | | | Files can be copied without us knowing, so check for it even if we have a cache entry.
* Fix subject guessingArno2018-02-031-3/+8
| | | | | | | | | | Well, as it says, this is pretty much guesswork. I didn't think that the subject itself could contain a ',', but reality proved me wrong. A common denominator seems to be 'yEnc,' at the end of the subject, so first check for that and split there before going for the default. Most likely it's not the last change to this function :(
* Do not block signals in FileWidgetArno2018-02-031-2/+0
| | | | | I guess there was a valid reason to block, but that's gone now. Couldn't bother to stare at the history...
* Implement alternating row colorsArno2018-02-031-0/+1
| | | | | | | | | | | | | | | Once again, surprisingly difficult, as you can see on the number of changed files. Coding the configuration options wasn't that difficult, but actually using them was. As it turned out, the default style on Windows doesn't use QApplication::palette() at all, though it does honor setAlternatingRowColors(). It just doesn't use the palette colors, but style sheets. Took me a while to figure out. So, there's always another layer of indirection: First, add all QTreeViews to Globals::views, then create a helper to set the style sheet.
* Add keyboard shortcuts in SearchDialogArno2018-02-031-0/+1
| | | | | | | | | | | | | CTRL+F: search filename CTRL+L: select all and focus search CTRL+M: search actor CTRL+T: search title CTRL+X: hide Unfortunately, it's surprisingly hard to capture CTRL+A, so I chose CTRL +M (m for model) for actor search. CTRL+A is consumed by some other Widget and never reaches SearchDialog. Maybe an EventFilter in the parent or the MainWindow would work, but that's not worth it.
* Icon fixesArno2018-02-021-5/+5
|
* Raise and show SearchDialog on CTRL+SArno2018-02-021-2/+2
|
* Read and write settings for SearchDialogArno2018-02-021-1/+1
|
* Implement a useful searchArno2018-02-011-1/+7
| | | | | | Display Title and Filename search as non-modal dialog, so one can compare Files and Database. For now only Title search is implemented. Filename search does nothing (yet).
* Sort copy dirs whenever possibleArno2018-02-011-0/+1
|
* Improve FileCopierArno2018-02-011-5/+6
| | | | | | | | | | | | | | | | This endeavor started out quite innocently: fix the connect syntax in ProgressDialog, but it quickly became much more. Vom Höxchen aufs Stöxchen :) First I thought it would be nice to add a total count to the ProgressDialog. Then I realized that I had QElapsedTimer::restart() totally wrong. It returns the ms *since the last restart*! It doesn't reset to zero, so fix that. While testing that I noticed that the download speed was quite below average, so change the buffer size and only check if we were cancelled when the timer elapsed. But that wasn't it. Eventually I dug into my firewall rules and routings to get it right.
* Add action for searching the interwebs for filenameArno2018-01-281-1/+15
|
* New feature: Guess subjectArno2018-01-271-1/+49
| | | | | | | | | If a descript.ion file exists in the current directory of fileWidget, read the subjects into a QStringList to determine the usenet subject from within ShemovCleaner. No more tedious task switching to the usenet client, just trigger "Guess subject..." :)
* Remember last MIME-FilterArno2018-01-191-0/+13
|
* Refresh favorite dirs after configuringArno2018-01-191-0/+8
| | | | | Update favorite dirs when adding or removing favorite directories. Also try to keep the current selection.
* Show total duration againArno2018-01-191-0/+1
| | | | Forgot to set fd->seconds when gathering data.
* Implement filtering by MIME-TypeArno2018-01-041-11/+29
| | | | | | The MIME-type is a regular expression that can be configured. Show the configured types in a QComboBox with the special value "<all>" at the top, which invalidates the MIME type filter.
* Implement favorite dirsArno2018-01-041-1/+20
|
* Modernize filewidget.cppArno2018-01-041-28/+28
| | | | | Convert to type safe connect syntax and remove Q_FOREACH. Hopefully no functional changes :)
* Add cache operationsArno2018-01-041-0/+32
| | | | | | Implement functions to remove files from cached data, or clear it completely. This may be necessary if something happened without us knowing, e.g. a file was copied by another program.
* Export reading and writing cache into functionsArno2018-01-041-26/+34
| | | | No functional changes.
* Improve lookup of cache dirArno2018-01-041-3/+2
| | | | | Implement looking up the cache dir as Helper::function. Create it if it doesn't exist.
* Update CachedFileData after copying filesArno2018-01-041-0/+4
| | | | Forgot setting copied to true...
* Check Present attribute on cached dataArno2018-01-031-23/+5
| | | | | | | | | | | | | Well, we cannot cache the Present attribute, because it can change without our knowledge, when a movie file has been archived in the meantime. Leave it in CachedFileData for now, but check it when we found a cache entry. While working on this, I realized that the Origin attribute is pretty much useless, at least in its current form. countMd5() already checks the origin table, and everything else was guesswork on the filename. Also, it was an extra, quite expensive SQL-Query for every video file, so remove it.
* Update the cache when copying or moving filesArno2018-01-031-3/+14
|
* Optimize deleteFilesArno2018-01-021-4/+9
| | | | | Only remove something from the view if deletion was successful. If it was a file, try to remove it from the cache.
* Sort size numerically, not alphabeticallyArno2018-01-021-2/+6
|
* Save CachedFileData to diskArno2018-01-021-0/+27
| | | | | | | | | Since we already have the data, save it to speed up the start. Surprisingly, the hardest part was to figure out how to use QStandardPaths to find a location where to save the file. I went with the semi-hardcoded path HomeLocation/.shemovcleaner, even though we're on windows.
* Implement cache for FileWidgetArno2018-01-021-85/+125
| | | | | | | | | | Some data-gathering is quite expensive and requires a QProcess, like getting the duration, so cache it in memory using QCache. Once the cache is filled, the UI is much snappier. This simplifies gatherData() a bit. It's still quite a long function, but now it doesn't create the QStandardItems any more. I moved it to a separate function.
* Try harder to delete a fileArno2018-01-021-1/+5
| | | | | | QFile::remove() fails when the read-only attribute is set. Turn out it can be unset with QFile::setPermissions(QFile::ReadOther | QFile::WriteOther). Try it when the initial call to remove() failed.
* Removed QSignalMapper from filewidget.cppArno2017-12-211-10/+3
| | | | | | Since the advent of lambdas as SLOTS the signal mapper is indeed useless und overly complicated. Remove it due to a deprecation warning from the compiler.
* Use QDirIterator in FileWidgetArno2017-12-191-18/+17
| | | | | | | | According to the documentation it should be faster, but it also has its drawbacks. We can't use the progressbar any more, because we don't know how many files we're going to get. Show the number of files in the statusMessage instead, and show the total size of analyzed files in GB when we're done.
* Improve FileWidgetArno2017-12-191-0/+6
| | | | | Also keep sort order and column while gathering data. Disable sorting while populating the model.
* Use QT for deleting directoriesArno2017-12-181-25/+17
| | | | | | QDir has a function removeRecursively(). Use that instead of a homebrew implementation. Don't gatherData() after that, just remove the deleted items from the view.
* Do not try to copy directoriesArno2016-12-061-1/+1
| | | | | We don't have support for recursive copies, and I'm not really sure if we need it, so don't do it for now.
* Add a summary to ProgressDialogArno2016-12-061-0/+8
| | | | | Show how many files we have, and display the transfer rate in Megabytes per second. Can't believe that it worked right from the start :)
* Add destination to ProgressDialogArno2016-12-061-4/+6
| | | | Elide the text if necessary. Only show the destination directory.
* Prettify ProgressDialogArno2016-12-061-1/+2
| | | | | Make it fixed width, show only the filename from the source instead of the full path and elide text if necessary.
* Actually use Copy Files to...Arno2016-12-031-1/+67
| | | | | | | | | | | | Create a FileCopier and show a custom, non-modal progress dialog when we're copying files. Turns out that a QProgressDialog always shows when it's created. This is by design, so I had to implement one that fits my needs. Also, a buffer size of 32K (as used in MKVMerger) is way too small to max out the available bandwidth, so I set it to an (arbitrary) value of 16MB.