Commit Graph

32 Commits

Author SHA1 Message Date
Lukas Prediger 83b6bf28f3 No exceptions for error handling! ConnectedDevice::Init now returns bool, indicating success or failure.
As decreed by @hatstand.
2021-06-21 12:51:44 +01:00
John Maguire 341dc7326f Reformat all C++ 2020-09-22 14:56:06 +01:00
Jonas Kvinge 8d78dae9b6 Quit thread before deleting the loader (#6254) 2019-01-15 17:57:00 +00:00
Jim Broadus 95187ed0a1 Fix encoding of GError messages when logging. (#6228)
GError messages contain non-ascii characters. This normally just produces some garbage when we use the default QString contructor that assumes ASCII for logging. However, when a message includes the right double quote, UTF-8 sequence 0xE2 0x80 0x9D, the final byte is OSC. VT100 expects a command sequence to follow and stops echoing output until it sees ST or BEL character, which may never come. Thus, the console output is halted.

This change uses QString::fromLocal8Bit instead of depending on the default constructor. About half of the sites in the codebase had already been converted.

One side effect is that log messages are quoted. There are additional options to control this, but those were only introduced in Qt 5.4.
2018-12-02 09:51:19 +00:00
Jim Broadus 122d28eab9 Fix device loader error messages. (#6215)
GPodLoader and MtpLoader Error signals were connected to Error signals in their repective device classes, but the actual signal definition in ConnectedDevice was removed in a refactor several years ago. This change adds LoaderError slots to these device classes and reports the error in the manner of the refactored code.
2018-11-28 10:23:31 +00: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
David Sansome bacef04405 Refactoring: remove a couple of the AlbumCoverLoader instances and instead use a shared CurrentArtLoader. 2012-02-26 14:40:51 +00:00
David Sansome 48f15c9fc7 Refactoring: instead of passing individual pointers to useful core classes (like TaskManager or LibraryBackend) to each class that uses them, pass one singleton-like Application instance everywhere. 2012-02-26 14:40:51 +00:00
David Sansome ccb9f8cf94 Use URLs everywhere instead of filenames. Move the URL parsing and song loading code out of individual playlist parsers and into the base class. Fix the playlist parser unit tests. 2011-04-28 12:27:53 +00:00
David Sansome 3eedc916ad Add a new logging system 2011-04-22 16:50:29 +00:00
David Sansome ed1a25693c Add missing licenses to debian/copyright, and add copyright information to each source file 2010-11-20 13:27:10 +00:00
David Sansome aa6e67eb1f Some native path separator fixes for libgpod on Windows, should fix loading of classic iPods on Windows. 2010-09-09 21:49:51 +00:00
David Sansome e4f5e97b17 Allow GetSupportedFiletypes to return an error, and make it possible to request a list of supported filetypes at the same time as opening the device for copying - making things much faster on MTP devices. 2010-08-30 12:22:15 +00:00
John Maguire 3db95b0c9c Add ipod supported file types. 2010-08-29 14:49:54 +00:00
David Sansome 04e7e26088 Allow devices to report progress information about individual songs back to the Organise object. Implement this for MTP 2010-08-28 21:55:30 +00:00
David Sansome 3f5e188045 Initial support for MTP devices 2010-08-14 15:57:05 +00:00
David Sansome 1d25ee78ed Support removing files from ipods 2010-08-14 10:32:47 +00:00
David Sansome 2e646494aa Update a device's free space after copying or removing files from it 2010-08-11 18:47:53 +00:00
David Sansome b27238a480 Test whether we can still talk to afc before freeing the lockdownd client (fixes usbmuxd errors once and for all), report afc copy errors, keep track of files that failed to copy to a device, don't attempt to write the itunesdb if there were errors during copying. 2010-08-10 19:42:43 +00:00
David Sansome 43a27979dc Keep a shared_ptr on connected devices during the lifetime of their background processing threads 2010-08-09 21:32:25 +00:00
David Sansome a228e2b806 Copy files to afc devices. Doesn't quite work yet 2010-08-08 17:41:06 +00:00
David Sansome 5517e2a503 Oops, don't need this hack any more 2010-08-01 11:05:14 +00:00
David Sansome 02783b1d5d Unmount devices from the main thread instead of the organiser thread - fixes a crash when unmounting after copying 2010-08-01 11:01:07 +00:00
David Sansome 1f2b69c6bc Add support for deleting files from the filesystem, devices, and ipods. 2010-07-31 16:12:16 +00:00
David Sansome d13c909674 When copying songs to an iPod, add them to our LibraryBackend as well so they get shown in the model. Also support deleting the originals. 2010-07-24 20:43:51 +00:00
David Sansome bc97872bc4 Destroy the gpodloader, only load the itunes database once, ensure only one Organiser thread can write to the ipod at once, make Organiser threads wait for the device to be loaded before they start writing. 2010-07-24 17:41:18 +00:00
David Sansome b624be9800 Add almost-working support for writing to ipods 2010-07-24 16:58:14 +00:00
David Sansome 62616304d8 Add a MusicStorage interface that can be used to abstract away the details of copying a file to a device. 2010-07-19 19:56:29 +00:00
David Sansome 43a73555db Implement the rest of the GIO backend. Devices are now keyed off "mount URLs" as well as backend-specific device IDs, if two or more devices share the same mount URL then the metadata gets taken from the most reliable backend. 2010-07-17 17:18:02 +00:00
David Sansome 0dcdf36535 Start of work on a GIO/GVFS device backend. 2010-07-17 14:22:07 +00:00
David Sansome e9525e8ec3 Very basic support for reading iPods with libgpod. Uses a hardcoded ~/.gvfs path for now. 2010-07-04 20:52:45 +00:00