path: root/rbutil/rbutilqt/base/autodetection.cpp
AgeCommit message (Collapse)AuthorFilesLines
2020-11-19rbutil: Modernize code to use C++11 nullptr.Dominik Riebeling1-1/+1
Change-Id: I112cf95122a896cdb30a823b4c1f49831273dc7e
2020-11-14rbutil: Rework player configuration.Dominik Riebeling1-1/+1
Rename config entries and remove now unnecessary default value handling. Change-Id: I5c60ef9769fc01f45f45290dafffb80c1962e674
2020-11-14rbutil: Rework player configuration.Dominik Riebeling1-1/+1
- Split internal configuration into player specific and common parts. Always require passing the player for player specific data instead of implicitly assuming the currently selected one; only use the currently selected one if the player name is explicitly passed as empty. - Similarly adjust handling of server info data; prepare for splitting into build type specific values so the naming becomes cleaner. Change-Id: I894e694f83bd9fe2d22ad46b3f8f7df3e2c68033
2014-05-24Fix crash when detecting a player in MTP mode.Dominik Riebeling1-2/+1
Change-Id: I65bf6928584735d6a179750c313fb8e7dcf7add5
2013-11-04Use cutelogger for Rockbox Utility internal trace.Dominik Riebeling1-19/+20
Change tracing from qDebug() to use cutelogger, which is available under the LGPL2.1. This allows to automatically add filename and line number to the log, and also provides multiple log levels. Change-Id: I5dbdaf902ba54ea99f07ae10a07467c52fdac910
2013-09-30Use function for updating detected device entry.Dominik Riebeling1-65/+22
Use a function instead of looking for an existing entry and creating a new one if necessary every time. Change-Id: I7b385dad7366f27370545a7d1a9f7052510cca11
2013-09-18Rework autodetection to better handle ambiguous cases.Dominik Riebeling1-140/+251
The old detection code simply assumed only one player to be connected and threw all information it could find together, causing wrong results in various cases. Rewrite it to better handle this. - Don't expect only a single player to be attached. Return a list of players found instead. The configuration dialog can then show the user a list to select from. This is not implemented yet, the configuration dialog will only show the devices found and tell the user to disconnect all but one. - Handle ambiguous cases better. A player found that is ambiguous is treated as such, and if refining the result didn't lead to a single match for each possible player a single entry is created that indicates it being ambiguous. The current code needs a bit of additional cleanup (the result exposes internal data to the caller it shouldn't) to be done later. Change-Id: I22dc2f73cdd6a9d90c34f3a0703aa9e0a2d2087a
2013-04-09Change autodetection result to a list.Dominik Riebeling1-3/+36
Both autodetection functionality and the configuration dialog assumed detection to only return one found device. This isn't necessarily true, especially since some players can be detected but detecting their mountpoint might be ambiguous (only if no previous Rockbox installation is present). Instead of returning individual results (found "ok" player, found "error" player etc.) return a list containing an entry for each player. Current autodetection code will never return more than one entry since it doesn't handle multiple devices yet, and the configuration dialog will show an error if multiple devices are found. Thus there is no user visible change yet. Both autodetection and configuration dialog can now get extended to handle multiple devices. Change-Id: I79b763dbd6e7111783194bcc22ab7cc06a4061c1
2013-04-04Extend Utils::mountpoints() to allow filtering for supported types.Dominik Riebeling1-1/+1
Instead of trying every mountpoint during autodetection allow filtering out filesystems that are not supported when retrieving the system mountpoints. Change-Id: Ic23a5c804cb7c78c146dbc1af7443c67ce12464e
2013-01-01Provide dealloc function to sansapatcher.Dominik Riebeling1-2/+1
Similar as done with ipodpatcher provide a function to free the allocated sector buffer. Change-Id: Ie51e82f7191496bb48973148af1cc35cd37993d3
2013-01-01Provide dealloc function to ipodpatcher.Dominik Riebeling1-2/+1
On Windows the sector buffer is allocated using VirtualAlloc, thus releasing this buffer should be done using VirtualFree. Provide an additional function for deallocating the buffer so users of ipodpatcher do not need to know about this. Change-Id: Ibb0fc575a185148a389e63935e86a392bf8d180d
2013-01-01sansapatcher: move sectorbuf pointer into sansa_t structure.Dominik Riebeling1-4/+3
Similar as the ipod_t structure for ipodpatcher the sansa_t structure holds all relevant information for sansapatcher. Put the global sansa_sectorbuf pointer into it as well. Change-Id: Iad08ef6aafc49609c3d0d556914246f230ee0179
2013-01-01ipodpatcher: move sectorbuf pointer into ipod_t structure.Dominik Riebeling1-4/+4
The ipod_t structure holds all relevant information for ipodpatcher. Put the global ipod_sectorbuf pointer into it as well. Allows the Rockbox Utility Ipod class to be instanciated multiple times since each instance can now have its own buffer. Change-Id: Ie319cbadbc20c367ceadba9a46b4dc34b57a79a7
2012-10-06Allow USB IDs to be non-unique.Dominik Riebeling1-6/+6
When retrieving USB IDs create a list of players matching to a USB ID instead of assuming only one player. This prevents non-unique IDs overwriting each other and will be used for improved autodetection later. Currently only the first ID is used during detection, and no additional IDs have been added yet. Change-Id: Ieac5594108bae708e364bd2c8df88f61fcdcbdcd
2011-10-19Remove svn keyword lines from sources.Dominik Riebeling1-1/+0
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2011-07-17Move some helper functions out of Autodetection.Dominik Riebeling1-228/+3
Those functions are rather general, so put them into the Utils class instead. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-09-01Remove Ipod Video 64MB handling.Dominik Riebeling1-7/+1
Since the builds for the Ipod Video 32MB and 64MB are now unified there is no need to handle them separately in Rockbox Utility anymore. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-04-27Handle device name resolving failures.Dominik Riebeling1-1/+2
Improve tracing of device name resolving. Explicitly fail if resolving the device name from the mountpoint failed during ipod / sansa bootloader installation. Fixes bootloader installation trying to use an empty device name in some cases which can happen if the mountpoint to get resolved uses an incompatible file system. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-04-25Log failures in mountpoint resolving, log filesystem formats in mountpoints().Dominik Riebeling1-11/+28
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-04-02Move utils.cpp functions into separate class and split it up.Dominik Riebeling1-0/+1
Move class-less functions in utils.cpp into a new Utils class and make the old functions static. This prevents clashes with system C functions. Rename some functions to avoid macro problems (check() is a macro on OS X). Split out the RockboxInfo class into a separate file. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-02-27Use the data partition device node when trying to resolve the mountpoint.Dominik Riebeling1-2/+18
The stricter matching for device nodes introduced with r24802 broke resolving the mountpoint during autodetection as sansapatcher and ipodpatcher return the device node of the player instead of its data partition. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-02-20Be more strict when when resolving devices and allow hfs too.Dominik Riebeling1-8/+22
On OS X HFS is a valid filesystem on an Ipod. When resolving device node to mountpoints and vice versa also check mounts of hfs partitions. This results in trying to install the bootloader on a MacPod to show the (intended) MacPod warning instead of failing with a "could not open ipod" error because no valid device node could be retrieved. Also, be more strict on matching to prevent problems with one name being a subset of another. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-02-20Recognize and handle MacPods during autodetection.Dominik Riebeling1-0/+3
Previously MacPods were detected but the mountpoint can't get resolved due to the different partition layout, thus having a MacPod would only detect the Ipod itself but not the mountpoint. Rockbox does not support MacPods, so inform the user as soon as possible. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2010-01-24rbutil: split RbSettings. use Stable/unstable status from server.Dominik Wenger1-4/+5
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-12-15Fix Ipod Video 64MB workaround for rockbox-info.txt detection.Dominik Riebeling1-1/+1
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-11-22FS#10100: Wait for the system to remount the player after bootloader ↵Dominik Riebeling1-1/+0
installation. OS X requires to unmount the player during bootloader installation on Sansas / Ipods. The system remounts the player automatically after a short while. Not waiting for the system to remount the player will result in a changed mount point, making the small / full install write the main build to the wrong location. This currently waits up to 60 seconds for the player to get remounted until it errors out. This value seems to be sufficient, if it's not please report so we can adjust it. Also, the waiting can't be interrupted right now. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-11-22Fix stupid combination of CnP error and typo.Dominik Riebeling1-1/+1
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-11-22OS X uses msdos as filesystem for vfat which is the same OpenBSD does. Fixes ↵Dominik Riebeling1-30/+11
mountpoint resolving. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-09-25Add special handling for ipodvideo64mb when detecting the player via ↵Dominik Riebeling1-0/+6
rockbox-info.txt. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-08-15Improve notification about unsupported players.Dominik Riebeling1-2/+3
- Display the name of a detected unsupported player when running autodetection from the configuration window. - Extend the list of known-unsupported players. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-08-10Clean up and rename Detect class.Dominik Riebeling1-2/+2
Move check() function out of the Detect class and place it into utils.cpp for now. Rename Detect class to System, as it now only retrieves data about the underlying system and doesn't detect anything anymore. Cleans up with the confusion between Detect and Autodetection. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-08-10Simplify and cleanup rockbox-info.txt handling.Dominik Riebeling1-1/+1
Simplify RockboxInfo file handling. Remove Detect::installedVersion() and Detect::installedTarget(), as those became wrappers around RockboxInfo without functionality. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-08-08Clean up some debug output, kill some trailing spaces and break some overly ↵Dominik Riebeling1-17/+18
long lines. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-05-09rbutil: make RbSettings a static class. (FS#10183 with improvements)Dominik Wenger1-3/+4
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-04-30Bootloader installation for ipod and sansa: override the scanning with the ↵Dominik Riebeling1-26/+89
device pointed to by the mountpoint. This allows selecting the correct player if two of the same brand are connected (FS#10096). git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-04-16Refactor USB ID map retrieval from device settings file and minimize ↵Dominik Riebeling1-3/+3
duplicated code. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2009-03-21rbutil: create a RockboxInfo class so all rockbox-info.txt handling is in ↵Dominik Wenger1-12/+9
one place. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2008-12-13Rename getMountpoints() to mountpoints() to be in line with general (and Qt) ↵Dominik Riebeling1-18/+18
naming -- get functions don't get a get prefix. Make the function static. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2008-12-13rbutil fixes for OpenBSD (FS#9340 by Brian Waichunas).Dominik Riebeling1-1/+20
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2008-10-15Don't export includes unless needed.Dominik Riebeling1-6/+10
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
2008-10-12Separate basic functionality from GUI parts by moving it into a separate ↵Dominik Riebeling1-0/+391
folder. Some files still need to get cleaned up prior moving them too. git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657