From: Jan Kupec Date: Fri, 27 Jul 2007 16:05:00 +0000 (+0000) Subject: - isChangeable(MediaAccessId) added X-Git-Tag: BASE-SuSE-Linux-10_3-Branch~455 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e67431e737e04e55fd7477b4903f5717dd860be6;p=platform%2Fupstream%2Flibzypp.git - isChangeable(MediaAccessId) added --- diff --git a/zypp/media/MediaManager.cc b/zypp/media/MediaManager.cc index 34ae9fe..d24f992 100644 --- a/zypp/media/MediaManager.cc +++ b/zypp/media/MediaManager.cc @@ -776,6 +776,13 @@ namespace zypp } // --------------------------------------------------------------- + bool + MediaManager::isChangeable(MediaAccessId accessId) + { + return url(accessId).getScheme() == "cd" || url(accessId).getScheme() == "dvd"; + } + + // --------------------------------------------------------------- Pathname MediaManager::localRoot(MediaAccessId accessId) const { diff --git a/zypp/media/MediaManager.h b/zypp/media/MediaManager.h index d9e5e3d..0a0a6e3 100644 --- a/zypp/media/MediaManager.h +++ b/zypp/media/MediaManager.h @@ -667,6 +667,20 @@ namespace zypp const MediaVerifierRef &verifier) const; /** + * Simple check, based on media's URL scheme, telling whether the + * it is possible to physically change the media inside its drive, like + * CDs or DVDs. Useful to decide whether to request media change from + * user or not. + * + * \param accessId The media access id. + * \return false if the media is not changeable, + * true otherwise. + * \throws MediaNotOpenException for invalid access id. + */ + bool + isChangeable(MediaAccessId accessId); + + /** * Return the local directory that corresponds to medias url, * no matter if media isAttached or not. Files requested will * be available at 'localRoot() + filename' or even better