Commit Graph

133 Commits

Author SHA1 Message Date
John Maguire 341dc7326f Reformat all C++ 2020-09-22 14:56:06 +01:00
Jim Broadus bc99ff80a9 Move LibraryDirectoryModel out of LibraryModel.
There are several instances of the LibraryModel class used in the system. Each
of these creates a LibraryDirectoryModel instance, but only the instance held
by the main library is every used. Move this out of the LibraryModel class and
into the Library class.
2020-02-11 08:09:22 +00:00
Jim Broadus 6a9276ec0a Fix LibraryModel async query crash.
A LibraryBackend may be deleted while an associated LibraryModel object is using
it. An example is an async query running while a connected device is removed.
To prevent this, use a share pointer for the LibraryBackend.

This fixes one case where LibraryBackend is used after deletion. However, the
raw pointer is still passed around in several other places. These should be
evaluated on a case-by-case basis to insure that circular depencencies aren't
introduced.
2020-01-14 21:47:31 -08:00
Jim Broadus f817e0de48 Prevent deletion of LibraryModel object while async query is running.
Create a thread pool for each LibraryModel object and block destruction until
all threads that are operating on this object are complete.

Note that this is not a complete solution. The async query also uses the library
backend which may still be deleted before the thread exits. This will be
addressed in a future change.
2020-01-12 12:24:21 -08:00
John Maguire 5123d1dd37
Merge pull request #6505 from jonaski/fallthrough
Add fallthrough comment where fallthrough is intended
2020-01-05 00:30:24 +00:00
Jonas Kvinge 39cdb7fc3f Add fallthrough comment where fallthrough is intended 2020-01-04 23:29:19 +01:00
Jonas Kvinge 651965b905 Fix formatting 2020-01-04 18:12:44 +01:00
Jonas Kvinge 250b5ca0a6 Remove pixmap cache and pending art when removing parent nodes instead 2020-01-04 18:07:34 +01:00
Cesar Enrique Garcia Dabo f5ec88b529 Add support in GetConfigPath() for /pixmapcache directory 2019-12-07 23:30:14 +01:00
Jonas Kvinge cdfc059cb1 Change remaining group by defaults to album artist 2019-11-13 20:20:44 +01:00
Jonas Kvinge 1b35d3f6a3 Dont clear pixmap cache on model reset 2019-11-12 19:26:52 +01:00
Jonas Kvinge 796fa285f5 Fix formatting 2019-11-12 19:16:22 +01:00
Jonas Kvinge 04baa9ec0f Remove album from pixmap cache when song is removed from library model 2019-11-12 19:08:42 +01:00
Jonas Kvinge d4fab4a2ea Merge remote-tracking branch 'upstream/master' into qt5-update 2018-11-11 22:46:07 +01:00
Amish Naidu 107e945872 Convert uses of QtAlgorithms to std:: algorithms 2018-10-09 19:17:54 +01:00
Chocobozzz 70f68b1926
Merge remote-tracking branch 'upstream/master' into qt5 2018-02-01 09:50:42 +01:00
Jacob Henner 203ec76973 Add contextual searches to playlists, library and global search. (#5649)
* Closes #5567: Contextual album/artist search in library search, global search, and playlists.

* Change artist/album search to 'search for this' in globalsearch

* Change artist/album search to 'search for this' in library

* Applying patch from @Fat-Zer to allow search incl year

* Re-adding missing schema definition
2017-08-09 14:12:36 +01:00
David Roeca 49876536a5 Resolve #3693 (#5790)
* bring in playlist updates for potential fix

* define signal to handle organise playlist bugs

* work in progress

* fix wrong signal/slot

* next push forward on handling new song creation

* Reorganize signals/slots; still need to figure out why not all signals are being handled

* Get playlists to work when they're in memory

* more changes to playlist updates

* revert unnecessary changes and finalize fix
2017-07-22 18:57:33 +01:00
Chocobozzz 18a89f78a9 Merge remote-tracking branch 'upstream/master' into qt5 2016-10-07 14:30:09 +02:00
Mark Furneaux 0ce9e1696c Don't cache missing covers (#5471)
They might change later
2016-08-23 09:26:15 -05:00
Chocobozzz e6e189967d Merge remote-tracking branch 'upstream/master' into qt5 2016-02-29 18:03:02 +01:00
narunlifescience b6bf54be6c remove magic numbers 2016-02-11 04:41:37 -06:00
Arun Narayanankutty 29b8d308b3 Use icon loader for remaining icons 2016-01-14 06:10:54 -06:00
Chocobozzz ff7026c9fe Merge remote-tracking branch 'upstream/master' into qt5 2015-12-13 20:05:12 +01:00
Nick Lanham 5c256f349a Add option to save current library grouping
- Adds saved groupings to the Group by menu
- Currently missing a way to manage saved groupings
- Saved groupings are in a new section of the config file as
   "GroupingName"->ByteArray serialization
2015-12-11 12:02:52 -08:00
John Maguire f300946c81 Remove most usages of QFutureWatcher 2015-11-27 14:28:12 +00:00
narunlifescience dd953fd86c check custom icon location, then system theme & then fallback theme
icons added & replaced
2015-10-13 22:35:49 -05:00
Chocobozzz 631a6cdabd Merge branch 'master' into qt5 2015-09-16 17:40:54 +02:00
Eduardo Sánchez Muñoz e0816800b1 Add support for original year tags. 2015-06-30 18:34:34 +02:00
Chocobozzz 5aec1c0e24 Merge remote-tracking branch 'upstream/master' into qt5
Update qt version to 5.4.2
2015-06-03 22:57:58 +02:00
Mattias Andersson 60918ef7f8 Return result directly. 2015-05-26 21:51:04 +02:00
Mattias Andersson aaf2ec25b3 Run make format. 2015-05-23 09:19:23 +02:00
Mattias Andersson 82dcdd3a12 Sort discs numerically when using Group by disc. 2015-05-23 09:19:23 +02:00
Chocobozzz 8b226c2171 Update non optionnals sources to qt5 2015-04-11 23:24:07 +02:00
Ignas Kaziukenas 0a2a358d8b "Green Day Problem" solved. Year-Album grouping also obeys grouping tag that allows to order albums released in the same year non-alphabetically 2014-10-29 15:29:45 +02:00
Ignas Kaziukenas a2df43c830 Reverted changes amde to groupby_performer 2014-10-27 15:49:11 +02:00
Ignas Kaziukenas 7516438c8b Added disc to the groupby interface. Replced groupby_performer to groupby_disc 2014-10-27 14:47:04 +02:00
Gavin Howard 0e030b5461 Ran make format. 2014-08-26 10:54:05 -06:00
Gavin Howard 54742de613 A quick patch to have the library ignore all articles when sorting. 2014-08-25 21:22:53 -06:00
Mark Furneaux b463f32459 Fix memory leak in pixmap disk cache 2014-05-28 17:30:07 -04:00
Mark Furneaux b2bd7828c4 More style changes 2014-05-27 20:18:24 -04:00
Mark Furneaux 94b391e0c9 Optimizations and style changes 2014-05-27 18:21:30 -04:00
Mark Furneaux 2332a74bbe Add persistent disk cache for library pixmaps
I'll reference #4379

When viewing the library with album covers visible, the covers load very slowly the first time
as they have to wait on the tagreaders. If I scroll down the library, it takes minutes for the
tagreader to catch up. The nice thing is that the pixmaps are cached. However, once
Clementine is restarted, the whole process has to happen again.

This patch adds a persistent disk cache in the form of a QNetworkDiskCache to store the
pixmaps on disk and load them into the QPixmapCache as required.

I've noted literally night and day performance improvements, not only when scrolling through the library.
There is much better interface responsiveness when searching, and I no longer see the no_cover_icon
temporarily anymore.
2014-05-27 17:40:25 -04:00
Mattias Andersson 3b01247df9 Iterate over a copy of the parents container since we are removing elements from the original. 2014-02-13 10:41:24 +01:00
John Maguire 3323c2d094 Convert all instances of foreach() to a C++11 for
find ext src -name '*.cpp' -exec \
    sed -i -e 's/foreach(\([^,]\+\),/for (\1 :/' {} \;
2014-02-10 14:43:32 +01:00
John Maguire bebd781fdf Reformat all non-3rd-party C/C++/Objective-C++.
Command line:
find src ext -regex '.*\.\(h\|cpp\|mm\)' -exec clang-format -i
 -style='{BasedOnStyle: Google, DerivePointerBinding: false}' {} \;
2014-02-07 16:34:20 +01:00
John Maguire 71893e4847 Use nullptr instead of NULL everywhere. 2014-02-06 17:29:59 +01:00
John Maguire d309d4ab27 Use c++11 instead of boost where possible. 2014-02-06 16:51:39 +01:00
GitAnt a39e559425 Implemented sort by bitrate 2013-12-17 16:07:20 +01:00
GitAnt d53bcde897 Consistently added GroupBy_Bitrate enum item 2013-12-16 19:18:02 +01:00