~ubuntu-core-dev/synaptic/ubuntu

« back to all changes in this revision

Viewing changes to common/rpackagecache.cc

  • Committer: mvo
  • Date: 2005-02-21 04:23:27 UTC
  • Revision ID: gustavo@niemeyer.net-20050221042327-a9b5ee8ac7b0cb68
* gtk/rgpkgdetails.cc, rgmainwindow.cc, rgpkgdetails.h:
  - DepInformation is no longer nested into RPackage because SWIG does
    not support nesting
* common/rswig.{cc,h}: 
  - interface classes for swig so that extending for the progress 
    is possible in python
* common/rpackagecache.{cc,h}, rpackagelister.{cc,h}: 
  - support non-locking
* common/rpackage.{cc,h}: DepInformation is no longer nested

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
  }
51
51
}
52
52
 
53
 
bool RPackageCache::open(OpProgress &progress)
 
53
bool RPackageCache::open(OpProgress &progress, bool lock)
54
54
{
55
 
   _system->Lock();
 
55
   if(lock)
 
56
      _system->Lock();
56
57
 
57
58
   if (_error->PendingError())
58
59
      return false;
64
65
      return _error->Error(_("The list of sources could not be read.\n\
65
66
Go to the repository dialog to correct the problem."));
66
67
 
67
 
   pkgMakeStatusCache(*_list, progress);
 
68
   if(lock)
 
69
      pkgMakeStatusCache(*_list, progress);
 
70
   else
 
71
      pkgMakeStatusCache(*_list, progress, 0, true);
68
72
 
69
73
   if (_error->PendingError())
70
74
      return _error->
108
112
   if (_dcache->DelCount() != 0 || _dcache->InstCount() != 0)
109
113
      return _error->Error(_("Internal Error, non-zero counts"));
110
114
 
111
 
   _locked = true;
 
115
   _locked = lock;
112
116
 
113
117
   return true;
114
118
}
115
119
 
116
120
 
117
121
 
118
 
bool RPackageCache::reset(OpProgress &progress)
 
122
bool RPackageCache::reset(OpProgress &progress, bool lock)
119
123
{
120
124
   delete _dcache;
121
125
   delete _map;
122
126
 
123
 
   releaseLock();
124
 
 
125
 
   return open(progress);
 
127
 
 
128
   if(_locked)
 
129
      releaseLock();
 
130
 
 
131
   return open(progress, lock);
126
132
}
127
133
 
128
134