Summary: | iPod model might not get written to iPods sysinfo file because of lacking permissions | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | Christian Ober-Blöbaum <cob> |
Component: | general | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dj, ruiz |
Priority: | NOR | ||
Version: | 1.4.6 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
fixed version of the function IpodMediaDevice::slotIpodAction( int id )
svn diff against current svn version of the patch |
Description
Christian Ober-Blöbaum
2007-08-07 14:37:45 UTC
Today I implemented the described solution myself and tested it - it is working as expected: when the sysinfo file could not be written (so the ipod model is not set successfully) then an error message is raised giving the user a hint that something is actually NOT right and also pointing him to a solution: So in ipodmediadevice.cpp in the function slotIpodAction after this lines: itdb_device_set_sysinfo( m_itdb->device, "ModelNumStr", model ); add the following code: GError *err = 0; gboolean success = tdb_device_write_sysinfo(m_itdb->device, &err); debug() << "itdb_device_write_sysinfo - success: " << access << endl; if( !success && err ) { g_error_free(err); Amarok::StatusBar::instance()->longMessage("Could not write sysinfo file to ipod (check the permissions of the file \"iPod_Control/Device/SysInfo\" on your iPod)"); // the i18n files will have to be enhanced for the following to work Amarok::StatusBar::instance()->shortMessage( i18n( "Unable to set iPod model to %1 GB %2 (x%3)" ) .arg( QString::number( table[index].capacity ), itdb_info_get_ipod_model_name_string( table[index].ipod_model ), table[index].model_number ) ); } else{ Amarok::StatusBar::instance()->shortMessage( i18n( "Setting iPod model to %1 GB %2 (x%3)" ) .arg( QString::number( table[index].capacity ), itdb_info_get_ipod_model_name_string( table[index].ipod_model ), table[index].model_number ) ); } Created attachment 21346 [details]
fixed version of the function IpodMediaDevice::slotIpodAction( int id )
The above was a little ugly - here is a file containing only the modified
function.
Adding i18n for the 2 new messages is still marked as TODO in the code.
Hi Christian Would be happy to apply it if you can generate a diff using svn diff it is too difficult to maintain code when we have to slot it in places etc. Thanks, Seb On 8 Aug 2007 12:16:50 -0000, Christian Ober-Blöbaum <cob@tzi.de> wrote: [bugs.kde.org quoted mail] Created attachment 21347 [details]
svn diff against current svn version of the patch
svn diff against current svn version of the file
new i18n strings still marked as fixme
Updating the i18n files is done automatically by the 'scripty' bot. Hi Seb, I just wanted to know about the current status regarding the patch. I did not notice any changes in the amarok svn repository during the last week. Is the patch in the attached file ready for inclusion or should anything be changed? Greetings, Christian. Sorry, there is so much mail with the bugs that i must have overlooked it! I'll get on it right away. SVN commit 703383 by seb: iPod model might not get written to iPods sysinfo file because of lacking permissions BUG: 148607 M +25 -5 ipodmediadevice.cpp --- branches/stable/extragear/multimedia/amarok/src/mediadevice/ipod/ipodmediadevice.cpp #703382:703383 @@ -357,11 +357,31 @@ itdb_device_set_sysinfo( m_itdb->device, "ModelNumStr", model ); - Amarok::StatusBar::instance()->shortMessage( - i18n( "Setting iPod model to %1 GB %2 (x%3)" ) - .arg( QString::number( table[index].capacity ), - itdb_info_get_ipod_model_name_string( table[index].ipod_model ), - table[index].model_number ) ); + GError *err = 0; + gboolean success = itdb_device_write_sysinfo(m_itdb->device, &err); + debug() << "success writing sysinfo to ipod?: " << success << endl; + if( !success && err ) + { + g_error_free(err); + //FIXME: update i18n files for next message + Amarok::StatusBar::instance()->longMessage( + i18n( "Could not write sysinfo file to ipod (check the permissions of the file \"iPod_Control/Device/SysInfo\" on your iPod)" ) ); + + //FIXME: update i18n files for next message + Amarok::StatusBar::instance()->shortMessage( + i18n( "Unable to set iPod model to %1 GB %2 (x%3)" ) + .arg( QString::number( table[index].capacity ), + itdb_info_get_ipod_model_name_string( table[index].ipod_model ), + table[index].model_number ) ); + } + else + { + Amarok::StatusBar::instance()->shortMessage( + i18n( "Setting iPod model to %1 GB %2 (x%3)" ) + .arg( QString::number( table[index].capacity ), + itdb_info_get_ipod_model_name_string( table[index].ipod_model ), + table[index].model_number ) ); + } } detectModel(); MediaBrowser::instance()->updateDevices(); SVN commit 703385 by seb: Forward port r703383 iPod model might not get written to iPods sysinfo file because of lacking permissions CCBUG: 148607 M +25 -5 ipodmediadevice.cpp --- trunk/extragear/multimedia/amarok/src/mediadevice/ipod/ipodmediadevice.cpp #703384:703385 @@ -357,11 +357,31 @@ itdb_device_set_sysinfo( m_itdb->device, "ModelNumStr", model ); - Amarok::StatusBar::instance()->shortMessage( - i18n( "Setting iPod model to %1 GB %2 (x%3)" ) - .arg( QString::number( table[index].capacity ), - itdb_info_get_ipod_model_name_string( table[index].ipod_model ), - table[index].model_number ) ); + GError *err = 0; + gboolean success = itdb_device_write_sysinfo(m_itdb->device, &err); + debug() << "success writing sysinfo to ipod?: " << success << endl; + if( !success && err ) + { + g_error_free(err); + //FIXME: update i18n files for next message + Amarok::StatusBar::instance()->longMessage( + i18n( "Could not write sysinfo file to ipod (check the permissions of the file \"iPod_Control/Device/SysInfo\" on your iPod)" ) ); + + //FIXME: update i18n files for next message + Amarok::StatusBar::instance()->shortMessage( + i18n( "Unable to set iPod model to %1 GB %2 (x%3)" ) + .arg( QString::number( table[index].capacity ), + itdb_info_get_ipod_model_name_string( table[index].ipod_model ), + table[index].model_number ) ); + } + else + { + Amarok::StatusBar::instance()->shortMessage( + i18n( "Setting iPod model to %1 GB %2 (x%3)" ) + .arg( QString::number( table[index].capacity ), + itdb_info_get_ipod_model_name_string( table[index].ipod_model ), + table[index].model_number ) ); + } } detectModel(); MediaBrowser::instance()->updateDevice(); *** Bug 141490 has been marked as a duplicate of this bug. *** |