Mailinglist Archive: zypp-commit (223 mails)

< Previous Next >
[zypp-commit] r10603 - in /trunk/libzypp/zypp: ResObject.cc ResObject.h
  • From: mlandres@xxxxxxxxxxxxxxxx
  • Date: Thu, 17 Jul 2008 09:37:33 -0000
  • Message-id: <20080717093734.14A0A301AB@xxxxxxxxxxxxxxxx>
Author: mlandres
Date: Thu Jul 17 11:37:33 2008
New Revision: 10603

URL: http://svn.opensuse.org/viewcvs/zypp?rev=10603&view=rev
Log:
Provide ResObject even if Solvable kind is unknown

Modified:
trunk/libzypp/zypp/ResObject.cc
trunk/libzypp/zypp/ResObject.h

Modified: trunk/libzypp/zypp/ResObject.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResObject.cc?rev=10603&r1=10602&r2=10603&view=diff
==============================================================================
--- trunk/libzypp/zypp/ResObject.cc (original)
+++ trunk/libzypp/zypp/ResObject.cc Thu Jul 17 11:37:33 2008
@@ -109,6 +109,9 @@

ResObject::Ptr makeResObject( const sat::Solvable & solvable_r )
{
+ if ( ! solvable_r )
+ return 0;
+
ResKind kind( solvable_r.kind() );
#define OUTS(X) if ( kind == ResTraits<X>::kind ) return make<X>( solvable_r
);
OUTS( Package );
@@ -117,7 +120,8 @@
OUTS( Product );
OUTS( SrcPackage );
#undef OUTS
- return 0;
+ // unknow => return a plain ResObject
+ return new ResObject( solvable_r );
}

/////////////////////////////////////////////////////////////////

Modified: trunk/libzypp/zypp/ResObject.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResObject.h?rev=10603&r1=10602&r2=10603&view=diff
==============================================================================
--- trunk/libzypp/zypp/ResObject.h (original)
+++ trunk/libzypp/zypp/ResObject.h Thu Jul 17 11:37:33 2008
@@ -154,6 +154,7 @@
const DiskUsage & diskusage() const;

protected:
+ friend ResObject::Ptr makeResObject( const sat::Solvable & solvable_r );
/** Ctor */
ResObject( const sat::Solvable & solvable_r );
/** Dtor */

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages