kdenonbeta/kdedebian/kapture/libkapture
CVS commit by mornfall:
Make the progress dialog more reasonable (but it's still broken).
M +12 -8 acqprogress.cpp 1.5
--- kdenonbeta/kdedebian/kapture/libkapture/acqprogress.cpp #1.4:1.5
@@ -156,5 +156,8 @@ kapture::AcqStatus::AcqStatus(QWidget *p
void kapture::AcqStatus::Done(pkgAcquire::ItemDesc &Itm)
{
- Update = true;
+ Item * i = m_items [Itm . Owner -> ID - 1];
+ cerr << "done item with ID = " << Itm . Owner -> ID - 1 << " i = " << (void *)i << endl;
+ if (i)
+ i -> setProgress (100);
};
/*}}}*/
@@ -184,5 +187,5 @@ void kapture::AcqStatus::IMSHit(pkgAcqui
Item *i = new Item (0, this, 0 /*previous item?*/,
QString (SizeToStr (Itm.Owner -> FileSize) . c_str ()) + QString ("B"),
- /* QString (Itm . Owner -> ID) + */ QString (Itm.Description . c_str ()));
+ /* QString (Itm . Owner -> ID) + */ QString (Itm.Description . c_str ()) + " (HIT)");
i -> setProgress (100);
// m_lastItem = i;
@@ -209,6 +212,4 @@ void kapture::AcqStatus::Fetch(pkgAcquir
return;
- cerr << "fetch called..." << endl;
-
Itm.Owner->ID = ID++;
@@ -217,4 +219,5 @@ void kapture::AcqStatus::Fetch(pkgAcquir
/* QString (Itm . Owner -> ID) + */ QString (Itm.Description . c_str ()));
m_items . push_back (i);
+ cerr << "fetch called on ID = " << ID - 1 << " i = " << (void *)i << endl;
/* cout << _("Get:") << Itm.Owner->ID << ' ' << Itm.Description;
* if (Itm.Owner->FileSize != 0)
@@ -283,13 +286,14 @@ bool kapture::AcqStatus::Pulse(pkgAcquir
pkgAcquireStatus::Pulse(Owner);
- /* XXX FIX for (pkgAcquire::Worker *I = Owner->WorkersBegin(); I != 0;
+ for (pkgAcquire::Worker *I = Owner->WorkersBegin(); I != 0;
I = Owner->WorkerStep(I))
{
if (I -> CurrentItem) {
- Item *i = m_items [I -> ID];
+ Item *i = m_items [I -> CurrentItem -> Owner -> ID - 1];
+ cerr << "refreshing item with ID = " << I -> CurrentItem -> Owner -> ID << " i = " << (void *)i << endl;
if (i)
i -> setProgress (long (double (I -> CurrentSize * 100.0) / double (I->TotalSize)));
}
- } */
+ }
KApplication::kApplication () -> processEvents ();
Reply to: