Commit Graph

49 Commits

Author SHA1 Message Date
Marcus Müller 8e47ab59e5 internet services: consistently use 'override'
Signed-off-by: Marcus Müller <marcus_clementine@baseband.digital>
2023-09-17 12:43:13 +01:00
Jim Broadus 102317e5c8 internet/podcasts: Fix crash when updating podcasts.
When a podcast is updated and the number of visible items is set in the
podcast settings, child items that disappear from the view, and are
deleted, are still referenced by the database id map.

Move the removal code from SubscriptionRemoved to a common method and
use that for this case.
2021-07-26 12:36:24 +01:00
Jim Broadus 5ebd6d1e6b internet/core: Move context_menu_ to base class
Every internet service class has a context_menu_ member. Moving this to
the base class will allow the consolidation of common menu functionality.
2021-03-18 11:16:14 +00:00
Jim Broadus 57a6fe4f20 utilities: Add common method for bug report URL generation
Move code from PodcastParser::ParseItem for reuse.

Example:
Calling Utilities::MakeBugReportUrl("New bug") returns:
https://github.com/clementine-player/Clementine/issues/new?title=New%20bug
2021-02-03 00:32:00 +00:00
Jim Broadus fc4cb6fc7a Fix opml import crash
The opml parsing code handles cases where there are extra levels in the xml file
by copying the child to the main container. This corrupts the source instance
during the copy, which leads to corruption in the destination, and ultimately a
crash when it is later used.

To fix, do the copy in two steps, copying the child container to a temporary
location before copying to the destination.
2020-10-17 09:12:22 +01:00
John Maguire 341dc7326f Reformat all C++ 2020-09-22 14:56:06 +01:00
Jim Broadus 84099f2491 Name all threads created by Application
In Application::MoveToNewThread, name the new thread after the object being
moved. Give those objects names as well.

The thread names display in gdb with "info threads".
2020-05-27 10:22:00 +01:00
dmdmdm 7caf200efa Added CBC Podcasts 2020-05-21 02:04:08 +01:00
Jim Broadus a5db937d23 Fix itunes search.
Using the [] operator on a non-const QJsonObject inserts an item. The test
for an error message was always positive. Use the contains method instead.
2020-02-12 09:53:45 +00:00
Jim Broadus 18a08e87c2 Add a directory_model accessor to Application class. 2020-02-11 08:09:22 +00:00
John Maguire 57841cf947
Merge pull request #6515 from jonaski/child
Replace QModelIndex::child() with QAbstractItemModel::index()
2020-01-06 00:11:22 +00:00
Jonas Kvinge 959a957a56 Replace QModelIndex::child() with QAbstractItemModel::index() 2020-01-05 18:37:27 +01:00
John Maguire 0991209087
Revert "Add an option to specify a gpodder server." 2020-01-05 17:10:00 +00:00
John Maguire 41c103413c
Merge pull request #6497 from jbroadus/gpodder-server
Add an option to specify a gpodder server.
2020-01-05 15:27:08 +00:00
Jonas Kvinge 5eb32b33c1 Replace QSet::toList() with QSet::values() 2020-01-05 00:58:33 +01:00
Jim Broadus 590d7f3823 Add an option to specify a gpodder server.
Add an "Advanced Settings" option to the gpodder sign in. If selected, a fully
qualified URL must be specified as the gpodder base. Upon successful login, the
URL is saved along with username and password. If advanced settings are not
selected, an empty URL is stored and the default will be used.
2020-01-03 22:46:15 -08:00
Jim Broadus e32ba7eac5 Gpodder login cleanup.
It's not necessary for the PodcastSettingsPage class to have knowledge of
GPodderSync's login implementation. Handling the network reply in a single
location sightly simplifies the code. It also makes the handling order
more deterministic.
2019-12-30 20:58:30 -08:00
Jim Broadus a1da067002 Reset gpodder session cookies on logout.
A sessionid cookie is stored when logging in to gpodder. After logging out, a
subsequent login with the same user name but incorrect password will succeed,
ignoring the authorization header. The incorrect password will be stored for
future use.

To fix this, reset the cookie jar for GPodderSync's network access manager at
logout.
2019-12-30 14:19:08 -08:00
Jim Broadus 36179a7197 Fix gpodder sync memory leaks in success cases.
A closure created by NewClosure that handles Qt signals is destroyed if the
signal object is destroyed, the slot object is destroyed, or the signal is
invoked. In the case where the sender is passed as a shared pointer, the
reference prevents the sender from being destroyed before the closure.

So for closures built to handle responses returned from ApiRequest in
GPodderSync, the closure object and the response object will only be destroyed
after the signal is invoked. In some cases, separate closures are built for
error signals as well. For these, only one closure will be destroyed. The other
closures and the response object will be leaked.

A simple fix for the success cases is to remove the unnecessary error case
closures and directly connect the signals to slots. This is low hanging fruit
and still leaves leaks in the error cases. Those cases will require a more
complete solution to properly manage the life cycle of the response object.
2019-12-29 10:11:29 -08:00
Jim Broadus 5e7e57df73 Set a 30 second timeout for gpodder requests. 2019-12-25 23:53:47 -08:00
John Maguire cb6cd7c485 Merge remote-tracking branch 'origin/master' into qt5 2019-10-04 16:51:43 +01:00
luz.paz fb93ae4b02 Fix misc. source comment typos
Typos found via `codespell`
2019-08-21 23:43:16 -04:00
Jonas Kvinge 1a2274bd2b Merge branch 'master' into qt5-update 2019-07-21 14:20:59 +02:00
Filip Gawin be827f4f7f Simplify some statements 2019-02-22 18:49:48 +01:00
Jonas Kvinge 16bdd39c03 Merge remote-tracking branch 'upstream/master' into qt5-update 2018-11-29 23:21:54 +01:00
Jim Broadus 5a1a5a9d95 Display podcast episode information. (#6203)
* Display podcast episode information.
Add an EpisodeInfoWidget with title, author, duration, date, and description fields. Include this in the PodcastInfoDialog. If exactly one episode is selected, then show both the podcast and episode widgets and display the episode's URL. Otherwise, hide the episode widget and follow the existing behavior. Note that the desription field for the EpisodeInfoWidget uses the QLabel and does not currently download embedded images.
Add an always_show_hours option to the PrettyTime methods to include hours in formatting even if the field is zero. This is less ambiguious in some cases where duration is displayed.

* Apply patch from automated formatter test.
2018-11-17 13:29:16 +00:00
Jim Broadus d8bab5a49f Fix memory leak in PodcastInfoWidget. (#6202) 2018-11-13 08:09:15 +00:00
Jonas Kvinge d4fab4a2ea Merge remote-tracking branch 'upstream/master' into qt5-update 2018-11-11 22:46:07 +01:00
Jim Broadus 2e4814eb36 Create a PodcastInfoDialog that utilizes the existing PodcastInfoWidget. Add a Podcast Information menu item that is enabled when exactly one podcast is represented by the highlighted items. (#6190) 2018-11-11 20:53:06 +00:00
Chocobozzz 70f68b1926
Merge remote-tracking branch 'upstream/master' into qt5 2018-02-01 09:50:42 +01:00
Stephen Dawkins d9b12a5599 Added additional check when enclosure type is missing (#5934) 2017-12-23 12:48:38 +00: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 2ede85bdcd Merge branch 'master' into qt5 2016-12-18 17:04:08 +01:00
Bigard Florian 6901c9b1b6 Fix podcast episodes forgotten (#5560) 2016-12-18 15:48:08 +00:00
Chocobozzz e6e189967d Merge remote-tracking branch 'upstream/master' into qt5 2016-02-29 18:03:02 +01:00
Matt Scheirer 8193f6c2ec OPML imports should prefer title attributes to text attributes for podcast names 2016-01-20 18:05:22 -05:00
Chocobozzz ff7026c9fe Merge remote-tracking branch 'upstream/master' into qt5 2015-12-13 20:05:12 +01:00
narunlifescience 2603cf2088 use iconloader & cleanup previous remnants
update
2015-12-01 00:32:20 -06: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 f4ca305fd7 remove useless qhash_qurl 2015-06-04 10:37:34 +02:00
Chocobozzz e986ab5a4b Merge master branch and adapt it to qt5 2015-04-16 17:16:34 +02:00
Chocobozzz 8b226c2171 Update non optionnals sources to qt5 2015-04-11 23:24:07 +02:00
Krzysztof Sobiecki 9934efc76b Small fixes for podcasts 2015-02-06 23:38:36 +01:00
Krzysztof Sobiecki 8cf127a19c [internet/podcasts]Fix modification date&time support
After setting QDateTime to invalid state, it's saved into database as uint,
with then is read from database as a valid date. To make behaviour consistent, this change is needed.
If date is 4294967295, then it's an invalid one.
2015-01-02 15:29:58 +01:00
Krzysztof Sobiecki acb02932bd Fix crash when marking podcast as listened
Fixes #4674
2014-12-25 23:02:12 +01:00
Krzysztof Sobiecki a6322da196 Fix header copyright tags in internet/ 2014-12-19 00:47:55 +01:00
Krzysztof Sobiecki 23ee9170b6 Fix header guards in internet/ 2014-12-18 23:54:21 +01:00
Krzysztof Sobiecki fa9ea6ec5f Fix compilation with moved files in internet/ 2014-12-18 23:35:21 +01:00
Krzysztof Sobiecki 93a286a272 Move files around and make subdirectories inside src/internet, move src/podcasts to src/internet 2014-12-18 00:39:20 +01:00