- Changed susetags Selection/Pattern to use Locale instead of
authorMichael Andres <ma@suse.de>
Mon, 6 Feb 2006 17:29:06 +0000 (17:29 +0000)
committerMichael Andres <ma@suse.de>
Mon, 6 Feb 2006 17:29:06 +0000 (17:29 +0000)
  LanguageCode.

zypp/LanguageCode.cc
zypp/detail/SelectionImplIf.h
zypp/source/susetags/PatternTagFileParser.cc
zypp/source/susetags/SelectionTagFileParser.cc
zypp/source/susetags/SuseTagsPatternImpl.h
zypp/source/susetags/SuseTagsSelectionImpl.h
zypp/ui/ResPoolProxy.h

index d8debe3..fbdc275 100644 (file)
@@ -93,8 +93,6 @@ namespace zypp
       if ( it != others.end() )
         return it;
 
-#warning Support sub-locales like el_GR
-
       // not found: Remember a new code
       CodeMap::value_type nval( code_r, std::string() );
 
index a3dcef1..ae36e02 100644 (file)
@@ -37,29 +37,23 @@ namespace zypp
       typedef Selection ResType;
 
     public:
-      /** Ctor */
-      SelectionImplIf() : ResObjectImplIf ()
-      {}
-      /** Dtor. Makes this an abstract class. */
-      virtual ~SelectionImplIf() = 0;
-
-    public:
 
         /** */
-        virtual TranslatedText summary() const = 0;
+        virtual TranslatedText summary() const PURE_VIRTUAL;
 
         /** */
-        virtual TranslatedText description() const = 0;
+        virtual TranslatedText description() const PURE_VIRTUAL;
 
         /** */
-       virtual Label category() const = 0;
+       virtual Label category() const PURE_VIRTUAL;
 
         /** */
-       virtual bool visible() const = 0;
-    
+       virtual bool visible() const PURE_VIRTUAL;
+
         /** */
-       virtual Label order() const = 0;
+       virtual Label order() const PURE_VIRTUAL;
 #if 0
+        // NOTE LangCode id zypp:Locale
       virtual std::list<std::string> suggests() const;
       virtual std::list<std::string> recommends() const;
       virtual std::list<std::string> insnotify( const LangCode & lang = LangCode("") ) const;
@@ -83,11 +77,6 @@ namespace zypp
     };
     ///////////////////////////////////////////////////////////////////
 
-    /* Implementation of pure virtual dtor is required! */
-    inline SelectionImplIf::~SelectionImplIf()
-    {}
-
-
     /////////////////////////////////////////////////////////////////
   } // namespace detail
   ///////////////////////////////////////////////////////////////////
index 4483749..2462f47 100644 (file)
@@ -57,7 +57,7 @@ namespace zypp
       {
         if ( tag.name == "Sum" )
         {
-          selImpl->_summary.setText(tag.value, LanguageCode(tag.modifier));
+          selImpl->_summary.setText(tag.value, Locale(tag.modifier));
         }
         else if ( tag.name == "Ver" )
         {
@@ -87,7 +87,7 @@ namespace zypp
           selImpl->_order = tag.value;
         }
       }
-      
+
       void PatternTagFileParser::consume( const MultiTag &tag )
       {
         if ( tag.name == "Req" )
index 2505300..78b141d 100644 (file)
@@ -57,7 +57,7 @@ namespace zypp
       {
        if ( tag.name == "Sum" )
        {
-         selImpl->_summary.setText(tag.value, LanguageCode(tag.modifier));
+         selImpl->_summary.setText(tag.value, Locale(tag.modifier));
        }
        else if ( tag.name == "Ver" )
        {
@@ -87,7 +87,7 @@ namespace zypp
          selImpl->_order = tag.value;
        }
       }
-      
+
       void SelectionTagFileParser::consume( const MultiTag &tag )
       {
        if ( tag.name == "Req" )
@@ -112,7 +112,7 @@ namespace zypp
        }
        else if ( tag.name == "Ins" )
        {
-         selImpl->_inspacks[LanguageCode(tag.modifier)] = tag.values;
+         selImpl->_inspacks[Locale(tag.modifier)] = tag.values;
        }
       }
 
@@ -122,12 +122,12 @@ namespace zypp
        CapFactory _f;
        Dependencies _deps;
 
-       for (std::list<std::string>::const_iterator it = selImpl->_inspacks[LanguageCode()].begin(); it != selImpl->_inspacks[LanguageCode()].end(); it++)
+       for (std::list<std::string>::const_iterator it = selImpl->_inspacks[Locale()].begin(); it != selImpl->_inspacks[Locale()].end(); it++)
        {
          Capability _cap = _f.parse( ResTraits<Package>::kind, *it);
          _deps[Dep::RECOMMENDS].insert(_cap);
        }
-       
+
        for (std::list<std::string>::const_iterator it = selImpl->_recommends.begin(); it != selImpl->_recommends.end(); it++)
        {
          Capability _cap = _f.parse( ResTraits<Selection>::kind, *it );
index 5214e17..a7fb732 100644 (file)
@@ -83,9 +83,9 @@ namespace zypp
       std::list<std::string> _pkgrecommends;
       std::list<std::string> _pkgrequires;
       std::list<std::string> _supported_locales;
-      std::map< LanguageCode, std::list<std::string> > _insnotify;
-      std::map< LanguageCode, std::list<std::string> > _delnotify;
-      
+      std::map< Locale, std::list<std::string> > _insnotify;
+      std::map< Locale, std::list<std::string> > _delnotify;
+
     };
     ///////////////////////////////////////////////////////////////////
 
index 47874fb..4f65b22 100644 (file)
@@ -80,11 +80,11 @@ namespace zypp
       std::list<std::string> _provides;
       std::list<std::string> _obsoletes;
       std::list<std::string> _supported_locales;
-      std::map< LanguageCode, std::list<std::string> > _insnotify;
-      std::map< LanguageCode, std::list<std::string> > _delnotify;
-      std::map< LanguageCode, std::list<std::string> > _inspacks;
-      std::map< LanguageCode, std::list<std::string> > _delpacks;
-      
+      std::map< Locale, std::list<std::string> > _insnotify;
+      std::map< Locale, std::list<std::string> > _delnotify;
+      std::map< Locale, std::list<std::string> > _inspacks;
+      std::map< Locale, std::list<std::string> > _delpacks;
+
     };
     ///////////////////////////////////////////////////////////////////
 
index 14b5dcc..3d37991 100644 (file)
@@ -17,6 +17,7 @@
 #include "zypp/base/PtrTypes.h"
 
 #include "zypp/ResPool.h"
+#include "zypp/ui/Selectable.h"
 
 ///////////////////////////////////////////////////////////////////
 namespace zypp