Imported Upstream version 16.3.2
[platform/upstream/libzypp.git] / zypp / repo / SUSEMediaVerifier.cc
index 3b84c3f..5145e2c 100644 (file)
@@ -25,7 +25,8 @@ SUSEMediaVerifier::SUSEMediaVerifier(const std::string & vendor_r,
     , _media_nr(media_nr)
 {}
 
-SUSEMediaVerifier::SUSEMediaVerifier( const Pathname &path_r )
+SUSEMediaVerifier::SUSEMediaVerifier( int media_nr, const Pathname &path_r )
+  : _media_nr(media_nr)
 {
   std::ifstream str(path_r.asString().c_str());
   std::string vendor;
@@ -48,17 +49,17 @@ bool SUSEMediaVerifier::isDesiredMedia(const media::MediaAccessRef &ref)
   if (_media_vendor.empty() || _media_id.empty())
     return true;
 
-    Pathname media_file = "/media." + str::numstring(_media_nr) + "/media";
-    ref->provideFile (media_file);
-    media_file = ref->localPath(media_file);
-    std::ifstream str(media_file.asString().c_str());
-    std::string vendor;
-    std::string id;
+  Pathname media_file = "/media." + str::numstring(_media_nr) + "/media";
+  ref->provideFile (media_file);
+  media_file = ref->localPath(media_file);
+  std::ifstream str(media_file.asString().c_str());
+  std::string vendor;
+  std::string id;
 #warning check the stream status
-    getline(str, vendor);
-    getline(str, id);
+  getline(str, vendor);
+  getline(str, id);
 
-    return (vendor == _media_vendor && id == _media_id );
+  return (vendor == _media_vendor && id == _media_id );
 }
 
 }