- remove the overkill zypp::locks namespace
authorJan Kupec <jkupec@suse.cz>
Mon, 14 Apr 2008 11:11:58 +0000 (11:11 +0000)
committerJan Kupec <jkupec@suse.cz>
Mon, 14 Apr 2008 11:11:58 +0000 (11:11 +0000)
tests/zypp/Locks_test.cc
zypp/Locks.cc
zypp/Locks.h
zypp/ZYppCallbacks.h
zypp/zypp_detail/ZYppImpl.cc

index 6f10a51..64ed544 100644 (file)
@@ -16,7 +16,6 @@ using std::cout;
 using std::endl;
 using std::string;
 using namespace zypp;
-using namespace zypp::locks;
 using namespace boost::unit_test;
 
 bool isLocked( const sat::Solvable & solvable )
index b734851..c4b50c5 100644 (file)
@@ -33,8 +33,6 @@ using namespace zypp::str;
 
 namespace zypp
 {
-namespace locks
-{
 
 Locks& Locks::instance()
 {
@@ -79,7 +77,7 @@ struct LockingOutputIterator
   
   private:
   OutputIterator& out;
- };
+};
 
 void Locks::loadLocks( const Pathname& file )
 {
@@ -117,7 +115,6 @@ void Locks::addLock(const ui::Selectable& selectable)
   q.addKind( selectable.kind() );
   q.setMatchExact();
   q.setCaseSensitive(true);
-  q.requireAll();
   addLock( q );
 }
 
@@ -337,5 +334,4 @@ void Locks::saveLocks( const Pathname& file )
   report->finish(SavingLocksReport::NO_ERROR);
 }
 
-} // ns locks
 } // ns zypp
index 51c57c8..00ebd8b 100644 (file)
@@ -1,4 +1,3 @@
-
 #ifndef ZYPP_LOCKS_H
 #define ZYPP_LOCKS_H
 
@@ -7,52 +6,48 @@
 #include "zypp/PoolQuery.h"
 #include "zypp/ZConfig.h"
 #include "zypp/ui/Selectable.h"
-
 namespace zypp
 {
-  namespace locks
+  class Locks
   {
-    class Locks
-    {
-    public:
-      class Impl;
+  public:
+    class Impl;
 
-      static Locks& instance();
+    static Locks& instance();
 
-      /**
-       * locks all solvables which is result of query
-       */
-      void addLock( const PoolQuery& query );
+    /**
+     * locks all solvables which is result of query
+     */
+    void addLock( const PoolQuery& query );
 
-      /**
-       * locks selectable
-       */
-      void addLock( const ui::Selectable& selectable );
+    /**
+     * locks selectable
+     */
+    void addLock( const ui::Selectable& selectable );
 
-      /**
-       * unlocks all solvables which is result of query.
-       * Can call callback
-       */
-      void unlock( const PoolQuery& query );
+    /**
+     * unlocks all solvables which is result of query.
+     * Can call callback
+     */
+    void unlock( const PoolQuery& query );
 
-      void unlock( const ui::Selectable& selectable );
+    void unlock( const ui::Selectable& selectable );
 
-      void loadLocks( const Pathname& file = ZConfig::instance().locksFile() );
+    void loadLocks( const Pathname& file = ZConfig::instance().locksFile() );
 
-      void saveLocks( const Pathname& file = ZConfig::instance().locksFile() );
+    void saveLocks( const Pathname& file = ZConfig::instance().locksFile() );
 
-      bool existEmptyLocks();
+    bool existEmptyLocks();
 
-      void removeEmptyLocks();
+    void removeEmptyLocks();
 
-    private:
-      Locks();
-      
-      RW_pointer<Impl, rw_pointer::Scoped<Impl> > _pimpl;
+  private:
+    Locks();
+    
+    RW_pointer<Impl, rw_pointer::Scoped<Impl> > _pimpl;
 
-    };
-  }
+  };
 }
     
 #endif
-
index 208a89c..1416835 100644 (file)
@@ -622,81 +622,75 @@ namespace zypp
   } // namespace target
   ///////////////////////////////////////////////////////////////////
 
-class PoolQuery;
-  ///////////////////////////////////////////////////////////////////
-  namespace locks
-  {
-    struct CleanEmptyLocksReport : public callback::ReportBase
-    {
-      enum Action {
-        ABORT,  // abort and return error
-        DELETE, // delete empty lock    
-       IGNORE  // skip empty lock
-      };
+  class PoolQuery;
 
-      enum Error {
-       NO_ERROR,
-       ABORTED         // cleaning aborted
-      };
+  struct CleanEmptyLocksReport : public callback::ReportBase
+  {
+    enum Action {
+      ABORT,  // abort and return error
+      DELETE, // delete empty lock    
+      IGNORE  // skip empty lock
+    };
 
-      virtual void start(
-      ) {}
+    enum Error {
+      NO_ERROR,
+      ABORTED // cleaning aborted
+    };
 
-      virtual bool progress(int /*value*/)
-      { return true; }
+    virtual void start(
+    ) {}
 
-      /**
-       * When find empty lock ask what to do with it
-       */
-      virtual Action execute(
-        const PoolQuery& /*error*/
-       ) { return DELETE; }
+    virtual bool progress(int /*value*/)
+    { return true; }
 
-       virtual void finish(
-         Error /*error*/
-        ) {}
+    /**
+     * When find empty lock ask what to do with it
+     */
+    virtual Action execute(
+        const PoolQuery& /*error*/
+     ) { return DELETE; }
 
-    };
+     virtual void finish(
+       Error /*error*/
+      ) {}
 
-    struct SavingLocksReport : public callback::ReportBase
-    {
-      enum Action {
-        ABORT,  // abort and return error
-        DELETE, // delete conflicted lock    
-       IGNORE  // skip conflict lock
-      };
+  };
 
-      enum Error {
-       NO_ERROR,
-       ABORTED         // cleaning aborted
-      };
+  struct SavingLocksReport : public callback::ReportBase
+  {
+    enum Action {
+      ABORT,  // abort and return error
+      DELETE, // delete conflicted lock    
+      IGNORE  // skip conflict lock
+    };
 
-      enum ConflictState{
-        SAME_RESULTS,
-        INTERSECT
-      };
+    enum Error {
+      NO_ERROR,
+      ABORTED  // cleaning aborted
+    };
 
-      virtual void start() {}
+    enum ConflictState{
+      SAME_RESULTS,
+      INTERSECT
+    };
 
-      virtual bool progress() /*still alive*/
-      { return true; }
+    virtual void start() {}
 
-      /**
-       * When user unlock something which is locked by non-identical query
-       */
-      virtual Action conflict(
-        const PoolQuery&, /*problematic query*/
-         ConflictState 
-       ) { return DELETE; }
+    virtual bool progress() /*still alive*/
+    { return true; }
 
-       virtual void finish(
-         Error /*error*/
-        ) {}
+    /**
+     * When user unlock something which is locked by non-identical query
+     */
+    virtual Action conflict(
+        const PoolQuery&, /*problematic query*/
+       ConflictState 
+     ) { return DELETE; }
 
-    };
-    /////////////////////////////////////////////////////////////////
-  } // namespace locks
-  ///////////////////////////////////////////////////////////////////
+     virtual void finish(
+       Error /*error*/
+      ) {}
+  };
 
 
   /////////////////////////////////////////////////////////////////
index 9e8144b..db8b79e 100644 (file)
@@ -183,7 +183,7 @@ namespace zypp
         return 0;
 
       //TODO catch posibble exceptions
-      locks::Locks::instance().loadLocks();
+      Locks::instance().loadLocks();
 
       //current locks api doesn't support counting lock
       //so count it after