provide location()
authorKlaus Kaempf <kkaempf@suse.de>
Thu, 2 Mar 2006 20:35:13 +0000 (20:35 +0000)
committerKlaus Kaempf <kkaempf@suse.de>
Thu, 2 Mar 2006 20:35:13 +0000 (20:35 +0000)
zmd/backend/dbsource/DbPackageImpl.cc
zmd/backend/dbsource/DbPackageImpl.h

index c87d5c6..ce8760a 100644 (file)
@@ -49,16 +49,27 @@ DbPackageImpl::readHandle( sqlite_int64 id, sqlite3_stmt *handle )
 {
     _zmdid = id;
 
-    const char * text = (const char *) sqlite3_column_text (handle, 12);
+    // 1-5: nvra, see DbSourceImpl
+    _size_installed = sqlite3_column_int( handle, 6 );
+    // 7: catalog
+    // 8: installed
+    // 9: local
+    const char * text = ((const char *) sqlite3_column_text( handle, 10 ));
+    if (text != NULL)
+       _group = text;
+    _size_archive = sqlite3_column_int( handle, 11 );
+    text = (const char *) sqlite3_column_text( handle, 12 );
     if (text != NULL)
        _summary = TranslatedText( string( text ) );
-    text = (const char *) sqlite3_column_text (handle, 13);
+    text = (const char *) sqlite3_column_text( handle, 13 );
     if (text != NULL)
        _description = TranslatedText( string( text ) );
-    _group = "group";          //FIXME ((const char *) sqlite3_column_text (handle, 10));
-    _size_installed = sqlite3_column_int (handle, 6);
-    _size_archive = sqlite3_column_int (handle, 11);
-    _install_only = (sqlite3_column_int (handle, 15) != 0);
+    text = (const char *) sqlite3_column_text( handle, 14 );
+    if (text != NULL)
+       _location = Pathname( text );
+    _install_only = (sqlite3_column_int( handle, 15 ) != 0);
+
+    return;
 }
 
 
@@ -77,6 +88,9 @@ TranslatedText DbPackageImpl::description() const
 PackageGroup DbPackageImpl::group() const
 { return _group; }
 
+Pathname DbPackageImpl::location() const
+{ return _location; }
+
 ByteCount DbPackageImpl::size() const
 { return _size_installed; }
 
index 980d0bb..70f036a 100644 (file)
@@ -45,6 +45,8 @@ public:
        /** */
        virtual ByteCount archivesize() const;
        /** */
+       virtual Pathname location() const;
+       /** */
        virtual bool installOnly() const;
        /** */
        virtual Source_Ref source() const;
@@ -56,6 +58,7 @@ protected:
        TranslatedText _summary;
        TranslatedText _description;
        PackageGroup _group;
+       Pathname _location;
        bool _install_only;
        ZmdId _zmdid;