mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Code Cleanup: Device Downloading
.. all comments are suggestions not mandatory and we have a feature request system for that.
This commit is contained in:
@@ -298,7 +298,8 @@ DownloadRideDialog::downloadClicked()
|
||||
|
||||
QList<DeviceRideItemPtr> &rides( device->rides() );
|
||||
if( ! rides.empty() ){
|
||||
// XXX: let user select, which rides he wants to download
|
||||
// we should let user select, which rides he wants to download
|
||||
// rather than download them all. Fix in v3.1
|
||||
for( int i = 0; i < rides.size(); ++i ){
|
||||
rides.at(i)->wanted = true;
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ JouleDevice::download( const QDir &tmpdir,
|
||||
|
||||
if (page < 65535) {
|
||||
// create temporary file
|
||||
QString tmpl = tmpdir.absoluteFilePath(".joule.XXXXXX"); //".joulegps.XXXXXX"
|
||||
QString tmpl = tmpdir.absoluteFilePath(".joule.XXXXXX"); // temp file
|
||||
QTemporaryFile tmp(tmpl);
|
||||
tmp.setAutoRemove(false);
|
||||
|
||||
|
||||
@@ -37,7 +37,9 @@ bool
|
||||
SrmDevices::supportsPort( CommPortPtr dev )
|
||||
{
|
||||
#if defined(SRMIO_HAVE_TERMIOS) || defined(SRMIO_HAVE_WINCOM)
|
||||
// XXX: check device name starts with "com" or "/dev"?
|
||||
// we could check device name starts with "com" or "/dev"
|
||||
// but we wouldn't have got here unless it was a supported
|
||||
// serial port anyway.
|
||||
if( dev->type() == "Serial" )
|
||||
return true;
|
||||
#endif
|
||||
@@ -60,7 +62,6 @@ SrmDevices::exclusivePort( CommPortPtr dev )
|
||||
{
|
||||
switch( protoVersion ){
|
||||
case 5:
|
||||
// XXX: this has to go, once we have other devices using prolific
|
||||
if( dev->type() == "Serial" && dev->name().contains( "PL2303" ) )
|
||||
return true;
|
||||
break;
|
||||
@@ -118,7 +119,9 @@ SrmDevice::open( QString &err )
|
||||
|
||||
if( dev->type() == "Serial" ){
|
||||
|
||||
// XXX: check device name starts with "com" or "/dev"?
|
||||
// no need to check device name starts with "com" or "/dev"
|
||||
// since we wouldn't get this far unless it was a supported
|
||||
// serial port device anyway.
|
||||
|
||||
#ifdef SRMIO_HAVE_WINCOM
|
||||
io = srmio_iow32_new( dev->name().toAscii().constData(), &serr );
|
||||
@@ -329,7 +332,7 @@ SrmDevice::download( const QDir &tmpdir,
|
||||
size_t block_cnt, block_num( 0 );
|
||||
size_t prog_sum( 0 ), prog_prev( 0 );
|
||||
size_t chunks_done( 0 );
|
||||
srmio_time_t splitGap( 72000 ); // 2h - XXX: make this configurable
|
||||
srmio_time_t splitGap( 72000 ); // 2h - NOTE: we could make this configurable
|
||||
|
||||
if( ! is_open ){
|
||||
if( ! open( err ) )
|
||||
|
||||
Reference in New Issue
Block a user