thanks Jano, this is much more clean
authorDuncan Mac-Vicar P <dmacvicar@suse.de>
Fri, 7 Nov 2008 12:46:24 +0000 (12:46 +0000)
committerDuncan Mac-Vicar P <dmacvicar@suse.de>
Fri, 7 Nov 2008 12:46:24 +0000 (12:46 +0000)
zypp/media/MediaAria2c.cc
zypp/media/MediaCurl.cc

index b8c79e2..a2e8d88 100644 (file)
@@ -85,16 +85,7 @@ static const char *const anonymousIdHeader()
   // agent string.
   // The target could be not initialized, and then this information
   // is not available.
-  Target_Ptr target;
-  // FIXME this has to go away as soon as the target
-  // does not throw when not initialized.
-  try {
-      target = zypp::getZYpp()->target();
-  }
-  catch ( const Exception &e )
-  {
-      // nothing to do
-  }
+  Target_Ptr target = zypp::getZYpp()->getTarget();
 
   static const std::string _value(
       str::form(
@@ -110,16 +101,7 @@ static const char *const distributionFlavorHeader()
   // agent string.
   // The target could be not initialized, and then this information
   // is not available.
-  Target_Ptr target;
-  // FIXME this has to go away as soon as the target
-  // does not throw when not initialized.
-  try {
-      target = zypp::getZYpp()->target();
-  }
-  catch ( const Exception &e )
-  {
-      // nothing to do
-  }
+  Target_Ptr target = zypp::getZYpp()->getTarget();
 
   static const std::string _value(
       str::trim( str::form(
@@ -135,16 +117,7 @@ const char *const MediaAria2c::agentString()
   // agent string.
   // The target could be not initialized, and then this information
   // is not available.
-  Target_Ptr target;
-  // FIXME this has to go away as soon as the target
-  // does not throw when not initialized.
-  try {
-      target = zypp::getZYpp()->target();
-  }
-  catch ( const Exception &e )
-  {
-      // nothing to do
-  }
+  Target_Ptr target = zypp::getZYpp()->getTarget();
 
   static const std::string _value(
     str::form(
index 9263f4a..43faf62 100644 (file)
@@ -191,16 +191,7 @@ static const char *const anonymousIdHeader()
   // agent string.
   // The target could be not initialized, and then this information
   // is not available.
-  Target_Ptr target;
-  // FIXME this has to go away as soon as the target
-  // does not throw when not initialized.
-  try {
-      target = zypp::getZYpp()->target();
-  }
-  catch ( const Exception &e )
-  {
-      // nothing to do
-  }
+  Target_Ptr target = zypp::getZYpp()->getTarget();
 
   static const std::string _value(
       str::trim( str::form(
@@ -216,16 +207,7 @@ static const char *const distributionFlavorHeader()
   // agent string.
   // The target could be not initialized, and then this information
   // is not available.
-  Target_Ptr target;
-  // FIXME this has to go away as soon as the target
-  // does not throw when not initialized.
-  try {
-      target = zypp::getZYpp()->target();
-  }
-  catch ( const Exception &e )
-  {
-      // nothing to do
-  }
+  Target_Ptr target = zypp::getZYpp()->getTarget();
 
   static const std::string _value(
       str::trim( str::form(
@@ -242,17 +224,8 @@ static const char *const agentString()
   // agent string.
   // The target could be not initialized, and then this information
   // is not available.
-  Target_Ptr target;
-  // FIXME this has to go away as soon as the target
-  // does not throw when not initialized.
-  try {
-      target = zypp::getZYpp()->target();
-  }
-  catch ( const Exception &e )
-  {
-      // nothing to do
-  }
-
+  Target_Ptr target = zypp::getZYpp()->getTarget();
   static const std::string _value(
     str::form(
        "ZYpp %s (curl %s) %s"