Fix a handful of FTBFS errors caused by tqStatus/Status string conversion

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/adept@1250604 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent a4c7be3bc2
commit 079be6b922

@ -29,7 +29,7 @@ using namespace std;
namespace adept {
AcqtqStatus::Item::Item (KListView *parent, pkgAcquire::ItemDesc &item, bool hit)
AcqStatus::Item::Item (KListView *parent, pkgAcquire::ItemDesc &item, bool hit)
: KListViewItem( parent )
{
m_pbcol = 0;
@ -50,19 +50,19 @@ AcqtqStatus::Item::Item (KListView *parent, pkgAcquire::ItemDesc &item, bool hit
// /* TQString (Itm . Owner -> ID) + */ TQString (Itm.Description . c_str ()));
}
AcqtqStatus::Item::~Item ()
AcqStatus::Item::~Item ()
{
delete m_prog;
}
int AcqtqStatus::Item::compare (TQListViewItem *i, int /*col*/, bool /*ascend*/) const
int AcqStatus::Item::compare (TQListViewItem *i, int /*col*/, bool /*ascend*/) const
{
int id1 = m_id;
int id2 = ((Item *) i) -> m_id;
return (id2 >= id1) - (id2 <= id1);
}
void AcqtqStatus::Item::pulse (pkgAcquire::Worker *w)
void AcqStatus::Item::pulse (pkgAcquire::Worker *w)
{
if (w) {
if (w->TotalSize)
@ -74,12 +74,12 @@ void AcqtqStatus::Item::pulse (pkgAcquire::Worker *w)
}
}
void AcqtqStatus::Item::settqStatus( const std::string &s, int i )
void AcqStatus::Item::settqStatus( const std::string &s, int i )
{
m_prog->settqStatus( s, i );
}
void AcqtqStatus::Item::paintCell (TQPainter *p, const TQColorGroup &cg,
void AcqStatus::Item::paintCell (TQPainter *p, const TQColorGroup &cg,
int column, int width, int tqalignment )
{
TQColorGroup _cg( cg );
@ -100,7 +100,7 @@ void AcqtqStatus::Item::paintCell (TQPainter *p, const TQColorGroup &cg,
}
}
AcqtqStatus::Item *AcqtqStatus::findItem (pkgAcquire::ItemDesc &Itm)
AcqStatus::Item *AcqStatus::findItem (pkgAcquire::ItemDesc &Itm)
{
if ( Itm.Owner->ID < m_idOffset )
return 0;
@ -109,7 +109,7 @@ AcqtqStatus::Item *AcqtqStatus::findItem (pkgAcquire::ItemDesc &Itm)
return m_items[ Itm.Owner->ID - m_idOffset ];
}
AcqtqStatus::AcqtqStatus(TQWidget *parent, const char *name)
AcqStatus::AcqStatus(TQWidget *parent, const char *name)
: KListView (parent, name), m_idOffset( 0 ), m_continue( true )
{
// m_lastItem = 0;
@ -122,7 +122,7 @@ AcqtqStatus::AcqtqStatus(TQWidget *parent, const char *name)
ID = 0;
}
void AcqtqStatus::Done (pkgAcquire::ItemDesc &Itm)
void AcqStatus::Done (pkgAcquire::ItemDesc &Itm)
{
Item *i = findItem (Itm);
if (i) {
@ -133,14 +133,14 @@ void AcqtqStatus::Done (pkgAcquire::ItemDesc &Itm)
KApplication::kApplication()->processEvents();
}
void AcqtqStatus::clear()
void AcqStatus::clear()
{
KListView::clear();
m_idOffset += m_items.size();
m_items.clear(); // got deleted by klistview already
}
void AcqtqStatus::Start()
void AcqStatus::Start()
{
clear();
pkgAcquireStatus::Start();
@ -151,7 +151,7 @@ void AcqtqStatus::Start()
KApplication::kApplication()->processEvents();
}
void AcqtqStatus::IMSHit(pkgAcquire::ItemDesc &Itm)
void AcqStatus::IMSHit(pkgAcquire::ItemDesc &Itm)
{
Itm.Owner->ID = ID++;
Item *i = new Item( this, Itm, true );
@ -164,7 +164,7 @@ void AcqtqStatus::IMSHit(pkgAcquire::ItemDesc &Itm)
KApplication::kApplication()->processEvents();
};
void AcqtqStatus::Fetch(pkgAcquire::ItemDesc &Itm)
void AcqStatus::Fetch(pkgAcquire::ItemDesc &Itm)
// an item started to download
{
Update = true;
@ -183,7 +183,7 @@ void AcqtqStatus::Fetch(pkgAcquire::ItemDesc &Itm)
KApplication::kApplication()->processEvents();
};
void AcqtqStatus::Fail(pkgAcquire::ItemDesc &Itm)
void AcqStatus::Fail(pkgAcquire::ItemDesc &Itm)
// item failed to download
{
kdDebug() << "fail, status = " << Itm.Owner->Status
@ -208,7 +208,7 @@ void AcqtqStatus::Fail(pkgAcquire::ItemDesc &Itm)
KApplication::kApplication()->processEvents();
};
void AcqtqStatus::Stop()
void AcqStatus::Stop()
{
pkgAcquireStatus::Stop();
emit statusChanged( StDone );
@ -216,7 +216,7 @@ void AcqtqStatus::Stop()
KApplication::kApplication()->processEvents();
}
bool AcqtqStatus::Pulse(pkgAcquire *Owner)
bool AcqStatus::Pulse(pkgAcquire *Owner)
{
pkgAcquireStatus::Pulse(Owner);
@ -248,7 +248,7 @@ bool AcqtqStatus::Pulse(pkgAcquire *Owner)
return false;
}
bool AcqtqStatus::MediaChange(string Media,string Drive)
bool AcqStatus::MediaChange(string Media,string Drive)
{
int res = KMessageBox::warningContinueCancel(
this, i18n( "Please insert the disc "
@ -261,7 +261,7 @@ bool AcqtqStatus::MediaChange(string Media,string Drive)
return true;
}
void AcqtqStatus::cancel()
void AcqStatus::cancel()
{
m_continue = false;
}
@ -271,20 +271,20 @@ AcqStatusDialog::AcqStatusDialog (TQWidget *parent, const char *name, bool modal
u8( "progress dialog (FIXME: waiting for headers, done)" ),
Ok|Cancel, Cancel, true )
{
m_status = new AcqtqStatus (this, "");
m_status = new AcqStatus (this, "");
setMainWidget( m_status.data() );
enableButton (Ok, false);
connect (m_status.data(), TQT_SIGNAL (statusChanged (AcqtqStatus::tqStatus)),
this, TQT_SLOT (statusChange (AcqtqStatus::tqStatus)));
connect (m_status.data(), TQT_SIGNAL (statusChanged (AcqStatus::tqStatus)),
this, TQT_SLOT (statusChange (AcqStatus::tqStatus)));
}
void AcqStatusDialog::statusChange (AcqtqStatus::tqStatus st)
void AcqStatusDialog::statusChange (AcqStatus::tqStatus st)
{
if (st == AcqtqStatus::StDownloading || st == AcqtqStatus::StWaiting) {
if (st == AcqStatus::StDownloading || st == AcqStatus::StWaiting) {
enableButton (Ok, false);
// XXX: cancel should be true; but needs implementation first
enableButton (Cancel, false);
} else if (st == AcqtqStatus::StDone) {
} else if (st == AcqStatus::StDone) {
enableButton (Ok, true);
enableButton (Cancel, false);
}

@ -15,7 +15,7 @@
#include <apt-pkg/acquire.h>
#include <apt-front/progresscallback.h>
class AcqtqStatus;
class AcqStatus;
class TQLabel;
class TQProgressBar;
class TQSpacer;
@ -23,7 +23,7 @@ class TQGridLayout;
namespace adept {
class AcqtqStatus : public KListView, public aptFront::ProgressCallback
class AcqStatus : public KListView, public aptFront::ProgressCallback
{
Q_OBJECT
TQ_OBJECT
@ -88,7 +88,7 @@ public:
enum tqStatus { StWaiting, StDownloading, StDone };
AcqtqStatus (TQWidget *parent, const char *name);
AcqStatus (TQWidget *parent, const char *name);
Item *findItem (pkgAcquire::ItemDesc &Itm);
virtual bool MediaChange (string Media,string Drive);
@ -107,7 +107,7 @@ public slots:
void cancel();
signals:
void statusChanged (AcqtqStatus::tqStatus st);
void statusChanged (AcqStatus::tqStatus st);
void totalProgress (int percent);
//AcqTexttqStatus(unsigned int &ScreenWidth,unsigned int Quiet);
@ -118,12 +118,12 @@ class AcqStatusDialog : public KDialogBase
Q_OBJECT
TQ_OBJECT
protected:
aptFront::SharedPtr<AcqtqStatus> m_status;
aptFront::SharedPtr<AcqStatus> m_status;
public:
aptFront::SharedPtr<aptFront::ProgressCallback> callback() { return m_status.data(); };
AcqStatusDialog (TQWidget *parent, const char *name, bool modal);
public slots:
void statusChange (AcqtqStatus::tqStatus st);
void statusChange (AcqStatus::tqStatus st);
};
}
#endif

@ -15,23 +15,23 @@ AcqProgressWidget::AcqProgressWidget( TQWidget *parent, const char *name )
m_progress->setProgress( 0 );
connect(m_status, TQT_SIGNAL( totalProgress( int ) ),
this, TQT_SLOT( setProgress( int ) ) );
connect(m_status, TQT_SIGNAL( statusChanged( AcqtqStatus::tqStatus ) ),
this, TQT_SLOT( statusChange( AcqtqStatus::tqStatus ) ) );
connect(m_status, TQT_SIGNAL( statusChanged( AcqStatus::tqStatus ) ),
this, TQT_SLOT( statusChange( AcqStatus::tqStatus ) ) );
connect( m_cancel, TQT_SIGNAL( clicked() ),
m_status, TQT_SLOT( cancel() ) );
}
void AcqProgressWidget::statusChange( AcqtqStatus::tqStatus s )
void AcqProgressWidget::statusChange( AcqStatus::tqStatus s )
{
TQString t;
switch (s) {
case AcqtqStatus::StWaiting:
case AcqStatus::StWaiting:
t = i18n( "Waiting for headers (%p%)" );
break;
case AcqtqStatus::StDownloading:
case AcqStatus::StDownloading:
t = i18n( "Downloading (%p%)" );
break;
case AcqtqStatus::StDone:
case AcqStatus::StDone:
t = i18n( "Done (%p%)" );
m_progress->setProgress( 100 );
break;

@ -19,10 +19,10 @@ public:
AcqProgressWidget (TQWidget *parent = 0, const char *name = 0);
aptFront::SharedPtr<aptFront::ProgressCallback> callback() { return m_statusRef.data(); };
public slots:
void statusChange( AcqtqStatus::tqStatus );
void statusChange( AcqStatus::tqStatus );
void setProgress( int );
protected:
aptFront::SharedPtr<AcqtqStatus> m_statusRef;
aptFront::SharedPtr<AcqStatus> m_statusRef;
};
}

@ -50,7 +50,7 @@
</widget>
<customwidgets>
<customwidget>
<class>adept::AcqtqStatus</class>
<class>adept::AcqStatus</class>
<header location="global">acqprogress.h</header>
<sizehint>
<width>-1</width>

@ -29,7 +29,7 @@ using namespace std;
namespace adept {
AcqtqStatus::Item::Item (KListView *parent, pkgAcquire::ItemDesc &item, bool hit)
AcqStatus::Item::Item (KListView *parent, pkgAcquire::ItemDesc &item, bool hit)
: KListViewItem( parent )
{
m_pbcol = 0;
@ -50,19 +50,19 @@ AcqtqStatus::Item::Item (KListView *parent, pkgAcquire::ItemDesc &item, bool hit
// /* TQString (Itm . Owner -> ID) + */ TQString (Itm.Description . c_str ()));
}
AcqtqStatus::Item::~Item ()
AcqStatus::Item::~Item ()
{
delete m_prog;
}
int AcqtqStatus::Item::compare (TQListViewItem *i, int /*col*/, bool /*ascend*/) const
int AcqStatus::Item::compare (TQListViewItem *i, int /*col*/, bool /*ascend*/) const
{
int id1 = m_id;
int id2 = ((Item *) i) -> m_id;
return (id2 >= id1) - (id2 <= id1);
}
void AcqtqStatus::Item::pulse (pkgAcquire::Worker *w)
void AcqStatus::Item::pulse (pkgAcquire::Worker *w)
{
if (w) {
if (w->TotalSize)
@ -74,12 +74,12 @@ void AcqtqStatus::Item::pulse (pkgAcquire::Worker *w)
}
}
void AcqtqStatus::Item::settqStatus( const std::string &s, int i )
void AcqStatus::Item::settqStatus( const std::string &s, int i )
{
m_prog->settqStatus( s, i );
}
void AcqtqStatus::Item::paintCell (TQPainter *p, const TQColorGroup &cg,
void AcqStatus::Item::paintCell (TQPainter *p, const TQColorGroup &cg,
int column, int width, int tqalignment )
{
TQColorGroup _cg( cg );
@ -100,7 +100,7 @@ void AcqtqStatus::Item::paintCell (TQPainter *p, const TQColorGroup &cg,
}
}
AcqtqStatus::Item *AcqtqStatus::findItem (pkgAcquire::ItemDesc &Itm)
AcqStatus::Item *AcqStatus::findItem (pkgAcquire::ItemDesc &Itm)
{
if ( Itm.Owner->ID < m_idOffset )
return 0;
@ -109,7 +109,7 @@ AcqtqStatus::Item *AcqtqStatus::findItem (pkgAcquire::ItemDesc &Itm)
return m_items[ Itm.Owner->ID - m_idOffset ];
}
AcqtqStatus::AcqtqStatus(TQWidget *parent, const char *name)
AcqStatus::AcqStatus(TQWidget *parent, const char *name)
: KListView (parent, name), m_idOffset( 0 ), m_continue( true )
{
// m_lastItem = 0;
@ -122,7 +122,7 @@ AcqtqStatus::AcqtqStatus(TQWidget *parent, const char *name)
ID = 0;
}
void AcqtqStatus::Done (pkgAcquire::ItemDesc &Itm)
void AcqStatus::Done (pkgAcquire::ItemDesc &Itm)
{
Item *i = findItem (Itm);
if (i) {
@ -133,14 +133,14 @@ void AcqtqStatus::Done (pkgAcquire::ItemDesc &Itm)
KApplication::kApplication()->processEvents();
}
void AcqtqStatus::clear()
void AcqStatus::clear()
{
KListView::clear();
m_idOffset += m_items.size();
m_items.clear(); // got deleted by klistview already
}
void AcqtqStatus::Start()
void AcqStatus::Start()
{
clear();
pkgAcquireStatus::Start();
@ -151,7 +151,7 @@ void AcqtqStatus::Start()
KApplication::kApplication()->processEvents();
}
void AcqtqStatus::IMSHit(pkgAcquire::ItemDesc &Itm)
void AcqStatus::IMSHit(pkgAcquire::ItemDesc &Itm)
{
Itm.Owner->ID = ID++;
Item *i = new Item( this, Itm, true );
@ -164,7 +164,7 @@ void AcqtqStatus::IMSHit(pkgAcquire::ItemDesc &Itm)
KApplication::kApplication()->processEvents();
};
void AcqtqStatus::Fetch(pkgAcquire::ItemDesc &Itm)
void AcqStatus::Fetch(pkgAcquire::ItemDesc &Itm)
// an item started to download
{
Update = true;
@ -183,7 +183,7 @@ void AcqtqStatus::Fetch(pkgAcquire::ItemDesc &Itm)
KApplication::kApplication()->processEvents();
};
void AcqtqStatus::Fail(pkgAcquire::ItemDesc &Itm)
void AcqStatus::Fail(pkgAcquire::ItemDesc &Itm)
// item failed to download
{
kdDebug() << "fail, status = " << Itm.Owner->tqStatus
@ -208,7 +208,7 @@ void AcqtqStatus::Fail(pkgAcquire::ItemDesc &Itm)
KApplication::kApplication()->processEvents();
};
void AcqtqStatus::Stop()
void AcqStatus::Stop()
{
pkgAcquireStatus::Stop();
emit statusChanged( StDone );
@ -216,7 +216,7 @@ void AcqtqStatus::Stop()
KApplication::kApplication()->processEvents();
}
bool AcqtqStatus::Pulse(pkgAcquire *Owner)
bool AcqStatus::Pulse(pkgAcquire *Owner)
{
pkgAcquireStatus::Pulse(Owner);
@ -248,7 +248,7 @@ bool AcqtqStatus::Pulse(pkgAcquire *Owner)
return false;
}
bool AcqtqStatus::MediaChange(string Media,string Drive)
bool AcqStatus::MediaChange(string Media,string Drive)
{
int res = KMessageBox::warningContinueCancel(
this, i18n( "Please insert the disc "
@ -261,7 +261,7 @@ bool AcqtqStatus::MediaChange(string Media,string Drive)
return true;
}
void AcqtqStatus::cancel()
void AcqStatus::cancel()
{
m_continue = false;
}
@ -271,20 +271,20 @@ AcqStatusDialog::AcqStatusDialog (TQWidget *parent, const char *name, bool modal
u8( "progress dialog (FIXME: waiting for headers, done)" ),
Ok|Cancel, Cancel, true )
{
m_status = new AcqtqStatus (this, "");
m_status = new AcqStatus (this, "");
setMainWidget( m_status.data() );
enableButton (Ok, false);
connect (m_status.data(), TQT_SIGNAL (statusChanged (AcqtqStatus::tqStatus)),
this, TQT_SLOT (statusChange (AcqtqStatus::tqStatus)));
connect (m_status.data(), TQT_SIGNAL (statusChanged (AcqStatus::tqStatus)),
this, TQT_SLOT (statusChange (AcqStatus::tqStatus)));
}
void AcqStatusDialog::statusChange (AcqtqStatus::tqStatus st)
void AcqStatusDialog::statusChange (AcqStatus::tqStatus st)
{
if (st == AcqtqStatus::StDownloading || st == AcqtqStatus::StWaiting) {
if (st == AcqStatus::StDownloading || st == AcqStatus::StWaiting) {
enableButton (Ok, false);
// XXX: cancel should be true; but needs implementation first
enableButton (Cancel, false);
} else if (st == AcqtqStatus::StDone) {
} else if (st == AcqStatus::StDone) {
enableButton (Ok, true);
enableButton (Cancel, false);
}

@ -15,7 +15,7 @@
#include <apt-pkg/acquire.h>
#include <apt-front/progresscallback.h>
class AcqtqStatus;
class AcqStatus;
class TQLabel;
class TQProgressBar;
class TQSpacer;
@ -23,7 +23,7 @@ class TQGridLayout;
namespace adept {
class AcqtqStatus : public KListView, public aptFront::ProgressCallback
class AcqStatus : public KListView, public aptFront::ProgressCallback
{
Q_OBJECT
TQ_OBJECT
@ -88,7 +88,7 @@ public:
enum tqStatus { StWaiting, StDownloading, StDone };
AcqtqStatus (TQWidget *parent, const char *name);
AcqStatus (TQWidget *parent, const char *name);
Item *findItem (pkgAcquire::ItemDesc &Itm);
virtual bool MediaChange (string Media,string Drive);
@ -107,7 +107,7 @@ public slots:
void cancel();
signals:
void statusChanged (AcqtqStatus::tqStatus st);
void statusChanged (AcqStatus::tqStatus st);
void totalProgress (int percent);
//AcqTexttqStatus(unsigned int &ScreenWidth,unsigned int Quiet);
@ -118,12 +118,12 @@ class AcqStatusDialog : public KDialogBase
Q_OBJECT
TQ_OBJECT
protected:
aptFront::SharedPtr<AcqtqStatus> m_status;
aptFront::SharedPtr<AcqStatus> m_status;
public:
aptFront::SharedPtr<aptFront::ProgressCallback> callback() { return m_status.data(); };
AcqStatusDialog (TQWidget *parent, const char *name, bool modal);
public slots:
void statusChange (AcqtqStatus::tqStatus st);
void statusChange (AcqStatus::tqStatus st);
};
}
#endif

@ -15,23 +15,23 @@ AcqProgressWidget::AcqProgressWidget( TQWidget *parent, const char *name )
m_progress->setProgress( 0 );
connect(m_status, TQT_SIGNAL( totalProgress( int ) ),
this, TQT_SLOT( setProgress( int ) ) );
connect(m_status, TQT_SIGNAL( statusChanged( AcqtqStatus::tqStatus ) ),
this, TQT_SLOT( statusChange( AcqtqStatus::tqStatus ) ) );
connect(m_status, TQT_SIGNAL( statusChanged( AcqStatus::tqStatus ) ),
this, TQT_SLOT( statusChange( AcqStatus::tqStatus ) ) );
connect( m_cancel, TQT_SIGNAL( clicked() ),
m_status, TQT_SLOT( cancel() ) );
}
void AcqProgressWidget::statusChange( AcqtqStatus::tqStatus s )
void AcqProgressWidget::statusChange( AcqStatus::tqStatus s )
{
TQString t;
switch (s) {
case AcqtqStatus::StWaiting:
case AcqStatus::StWaiting:
t = i18n( "Waiting for headers (%p%)" );
break;
case AcqtqStatus::StDownloading:
case AcqStatus::StDownloading:
t = i18n( "Downloading (%p%)" );
break;
case AcqtqStatus::StDone:
case AcqStatus::StDone:
t = i18n( "Done (%p%)" );
m_progress->setProgress( 100 );
break;

@ -19,10 +19,10 @@ public:
AcqProgressWidget (TQWidget *parent = 0, const char *name = 0);
aptFront::SharedPtr<aptFront::ProgressCallback> callback() { return m_statusRef.data(); };
public slots:
void statusChange( AcqtqStatus::tqStatus );
void statusChange( AcqStatus::tqStatus );
void setProgress( int );
protected:
aptFront::SharedPtr<AcqtqStatus> m_statusRef;
aptFront::SharedPtr<AcqStatus> m_statusRef;
};
}

@ -50,7 +50,7 @@
</widget>
<customwidgets>
<customwidget>
<class>adept::AcqtqStatus</class>
<class>adept::AcqStatus</class>
<header location="global">acqprogress.h</header>
<sizehint>
<width>-1</width>

Loading…
Cancel
Save