Author: jkupec
Date: Mon Apr 7 13:48:09 2008
New Revision: 9420
URL: http://svn.opensuse.org/viewcvs/zypp?rev=9420&view=rev
Log:
- cleanup
Modified:
trunk/zypper/src/zypper-search.h
trunk/zypper/src/zypper.cc
Modified: trunk/zypper/src/zypper-search.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-search.h?rev=9420&r1=9419&r2=9420&view=diff
==============================================================================
--- trunk/zypper/src/zypper-search.h (original)
+++ trunk/zypper/src/zypper-search.h Mon Apr 7 13:48:09 2008
@@ -7,22 +7,15 @@
| |
\---------------------------------------------------------------------*/
-
#ifndef ZYPPERSEARCH_H_
#define ZYPPERSEARCH_H_
-#include <string>
-#include <vector>
-#include
-#include "zypp/ZYpp.h"
-#include "zypp/PoolQuery.h"
-#include "zypp/ResObject.h"
+#include "zypp/ZYpp.h" // for zypp::ResPool::instance()
+#include "zypp/sat/Solvable.h"
#include "zypp/PoolItem.h"
#include "zypper.h"
-#include "zypper-main.h"
-#include "zypper-utils.h"
-#include "zypper-getopt.h"
+#include "zypper-utils.h" // for kind_to_string_localized
#include "zypper-tabulator.h"
/**
@@ -32,13 +25,10 @@
{
// the table used for output
Table * _table;
- // the db query interface, used to retrieve additional data like the repository alias
- zypp::PoolQuery _query;
const GlobalOptions & _gopts;
- FillTable( Table & table, zypp::PoolQuery query )
+ FillTable( Table & table )
: _table( &table )
- , _query( query )
, _gopts(Zypper::instance()->globalOpts())
{
TableHeader header;
@@ -62,28 +52,6 @@
*_table << header;
}
- // PoolItem callback, called for installed resolvables
-
- bool operator()(const zypp::ResObject::Ptr &item) const
- {
- TableRow row;
-
- // add other fields to the result table
-
- zypp::PoolItem pi( zypp::ResPool::instance().find( item->satSolvable() ) );
-
- row << ( pi.status().isInstalled() ? "i" : " " )
- << item->repository().info().name()
- // TODO what about rug's Bundle?
- << (_gopts.is_rug_compatible ?
- "" : kind_to_string_localized(item->kind(), 1))
- << item->name()
- << item->edition().asString()
- << item->arch().asString();
- *_table << row;
- return true;
- }
-
bool operator()(const zypp::sat::Solvable & solv) const
{
TableRow row;
Modified: trunk/zypper/src/zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=9420&r1=9419&r2=9420&view=diff
==============================================================================
--- trunk/zypper/src/zypper.cc (original)
+++ trunk/zypper/src/zypper.cc Mon Apr 7 13:48:09 2008
@@ -29,6 +29,7 @@
#include "zypp/repo/RepoException.h"
#include "zypp/zypp_detail/ZYppReadOnlyHack.h"
#include "zypp/sat/SolvAttr.h"
+#include "zypp/PoolQuery.h"
#include "zypp/target/rpm/RpmHeader.h" // for install <.rpmURI>
@@ -2039,9 +2040,10 @@
if (copts.count("installed-only")) query.setInstalledOnly();
//if (copts.count("match-any")) options.setMatchAny();
//if (copts.count("match-words")) options.setMatchWords();
- if (copts.count("match-exact")) query.setMatchExact();
- //if (copts.count("search-descriptions")) options.setSearchDescriptions();
- if (copts.count("case-sensitive")) query.setCaseSensitive();
+ if (copts.count("match-exact"))
+ query.setMatchExact();
+ if (copts.count("case-sensitive"))
+ query.setCaseSensitive();
if (copts.count("type") > 0)
{
@@ -2077,14 +2079,6 @@
}
}
- init_target(*this);
-
- // now load resolvables:
- load_resolvables(*this);
-
- Table t;
- t.style(Ascii);
-
for(vector<string>::const_iterator it = _arguments.begin();
it != _arguments.end(); ++it)
query.addString(*it);
@@ -2095,10 +2089,17 @@
query.addAttribute(sat::SolvAttr::description);
}
+ init_target(*this);
+
+ // now load resolvables:
+ load_resolvables(*this);
+
+ Table t;
+ t.style(Ascii);
+
try
{
- FillTable callback( t, query );
- cout <<"going ahead"<