From kde-hardware-devel Fri Aug 16 07:18:37 2013 From: "Mark Kretschmann" Date: Fri, 16 Aug 2013 07:18:37 +0000 To: kde-hardware-devel Subject: Re: [Kde-hardware-devel] Review Request 111626: Fix Amarok crash with Audio CD inserted Message-Id: <20130816071837.22755.87090 () vidsolbach ! de> X-MARC-Message: https://marc.info/?l=kde-hardware-devel&m=137663756929144 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============6112766084023474373==" --===============6112766084023474373== Content-Type: multipart/alternative; boundary="===============2017068437761351222==" --===============2017068437761351222== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111626/#review37921 ----------------------------------------------------------- What's up with this one, is it already shipped? - Mark Kretschmann On July 21, 2013, 12:28 p.m., Christoph Feck wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://git.reviewboard.kde.org/r/111626/ > ----------------------------------------------------------- > > (Updated July 21, 2013, 12:28 p.m.) > > > Review request for Amarok, kdelibs and Solid. > > > Description > ------- > > https://bugs.kde.org/show_bug.cgi?id=314544#c40 says: > > "Looking at the backtrace, KFilePlacesItem tries to detect Audio CDs as follows: > > Solid::Device d = device(); > if (d.isValid()) { > if (m_access) { > return QUrl(KUrl(m_access->filePath())); > } else if (m_disc && (m_disc->availableContent() & Solid::OpticalDisc::Audio)!=0) { > QString device = d.as()->device(); > return QUrl(QString("audiocd:/?device=%1").arg(device)); > } > } > > The crash happens, because d.as returns 0, in other words, Audio CDs are no longer treated as block devices. > > Failure of said cast can be easily detected, but the question is rather, if it's not a Solid bug, how the code needs to be modified to correctly get the audiocd:/ URL for the block device." > > While I did not yet figure out, how I can get the block device URL for a disc in case block is 0, I propose this temporary fix. It should fix the crash, but could fail to correctly invoke the audiocd:/ kio with multiple disc drives. > > > This addresses bug 314544. > http://bugs.kde.org/show_bug.cgi?id=314544 > > > Diffs > ----- > > kfile/kfileplacesitem.cpp 5a12486 > > Diff: http://git.reviewboard.kde.org/r/111626/diff/ > > > Testing > ------- > > I could not test, my system has no disc drives. > > > Thanks, > > Christoph Feck > > --===============2017068437761351222== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit
This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/111626/

What's up with this one, is it already shipped?

- Mark


On July 21st, 2013, 12:28 p.m. UTC, Christoph Feck wrote:

Review request for Amarok, kdelibs and Solid.
By Christoph Feck.

Updated July 21, 2013, 12:28 p.m.

Description

https://bugs.kde.org/show_bug.cgi?id=314544#c40 says:

"Looking at the backtrace, KFilePlacesItem tries to detect Audio CDs as follows:

    Solid::Device d = device();
    if (d.isValid()) {
            if (m_access) {
                return QUrl(KUrl(m_access->filePath()));
            } else if (m_disc && (m_disc->availableContent() & Solid::OpticalDisc::Audio)!=0) {
                QString device = d.as<Solid::Block>()->device();
                return QUrl(QString("audiocd:/?device=%1").arg(device));
            }
    }

The crash happens, because d.as<Solid::Block> returns 0, in other words, Audio CDs are no longer treated as block devices.

Failure of said cast can be easily detected, but the question is rather, if it's not a Solid bug, how the code needs to be modified to correctly get the audiocd:/ URL for the block device."

While I did not yet figure out, how I can get the block device URL for a disc in case block is 0, I propose this temporary fix. It should fix the crash, but could fail to correctly invoke the audiocd:/ kio with multiple disc drives.

Testing

I could not test, my system has no disc drives.
Bugs: 314544

Diffs

  • kfile/kfileplacesitem.cpp (5a12486)

View Diff

--===============2017068437761351222==-- --===============6112766084023474373== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kde-hardware-devel mailing list Kde-hardware-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-hardware-devel --===============6112766084023474373==--