Rename old tq methods that no longer need a unique name

pull/1/head
Timothy Pearson 13 years ago
parent 42a9872891
commit a90eb215f5

@ -77,7 +77,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>16</height> <height>16</height>

@ -108,7 +108,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>148</width> <width>148</width>
<height>20</height> <height>20</height>
@ -223,7 +223,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>111</width> <width>111</width>
<height>20</height> <height>20</height>
@ -283,7 +283,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>111</width> <width>111</width>
<height>20</height> <height>20</height>
@ -405,7 +405,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
@ -459,7 +459,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>41</width> <width>41</width>
<height>20</height> <height>20</height>
@ -553,7 +553,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>383</width> <width>383</width>
<height>20</height> <height>20</height>
@ -601,7 +601,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>81</width> <width>81</width>
<height>20</height> <height>20</height>
@ -622,7 +622,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>30</height> <height>30</height>

@ -69,7 +69,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
@ -246,7 +246,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>10</width> <width>10</width>
<height>20</height> <height>20</height>
@ -273,7 +273,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>191</width> <width>191</width>
<height>20</height> <height>20</height>
@ -290,7 +290,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>207</width> <width>207</width>
<height>20</height> <height>20</height>
@ -380,7 +380,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
@ -594,7 +594,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>208</width> <width>208</width>
<height>20</height> <height>20</height>
@ -611,7 +611,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>208</width> <width>208</width>
<height>20</height> <height>20</height>
@ -628,7 +628,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>208</width> <width>208</width>
<height>20</height> <height>20</height>
@ -697,7 +697,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>

@ -217,9 +217,9 @@ void FileSelectDlg::updateSizeLabels()
lblRequired->setText(kt::BytesToString(bytes_to_download)); lblRequired->setText(kt::BytesToString(bytes_to_download));
if (bytes_to_download > bytes_free) if (bytes_to_download > bytes_free)
lbltqStatus->setText("<font color=\"#ff0000\">" + kt::BytesToString(-1*(long long)(bytes_free - bytes_to_download)) + i18n(" short!")); lblStatus->setText("<font color=\"#ff0000\">" + kt::BytesToString(-1*(long long)(bytes_free - bytes_to_download)) + i18n(" short!"));
else else
lbltqStatus->setText(kt::BytesToString(bytes_free - bytes_to_download)); lblStatus->setText(kt::BytesToString(bytes_free - bytes_to_download));
} }
void FileSelectDlg::treeItemChanged() void FileSelectDlg::treeItemChanged()

@ -207,7 +207,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>135</height> <height>135</height>
@ -237,7 +237,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Preferred</enum> <enum>Preferred</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
@ -298,7 +298,7 @@
</widget> </widget>
<widget class="TQLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>lbltqStatus</cstring> <cstring>lblStatus</cstring>
</property> </property>
</widget> </widget>
</vbox> </vbox>
@ -315,7 +315,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>220</width> <width>220</width>
<height>20</height> <height>20</height>

@ -29,7 +29,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>50</height> <height>50</height>
@ -142,7 +142,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>

@ -73,7 +73,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Fixed</enum> <enum>Fixed</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
@ -144,7 +144,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Fixed</enum> <enum>Fixed</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
@ -192,7 +192,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Fixed</enum> <enum>Fixed</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>16</height> <height>16</height>
@ -234,7 +234,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>30</height> <height>30</height>

@ -30,7 +30,7 @@
using namespace bt; using namespace bt;
using namespace kt; using namespace kt;
/* /*
static TQString StatusToString(TorrentInterface* tc,TorrenttqStatus s) static TQString StatusToString(TorrentInterface* tc,TorrentStatus s)
{ {
switch (s) switch (s)
{ {
@ -55,7 +55,7 @@ static TQString StatusToString(TorrentInterface* tc,TorrenttqStatus s)
} }
*/ */
static TQColor StatusToColor(TorrenttqStatus s,const TQColorGroup & cg) static TQColor StatusToColor(TorrentStatus s,const TQColorGroup & cg)
{ {
TQColor green(40,205,40); TQColor green(40,205,40);
TQColor yellow(255,174,0); TQColor yellow(255,174,0);

@ -91,7 +91,7 @@ static void WriteLeakReport()
fclose(report); fclose(report);
} }
static void PrinttqStatus() static void PrintStatus()
{ {
if (mtree.count == 0) if (mtree.count == 0)
{ {
@ -124,7 +124,7 @@ static void RegisterAlloc(void* ptr,Uint32 size)
for (Uint32 b = 0;b < SOME_PRIME;b++) for (Uint32 b = 0;b < SOME_PRIME;b++)
mtree.buckets[b] = 0; mtree.buckets[b] = 0;
mtree.num_buckets = SOME_PRIME; mtree.num_buckets = SOME_PRIME;
atexit(PrinttqStatus); atexit(PrintStatus);
} }
// hash the address // hash the address

@ -49,8 +49,8 @@ Button::Button(ButtonBar *parent, const TQString text, const TQIconSet &icon,
setToggleButton(true); setToggleButton(true);
setFocusPolicy(TQ_NoFocus); setFocusPolicy(TQ_NoFocus);
setDescription(m_description); setDescription(m_description);
tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum); setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum);
resize(tqsizeHint()); resize(sizeHint());
fixDimensions(Ideal::Bottom); fixDimensions(Ideal::Bottom);
TQToolTip::add(this, m_realText); TQToolTip::add(this, m_realText);
@ -131,11 +131,11 @@ void Button::drawButton(TQPainter *p)
pm.fill(eraseColor()); pm.fill(eraseColor());
TQPainter p2(&pm); TQPainter p2(&pm);
tqstyle().tqdrawControl(TQStyle::CE_PushButton,&p2,this, TQRect(0,0,pm.width(),pm.height()), tqcolorGroup(),flags); tqstyle().drawControl(TQStyle::CE_PushButton,&p2,this, TQRect(0,0,pm.width(),pm.height()), colorGroup(),flags);
tqstyle().tqdrawControl(TQStyle::CE_PushButtonLabel, &p2, this, tqstyle().drawControl(TQStyle::CE_PushButtonLabel, &p2, this,
TQRect(0,0,pm.width(),pm.height()), TQRect(0,0,pm.width(),pm.height()),
tqcolorGroup(), flags, TQStyleOption()); colorGroup(), flags, TQStyleOption());
switch (m_place) switch (m_place)
{ {
@ -178,7 +178,7 @@ void Button::fixDimensions(Place oldPlace)
if ((oldPlace == Ideal::Bottom) || (oldPlace == Ideal::Top)) if ((oldPlace == Ideal::Bottom) || (oldPlace == Ideal::Top))
{ {
setFixedWidth(height()); setFixedWidth(height());
setMinimumHeight(tqsizeHint().width()); setMinimumHeight(sizeHint().width());
setMaximumHeight(32767); setMaximumHeight(32767);
} }
break; break;
@ -187,19 +187,19 @@ void Button::fixDimensions(Place oldPlace)
if ((oldPlace == Ideal::Left) || (oldPlace == Ideal::Right)) if ((oldPlace == Ideal::Left) || (oldPlace == Ideal::Right))
{ {
setFixedHeight(width()); setFixedHeight(width());
setMinimumWidth(tqsizeHint().height()); setMinimumWidth(sizeHint().height());
setMaximumWidth(32767); setMaximumWidth(32767);
} }
break; break;
} }
} }
TQSize Button::tqsizeHint() const TQSize Button::sizeHint() const
{ {
return tqsizeHint(text()); return sizeHint(text());
} }
TQSize Button::tqsizeHint(const TQString &text) const TQSize Button::sizeHint(const TQString &text) const
{ {
constPolish(); constPolish();
int w = 0, h = 0; int w = 0, h = 0;
@ -211,7 +211,7 @@ TQSize Button::tqsizeHint(const TQString &text) const
h = TQMAX( h, ih ); h = TQMAX( h, ih );
} }
if ( isMenuButton() ) if ( isMenuButton() )
w += tqstyle().tqpixelMetric(TQStyle::PM_MenuButtonIndicator, this); w += tqstyle().pixelMetric(TQStyle::PM_MenuButtonIndicator, this);
if ( pixmap() ) { if ( pixmap() ) {
TQPixmap *pm = (TQPixmap *)pixmap(); TQPixmap *pm = (TQPixmap *)pixmap();
w += pm->width(); w += pm->width();
@ -220,7 +220,7 @@ TQSize Button::tqsizeHint(const TQString &text) const
TQString s( text ); TQString s( text );
bool empty = s.isEmpty(); bool empty = s.isEmpty();
if ( empty ) if ( empty )
s = TQString::tqfromLatin1("XXXX"); s = TQString::fromLatin1("XXXX");
TQFontMetrics fm = fontMetrics(); TQFontMetrics fm = fontMetrics();
TQSize sz = fm.size( ShowPrefix, s ); TQSize sz = fm.size( ShowPrefix, s );
if(!empty || !w) if(!empty || !w)
@ -239,12 +239,12 @@ void Button::updateSize()
{ {
case Ideal::Left: case Ideal::Left:
case Ideal::Right: case Ideal::Right:
setMinimumHeight(tqsizeHint().width()); setMinimumHeight(sizeHint().width());
resize(tqsizeHint().height(), tqsizeHint().width()); resize(sizeHint().height(), sizeHint().width());
break; break;
case Ideal::Top: case Ideal::Top:
case Ideal::Bottom: case Ideal::Bottom:
resize(tqsizeHint().width(), tqsizeHint().height()); resize(sizeHint().width(), sizeHint().height());
break; break;
} }
} }

@ -54,8 +54,8 @@ public:
/**Sets the mode of a button.*/ /**Sets the mode of a button.*/
void setMode(Ideal::ButtonMode mode); void setMode(Ideal::ButtonMode mode);
TQSize tqsizeHint() const; TQSize sizeHint() const;
TQSize tqsizeHint(const TQString &text) const; TQSize sizeHint(const TQString &text) const;
/**Updates size of a widget. Used after squeezing button's text.*/ /**Updates size of a widget. Used after squeezing button's text.*/
void updateSize(); void updateSize();

@ -37,9 +37,9 @@ ButtonLayout::ButtonLayout(ButtonBar *parent, Direction d, int margin, int spaci
{ {
} }
TQSize ButtonLayout::tqminimumSize() const TQSize ButtonLayout::minimumSize() const
{ {
TQSize size = TQBoxLayout::tqminimumSize(); TQSize size = TQBoxLayout::minimumSize();
if (!m_buttonBar->autoResize()) if (!m_buttonBar->autoResize())
return size; return size;
@ -54,7 +54,7 @@ TQSize ButtonLayout::tqminimumSize() const
case Ideal::Bottom: case Ideal::Bottom:
return TQSize(0,size.height()); return TQSize(0,size.height());
} }
return TQBoxLayout::tqminimumSize(); return TQBoxLayout::minimumSize();
} }
@ -128,14 +128,14 @@ void ButtonBar::fixDimensions()
{ {
case Ideal::Left: case Ideal::Left:
case Ideal::Right: case Ideal::Right:
setFixedWidth(tqsizeHint().width()); setFixedWidth(sizeHint().width());
setMinimumHeight(tqsizeHint().height()); setMinimumHeight(sizeHint().height());
setMaximumHeight(32767); setMaximumHeight(32767);
break; break;
case Ideal::Top: case Ideal::Top:
case Ideal::Bottom: case Ideal::Bottom:
setFixedHeight(tqsizeHint().height()); setFixedHeight(sizeHint().height());
setMinimumWidth(tqsizeHint().width()); setMinimumWidth(sizeHint().width());
setMaximumWidth(32767); setMaximumWidth(32767);
break; break;
} }
@ -156,13 +156,13 @@ void ButtonBar::resizeEvent(TQResizeEvent *ev)
{ {
case Ideal::Left: case Ideal::Left:
case Ideal::Right: case Ideal::Right:
preferredDimension = l->TQBoxLayout::tqminimumSize().height(); preferredDimension = l->TQBoxLayout::minimumSize().height();
actualDimension = size().height(); actualDimension = size().height();
oldDimension = ev->oldSize().height(); oldDimension = ev->oldSize().height();
break; break;
case Ideal::Top: case Ideal::Top:
case Ideal::Bottom: case Ideal::Bottom:
preferredDimension = l->TQBoxLayout::tqminimumSize().width(); preferredDimension = l->TQBoxLayout::minimumSize().width();
actualDimension = size().width(); actualDimension = size().width();
oldDimension = ev->oldSize().width(); oldDimension = ev->oldSize().width();
break; break;
@ -285,7 +285,7 @@ int ButtonBar::originalDimension()
int size = 0; int size = 0;
for (ButtonList::const_iterator it = m_buttons.constBegin(); it != m_buttons.constEnd(); ++it) for (ButtonList::const_iterator it = m_buttons.constBegin(); it != m_buttons.constEnd(); ++it)
{ {
size += (*it)->tqsizeHint((*it)->realText()).width(); size += (*it)->sizeHint((*it)->realText()).width();
} }
return size; return size;
} }

@ -34,12 +34,12 @@ class ButtonBar;
/**@short A tqlayout for a ButtonBar class. /**@short A tqlayout for a ButtonBar class.
Overrides tqminimumSize method to allow shrinking button bar buttons.*/ Overrides minimumSize method to allow shrinking button bar buttons.*/
class ButtonLayout: public TQBoxLayout{ class ButtonLayout: public TQBoxLayout{
public: public:
ButtonLayout(ButtonBar *parent, Direction d, int margin = 0, int spacing = -1, const char * name = 0); ButtonLayout(ButtonBar *parent, Direction d, int margin = 0, int spacing = -1, const char * name = 0);
virtual TQSize tqminimumSize() const; virtual TQSize minimumSize() const;
private: private:
ButtonBar *m_buttonBar; ButtonBar *m_buttonBar;

@ -119,9 +119,9 @@ void DDockWindow::setVisible(bool v)
if (!m_visible) if (!m_visible)
{ {
if (m_position == DDockWindow::Bottom) if (m_position == DDockWindow::Bottom)
setFixedExtentHeight(m_internalLayout->tqsizeHint().height()); setFixedExtentHeight(m_internalLayout->sizeHint().height());
else else
setFixedExtentWidth(m_internalLayout->tqsizeHint().width()); setFixedExtentWidth(m_internalLayout->sizeHint().width());
emit hidden(); emit hidden();
} }
else else
@ -130,12 +130,12 @@ void DDockWindow::setVisible(bool v)
int size = 0; int size = 0;
if (m_position == DDockWindow::Bottom) if (m_position == DDockWindow::Bottom)
{ {
size = config->readNumEntry("ViewWidth", m_internalLayout->tqminimumSize().height()); size = config->readNumEntry("ViewWidth", m_internalLayout->minimumSize().height());
setFixedExtentHeight(size); setFixedExtentHeight(size);
} }
else else
{ {
size = config->readNumEntry("ViewWidth", m_internalLayout->tqminimumSize().width()); size = config->readNumEntry("ViewWidth", m_internalLayout->minimumSize().width());
setFixedExtentWidth(size); setFixedExtentWidth(size);
} }
} }
@ -338,7 +338,7 @@ bool DDockWindow::isActive()
{ {
if (m_toggledButton) if (m_toggledButton)
{ {
TQWidget *w = tqApp->tqfocusWidget(); TQWidget *w = tqApp->focusWidget();
if (!w) if (!w)
return false; return false;
TQWidget *toolWidget = m_widgets[m_toggledButton]; TQWidget *toolWidget = m_widgets[m_toggledButton];

@ -189,7 +189,7 @@ DTabWidget *DMainWindow::splitVertical()
void DMainWindow::invalidateActiveTabWidget() void DMainWindow::invalidateActiveTabWidget()
{ {
/* TQWidget *focused = m_central->tqfocusWidget(); /* TQWidget *focused = m_central->focusWidget();
kdDebug(9000) << "tqinvalidate: " << focused << endl; kdDebug(9000) << "tqinvalidate: " << focused << endl;
if (focused == 0) if (focused == 0)
return; return;

@ -113,7 +113,7 @@ void DockSplitter::removeDock(uint row, uint col, bool alsoDelete)
w->hide(); w->hide();
} }
m_splitters[row]->setMinimumSize(m_splitters[row]->tqminimumSizeHint()); m_splitters[row]->setMinimumSize(m_splitters[row]->minimumSizeHint());
if (isRowEmpty(row)) if (isRowEmpty(row))
{ {

@ -20,7 +20,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>0</height> <height>0</height>
@ -64,7 +64,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>400</width> <width>400</width>
<height>0</height> <height>0</height>
@ -91,7 +91,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>297</width> <width>297</width>
<height>20</height> <height>20</height>

@ -123,7 +123,7 @@ QueueDialog::QueueDialog(bt::QueueManager* qm, TQWidget *parent, const char *nam
for( ; it != qman->end(); ++it) for( ; it != qman->end(); ++it)
{ {
TorrentInterface* tc = *it; TorrentInterface* tc = *it;
TorrenttqStatus ts = tc->getStats().status; TorrentStatus ts = tc->getStats().status;
if(ts == kt::SEEDING || ts == kt::DOWNLOAD_COMPLETE || if(ts == kt::SEEDING || ts == kt::DOWNLOAD_COMPLETE ||
ts == kt::SEEDING_COMPLETE || tc->getStats().completed) ts == kt::SEEDING_COMPLETE || tc->getStats().completed)
@ -288,7 +288,7 @@ void QueueDialog::downloadList_currentChanged(TQListViewItem* item)
{ {
if(!item) if(!item)
{ {
dltqStatus->clear(); dlStatus->clear();
dlTracker->clear(); dlTracker->clear();
dlRatio->clear(); dlRatio->clear();
dlDHT->clear(); dlDHT->clear();
@ -298,7 +298,7 @@ void QueueDialog::downloadList_currentChanged(TQListViewItem* item)
const TorrentInterface* tc = ((QueueItem*)item)->getTC(); const TorrentInterface* tc = ((QueueItem*)item)->getTC();
TorrentStats s = tc->getStats(); TorrentStats s = tc->getStats();
dltqStatus->setText(tc->statusToString()); dlStatus->setText(tc->statusToString());
dlTracker->setText(tc->getTrackersList()->getTrackerURL().prettyURL()); dlTracker->setText(tc->getTrackersList()->getTrackerURL().prettyURL());
dlRatio->setText(TQString("%1").tqarg((float)s.bytes_uploaded / s.bytes_downloaded,0,'f',2)); dlRatio->setText(TQString("%1").tqarg((float)s.bytes_uploaded / s.bytes_downloaded,0,'f',2));
dlBytes->setText(BytesToString(s.bytes_left_to_download)); dlBytes->setText(BytesToString(s.bytes_left_to_download));
@ -309,7 +309,7 @@ void QueueDialog::seedList_currentChanged(TQListViewItem* item)
{ {
if(!item) if(!item)
{ {
ultqStatus->clear(); ulStatus->clear();
ulTracker->clear(); ulTracker->clear();
ulRatio->clear(); ulRatio->clear();
ulDHT->clear(); ulDHT->clear();
@ -319,7 +319,7 @@ void QueueDialog::seedList_currentChanged(TQListViewItem* item)
const TorrentInterface* tc = ((QueueItem*)item)->getTC(); const TorrentInterface* tc = ((QueueItem*)item)->getTC();
TorrentStats s = tc->getStats(); TorrentStats s = tc->getStats();
ultqStatus->setText(tc->statusToString()); ulStatus->setText(tc->statusToString());
ulTracker->setText(tc->getTrackersList()->getTrackerURL().prettyURL()); ulTracker->setText(tc->getTrackersList()->getTrackerURL().prettyURL());
ulRatio->setText(TQString("%1").tqarg((float)s.bytes_uploaded / s.bytes_downloaded,0,'f',2)); ulRatio->setText(TQString("%1").tqarg((float)s.bytes_uploaded / s.bytes_downloaded,0,'f',2));
ulBytes->setText(BytesToString(s.bytes_uploaded)); ulBytes->setText(BytesToString(s.bytes_uploaded));

@ -129,7 +129,7 @@
</property> </property>
<widget class="TQLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>dltqStatus</cstring> <cstring>dlStatus</cstring>
</property> </property>
<property name="text"> <property name="text">
<string></string> <string></string>
@ -345,7 +345,7 @@
</property> </property>
<widget class="TQLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>ultqStatus</cstring> <cstring>ulStatus</cstring>
</property> </property>
<property name="text"> <property name="text">
<string></string> <string></string>
@ -416,7 +416,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Preferred</enum> <enum>Preferred</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
@ -452,7 +452,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Preferred</enum> <enum>Preferred</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
@ -471,7 +471,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>30</height> <height>30</height>
@ -504,7 +504,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
@ -540,7 +540,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Preferred</enum> <enum>Preferred</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
@ -573,7 +573,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>

@ -84,7 +84,7 @@
<property name="name"> <property name="name">
<cstring>m_chunks_found</cstring> <cstring>m_chunks_found</cstring>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>100</width>
<height>0</height> <height>0</height>
@ -104,7 +104,7 @@
<property name="name"> <property name="name">
<cstring>m_chunks_failed</cstring> <cstring>m_chunks_failed</cstring>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>100</width>
<height>0</height> <height>0</height>
@ -164,7 +164,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>181</width> <width>181</width>
<height>20</height> <height>20</height>

@ -141,7 +141,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>121</width> <width>121</width>
<height>20</height> <height>20</height>

@ -148,7 +148,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>21</width> <width>21</width>
<height>20</height> <height>20</height>
@ -233,7 +233,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
@ -372,7 +372,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Maximum</enum> <enum>Maximum</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
@ -422,7 +422,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>40</height> <height>40</height>

@ -114,7 +114,7 @@ void TrayHoverPopup::create()
hb->setSpacing(KDialog::spacingHint()); hb->setSpacing(KDialog::spacingHint());
TQLabel* pix_lbl = new TQLabel(hb,"title_icon"); TQLabel* pix_lbl = new TQLabel(hb,"title_icon");
pix_lbl->setPixmap(pix); pix_lbl->setPixmap(pix);
pix_lbl->tqsetAlignment(AlignLeft); pix_lbl->setAlignment(AlignLeft);
} }
@ -122,13 +122,13 @@ void TrayHoverPopup::create()
TQFont fnt = title->font(); TQFont fnt = title->font();
fnt.setBold( true ); fnt.setBold( true );
title->setFont( fnt ); title->setFont( fnt );
title->tqsetAlignment( TQt::AlignHCenter ); title->setAlignment( TQt::AlignHCenter );
if ( hb ) if ( hb )
hb->setStretchFactor(title, 10 ); // enforce centering hb->setStretchFactor(title, 10 ); // enforce centering
// text will be filled later // text will be filled later
text = new TQLabel( "Dummy", vb, "msg_label" ); text = new TQLabel( "Dummy", vb, "msg_label" );
text->tqsetAlignment( AlignLeft ); text->setAlignment( AlignLeft );
setView(vb); setView(vb);
} }

@ -39,7 +39,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>61</width> <width>61</width>
<height>20</height> <height>20</height>

@ -45,7 +45,7 @@ Index: estimation-scripts/enable-logging.diff
-+ { -+ {
-+ if(!started) -+ if(!started)
-+ { -+ {
-+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::tqcurrentDateTime().toTime_t() << "," << tc->getDownloadRate() << "," << tc->getBytesDownloaded() << "," << tc->getBytesLeft() << "," << tc->getNumPeers() << ",ACTIVATED" << endl; -+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::currentDateTime().toTime_t() << "," << tc->getDownloadRate() << "," << tc->getBytesDownloaded() << "," << tc->getBytesLeft() << "," << tc->getNumPeers() << ",ACTIVATED" << endl;
-+ tmpLog = false; -+ tmpLog = false;
-+ started = true; -+ started = true;
-+ toLog = true; -+ toLog = true;
@ -56,7 +56,7 @@ Index: estimation-scripts/enable-logging.diff
-+ { -+ {
-+ if(started) -+ if(started)
-+ { -+ {
-+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::tqcurrentDateTime().toTime_t() << "," << tc->getDownloadRate() << "," << tc->getBytesDownloaded() << "," << tc->getBytesLeft() << "," << tc->getNumPeers() << ",DEACTIVATED" <<endl; -+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::currentDateTime().toTime_t() << "," << tc->getDownloadRate() << "," << tc->getBytesDownloaded() << "," << tc->getBytesLeft() << "," << tc->getNumPeers() << ",DEACTIVATED" <<endl;
-+ tmpLog = false; -+ tmpLog = false;
-+ started = false; -+ started = false;
-+ } -+ }
@ -71,7 +71,7 @@ Index: estimation-scripts/enable-logging.diff
- if (tc->getBytesLeft() == 0) - if (tc->getBytesLeft() == 0)
- { - {
-+ if(toLog && tmpLog) -+ if(toLog && tmpLog)
-+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::tqcurrentDateTime().toTime_t() << "," << tc->getDownloadRate() << "," << tc->getBytesDownloaded() << "," << 0 << "," << tc->getNumPeers() << ",FINISHED" << endl; -+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::currentDateTime().toTime_t() << "," << tc->getDownloadRate() << "," << tc->getBytesDownloaded() << "," << 0 << "," << tc->getNumPeers() << ",FINISHED" << endl;
-+ toLog = false; -+ toLog = false;
-+ -+
- setText(7,i18n("finished")); - setText(7,i18n("finished"));
@ -83,13 +83,13 @@ Index: estimation-scripts/enable-logging.diff
- if (tc->getDownloadRate() == 0) - if (tc->getDownloadRate() == 0)
-+ { -+ {
-+ if(toLog && tmpLog) -+ if(toLog && tmpLog)
-+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::tqcurrentDateTime().toTime_t() << "," << 0 << "," << tc->getBytesDownloaded() << "," << tc->getBytesLeft() << "," << tc->getNumPeers() << ",RUNNING" << endl; -+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::currentDateTime().toTime_t() << "," << 0 << "," << tc->getBytesDownloaded() << "," << tc->getBytesLeft() << "," << tc->getNumPeers() << ",RUNNING" << endl;
- setText(7,i18n("infinity")); - setText(7,i18n("infinity"));
-+ } -+ }
- else - else
- { - {
-+ if(toLog && tmpLog) -+ if(toLog && tmpLog)
-+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::tqcurrentDateTime().toTime_t() << "," << tc->getDownloadRate() << "," << tc->getBytesDownloaded() << "," << tc->getBytesLeft() << "," << tc->getNumPeers() << ",RUNNING" << endl; -+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::currentDateTime().toTime_t() << "," << tc->getDownloadRate() << "," << tc->getBytesDownloaded() << "," << tc->getBytesLeft() << "," << tc->getNumPeers() << ",RUNNING" << endl;
-+ -+
- Uint32 secs = (int)floor( (float)tc->getBytesLeft() / (float)tc->getDownloadRate() ); - Uint32 secs = (int)floor( (float)tc->getBytesLeft() / (float)tc->getDownloadRate() );
- QTime t; - QTime t;
@ -155,7 +155,7 @@ Index: apps/ktorrent/ktorrentviewitem.cpp
+ { + {
+ if(!started) + if(!started)
+ { + {
+ Out() << "{" << s.torrent_name << "}," << QDateTime::tqcurrentDateTime().toTime_t() << "," << s.download_rate << "," << s.bytes_downloaded << "," << s.bytes_left << "," << s.num_peers << ",ACTIVATED" << endl; + Out() << "{" << s.torrent_name << "}," << QDateTime::currentDateTime().toTime_t() << "," << s.download_rate << "," << s.bytes_downloaded << "," << s.bytes_left << "," << s.num_peers << ",ACTIVATED" << endl;
+ tmpLog = false; + tmpLog = false;
+ started = true; + started = true;
+ toLog = true; + toLog = true;
@ -166,7 +166,7 @@ Index: apps/ktorrent/ktorrentviewitem.cpp
+ { + {
+ if(started) + if(started)
+ { + {
+ Out() << "{" << s.torrent_name << "}," << QDateTime::tqcurrentDateTime().toTime_t() << "," << s.download_rate << "," << s.bytes_downloaded << "," << s.bytes_left << "," << s.num_peers << ",DEACTIVATED" <<endl; + Out() << "{" << s.torrent_name << "}," << QDateTime::currentDateTime().toTime_t() << "," << s.download_rate << "," << s.bytes_downloaded << "," << s.bytes_left << "," << s.num_peers << ",DEACTIVATED" <<endl;
+ tmpLog = false; + tmpLog = false;
+ started = false; + started = false;
+ } + }
@ -182,7 +182,7 @@ Index: apps/ktorrent/ktorrentviewitem.cpp
if (s.bytes_left == 0) if (s.bytes_left == 0)
{ {
+ if(toLog && tmpLog) + if(toLog && tmpLog)
+ Out() << "{" << s.torrent_name << "}," << QDateTime::tqcurrentDateTime().toTime_t() << "," << s.download_rate << "," << s.bytes_downloaded << "," << 0 << "," << s.num_peers << ",FINISHED" << endl; + Out() << "{" << s.torrent_name << "}," << QDateTime::currentDateTime().toTime_t() << "," << s.download_rate << "," << s.bytes_downloaded << "," << 0 << "," << s.num_peers << ",FINISHED" << endl;
+ toLog = false; + toLog = false;
+ +
+ +
@ -195,14 +195,14 @@ Index: apps/ktorrent/ktorrentviewitem.cpp
if (s.download_rate == 0) if (s.download_rate == 0)
+ { + {
+ if(toLog && tmpLog) + if(toLog && tmpLog)
+ Out() << "{" << s.torrent_name << "}," << QDateTime::tqcurrentDateTime().toTime_t() << "," << 0 << "," << s.bytes_downloaded << "," << s.bytes_left << "," << s.num_peers << ",RUNNING" << endl; + Out() << "{" << s.torrent_name << "}," << QDateTime::currentDateTime().toTime_t() << "," << 0 << "," << s.bytes_downloaded << "," << s.bytes_left << "," << s.num_peers << ",RUNNING" << endl;
+ +
setText(7,i18n("infinity")); setText(7,i18n("infinity"));
+ } + }
else else
{ {
+ if(toLog && tmpLog) + if(toLog && tmpLog)
+ Out() << "{" << s.torrent_name << "}," << QDateTime::tqcurrentDateTime().toTime_t() << "," << s.download_rate << "," << s.bytes_downloaded << "," << s.bytes_left << "," << s.num_peers << ",RUNNING" << endl; + Out() << "{" << s.torrent_name << "}," << QDateTime::currentDateTime().toTime_t() << "," << s.download_rate << "," << s.bytes_downloaded << "," << s.bytes_left << "," << s.num_peers << ",RUNNING" << endl;
+ +
Uint32 secs = (int)floor( (float)s.bytes_left / (float)s.download_rate); Uint32 secs = (int)floor( (float)s.bytes_left / (float)s.download_rate);
setText(7,DurationToString(secs)); setText(7,DurationToString(secs));

@ -44,7 +44,7 @@ namespace kt
class TorrentFileInterface; class TorrentFileInterface;
class PeerSource; class PeerSource;
enum TorrenttqStatus enum TorrentStatus
{ {
NOT_STARTED, NOT_STARTED,
SEEDING_COMPLETE, SEEDING_COMPLETE,
@ -118,8 +118,8 @@ namespace kt
Uint32 leechers_total; Uint32 leechers_total;
/// Num leechers connected to /// Num leechers connected to
Uint32 leechers_connected_to; Uint32 leechers_connected_to;
/// tqStatus of the download /// Status of the download
TorrenttqStatus status; TorrentStatus status;
/// The status of the tracker /// The status of the tracker
TQString trackerstatus; TQString trackerstatus;
/// The number of bytes downloaded in this session /// The number of bytes downloaded in this session

@ -184,11 +184,11 @@ namespace kt
selected = 0; selected = 0;
// update odd status of each item // update odd status of each item
updateOddtqStatus(); updateOddStatus();
} }
} }
void LabelView::updateOddtqStatus() void LabelView::updateOddStatus()
{ {
bool odd = true; bool odd = true;
LabelViewItr i = items.begin(); LabelViewItr i = items.begin();
@ -250,7 +250,7 @@ namespace kt
{ {
items.sort(LabelViewItemCmp()); items.sort(LabelViewItemCmp());
item_box->sorted(items); item_box->sorted(items);
updateOddtqStatus(); updateOddStatus();
} }
} }

@ -110,7 +110,7 @@ namespace kt
void onItemClicked(LabelViewItem* it); void onItemClicked(LabelViewItem* it);
private: private:
void updateOddtqStatus(); void updateOddStatus();
signals: signals:
/// The current item has changed /// The current item has changed

@ -23,7 +23,7 @@
<property name="name"> <property name="name">
<cstring>icon_lbl</cstring> <cstring>icon_lbl</cstring>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>64</width> <width>64</width>
<height>64</height> <height>64</height>

@ -82,7 +82,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>31</height> <height>31</height>

@ -37,7 +37,7 @@ namespace bt
clear(); clear();
} }
void Chunk::setData(Uint8* d,tqStatus nstatus) void Chunk::setData(Uint8* d,Status nstatus)
{ {
clear(); clear();
status = nstatus; status = nstatus;

@ -45,7 +45,7 @@ namespace bt
Chunk(unsigned int index,Uint32 size); Chunk(unsigned int index,Uint32 size);
~Chunk(); ~Chunk();
enum tqStatus enum Status
{ {
MMAPPED, MMAPPED,
BUFFERED, BUFFERED,
@ -54,13 +54,13 @@ namespace bt
}; };
/// Get the chunks status. /// Get the chunks status.
tqStatus gettqStatus() const; Status getStatus() const;
/** /**
* Set the chunks status * Set the chunks status
* @param s * @param s
*/ */
void settqStatus(tqStatus s); void setStatus(Status s);
/// Get the data /// Get the data
const Uint8* getData() const; const Uint8* getData() const;
@ -69,7 +69,7 @@ namespace bt
Uint8* getData(); Uint8* getData();
/// Set the data and the new status /// Set the data and the new status
void setData(Uint8* d,tqStatus nstatus); void setData(Uint8* d,Status nstatus);
/// Clear the chunk (delete data depending on the mode) /// Clear the chunk (delete data depending on the mode)
void clear(); void clear();
@ -118,7 +118,7 @@ namespace bt
virtual void unmapped(); virtual void unmapped();
private: private:
tqStatus status; Status status;
Uint32 index; Uint32 index;
Uint8* data; Uint8* data;
Uint32 size; Uint32 size;
@ -126,12 +126,12 @@ namespace bt
Priority priority; Priority priority;
}; };
inline Chunk::tqStatus Chunk::gettqStatus() const inline Chunk::Status Chunk::getStatus() const
{ {
return status; return status;
} }
inline void Chunk::settqStatus(Chunk::tqStatus s) inline void Chunk::setStatus(Chunk::Status s)
{ {
status = s; status = s;
} }

@ -35,17 +35,17 @@
namespace bt namespace bt
{ {
class DownloadtqStatus : public std::set<Uint32> class DownloadStatus : public std::set<Uint32>
{ {
public: public:
// typedef std::set<Uint32>::iterator iterator; // typedef std::set<Uint32>::iterator iterator;
DownloadtqStatus() DownloadStatus()
{ {
} }
~DownloadtqStatus() ~DownloadStatus()
{ {
} }
@ -111,7 +111,7 @@ namespace bt
return false; return false;
DownloadtqStatus* ds = dstatus.find(p.getPeer()); DownloadStatus* ds = dstatus.find(p.getPeer());
if (ds) if (ds)
ds->remove(pp); ds->remove(pp);
@ -169,7 +169,7 @@ namespace bt
pd->grab(); pd->grab();
pdown.append(pd); pdown.append(pd);
dstatus.insert(pd->getPeer()->getID(),new DownloadtqStatus()); dstatus.insert(pd->getPeer()->getID(),new DownloadStatus());
sendRequests(pd); sendRequests(pd);
connect(pd,TQT_SIGNAL(timedout(const Request& )),this,TQT_SLOT(onTimeout(const Request& ))); connect(pd,TQT_SIGNAL(timedout(const Request& )),this,TQT_SLOT(onTimeout(const Request& )));
connect(pd,TQT_SIGNAL(rejected( const Request& )),this,TQT_SLOT(onRejected( const Request& ))); connect(pd,TQT_SIGNAL(rejected( const Request& )),this,TQT_SLOT(onRejected( const Request& )));
@ -179,7 +179,7 @@ namespace bt
void ChunkDownload::notDownloaded(const Request & r,bool reject) void ChunkDownload::notDownloaded(const Request & r,bool reject)
{ {
// find the peer // find the peer
DownloadtqStatus* ds = dstatus.find(r.getPeer()); DownloadStatus* ds = dstatus.find(r.getPeer());
if (ds) if (ds)
{ {
// Out() << "ds != 0" << endl; // Out() << "ds != 0" << endl;
@ -216,7 +216,7 @@ namespace bt
void ChunkDownload::sendRequests(PeerDownloader* pd) void ChunkDownload::sendRequests(PeerDownloader* pd)
{ {
timer.update(); timer.update();
DownloadtqStatus* ds = dstatus.find(pd->getPeer()->getID()); DownloadStatus* ds = dstatus.find(pd->getPeer()->getID());
if (!ds) if (!ds)
return; return;
@ -262,11 +262,11 @@ namespace bt
void ChunkDownload::sendCancels(PeerDownloader* pd) void ChunkDownload::sendCancels(PeerDownloader* pd)
{ {
DownloadtqStatus* ds = dstatus.find(pd->getPeer()->getID()); DownloadStatus* ds = dstatus.find(pd->getPeer()->getID());
if (!ds) if (!ds)
return; return;
DownloadtqStatus::iterator itr = ds->begin(); DownloadStatus::iterator itr = ds->begin();
while (itr != ds->end()) while (itr != ds->end())
{ {
Uint32 i = *itr; Uint32 i = *itr;
@ -287,7 +287,7 @@ namespace bt
while (i != pdown.end()) while (i != pdown.end())
{ {
PeerDownloader* pd = *i; PeerDownloader* pd = *i;
DownloadtqStatus* ds = dstatus.find(pd->getPeer()->getID()); DownloadStatus* ds = dstatus.find(pd->getPeer()->getID());
Uint32 pp = p.getOffset() / MAX_PIECE_LEN; Uint32 pp = p.getOffset() / MAX_PIECE_LEN;
if (ds && ds->contains(pp)) if (ds && ds->contains(pp))
{ {
@ -360,7 +360,7 @@ namespace bt
ChunkDownloadHeader hdr; ChunkDownloadHeader hdr;
hdr.index = chunk->getIndex(); hdr.index = chunk->getIndex();
hdr.num_bits = pieces.getNumBits(); hdr.num_bits = pieces.getNumBits();
hdr.buffered = chunk->gettqStatus() == Chunk::BUFFERED ? 1 : 0; hdr.buffered = chunk->getStatus() == Chunk::BUFFERED ? 1 : 0;
// save the chunk header // save the chunk header
file.write(&hdr,sizeof(ChunkDownloadHeader)); file.write(&hdr,sizeof(ChunkDownloadHeader));
// save the bitset // save the bitset
@ -370,7 +370,7 @@ namespace bt
// if it's a buffered chunk, save the contents to // if it's a buffered chunk, save the contents to
file.write(chunk->getData(),chunk->getSize()); file.write(chunk->getData(),chunk->getSize());
chunk->clear(); chunk->clear();
chunk->settqStatus(Chunk::ON_DISK); chunk->setStatus(Chunk::ON_DISK);
} }
} }

@ -41,7 +41,7 @@ namespace bt
class Peer; class Peer;
class Request; class Request;
class PeerDownloader; class PeerDownloader;
class DownloadtqStatus; class DownloadStatus;
struct ChunkDownloadHeader struct ChunkDownloadHeader
{ {
@ -193,7 +193,7 @@ namespace bt
Uint32 last_size; Uint32 last_size;
Timer timer; Timer timer;
TQPtrList<PeerDownloader> pdown; TQPtrList<PeerDownloader> pdown;
PtrMap<Uint32,DownloadtqStatus> dstatus; PtrMap<Uint32,DownloadStatus> dstatus;
std::set<Uint32> piece_providers; std::set<Uint32> piece_providers;

@ -189,7 +189,7 @@ namespace bt
Chunk* c = getChunk(hdr.index); Chunk* c = getChunk(hdr.index);
if (c) if (c)
{ {
c->settqStatus(Chunk::ON_DISK); c->setStatus(Chunk::ON_DISK);
bitset.set(hdr.index,true); bitset.set(hdr.index,true);
todo.set(hdr.index,false); todo.set(hdr.index,false);
recalc_chunks_left = true; recalc_chunks_left = true;
@ -209,7 +209,7 @@ namespace bt
for (unsigned int i = 0;i < tor.getNumChunks();i++) for (unsigned int i = 0;i < tor.getNumChunks();i++)
{ {
Chunk* c = getChunk(i); Chunk* c = getChunk(i);
if (c->gettqStatus() != Chunk::NOT_DOWNLOADED) if (c->getStatus() != Chunk::NOT_DOWNLOADED)
{ {
NewChunkHeader hdr; NewChunkHeader hdr;
hdr.index = i; hdr.index = i;
@ -267,16 +267,16 @@ namespace bt
for (Uint32 i = 0;i < bitset.getNumBits();i++) for (Uint32 i = 0;i < bitset.getNumBits();i++)
{ {
Chunk* c = chunks[i]; Chunk* c = chunks[i];
if (c->gettqStatus() == Chunk::MMAPPED) if (c->getStatus() == Chunk::MMAPPED)
{ {
cache->save(c); cache->save(c);
c->clear(); c->clear();
c->settqStatus(Chunk::ON_DISK); c->setStatus(Chunk::ON_DISK);
} }
else if (c->gettqStatus() == Chunk::BUFFERED) else if (c->getStatus() == Chunk::BUFFERED)
{ {
c->clear(); c->clear();
c->settqStatus(Chunk::ON_DISK); c->setStatus(Chunk::ON_DISK);
} }
} }
cache->close(); cache->close();
@ -288,11 +288,11 @@ namespace bt
return 0; return 0;
Chunk* c = chunks[i]; Chunk* c = chunks[i];
if (c->gettqStatus() == Chunk::NOT_DOWNLOADED || c->isExcluded()) if (c->getStatus() == Chunk::NOT_DOWNLOADED || c->isExcluded())
{ {
return 0; return 0;
} }
else if (c->gettqStatus() == Chunk::ON_DISK) else if (c->getStatus() == Chunk::ON_DISK)
{ {
// load the chunk if it is on disk // load the chunk if it is on disk
cache->load(c); cache->load(c);
@ -338,10 +338,10 @@ namespace bt
Chunk* c = chunks[i]; Chunk* c = chunks[i];
if (!c->taken()) if (!c->taken())
{ {
if (c->gettqStatus() == Chunk::MMAPPED) if (c->getStatus() == Chunk::MMAPPED)
cache->save(c); cache->save(c);
c->clear(); c->clear();
c->settqStatus(Chunk::ON_DISK); c->setStatus(Chunk::ON_DISK);
loaded.remove(i); loaded.remove(i);
} }
} }
@ -352,10 +352,10 @@ namespace bt
return; return;
Chunk* c = chunks[i]; Chunk* c = chunks[i];
if (c->gettqStatus() == Chunk::MMAPPED) if (c->getStatus() == Chunk::MMAPPED)
cache->save(c); cache->save(c);
c->clear(); c->clear();
c->settqStatus(Chunk::NOT_DOWNLOADED); c->setStatus(Chunk::NOT_DOWNLOADED);
bitset.set(i,false); bitset.set(i,false);
todo.set(i,!excluded_chunks.get(i) && !only_seed_chunks.get(i)); todo.set(i,!excluded_chunks.get(i) && !only_seed_chunks.get(i));
loaded.remove(i); loaded.remove(i);
@ -372,10 +372,10 @@ namespace bt
// get rid of chunk if nobody asked for it in the last 5 seconds // get rid of chunk if nobody asked for it in the last 5 seconds
if (!c->taken() && bt::GetCurrentTime() - i.data() > 5000) if (!c->taken() && bt::GetCurrentTime() - i.data() > 5000)
{ {
if (c->gettqStatus() == Chunk::MMAPPED) if (c->getStatus() == Chunk::MMAPPED)
cache->save(c); cache->save(c);
c->clear(); c->clear();
c->settqStatus(Chunk::ON_DISK); c->setStatus(Chunk::ON_DISK);
TQMap<Uint32,TimeStamp>::iterator j = i; TQMap<Uint32,TimeStamp>::iterator j = i;
i++; i++;
loaded.erase(j); loaded.erase(j);
@ -413,7 +413,7 @@ namespace bt
else else
{ {
c->clear(); c->clear();
c->settqStatus(Chunk::NOT_DOWNLOADED); c->setStatus(Chunk::NOT_DOWNLOADED);
Out(SYS_DIO|LOG_IMPORTANT) << "Warning: attempted to save a chunk which was excluded" << endl; Out(SYS_DIO|LOG_IMPORTANT) << "Warning: attempted to save a chunk which was excluded" << endl;
} }
} }
@ -1016,7 +1016,7 @@ namespace bt
bool ChunkManager::prepareChunk(Chunk* c,bool allways) bool ChunkManager::prepareChunk(Chunk* c,bool allways)
{ {
if (!allways && c->gettqStatus() != Chunk::NOT_DOWNLOADED) if (!allways && c->getStatus() != Chunk::NOT_DOWNLOADED)
return false; return false;
return cache->prep(c); return cache->prep(c);
@ -1044,7 +1044,7 @@ namespace bt
bitset.set(i,true); bitset.set(i,true);
todo.set(i,false); todo.set(i,false);
// the chunk must be on disk // the chunk must be on disk
c->settqStatus(Chunk::ON_DISK); c->setStatus(Chunk::ON_DISK);
tor.updateFilePercentage(i,bitset); tor.updateFilePercentage(i,bitset);
} }
else if (!ok_chunks.get(i) && bitset.get(i)) else if (!ok_chunks.get(i) && bitset.get(i))
@ -1053,12 +1053,12 @@ namespace bt
// We think we have a chunk, but we don't // We think we have a chunk, but we don't
bitset.set(i,false); bitset.set(i,false);
todo.set(i,!only_seed_chunks.get(i) && !excluded_chunks.get(i)); todo.set(i,!only_seed_chunks.get(i) && !excluded_chunks.get(i));
if (c->gettqStatus() == Chunk::ON_DISK) if (c->getStatus() == Chunk::ON_DISK)
{ {
c->settqStatus(Chunk::NOT_DOWNLOADED); c->setStatus(Chunk::NOT_DOWNLOADED);
tor.updateFilePercentage(i,bitset); tor.updateFilePercentage(i,bitset);
} }
else if (c->gettqStatus() == Chunk::MMAPPED || c->gettqStatus() == Chunk::BUFFERED) else if (c->getStatus() == Chunk::MMAPPED || c->getStatus() == Chunk::BUFFERED)
{ {
resetChunk(i); resetChunk(i);
} }

@ -165,7 +165,7 @@ namespace bt
for (Uint32 i = from;i <= to;i++) for (Uint32 i = from;i <= to;i++)
{ {
bool in_chunks = std::find(chunks.begin(),chunks.end(),i) != chunks.end(); bool in_chunks = std::find(chunks.begin(),chunks.end(),i) != chunks.end();
if (!in_chunks && cman.getChunk(i)->gettqStatus() != Chunk::ON_DISK) if (!in_chunks && cman.getChunk(i)->getStatus() != Chunk::ON_DISK)
{ {
// Out(SYS_DIO|LOG_DEBUG) << "ChunkSelector::reIncluded " << i << endl; // Out(SYS_DIO|LOG_DEBUG) << "ChunkSelector::reIncluded " << i << endl;
chunks.push_back(i); chunks.push_back(i);

@ -87,7 +87,7 @@ namespace bt
} }
// if the chunk is not in memory, reload it // if the chunk is not in memory, reload it
if (cd->getChunk()->gettqStatus() == Chunk::ON_DISK) if (cd->getChunk()->getStatus() == Chunk::ON_DISK)
{ {
cman.prepareChunk(cd->getChunk(),true); cman.prepareChunk(cd->getChunk(),true);
} }
@ -119,7 +119,7 @@ namespace bt
downloaded += p.getLength(); downloaded += p.getLength();
// save to disk again, if it is idle // save to disk again, if it is idle
if (cd->isIdle() && cd->getChunk()->gettqStatus() == Chunk::MMAPPED) if (cd->isIdle() && cd->getChunk()->getStatus() == Chunk::MMAPPED)
{ {
cman.saveChunk(cd->getChunk()->getIndex(),false); cman.saveChunk(cd->getChunk()->getIndex(),false);
} }
@ -160,7 +160,7 @@ namespace bt
if (cd->isIdle()) // idle chunks do not need to be in memory if (cd->isIdle()) // idle chunks do not need to be in memory
{ {
Chunk* c = cd->getChunk(); Chunk* c = cd->getChunk();
if (c->gettqStatus() == Chunk::MMAPPED) if (c->getStatus() == Chunk::MMAPPED)
{ {
cman.saveChunk(cd->getChunk()->getIndex(),false); cman.saveChunk(cd->getChunk()->getIndex(),false);
} }
@ -169,7 +169,7 @@ namespace bt
{ {
cd->releaseAllPDs(); cd->releaseAllPDs();
Chunk* c = cd->getChunk(); Chunk* c = cd->getChunk();
if (c->gettqStatus() == Chunk::MMAPPED) if (c->getStatus() == Chunk::MMAPPED)
{ {
cman.saveChunk(cd->getChunk()->getIndex(),false); cman.saveChunk(cd->getChunk()->getIndex(),false);
} }
@ -277,7 +277,7 @@ namespace bt
if (sel) if (sel)
{ {
// if it is on disk, reload it // if it is on disk, reload it
if (sel->getChunk()->gettqStatus() == Chunk::ON_DISK) if (sel->getChunk()->getStatus() == Chunk::ON_DISK)
cman.prepareChunk(sel->getChunk(),true); cman.prepareChunk(sel->getChunk(),true);
sel->assignPeer(pd); sel->assignPeer(pd);
@ -341,7 +341,7 @@ namespace bt
if (cdmin) if (cdmin)
{ {
// if it is on disk, reload it // if it is on disk, reload it
if (cdmin->getChunk()->gettqStatus() == Chunk::ON_DISK) if (cdmin->getChunk()->getStatus() == Chunk::ON_DISK)
{ {
cman.prepareChunk(cdmin->getChunk(),true); cman.prepareChunk(cdmin->getChunk(),true);
} }
@ -438,10 +438,10 @@ namespace bt
{ {
Uint32 ch = i->first; Uint32 ch = i->first;
Chunk* c = i->second->getChunk(); Chunk* c = i->second->getChunk();
if (c->gettqStatus() == Chunk::MMAPPED) if (c->getStatus() == Chunk::MMAPPED)
cman.saveChunk(ch,false); cman.saveChunk(ch,false);
c->settqStatus(Chunk::NOT_DOWNLOADED); c->setStatus(Chunk::NOT_DOWNLOADED);
} }
current_chunks.clear(); current_chunks.clear();
} }

@ -425,7 +425,7 @@ namespace bt
{ {
// if mmap fails or is not possible use buffered mode // if mmap fails or is not possible use buffered mode
c->allocate(); c->allocate();
c->settqStatus(Chunk::BUFFERED); c->setStatus(Chunk::BUFFERED);
} }
else else
{ {
@ -436,7 +436,7 @@ namespace bt
{ {
// just allocate it // just allocate it
c->allocate(); c->allocate();
c->settqStatus(Chunk::BUFFERED); c->setStatus(Chunk::BUFFERED);
} }
return true; return true;
} }
@ -446,7 +446,7 @@ namespace bt
TQValueList<Uint32> tflist; TQValueList<Uint32> tflist;
tor.calcChunkPos(c->getIndex(),tflist); tor.calcChunkPos(c->getIndex(),tflist);
if (c->gettqStatus() == Chunk::MMAPPED) if (c->getStatus() == Chunk::MMAPPED)
{ {
// mapped chunks are easy // mapped chunks are easy
CacheFile* fd = files.find(tflist[0]); CacheFile* fd = files.find(tflist[0]);
@ -455,7 +455,7 @@ namespace bt
fd->unmap(c->getData(),c->getSize()); fd->unmap(c->getData(),c->getSize());
c->clear(); c->clear();
c->settqStatus(Chunk::ON_DISK); c->setStatus(Chunk::ON_DISK);
return; return;
} }
@ -506,7 +506,7 @@ namespace bt
// set the chunk to on disk and clear it // set the chunk to on disk and clear it
c->clear(); c->clear();
c->settqStatus(Chunk::ON_DISK); c->setStatus(Chunk::ON_DISK);
} }
void MultiFileCache::downloadStatusChanged(TorrentFile* tf, bool download) void MultiFileCache::downloadStatusChanged(TorrentFile* tf, bool download)

@ -386,7 +386,7 @@ namespace bt
// 30 minutes // 30 minutes
curr->setInterval(FINAL_WAIT_TIME); curr->setInterval(FINAL_WAIT_TIME);
timer.start(FINAL_WAIT_TIME * 1000,true); timer.start(FINAL_WAIT_TIME * 1000,true);
request_time = TQDateTime::tqcurrentDateTime(); request_time = TQDateTime::currentDateTime();
} }
else if (curr->failureCount() > 2) else if (curr->failureCount() > 2)
{ {
@ -394,14 +394,14 @@ namespace bt
// a minute or 5, no need for hammering every 30 seconds // a minute or 5, no need for hammering every 30 seconds
curr->setInterval(LONGER_WAIT_TIME); curr->setInterval(LONGER_WAIT_TIME);
timer.start(LONGER_WAIT_TIME * 1000,true); timer.start(LONGER_WAIT_TIME * 1000,true);
request_time = TQDateTime::tqcurrentDateTime(); request_time = TQDateTime::currentDateTime();
} }
else else
{ {
// lets not hammer and wait 30 seconds // lets not hammer and wait 30 seconds
curr->setInterval(INITIAL_WAIT_TIME); curr->setInterval(INITIAL_WAIT_TIME);
timer.start(INITIAL_WAIT_TIME * 1000,true); timer.start(INITIAL_WAIT_TIME * 1000,true);
request_time = TQDateTime::tqcurrentDateTime(); request_time = TQDateTime::currentDateTime();
} }
} }
else else
@ -418,7 +418,7 @@ namespace bt
{ {
curr->setInterval(FINAL_WAIT_TIME); curr->setInterval(FINAL_WAIT_TIME);
timer.start(FINAL_WAIT_TIME * 1000,true); timer.start(FINAL_WAIT_TIME * 1000,true);
request_time = TQDateTime::tqcurrentDateTime(); request_time = TQDateTime::currentDateTime();
} }
else if (trk->failureCount() > 2) else if (trk->failureCount() > 2)
{ {
@ -426,14 +426,14 @@ namespace bt
// wait 5 minutes and try again // wait 5 minutes and try again
curr->setInterval(LONGER_WAIT_TIME); curr->setInterval(LONGER_WAIT_TIME);
timer.start(LONGER_WAIT_TIME * 1000,true); timer.start(LONGER_WAIT_TIME * 1000,true);
request_time = TQDateTime::tqcurrentDateTime(); request_time = TQDateTime::currentDateTime();
} }
else else
{ {
// wait 30 seconds and try again // wait 30 seconds and try again
curr->setInterval(INITIAL_WAIT_TIME); curr->setInterval(INITIAL_WAIT_TIME);
timer.start(INITIAL_WAIT_TIME * 1000,true); timer.start(INITIAL_WAIT_TIME * 1000,true);
request_time = TQDateTime::tqcurrentDateTime(); request_time = TQDateTime::currentDateTime();
} }
} }
} }
@ -449,7 +449,7 @@ namespace bt
pending = false; pending = false;
if (started) if (started)
statusChanged(i18n("OK")); statusChanged(i18n("OK"));
request_time = TQDateTime::tqcurrentDateTime(); request_time = TQDateTime::currentDateTime();
} }
void PeerSourceManager::onTrackerRequestPending() void PeerSourceManager::onTrackerRequestPending()
@ -504,7 +504,7 @@ namespace bt
if (pending || !started || !curr) if (pending || !started || !curr)
return 0; return 0;
return curr->getInterval() - request_time.secsTo(TQDateTime::tqcurrentDateTime()); return curr->getInterval() - request_time.secsTo(TQDateTime::currentDateTime());
} }
Uint32 PeerSourceManager::getNumSeeders() const Uint32 PeerSourceManager::getNumSeeders() const

@ -165,7 +165,7 @@ namespace bt
signals: signals:
/** /**
* tqStatus has changed of the tracker. * Status has changed of the tracker.
* @param ns The new status * @param ns The new status
*/ */
void statusChanged(const TQString & ns); void statusChanged(const TQString & ns);

@ -76,7 +76,7 @@ namespace bt
{ {
// mmap continuously fails, so stop using it // mmap continuously fails, so stop using it
c->allocate(); c->allocate();
c->settqStatus(Chunk::BUFFERED); c->setStatus(Chunk::BUFFERED);
} }
else else
{ {
@ -88,7 +88,7 @@ namespace bt
// buffer it if mmapping fails // buffer it if mmapping fails
Out(SYS_GEN|LOG_IMPORTANT) << "Warning : mmap failure, falling back to buffered mode" << endl; Out(SYS_GEN|LOG_IMPORTANT) << "Warning : mmap failure, falling back to buffered mode" << endl;
c->allocate(); c->allocate();
c->settqStatus(Chunk::BUFFERED); c->setStatus(Chunk::BUFFERED);
} }
else else
{ {
@ -105,7 +105,7 @@ namespace bt
if (mmap_failures >= 3 || !(buf = (Uint8*)fd->map(c,off,c->getSize(),CacheFile::READ))) if (mmap_failures >= 3 || !(buf = (Uint8*)fd->map(c,off,c->getSize(),CacheFile::READ)))
{ {
c->allocate(); c->allocate();
c->settqStatus(Chunk::BUFFERED); c->setStatus(Chunk::BUFFERED);
fd->read(c->getData(),c->getSize(),off); fd->read(c->getData(),c->getSize(),off);
if (mmap_failures < 3) if (mmap_failures < 3)
mmap_failures++; mmap_failures++;
@ -119,18 +119,18 @@ namespace bt
void SingleFileCache::save(Chunk* c) void SingleFileCache::save(Chunk* c)
{ {
// unmap the chunk if it is mapped // unmap the chunk if it is mapped
if (c->gettqStatus() == Chunk::MMAPPED) if (c->getStatus() == Chunk::MMAPPED)
{ {
fd->unmap(c->getData(),c->getSize()); fd->unmap(c->getData(),c->getSize());
c->clear(); c->clear();
c->settqStatus(Chunk::ON_DISK); c->setStatus(Chunk::ON_DISK);
} }
else if (c->gettqStatus() == Chunk::BUFFERED) else if (c->getStatus() == Chunk::BUFFERED)
{ {
Uint64 off = c->getIndex() * tor.getChunkSize(); Uint64 off = c->getIndex() * tor.getChunkSize();
fd->write(c->getData(),c->getSize(),off); fd->write(c->getData(),c->getSize(),off);
c->clear(); c->clear();
c->settqStatus(Chunk::ON_DISK); c->setStatus(Chunk::ON_DISK);
} }
} }

@ -200,7 +200,7 @@ namespace bt
if (stats.completed && !comp) if (stats.completed && !comp)
{ {
pman->killSeeders(); pman->killSeeders();
TQDateTime now = TQDateTime::tqcurrentDateTime(); TQDateTime now = TQDateTime::currentDateTime();
istats.running_time_dl += istats.time_started_dl.secsTo(now); istats.running_time_dl += istats.time_started_dl.secsTo(now);
updateStatusMsg(); updateStatusMsg();
updateStats(); updateStats();
@ -228,7 +228,7 @@ namespace bt
else else
psman->manualUpdate(); psman->manualUpdate();
istats.last_announce = bt::GetCurrentTime(); istats.last_announce = bt::GetCurrentTime();
istats.time_started_dl = TQDateTime::tqcurrentDateTime(); istats.time_started_dl = TQDateTime::currentDateTime();
} }
updateStatusMsg(); updateStatusMsg();
@ -351,7 +351,7 @@ namespace bt
throw; throw;
} }
istats.time_started_ul = istats.time_started_dl = TQDateTime::tqcurrentDateTime(); istats.time_started_ul = istats.time_started_dl = TQDateTime::currentDateTime();
resetTrackerStats(); resetTrackerStats();
if (prealloc) if (prealloc)
@ -408,7 +408,7 @@ namespace bt
void TorrentControl::stop(bool user,WaitJob* wjob) void TorrentControl::stop(bool user,WaitJob* wjob)
{ {
TQDateTime now = TQDateTime::tqcurrentDateTime(); TQDateTime now = TQDateTime::currentDateTime();
if(!stats.completed) if(!stats.completed)
istats.running_time_dl += istats.time_started_dl.secsTo(now); istats.running_time_dl += istats.time_started_dl.secsTo(now);
istats.running_time_ul += istats.time_started_ul.secsTo(now); istats.running_time_ul += istats.time_started_ul.secsTo(now);
@ -992,7 +992,7 @@ namespace bt
if (stats.running) if (stats.running)
{ {
TQDateTime now = TQDateTime::tqcurrentDateTime(); TQDateTime now = TQDateTime::currentDateTime();
st.write("RUNNING_TIME_DL",TQString("%1").tqarg(istats.running_time_dl + istats.time_started_dl.secsTo(now))); st.write("RUNNING_TIME_DL",TQString("%1").tqarg(istats.running_time_dl + istats.time_started_dl.secsTo(now)));
st.write("RUNNING_TIME_UL",TQString("%1").tqarg(istats.running_time_ul + istats.time_started_ul.secsTo(now))); st.write("RUNNING_TIME_UL",TQString("%1").tqarg(istats.running_time_ul + istats.time_started_ul.secsTo(now)));
} }
@ -1222,7 +1222,7 @@ namespace bt
if (!stats.running || stats.completed) if (!stats.running || stats.completed)
return istats.running_time_dl; return istats.running_time_dl;
else else
return istats.running_time_dl + istats.time_started_dl.secsTo(TQDateTime::tqcurrentDateTime()); return istats.running_time_dl + istats.time_started_dl.secsTo(TQDateTime::currentDateTime());
} }
Uint32 TorrentControl::getRunningTimeUL() const Uint32 TorrentControl::getRunningTimeUL() const
@ -1230,7 +1230,7 @@ namespace bt
if (!stats.running) if (!stats.running)
return istats.running_time_ul; return istats.running_time_ul;
else else
return istats.running_time_ul + istats.time_started_ul.secsTo(TQDateTime::tqcurrentDateTime()); return istats.running_time_ul + istats.time_started_ul.secsTo(TQDateTime::currentDateTime());
} }
Uint32 TorrentControl::getNumFiles() const Uint32 TorrentControl::getNumFiles() const

@ -116,7 +116,7 @@ namespace bt
// this could result in the loss of some messages // this could result in the loss of some messages
if (!rotate_job) if (!rotate_job)
{ {
*out << TQDateTime::tqcurrentDateTime().toString() << ": " << tmp << ::endl; *out << TQDateTime::currentDateTime().toString() << ": " << tmp << ::endl;
fptr.flush(); fptr.flush();
if (to_cout) if (to_cout)
std::cout << TQString(tmp.local8Bit()) << std::endl; std::cout << TQString(tmp.local8Bit()) << std::endl;

@ -71,15 +71,15 @@ namespace kt
TQMimeSourceFactory* factory = TQMimeSourceFactory::defaultFactory(); TQMimeSourceFactory* factory = TQMimeSourceFactory::defaultFactory();
TQImage excluded(16, 16, 32); TQImage excluded(16, 16, 32);
FillAndFrameBlack(&excluded, TQColor(bar->tqcolorGroup().color(TQColorGroup::Mid)).pixel(), 16); FillAndFrameBlack(&excluded, TQColor(bar->colorGroup().color(TQColorGroup::Mid)).pixel(), 16);
factory->setImage("excluded_color", excluded); factory->setImage("excluded_color", excluded);
TQImage available(16, 16, 32); TQImage available(16, 16, 32);
FillAndFrameBlack(&available, bar->tqcolorGroup().highlight().pixel(), 16); FillAndFrameBlack(&available, bar->colorGroup().highlight().pixel(), 16);
factory->setImage("available_color", available); factory->setImage("available_color", available);
TQImage unavailable(16, 16, 32); TQImage unavailable(16, 16, 32);
FillAndFrameBlack(&unavailable, bar->tqcolorGroup().base().pixel(), 16); FillAndFrameBlack(&unavailable, bar->colorGroup().base().pixel(), 16);
factory->setImage("unavailable_color", unavailable); factory->setImage("unavailable_color", unavailable);
} }
@ -121,7 +121,7 @@ namespace kt
// PROFILE("ChunkBar::updateBar"); // PROFILE("ChunkBar::updateBar");
// Out() << "Pixmap : " << s.width() << " " << s.height() << endl; // Out() << "Pixmap : " << s.width() << " " << s.height() << endl;
pixmap.resize(s); pixmap.resize(s);
pixmap.fill(tqcolorGroup().color(TQColorGroup::Base)); pixmap.fill(colorGroup().color(TQColorGroup::Base));
TQPainter painter(&pixmap); TQPainter painter(&pixmap);
drawBarContents(&painter); drawBarContents(&painter);
update(); update();
@ -132,9 +132,9 @@ namespace kt
{ {
// first draw background // first draw background
if (isEnabled()) if (isEnabled())
p->setBrush(tqcolorGroup().base()); p->setBrush(colorGroup().base());
else else
p->setBrush(tqcolorGroup().background()); p->setBrush(colorGroup().background());
p->setPen(TQt::NoPen); p->setPen(TQt::NoPen);
p->drawRect(contentsRect()); p->drawRect(contentsRect());
@ -148,7 +148,7 @@ namespace kt
TQSize s = contentsRect().size(); TQSize s = contentsRect().size();
//Out() << "Pixmap : " << s.width() << " " << s.height() << endl; //Out() << "Pixmap : " << s.width() << " " << s.height() << endl;
pixmap.resize(s); pixmap.resize(s);
pixmap.fill(tqcolorGroup().color(TQColorGroup::Base)); pixmap.fill(colorGroup().color(TQColorGroup::Base));
TQPainter painter(&pixmap); TQPainter painter(&pixmap);
drawBarContents(&painter); drawBarContents(&painter);
update(); update();
@ -164,15 +164,15 @@ namespace kt
const BitSet & bs = getBitSet(); const BitSet & bs = getBitSet();
curr = bs; curr = bs;
if (bs.allOn()) if (bs.allOn())
drawAllOn(p,tqcolorGroup().highlight()); drawAllOn(p,colorGroup().highlight());
else if (s.total_chunks > w) else if (s.total_chunks > w)
drawMoreChunksThenPixels(p,bs,tqcolorGroup().highlight()); drawMoreChunksThenPixels(p,bs,colorGroup().highlight());
else else
drawEqual(p,bs,tqcolorGroup().highlight()); drawEqual(p,bs,colorGroup().highlight());
if (show_excluded && s.num_chunks_excluded > 0) if (show_excluded && s.num_chunks_excluded > 0)
{ {
TQColor c = tqcolorGroup().color(TQColorGroup::Mid); TQColor c = colorGroup().color(TQColorGroup::Mid);
if (curr_ebs.allOn()) if (curr_ebs.allOn())
drawAllOn(p,c); drawAllOn(p,c);
else if (s.total_chunks > w) else if (s.total_chunks > w)
@ -186,7 +186,7 @@ namespace kt
void ChunkBar::drawEqual(TQPainter *p,const BitSet & bs,const TQColor & color) void ChunkBar::drawEqual(TQPainter *p,const BitSet & bs,const TQColor & color)
{ {
//p->setPen(TQPen(tqcolorGroup().highlight(),1,TQt::SolidLine)); //p->setPen(TQPen(colorGroup().highlight(),1,TQt::SolidLine));
TQColor c = color; TQColor c = color;
Uint32 w = contentsRect().width(); Uint32 w = contentsRect().width();

@ -47,7 +47,7 @@
<property name="name"> <property name="name">
<cstring>m_total_chunks</cstring> <cstring>m_total_chunks</cstring>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>50</width> <width>50</width>
<height>0</height> <height>0</height>
@ -85,7 +85,7 @@
<property name="name"> <property name="name">
<cstring>m_chunks_downloading</cstring> <cstring>m_chunks_downloading</cstring>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>50</width> <width>50</width>
<height>0</height> <height>0</height>
@ -123,7 +123,7 @@
<property name="name"> <property name="name">
<cstring>m_chunks_downloaded</cstring> <cstring>m_chunks_downloaded</cstring>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>50</width> <width>50</width>
<height>0</height> <height>0</height>
@ -161,7 +161,7 @@
<property name="name"> <property name="name">
<cstring>m_excluded_chunks</cstring> <cstring>m_excluded_chunks</cstring>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>50</width> <width>50</width>
<height>0</height> <height>0</height>
@ -199,7 +199,7 @@
<property name="name"> <property name="name">
<cstring>m_chunks_left</cstring> <cstring>m_chunks_left</cstring>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>50</width> <width>50</width>
<height>0</height> <height>0</height>
@ -237,7 +237,7 @@
<property name="name"> <property name="name">
<cstring>m_size_chunks</cstring> <cstring>m_size_chunks</cstring>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>80</width> <width>80</width>
<height>0</height> <height>0</height>
@ -265,7 +265,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>

@ -43,7 +43,7 @@ kt::FloatSpinBox::FloatSpinBox(
setStep( 0.25f ); setStep( 0.25f );
connect(this, TQT_SIGNAL(valueChanged ( int )), this, TQT_SLOT(internalValueChanged( int ))); connect(this, TQT_SIGNAL(valueChanged ( int )), this, TQT_SLOT(internalValueChanged( int )));
setValidator( new LocaleFloatValidator( TQT_TQOBJECT(dynamic_cast<TQSpinBox * > (this)) )); setValidator( new LocaleFloatValidator( TQT_TQOBJECT(dynamic_cast<TQSpinBox * > (this)) ));
editor()->tqsetAlignment(TQt::AlignRight); editor()->setAlignment(TQt::AlignRight);
} }
kt::FloatSpinBox::FloatSpinBox( kt::FloatSpinBox::FloatSpinBox(

@ -45,7 +45,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>21</height> <height>21</height>

@ -37,7 +37,7 @@ namespace kt
StatusTab::StatusTab(TQWidget* parent, const char* name, WFlags fl) StatusTab::StatusTab(TQWidget* parent, const char* name, WFlags fl)
: StatusTabBase(parent,name,fl),curr_tc(0) : StatusTabBase(parent,name,fl),curr_tc(0)
{ {
TQColorGroup cg = tqcolorGroup(); TQColorGroup cg = colorGroup();
// do not use hardcoded colors // do not use hardcoded colors
m_info_caption->setPaletteBackgroundColor(cg.mid()); m_info_caption->setPaletteBackgroundColor(cg.mid());
m_chunks_caption->setPaletteBackgroundColor(cg.mid()); m_chunks_caption->setPaletteBackgroundColor(cg.mid());

@ -75,7 +75,7 @@
<property name="name"> <property name="name">
<cstring>m_seeders</cstring> <cstring>m_seeders</cstring>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>100</width>
<height>0</height> <height>0</height>
@ -95,7 +95,7 @@
<property name="name"> <property name="name">
<cstring>m_leechers</cstring> <cstring>m_leechers</cstring>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>100</width>
<height>0</height> <height>0</height>
@ -133,7 +133,7 @@
<property name="name"> <property name="name">
<cstring>m_avg_down</cstring> <cstring>m_avg_down</cstring>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>100</width>
<height>0</height> <height>0</height>
@ -153,7 +153,7 @@
<property name="name"> <property name="name">
<cstring>m_avg_up</cstring> <cstring>m_avg_up</cstring>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>100</width>
<height>0</height> <height>0</height>
@ -207,7 +207,7 @@
<property name="name"> <property name="name">
<cstring>m_tracker_status</cstring> <cstring>m_tracker_status</cstring>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>100</width>
<height>0</height> <height>0</height>
@ -227,7 +227,7 @@
<property name="name"> <property name="name">
<cstring>m_tracker_update_time</cstring> <cstring>m_tracker_update_time</cstring>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>100</width>
<height>0</height> <height>0</height>
@ -255,7 +255,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>207</width> <width>207</width>
<height>20</height> <height>20</height>
@ -344,7 +344,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>20</height> <height>20</height>
@ -379,7 +379,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>20</height> <height>20</height>
@ -398,7 +398,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>16</height> <height>16</height>
@ -477,7 +477,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>20</width> <width>20</width>
<height>0</height> <height>0</height>
@ -515,7 +515,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>20</width> <width>20</width>
<height>0</height> <height>0</height>
@ -561,7 +561,7 @@
<property name="name"> <property name="name">
<cstring>m_share_ratio</cstring> <cstring>m_share_ratio</cstring>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>50</width> <width>50</width>
<height>0</height> <height>0</height>
@ -589,7 +589,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>MinimumExpanding</enum> <enum>MinimumExpanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>

@ -167,7 +167,7 @@ namespace kt
// only enable change when we can actually change and the torrent is running // only enable change when we can actually change and the torrent is running
btnChange->setEnabled(s.running && listTrackers->childCount() > 1); btnChange->setEnabled(s.running && listTrackers->childCount() > 1);
lbltqStatus->setText("<b>" + s.trackerstatus + "</b>"); lblStatus->setText("<b>" + s.trackerstatus + "</b>");
if (tc->getTrackersList()) if (tc->getTrackersList())
{ {
TQString t = tc->getTrackersList()->getTrackerURL().prettyURL(); TQString t = tc->getTrackersList()->getTrackerURL().prettyURL();
@ -191,7 +191,7 @@ namespace kt
listTrackers->clear(); listTrackers->clear();
if(!tc) if(!tc)
{ {
lbltqStatus->clear(); lblStatus->clear();
lblCurrent->clear(); lblCurrent->clear();
lblUpdate->clear(); lblUpdate->clear();
txtTracker->clear(); txtTracker->clear();

@ -85,7 +85,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>68</height> <height>68</height>
@ -180,7 +180,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Fixed</enum> <enum>Fixed</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>16</width> <width>16</width>
<height>20</height> <height>20</height>
@ -205,7 +205,7 @@
</widget> </widget>
<widget class="TQLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>lbltqStatus</cstring> <cstring>lblStatus</cstring>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy> <sizepolicy>
@ -229,7 +229,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Fixed</enum> <enum>Fixed</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>16</width> <width>16</width>
<height>20</height> <height>20</height>

@ -73,7 +73,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>390</width> <width>390</width>
<height>0</height> <height>0</height>

@ -29,7 +29,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
@ -108,7 +108,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>361</width> <width>361</width>
<height>20</height> <height>20</height>
@ -152,7 +152,7 @@ NOTE: ZIP file from bluetack.co.uk is supported.</string>
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>

@ -29,7 +29,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>110</height> <height>110</height>

@ -50,7 +50,7 @@ namespace kt
setTextFormat(TQt::LogText); setTextFormat(TQt::LogText);
setMaxLogLines(200); setMaxLogLines(200);
setMinimumSize(TQSize(0,50)); setMinimumSize(TQSize(0,50));
tqsetSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Expanding); setSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Expanding);
KGlobal::config()->setGroup("LogViewer"); KGlobal::config()->setGroup("LogViewer");
if (KGlobal::config()->hasKey("LogViewerWidgetSize")) if (KGlobal::config()->hasKey("LogViewerWidgetSize"))
{ {

@ -39,7 +39,7 @@
<property name="name"> <property name="name">
<cstring>textLabel1</cstring> <cstring>textLabel1</cstring>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>60</width> <width>60</width>
<height>0</height> <height>0</height>
@ -53,7 +53,7 @@
<property name="name"> <property name="name">
<cstring>textLabel2</cstring> <cstring>textLabel2</cstring>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>60</width> <width>60</width>
<height>0</height> <height>0</height>
@ -118,7 +118,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>61</width> <width>61</width>
<height>20</height> <height>20</height>

@ -54,7 +54,7 @@ Article::Article(const TQDomNode &node, Format format) : d(new Private)
d->numComments=0; d->numComments=0;
if (!(elemText = extractNode(node, TQString::tqfromLatin1("title"))).isNull()) if (!(elemText = extractNode(node, TQString::fromLatin1("title"))).isNull())
d->title = elemText; d->title = elemText;
@ -62,14 +62,14 @@ Article::Article(const TQDomNode &node, Format format) : d(new Private)
bool foundTorrentEnclosure = false; bool foundTorrentEnclosure = false;
for (n = node.firstChild(); !n.isNull(); n = n.nextSibling()) { for (n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
const TQDomElement e = n.toElement(); const TQDomElement e = n.toElement();
if ( (e.tagName()==TQString::tqfromLatin1("enclosure") ) ) if ( (e.tagName()==TQString::fromLatin1("enclosure") ) )
{ {
TQString enclosureAttr = e.attribute(TQString::tqfromLatin1("type")); TQString enclosureAttr = e.attribute(TQString::fromLatin1("type"));
if (!enclosureAttr.isNull() ) if (!enclosureAttr.isNull() )
{ {
if (enclosureAttr == "application/x-bittorrent") if (enclosureAttr == "application/x-bittorrent")
{ {
enclosureAttr = e.attribute(TQString::tqfromLatin1("url")); enclosureAttr = e.attribute(TQString::fromLatin1("url"));
if (!enclosureAttr.isNull() ) if (!enclosureAttr.isNull() )
{ {
d->link=enclosureAttr; d->link=enclosureAttr;
@ -88,41 +88,41 @@ Article::Article(const TQDomNode &node, Format format) : d(new Private)
TQDomNode n; TQDomNode n;
for (n = node.firstChild(); !n.isNull(); n = n.nextSibling()) { for (n = node.firstChild(); !n.isNull(); n = n.nextSibling()) {
const TQDomElement e = n.toElement(); const TQDomElement e = n.toElement();
if ( (e.tagName()==TQString::tqfromLatin1("link")) && if ( (e.tagName()==TQString::fromLatin1("link")) &&
(e.attribute(TQString::tqfromLatin1("rel"))==TQString::tqfromLatin1("alternate"))) (e.attribute(TQString::fromLatin1("rel"))==TQString::fromLatin1("alternate")))
{ {
d->link=n.toElement().attribute(TQString::tqfromLatin1("href")); d->link=n.toElement().attribute(TQString::fromLatin1("href"));
break; break;
} }
} }
} }
else else
{ {
if (!(elemText = extractNode(node, TQString::tqfromLatin1("link"))).isNull()) if (!(elemText = extractNode(node, TQString::fromLatin1("link"))).isNull())
d->link = elemText; d->link = elemText;
} }
} }
// prefer content/content:encoded over summary/description for feeds that provide it // prefer content/content:encoded over summary/description for feeds that provide it
TQString tagName=(format==AtomFeed)? TQString::tqfromLatin1("content"): TQString::tqfromLatin1("content:encoded"); TQString tagName=(format==AtomFeed)? TQString::fromLatin1("content"): TQString::fromLatin1("content:encoded");
if (!(elemText = extractNode(node, tagName, false)).isNull()) if (!(elemText = extractNode(node, tagName, false)).isNull())
d->description = elemText; d->description = elemText;
if (d->description.isEmpty()) if (d->description.isEmpty())
{ {
if (!(elemText = extractNode(node, TQString::tqfromLatin1("body"), false)).isNull()) if (!(elemText = extractNode(node, TQString::fromLatin1("body"), false)).isNull())
d->description = elemText; d->description = elemText;
if (d->description.isEmpty()) // 3rd try: see http://www.intertwingly.net/blog/1299.html if (d->description.isEmpty()) // 3rd try: see http://www.intertwingly.net/blog/1299.html
{ {
if (!(elemText = extractNode(node, TQString::tqfromLatin1((format==AtomFeed)? "summary" : "description"), false)).isNull()) if (!(elemText = extractNode(node, TQString::fromLatin1((format==AtomFeed)? "summary" : "description"), false)).isNull())
d->description = elemText; d->description = elemText;
} }
} }
if (!(elemText = extractNode(node, TQString::tqfromLatin1((format==AtomFeed)? "created": "pubDate"))).isNull()) if (!(elemText = extractNode(node, TQString::fromLatin1((format==AtomFeed)? "created": "pubDate"))).isNull())
{ {
time_t _time; time_t _time;
if (format==AtomFeed) if (format==AtomFeed)
@ -134,7 +134,7 @@ Article::Article(const TQDomNode &node, Format format) : d(new Private)
if (_time != 0) if (_time != 0)
d->pubDate.setTime_t(_time); d->pubDate.setTime_t(_time);
} }
if (!(elemText = extractNode(node, TQString::tqfromLatin1("dc:date"))).isNull()) if (!(elemText = extractNode(node, TQString::fromLatin1("dc:date"))).isNull())
{ {
time_t _time = parseISO8601Date(elemText); time_t _time = parseISO8601Date(elemText);
@ -146,23 +146,23 @@ Article::Article(const TQDomNode &node, Format format) : d(new Private)
//no luck so far - so let's set it to the current time //no luck so far - so let's set it to the current time
if (!d->pubDate.isValid()) if (!d->pubDate.isValid())
{ {
d->pubDate = TQDateTime::tqcurrentDateTime(); d->pubDate = TQDateTime::currentDateTime();
} }
if (!(elemText = extractNode(node, TQString::tqfromLatin1("wfw:comment"))).isNull()) { if (!(elemText = extractNode(node, TQString::fromLatin1("wfw:comment"))).isNull()) {
d->commentsLink = elemText; d->commentsLink = elemText;
} }
if (!(elemText = extractNode(node, TQString::tqfromLatin1("slash:comments"))).isNull()) { if (!(elemText = extractNode(node, TQString::fromLatin1("slash:comments"))).isNull()) {
d->numComments = elemText.toInt(); d->numComments = elemText.toInt();
} }
tagName=(format==AtomFeed)? TQString::tqfromLatin1("id"): TQString::tqfromLatin1("guid"); tagName=(format==AtomFeed)? TQString::fromLatin1("id"): TQString::fromLatin1("guid");
n = node.namedItem(tagName); n = node.namedItem(tagName);
if (!n.isNull()) { if (!n.isNull()) {
d->guidIsPermaLink = (format==AtomFeed)? false : true; d->guidIsPermaLink = (format==AtomFeed)? false : true;
if (n.toElement().attribute(TQString::tqfromLatin1("isPermaLink"), "true") == "false") d->guidIsPermaLink = false; if (n.toElement().attribute(TQString::fromLatin1("isPermaLink"), "true") == "false") d->guidIsPermaLink = false;
if (!(elemText = extractNode(node, tagName)).isNull()) if (!(elemText = extractNode(node, tagName)).isNull())
d->guid = elemText; d->guid = elemText;
@ -176,14 +176,14 @@ Article::Article(const TQDomNode &node, Format format) : d(new Private)
md5Machine.update(d->title.utf8()); md5Machine.update(d->title.utf8());
md5Machine.update(d->description.utf8()); md5Machine.update(d->description.utf8());
d->guid = TQString(md5Machine.hexDigest().data()); d->guid = TQString(md5Machine.hexDigest().data());
d->meta[TQString::tqfromLatin1("guidIsHash")] = TQString::tqfromLatin1("true"); d->meta[TQString::fromLatin1("guidIsHash")] = TQString::fromLatin1("true");
} }
for (TQDomNode i = node.firstChild(); !i.isNull(); i = i.nextSibling()) for (TQDomNode i = node.firstChild(); !i.isNull(); i = i.nextSibling())
{ {
if (i.isElement() && i.toElement().tagName() == TQString::tqfromLatin1("metaInfo:meta")) if (i.isElement() && i.toElement().tagName() == TQString::fromLatin1("metaInfo:meta"))
{ {
TQString type = i.toElement().attribute(TQString::tqfromLatin1("type")); TQString type = i.toElement().attribute(TQString::fromLatin1("type"));
d->meta[type] = i.toElement().text(); d->meta[type] = i.toElement().text();
} }
} }

@ -79,42 +79,42 @@ Document::Document(const TQDomDocument &doc) : d(new Private)
TQString attr; TQString attr;
// we should probably check that it ISN'T feed or rss, rather than check if it is xhtml // we should probably check that it ISN'T feed or rss, rather than check if it is xhtml
if (rootNode.toElement().tagName()==TQString::tqfromLatin1("html")) if (rootNode.toElement().tagName()==TQString::fromLatin1("html"))
d->valid=false; d->valid=false;
else else
d->valid=true; d->valid=true;
attr = rootNode.toElement().attribute(TQString::tqfromLatin1("version"), TQString()); attr = rootNode.toElement().attribute(TQString::fromLatin1("version"), TQString());
if (!attr.isNull()) { if (!attr.isNull()) {
if (rootNode.toElement().tagName()=="feed") if (rootNode.toElement().tagName()=="feed")
{ {
d->format=AtomFeed; d->format=AtomFeed;
if (attr == TQString::tqfromLatin1("0.3")) if (attr == TQString::fromLatin1("0.3"))
d->version = vAtom_0_3; d->version = vAtom_0_3;
else if (attr == TQString::tqfromLatin1("0.2")) /* smt -> review */ else if (attr == TQString::fromLatin1("0.2")) /* smt -> review */
d->version = vAtom_0_2; d->version = vAtom_0_2;
else if (attr == TQString::tqfromLatin1("0.1")) /* smt -> review */ else if (attr == TQString::fromLatin1("0.1")) /* smt -> review */
d->version = vAtom_0_1; d->version = vAtom_0_1;
} }
else else
{ {
d->format=RSSFeed; d->format=RSSFeed;
if (attr == TQString::tqfromLatin1("0.91")) if (attr == TQString::fromLatin1("0.91"))
d->version = v0_91; d->version = v0_91;
else if (attr == TQString::tqfromLatin1("0.92")) else if (attr == TQString::fromLatin1("0.92"))
d->version = v0_92; d->version = v0_92;
else if (attr == TQString::tqfromLatin1("0.93")) else if (attr == TQString::fromLatin1("0.93"))
d->version = v0_93; d->version = v0_93;
else if (attr == TQString::tqfromLatin1("0.94")) else if (attr == TQString::fromLatin1("0.94"))
d->version = v0_94; d->version = v0_94;
else if (attr.startsWith("2.0") || attr == TQString::tqfromLatin1("2")) // http://www.breuls.org/rss puts 2.00 in version (BR #0000016) else if (attr.startsWith("2.0") || attr == TQString::fromLatin1("2")) // http://www.breuls.org/rss puts 2.00 in version (BR #0000016)
d->version = v2_0; d->version = v2_0;
} }
} }
if (d->format==UnknownFormat) if (d->format==UnknownFormat)
{ {
attr = rootNode.toElement().attribute(TQString::tqfromLatin1("xmlns"), TQString()); attr = rootNode.toElement().attribute(TQString::fromLatin1("xmlns"), TQString());
if (!attr.isNull()) { if (!attr.isNull()) {
/* /*
* Hardcoding these URLs is actually a bad idea, since the DTD doesn't * Hardcoding these URLs is actually a bad idea, since the DTD doesn't
@ -124,11 +124,11 @@ Document::Document(const TQDomDocument &doc) : d(new Private)
* distinguish the RSS versions by analyzing the relationship between * distinguish the RSS versions by analyzing the relationship between
* the nodes. * the nodes.
*/ */
if (attr == TQString::tqfromLatin1("http://my.netscape.com/rdf/simple/0.9/")) { if (attr == TQString::fromLatin1("http://my.netscape.com/rdf/simple/0.9/")) {
d->format=RSSFeed; d->format=RSSFeed;
d->version = v0_90; d->version = v0_90;
} }
else if (attr == TQString::tqfromLatin1("http://purl.org/rss/1.0/")) { else if (attr == TQString::fromLatin1("http://purl.org/rss/1.0/")) {
d->format=RSSFeed; d->format=RSSFeed;
d->version = v1_0; d->version = v1_0;
} }
@ -140,13 +140,13 @@ Document::Document(const TQDomDocument &doc) : d(new Private)
if (d->format == AtomFeed) if (d->format == AtomFeed)
channelNode=rootNode; channelNode=rootNode;
else else
channelNode=rootNode.namedItem(TQString::tqfromLatin1("channel")); channelNode=rootNode.namedItem(TQString::fromLatin1("channel"));
if (!(elemText = extractNode(channelNode, TQString::tqfromLatin1("title"))).isNull()) if (!(elemText = extractNode(channelNode, TQString::fromLatin1("title"))).isNull())
d->title = elemText; d->title = elemText;
if (!(elemText = extractNode(channelNode, TQString::tqfromLatin1("description"))).isNull()) if (!(elemText = extractNode(channelNode, TQString::fromLatin1("description"))).isNull())
d->description = elemText; d->description = elemText;
if (!(elemText = extractNode(channelNode, TQString::tqfromLatin1("link"))).isNull()) if (!(elemText = extractNode(channelNode, TQString::fromLatin1("link"))).isNull())
d->link = elemText; d->link = elemText;
@ -159,27 +159,27 @@ Document::Document(const TQDomDocument &doc) : d(new Private)
else else
{ {
// following is a HACK for broken 0.91 feeds like xanga.com's // following is a HACK for broken 0.91 feeds like xanga.com's
if (!rootNode.namedItem(TQString::tqfromLatin1("item")).isNull()) if (!rootNode.namedItem(TQString::fromLatin1("item")).isNull())
parentNode = rootNode; parentNode = rootNode;
else else
parentNode = channelNode; parentNode = channelNode;
} }
// image and textinput aren't supported by Atom.. handle in case feed provides // image and textinput aren't supported by Atom.. handle in case feed provides
TQDomNode n = parentNode.namedItem(TQString::tqfromLatin1("image")); TQDomNode n = parentNode.namedItem(TQString::fromLatin1("image"));
if (!n.isNull()) if (!n.isNull())
d->image = new Image(n); d->image = new Image(n);
n = parentNode.namedItem(TQString::tqfromLatin1("textinput")); n = parentNode.namedItem(TQString::fromLatin1("textinput"));
if (!n.isNull()) if (!n.isNull())
d->textInput = new TextInput(n); d->textInput = new TextInput(n);
// Our (hopefully faster) version of elementsByTagName() // Our (hopefully faster) version of elementsByTagName()
TQString tagName; TQString tagName;
if (d->format == AtomFeed) if (d->format == AtomFeed)
tagName=TQString::tqfromLatin1("entry"); tagName=TQString::fromLatin1("entry");
else else
tagName=TQString::tqfromLatin1("item"); tagName=TQString::fromLatin1("item");
for (n = parentNode.firstChild(); !n.isNull(); n = n.nextSibling()) { for (n = parentNode.firstChild(); !n.isNull(); n = n.nextSibling()) {
const TQDomElement e = n.toElement(); const TQDomElement e = n.toElement();
@ -187,212 +187,212 @@ Document::Document(const TQDomDocument &doc) : d(new Private)
d->articles.append(Article(e, d->format)); d->articles.append(Article(e, d->format));
} }
if (!(elemText = extractNode(channelNode, TQString::tqfromLatin1("copyright"))).isNull()) if (!(elemText = extractNode(channelNode, TQString::fromLatin1("copyright"))).isNull())
d->copyright = elemText; d->copyright = elemText;
if (d->format == AtomFeed) if (d->format == AtomFeed)
elemText = rootNode.toElement().attribute(TQString::tqfromLatin1("xml:lang"), TQString()); elemText = rootNode.toElement().attribute(TQString::fromLatin1("xml:lang"), TQString());
else else
elemText = extractNode(channelNode, TQString::tqfromLatin1("language")); elemText = extractNode(channelNode, TQString::fromLatin1("language"));
if (!elemText.isNull()){ if (!elemText.isNull()){
if (elemText == TQString::tqfromLatin1("af")) if (elemText == TQString::fromLatin1("af"))
d->language = af; d->language = af;
else if (elemText == TQString::tqfromLatin1("sq")) else if (elemText == TQString::fromLatin1("sq"))
d->language = sq; d->language = sq;
else if (elemText == TQString::tqfromLatin1("eu")) else if (elemText == TQString::fromLatin1("eu"))
d->language = eu; d->language = eu;
else if (elemText == TQString::tqfromLatin1("be")) else if (elemText == TQString::fromLatin1("be"))
d->language = be; d->language = be;
else if (elemText == TQString::tqfromLatin1("bg")) else if (elemText == TQString::fromLatin1("bg"))
d->language = bg; d->language = bg;
else if (elemText == TQString::tqfromLatin1("ca")) else if (elemText == TQString::fromLatin1("ca"))
d->language = ca; d->language = ca;
else if (elemText == TQString::tqfromLatin1("zh-cn")) else if (elemText == TQString::fromLatin1("zh-cn"))
d->language = zh_cn; d->language = zh_cn;
else if (elemText == TQString::tqfromLatin1("zh-tw")) else if (elemText == TQString::fromLatin1("zh-tw"))
d->language = zh_tw; d->language = zh_tw;
else if (elemText == TQString::tqfromLatin1("hr")) else if (elemText == TQString::fromLatin1("hr"))
d->language = hr; d->language = hr;
else if (elemText == TQString::tqfromLatin1("cs")) else if (elemText == TQString::fromLatin1("cs"))
d->language = cs; d->language = cs;
else if (elemText == TQString::tqfromLatin1("da")) else if (elemText == TQString::fromLatin1("da"))
d->language = da; d->language = da;
else if (elemText == TQString::tqfromLatin1("nl")) else if (elemText == TQString::fromLatin1("nl"))
d->language = nl; d->language = nl;
else if (elemText == TQString::tqfromLatin1("nl-be")) else if (elemText == TQString::fromLatin1("nl-be"))
d->language = nl_be; d->language = nl_be;
else if (elemText == TQString::tqfromLatin1("nl-nl")) else if (elemText == TQString::fromLatin1("nl-nl"))
d->language = nl_nl; d->language = nl_nl;
else if (elemText == TQString::tqfromLatin1("en")) else if (elemText == TQString::fromLatin1("en"))
d->language = en; d->language = en;
else if (elemText == TQString::tqfromLatin1("en-au")) else if (elemText == TQString::fromLatin1("en-au"))
d->language = en_au; d->language = en_au;
else if (elemText == TQString::tqfromLatin1("en-bz")) else if (elemText == TQString::fromLatin1("en-bz"))
d->language = en_bz; d->language = en_bz;
else if (elemText == TQString::tqfromLatin1("en-ca")) else if (elemText == TQString::fromLatin1("en-ca"))
d->language = en_ca; d->language = en_ca;
else if (elemText == TQString::tqfromLatin1("en-ie")) else if (elemText == TQString::fromLatin1("en-ie"))
d->language = en_ie; d->language = en_ie;
else if (elemText == TQString::tqfromLatin1("en-jm")) else if (elemText == TQString::fromLatin1("en-jm"))
d->language = en_jm; d->language = en_jm;
else if (elemText == TQString::tqfromLatin1("en-nz")) else if (elemText == TQString::fromLatin1("en-nz"))
d->language = en_nz; d->language = en_nz;
else if (elemText == TQString::tqfromLatin1("en-ph")) else if (elemText == TQString::fromLatin1("en-ph"))
d->language = en_ph; d->language = en_ph;
else if (elemText == TQString::tqfromLatin1("en-za")) else if (elemText == TQString::fromLatin1("en-za"))
d->language = en_za; d->language = en_za;
else if (elemText == TQString::tqfromLatin1("en-tt")) else if (elemText == TQString::fromLatin1("en-tt"))
d->language = en_tt; d->language = en_tt;
else if (elemText == TQString::tqfromLatin1("en-gb")) else if (elemText == TQString::fromLatin1("en-gb"))
d->language = en_gb; d->language = en_gb;
else if (elemText == TQString::tqfromLatin1("en-us")) else if (elemText == TQString::fromLatin1("en-us"))
d->language = en_us; d->language = en_us;
else if (elemText == TQString::tqfromLatin1("en-zw")) else if (elemText == TQString::fromLatin1("en-zw"))
d->language = en_zw; d->language = en_zw;
else if (elemText == TQString::tqfromLatin1("fo")) else if (elemText == TQString::fromLatin1("fo"))
d->language = fo; d->language = fo;
else if (elemText == TQString::tqfromLatin1("fi")) else if (elemText == TQString::fromLatin1("fi"))
d->language = fi; d->language = fi;
else if (elemText == TQString::tqfromLatin1("fr")) else if (elemText == TQString::fromLatin1("fr"))
d->language = fr; d->language = fr;
else if (elemText == TQString::tqfromLatin1("fr-be")) else if (elemText == TQString::fromLatin1("fr-be"))
d->language = fr_be; d->language = fr_be;
else if (elemText == TQString::tqfromLatin1("fr-ca")) else if (elemText == TQString::fromLatin1("fr-ca"))
d->language = fr_ca; d->language = fr_ca;
else if (elemText == TQString::tqfromLatin1("fr-fr")) else if (elemText == TQString::fromLatin1("fr-fr"))
d->language = fr_fr; d->language = fr_fr;
else if (elemText == TQString::tqfromLatin1("fr-lu")) else if (elemText == TQString::fromLatin1("fr-lu"))
d->language = fr_lu; d->language = fr_lu;
else if (elemText == TQString::tqfromLatin1("fr-mc")) else if (elemText == TQString::fromLatin1("fr-mc"))
d->language = fr_mc; d->language = fr_mc;
else if (elemText == TQString::tqfromLatin1("fr-ch")) else if (elemText == TQString::fromLatin1("fr-ch"))
d->language = fr_ch; d->language = fr_ch;
else if (elemText == TQString::tqfromLatin1("gl")) else if (elemText == TQString::fromLatin1("gl"))
d->language = gl; d->language = gl;
else if (elemText == TQString::tqfromLatin1("gd")) else if (elemText == TQString::fromLatin1("gd"))
d->language = gd; d->language = gd;
else if (elemText == TQString::tqfromLatin1("de")) else if (elemText == TQString::fromLatin1("de"))
d->language = de; d->language = de;
else if (elemText == TQString::tqfromLatin1("de-at")) else if (elemText == TQString::fromLatin1("de-at"))
d->language = de_at; d->language = de_at;
else if (elemText == TQString::tqfromLatin1("de-de")) else if (elemText == TQString::fromLatin1("de-de"))
d->language = de_de; d->language = de_de;
else if (elemText == TQString::tqfromLatin1("de-li")) else if (elemText == TQString::fromLatin1("de-li"))
d->language = de_li; d->language = de_li;
else if (elemText == TQString::tqfromLatin1("de-lu")) else if (elemText == TQString::fromLatin1("de-lu"))
d->language = de_lu; d->language = de_lu;
else if (elemText == TQString::tqfromLatin1("de-ch")) else if (elemText == TQString::fromLatin1("de-ch"))
d->language = de_ch; d->language = de_ch;
else if (elemText == TQString::tqfromLatin1("el")) else if (elemText == TQString::fromLatin1("el"))
d->language = el; d->language = el;
else if (elemText == TQString::tqfromLatin1("hu")) else if (elemText == TQString::fromLatin1("hu"))
d->language = hu; d->language = hu;
else if (elemText == TQString::tqfromLatin1("is")) else if (elemText == TQString::fromLatin1("is"))
d->language = is; d->language = is;
else if (elemText == TQString::tqfromLatin1("id")) else if (elemText == TQString::fromLatin1("id"))
d->language = id; d->language = id;
else if (elemText == TQString::tqfromLatin1("ga")) else if (elemText == TQString::fromLatin1("ga"))
d->language = ga; d->language = ga;
else if (elemText == TQString::tqfromLatin1("it")) else if (elemText == TQString::fromLatin1("it"))
d->language = it; d->language = it;
else if (elemText == TQString::tqfromLatin1("it-it")) else if (elemText == TQString::fromLatin1("it-it"))
d->language = it_it; d->language = it_it;
else if (elemText == TQString::tqfromLatin1("it-ch")) else if (elemText == TQString::fromLatin1("it-ch"))
d->language = it_ch; d->language = it_ch;
else if (elemText == TQString::tqfromLatin1("ja")) else if (elemText == TQString::fromLatin1("ja"))
d->language = ja; d->language = ja;
else if (elemText == TQString::tqfromLatin1("ko")) else if (elemText == TQString::fromLatin1("ko"))
d->language = ko; d->language = ko;
else if (elemText == TQString::tqfromLatin1("mk")) else if (elemText == TQString::fromLatin1("mk"))
d->language = mk; d->language = mk;
else if (elemText == TQString::tqfromLatin1("no")) else if (elemText == TQString::fromLatin1("no"))
d->language = no; d->language = no;
else if (elemText == TQString::tqfromLatin1("pl")) else if (elemText == TQString::fromLatin1("pl"))
d->language = pl; d->language = pl;
else if (elemText == TQString::tqfromLatin1("pt")) else if (elemText == TQString::fromLatin1("pt"))
d->language = pt; d->language = pt;
else if (elemText == TQString::tqfromLatin1("pt-br")) else if (elemText == TQString::fromLatin1("pt-br"))
d->language = pt_br; d->language = pt_br;
else if (elemText == TQString::tqfromLatin1("pt-pt")) else if (elemText == TQString::fromLatin1("pt-pt"))
d->language = pt_pt; d->language = pt_pt;
else if (elemText == TQString::tqfromLatin1("ro")) else if (elemText == TQString::fromLatin1("ro"))
d->language = ro; d->language = ro;
else if (elemText == TQString::tqfromLatin1("ro-mo")) else if (elemText == TQString::fromLatin1("ro-mo"))
d->language = ro_mo; d->language = ro_mo;
else if (elemText == TQString::tqfromLatin1("ro-ro")) else if (elemText == TQString::fromLatin1("ro-ro"))
d->language = ro_ro; d->language = ro_ro;
else if (elemText == TQString::tqfromLatin1("ru")) else if (elemText == TQString::fromLatin1("ru"))
d->language = ru; d->language = ru;
else if (elemText == TQString::tqfromLatin1("ru-mo")) else if (elemText == TQString::fromLatin1("ru-mo"))
d->language = ru_mo; d->language = ru_mo;
else if (elemText == TQString::tqfromLatin1("ru-ru")) else if (elemText == TQString::fromLatin1("ru-ru"))
d->language = ru_ru; d->language = ru_ru;
else if (elemText == TQString::tqfromLatin1("sr")) else if (elemText == TQString::fromLatin1("sr"))
d->language = sr; d->language = sr;
else if (elemText == TQString::tqfromLatin1("sk")) else if (elemText == TQString::fromLatin1("sk"))
d->language = sk; d->language = sk;
else if (elemText == TQString::tqfromLatin1("sl")) else if (elemText == TQString::fromLatin1("sl"))
d->language = sl; d->language = sl;
else if (elemText == TQString::tqfromLatin1("es")) else if (elemText == TQString::fromLatin1("es"))
d->language = es; d->language = es;
else if (elemText == TQString::tqfromLatin1("es-ar")) else if (elemText == TQString::fromLatin1("es-ar"))
d->language = es_ar; d->language = es_ar;
else if (elemText == TQString::tqfromLatin1("es-bo")) else if (elemText == TQString::fromLatin1("es-bo"))
d->language = es_bo; d->language = es_bo;
else if (elemText == TQString::tqfromLatin1("es-cl")) else if (elemText == TQString::fromLatin1("es-cl"))
d->language = es_cl; d->language = es_cl;
else if (elemText == TQString::tqfromLatin1("es-co")) else if (elemText == TQString::fromLatin1("es-co"))
d->language = es_co; d->language = es_co;
else if (elemText == TQString::tqfromLatin1("es-cr")) else if (elemText == TQString::fromLatin1("es-cr"))
d->language = es_cr; d->language = es_cr;
else if (elemText == TQString::tqfromLatin1("es-do")) else if (elemText == TQString::fromLatin1("es-do"))
d->language = es_do; d->language = es_do;
else if (elemText == TQString::tqfromLatin1("es-ec")) else if (elemText == TQString::fromLatin1("es-ec"))
d->language = es_ec; d->language = es_ec;
else if (elemText == TQString::tqfromLatin1("es-sv")) else if (elemText == TQString::fromLatin1("es-sv"))
d->language = es_sv; d->language = es_sv;
else if (elemText == TQString::tqfromLatin1("es-gt")) else if (elemText == TQString::fromLatin1("es-gt"))
d->language = es_gt; d->language = es_gt;
else if (elemText == TQString::tqfromLatin1("es-hn")) else if (elemText == TQString::fromLatin1("es-hn"))
d->language = es_hn; d->language = es_hn;
else if (elemText == TQString::tqfromLatin1("es-mx")) else if (elemText == TQString::fromLatin1("es-mx"))
d->language = es_mx; d->language = es_mx;
else if (elemText == TQString::tqfromLatin1("es-ni")) else if (elemText == TQString::fromLatin1("es-ni"))
d->language = es_ni; d->language = es_ni;
else if (elemText == TQString::tqfromLatin1("es-pa")) else if (elemText == TQString::fromLatin1("es-pa"))
d->language = es_pa; d->language = es_pa;
else if (elemText == TQString::tqfromLatin1("es-py")) else if (elemText == TQString::fromLatin1("es-py"))
d->language = es_py; d->language = es_py;
else if (elemText == TQString::tqfromLatin1("es-pe")) else if (elemText == TQString::fromLatin1("es-pe"))
d->language = es_pe; d->language = es_pe;
else if (elemText == TQString::tqfromLatin1("es-pr")) else if (elemText == TQString::fromLatin1("es-pr"))
d->language = es_pr; d->language = es_pr;
else if (elemText == TQString::tqfromLatin1("es-es")) else if (elemText == TQString::fromLatin1("es-es"))
d->language = es_es; d->language = es_es;
else if (elemText == TQString::tqfromLatin1("es-uy")) else if (elemText == TQString::fromLatin1("es-uy"))
d->language = es_uy; d->language = es_uy;
else if (elemText == TQString::tqfromLatin1("es-ve")) else if (elemText == TQString::fromLatin1("es-ve"))
d->language = es_ve; d->language = es_ve;
else if (elemText == TQString::tqfromLatin1("sv")) else if (elemText == TQString::fromLatin1("sv"))
d->language = sv; d->language = sv;
else if (elemText == TQString::tqfromLatin1("sv-fi")) else if (elemText == TQString::fromLatin1("sv-fi"))
d->language = sv_fi; d->language = sv_fi;
else if (elemText == TQString::tqfromLatin1("sv-se")) else if (elemText == TQString::fromLatin1("sv-se"))
d->language = sv_se; d->language = sv_se;
else if (elemText == TQString::tqfromLatin1("tr")) else if (elemText == TQString::fromLatin1("tr"))
d->language = tr; d->language = tr;
else if (elemText == TQString::tqfromLatin1("uk")) else if (elemText == TQString::fromLatin1("uk"))
d->language = uk; d->language = uk;
else else
d->language = UndefinedLanguage; d->language = UndefinedLanguage;
} }
if (d->format == AtomFeed) if (d->format == AtomFeed)
tagName=TQString::tqfromLatin1("issued"); // atom doesn't specify this for feeds tagName=TQString::fromLatin1("issued"); // atom doesn't specify this for feeds
// but some broken feeds do this // but some broken feeds do this
else else
tagName=TQString::tqfromLatin1("pubDate"); tagName=TQString::fromLatin1("pubDate");
if (!(elemText = extractNode(channelNode, tagName)).isNull()) { if (!(elemText = extractNode(channelNode, tagName)).isNull()) {
time_t _time; time_t _time;
@ -408,7 +408,7 @@ Document::Document(const TQDomDocument &doc) : d(new Private)
d->pubDate.setTime_t(_time); d->pubDate.setTime_t(_time);
} }
if (!(elemText = extractNode(channelNode, TQString::tqfromLatin1("dc:date"))).isNull()) { if (!(elemText = extractNode(channelNode, TQString::fromLatin1("dc:date"))).isNull()) {
time_t _time = parseISO8601Date(elemText); time_t _time = parseISO8601Date(elemText);
/* \bug This isn't really the right way since it will set the date to /* \bug This isn't really the right way since it will set the date to
* Jan 1 1970, 1:00:00 if the passed date was invalid; this means that * Jan 1 1970, 1:00:00 if the passed date was invalid; this means that
@ -418,9 +418,9 @@ Document::Document(const TQDomDocument &doc) : d(new Private)
} }
if (d->format == AtomFeed) if (d->format == AtomFeed)
tagName=TQString::tqfromLatin1("modified"); tagName=TQString::fromLatin1("modified");
else else
tagName=TQString::tqfromLatin1("lastBuildDate"); tagName=TQString::fromLatin1("lastBuildDate");
if (!(elemText = extractNode(channelNode, tagName)).isNull()) { if (!(elemText = extractNode(channelNode, tagName)).isNull()) {
time_t _time; time_t _time;
if (d->format == AtomFeed) if (d->format == AtomFeed)
@ -430,44 +430,44 @@ Document::Document(const TQDomDocument &doc) : d(new Private)
d->lastBuildDate.setTime_t(_time); d->lastBuildDate.setTime_t(_time);
} }
if (!(elemText = extractNode(channelNode, TQString::tqfromLatin1("rating"))).isNull()) if (!(elemText = extractNode(channelNode, TQString::fromLatin1("rating"))).isNull())
d->rating = elemText; d->rating = elemText;
if (!(elemText = extractNode(channelNode, TQString::tqfromLatin1("docs"))).isNull()) if (!(elemText = extractNode(channelNode, TQString::fromLatin1("docs"))).isNull())
d->docs = elemText; d->docs = elemText;
if (!(elemText = extractNode(channelNode, TQString::tqfromLatin1((d->format == AtomFeed) ? "author" : "managingEditor"))).isNull()) if (!(elemText = extractNode(channelNode, TQString::fromLatin1((d->format == AtomFeed) ? "author" : "managingEditor"))).isNull())
d->managingEditor = elemText; d->managingEditor = elemText;
if (!(elemText = extractNode(channelNode, TQString::tqfromLatin1("webMaster"))).isNull()) if (!(elemText = extractNode(channelNode, TQString::fromLatin1("webMaster"))).isNull())
d->webMaster = elemText; d->webMaster = elemText;
if (!(elemText = extractNode(channelNode, TQString::tqfromLatin1("ttl"))).isNull()) if (!(elemText = extractNode(channelNode, TQString::fromLatin1("ttl"))).isNull())
d->ttl = elemText.toUInt(); d->ttl = elemText.toUInt();
n = channelNode.namedItem(TQString::tqfromLatin1("skipHours")); n = channelNode.namedItem(TQString::fromLatin1("skipHours"));
if (!n.isNull()) if (!n.isNull())
for (TQDomElement e = n.firstChild().toElement(); !e.isNull(); e = e.nextSibling().toElement()) for (TQDomElement e = n.firstChild().toElement(); !e.isNull(); e = e.nextSibling().toElement())
if (e.tagName() == TQString::tqfromLatin1("hour")) if (e.tagName() == TQString::fromLatin1("hour"))
d->skipHours.append(e.text().toUInt()); d->skipHours.append(e.text().toUInt());
n = channelNode.namedItem(TQString::tqfromLatin1("skipDays")); n = channelNode.namedItem(TQString::fromLatin1("skipDays"));
if (!n.isNull()) { if (!n.isNull()) {
Day day; Day day;
TQString elemText; TQString elemText;
for (TQDomElement e = n.firstChild().toElement(); !e.isNull(); e = e.nextSibling().toElement()) for (TQDomElement e = n.firstChild().toElement(); !e.isNull(); e = e.nextSibling().toElement())
if (e.tagName() == TQString::tqfromLatin1("day")) { if (e.tagName() == TQString::fromLatin1("day")) {
elemText = e.text().lower(); elemText = e.text().lower();
if (elemText == TQString::tqfromLatin1("monday")) if (elemText == TQString::fromLatin1("monday"))
day = Monday; day = Monday;
else if (elemText == TQString::tqfromLatin1("tuesday")) else if (elemText == TQString::fromLatin1("tuesday"))
day = Tuesday; day = Tuesday;
else if (elemText == TQString::tqfromLatin1("wednesday")) else if (elemText == TQString::fromLatin1("wednesday"))
day = Wednesday; day = Wednesday;
else if (elemText == TQString::tqfromLatin1("thursday")) else if (elemText == TQString::fromLatin1("thursday"))
day = Thursday; day = Thursday;
else if (elemText == TQString::tqfromLatin1("friday")) else if (elemText == TQString::fromLatin1("friday"))
day = Friday; day = Friday;
else if (elemText == TQString::tqfromLatin1("saturday")) else if (elemText == TQString::fromLatin1("saturday"))
day = Saturday; day = Saturday;
else if (elemText == TQString::tqfromLatin1("sunday")) else if (elemText == TQString::fromLatin1("sunday"))
day = Sunday; day = Sunday;
else else
day = UndefinedDay; day = UndefinedDay;
@ -496,16 +496,16 @@ Version Document::version() const
TQString Document::verbVersion() const TQString Document::verbVersion() const
{ {
switch (d->version) { switch (d->version) {
case v0_90: return TQString::tqfromLatin1("0.90"); case v0_90: return TQString::fromLatin1("0.90");
case v0_91: return TQString::tqfromLatin1("0.91"); case v0_91: return TQString::fromLatin1("0.91");
case v0_92: return TQString::tqfromLatin1("0.92"); case v0_92: return TQString::fromLatin1("0.92");
case v0_93: return TQString::tqfromLatin1("0.93"); case v0_93: return TQString::fromLatin1("0.93");
case v0_94: return TQString::tqfromLatin1("0.94"); case v0_94: return TQString::fromLatin1("0.94");
case v1_0: return TQString::tqfromLatin1("1.0"); case v1_0: return TQString::fromLatin1("1.0");
case v2_0: return TQString::tqfromLatin1("2.0"); case v2_0: return TQString::fromLatin1("2.0");
case vAtom_0_3: return TQString::tqfromLatin1("0.3"); case vAtom_0_3: return TQString::fromLatin1("0.3");
case vAtom_0_2: return TQString::tqfromLatin1("0.2"); case vAtom_0_2: return TQString::fromLatin1("0.2");
case vAtom_0_1: return TQString::tqfromLatin1("0.1"); case vAtom_0_1: return TQString::fromLatin1("0.1");
} }
return TQString(); return TQString();
} }

@ -39,7 +39,7 @@ namespace RSS
* Possible status values returned by the signal * Possible status values returned by the signal
* Loader::loadingComplete(). * Loader::loadingComplete().
*/ */
enum tqStatus { enum Status {
Success, /** Success, /**
* Nothing went wrong so far, but you still have to check * Nothing went wrong so far, but you still have to check
* what values are returned by the classes since it's not * what values are returned by the classes since it's not

@ -48,17 +48,17 @@ Image::Image(const TQDomNode &node) : TQObject(), d(new Private)
{ {
TQString elemText; TQString elemText;
if (!(elemText = extractNode(node, TQString::tqfromLatin1("title"))).isNull()) if (!(elemText = extractNode(node, TQString::fromLatin1("title"))).isNull())
d->title = elemText; d->title = elemText;
if (!(elemText = extractNode(node, TQString::tqfromLatin1("url"))).isNull()) if (!(elemText = extractNode(node, TQString::fromLatin1("url"))).isNull())
d->url = elemText; d->url = elemText;
if (!(elemText = extractNode(node, TQString::tqfromLatin1("link"))).isNull()) if (!(elemText = extractNode(node, TQString::fromLatin1("link"))).isNull())
d->link = elemText; d->link = elemText;
if (!(elemText = extractNode(node, TQString::tqfromLatin1("description"))).isNull()) if (!(elemText = extractNode(node, TQString::fromLatin1("description"))).isNull())
d->description = elemText; d->description = elemText;
if (!(elemText = extractNode(node, TQString::tqfromLatin1("height"))).isNull()) if (!(elemText = extractNode(node, TQString::fromLatin1("height"))).isNull())
d->height = elemText.toUInt(); d->height = elemText.toUInt();
if (!(elemText = extractNode(node, TQString::tqfromLatin1("width"))).isNull()) if (!(elemText = extractNode(node, TQString::fromLatin1("width"))).isNull())
d->width = elemText.toUInt(); d->width = elemText.toUInt();
} }

@ -240,7 +240,7 @@ Loader *Loader::create()
Loader *Loader::create(TQObject *object, const char *slot) Loader *Loader::create(TQObject *object, const char *slot)
{ {
Loader *loader = create(); Loader *loader = create();
connect(loader, TQT_SIGNAL(loadingComplete(Loader *, Document, tqStatus)), connect(loader, TQT_SIGNAL(loadingComplete(Loader *, Document, Status)),
object, slot); object, slot);
return loader; return loader;
} }
@ -300,7 +300,7 @@ void Loader::slotRetrieverDone(const TQByteArray &data, bool success)
d->retriever = NULL; d->retriever = NULL;
Document rssDoc; Document rssDoc;
tqStatus status = Success; Status status = Success;
if (success) { if (success) {
TQDomDocument doc; TQDomDocument doc;

@ -209,8 +209,8 @@ namespace RSS
* *
* \code * \code
* Loader *loader = Loader::create(); * Loader *loader = Loader::create();
* connect(loader, TQT_SIGNAL(loadingComplete(Loader *, Document, tqStatus)), * connect(loader, TQT_SIGNAL(loadingComplete(Loader *, Document, Status)),
* this, TQT_SLOT(slotLoadingComplete(Loader *, Document, tqStatus))); * this, TQT_SLOT(slotLoadingComplete(Loader *, Document, Status)));
* loader->loadFrom("http://www.blah.org/foobar.rdf", new FileRetriever); * loader->loadFrom("http://www.blah.org/foobar.rdf", new FileRetriever);
* \endcode * \endcode
* *
@ -234,7 +234,7 @@ namespace RSS
* 'slotLoadingComplete' method might look like this: * 'slotLoadingComplete' method might look like this:
* *
* \code * \code
* void MyClass::slotLoadingComplete(Loader *loader, Document doc, tqStatus status) * void MyClass::slotLoadingComplete(Loader *loader, Document doc, Status status)
* { * {
* // Note that Loader::~Loader() is private, so you cannot delete Loader instances. * // Note that Loader::~Loader() is private, so you cannot delete Loader instances.
* // You don't need to do that anyway since Loader instances delete themselves. * // You don't need to do that anyway since Loader instances delete themselves.
@ -320,9 +320,9 @@ namespace RSS
* the case if you intend to call getPixmap() on Document::image()! * the case if you intend to call getPixmap() on Document::image()!
* @param status A status byte telling whether there were any problems * @param status A status byte telling whether there were any problems
* while retrieving or parsing the data. * while retrieving or parsing the data.
* @see Document, tqStatus * @see Document, Status
*/ */
void loadingComplete(Loader *loader, Document doc, tqStatus status); void loadingComplete(Loader *loader, Document doc, Status status);
private slots: private slots:
void slotRetrieverDone(const TQByteArray &data, bool success); void slotRetrieverDone(const TQByteArray &data, bool success);

@ -19,12 +19,12 @@ static const KCmdLineOptions options[] =
void Tester::test( const TQString &url ) void Tester::test( const TQString &url )
{ {
Loader *loader = Loader::create(); Loader *loader = Loader::create();
connect( loader, TQT_SIGNAL( loadingComplete( Loader *, Document, tqStatus ) ), connect( loader, TQT_SIGNAL( loadingComplete( Loader *, Document, Status ) ),
this, TQT_SLOT( slotLoadingComplete( Loader *, Document, tqStatus ) ) ); this, TQT_SLOT( slotLoadingComplete( Loader *, Document, Status ) ) );
loader->loadFrom( url, new FileRetriever ); loader->loadFrom( url, new FileRetriever );
} }
void Tester::slotLoadingComplete( Loader *loader, Document doc, tqStatus status ) void Tester::slotLoadingComplete( Loader *loader, Document doc, Status status )
{ {
if ( status == Success ) if ( status == Success )
{ {

@ -10,7 +10,7 @@
using RSS::Loader; using RSS::Loader;
using RSS::Document; using RSS::Document;
using RSS::tqStatus; using RSS::Status;
class Tester : public TQObject class Tester : public TQObject
{ {
@ -20,7 +20,7 @@ class Tester : public TQObject
void test( const TQString &url ); void test( const TQString &url );
private slots: private slots:
void slotLoadingComplete( Loader *loader, Document doc, tqStatus status ); void slotLoadingComplete( Loader *loader, Document doc, Status status );
}; };
#endif #endif

@ -38,13 +38,13 @@ TextInput::TextInput(const TQDomNode &node) : d(new Private)
{ {
TQString elemText; TQString elemText;
if (!(elemText = extractNode(node, TQString::tqfromLatin1("title"))).isNull()) if (!(elemText = extractNode(node, TQString::fromLatin1("title"))).isNull())
d->title = elemText; d->title = elemText;
if (!(elemText = extractNode(node, TQString::tqfromLatin1("description"))).isNull()) if (!(elemText = extractNode(node, TQString::fromLatin1("description"))).isNull())
d->description = elemText; d->description = elemText;
if (!(elemText = extractNode(node, TQString::tqfromLatin1("name")))) if (!(elemText = extractNode(node, TQString::fromLatin1("name"))))
d->name = elemText; d->name = elemText;
if (!(elemText = extractNode(node, TQString::tqfromLatin1("link"))).isNull()) if (!(elemText = extractNode(node, TQString::fromLatin1("link"))).isNull())
d->link = elemText; d->link = elemText;
} }

@ -223,7 +223,7 @@ namespace kt
RssArticle::List::iterator it; RssArticle::List::iterator it;
for ( it = m_articles.begin(); it != m_articles.end(); ) for ( it = m_articles.begin(); it != m_articles.end(); )
{ {
if ((*it).pubDate().daysTo(TQDateTime::tqcurrentDateTime()) > m_articleAge) if ((*it).pubDate().daysTo(TQDateTime::currentDateTime()) > m_articleAge)
{ {
it = m_articles.erase(it); it = m_articles.erase(it);
removed = true; removed = true;
@ -254,12 +254,12 @@ namespace kt
feedLoading = true; feedLoading = true;
cleanArticles(); cleanArticles();
Loader * feedLoader = Loader::create(); Loader * feedLoader = Loader::create();
connect( feedLoader, TQT_SIGNAL( loadingComplete( Loader *, Document, tqStatus ) ), connect( feedLoader, TQT_SIGNAL( loadingComplete( Loader *, Document, Status ) ),
this, TQT_SLOT( feedLoaded( Loader *, Document, tqStatus ) ) ); this, TQT_SLOT( feedLoaded( Loader *, Document, Status ) ) );
feedLoader->loadFrom( m_feedUrl, new FileRetriever ); feedLoader->loadFrom( m_feedUrl, new FileRetriever );
} }
void RssFeed::feedLoaded(Loader *feedLoader, Document doc, tqStatus status) void RssFeed::feedLoaded(Loader *feedLoader, Document doc, Status status)
{ {
feedLoading = false; feedLoading = false;
@ -290,7 +290,7 @@ namespace kt
for (int i=doc.articles().count()-1; i>=0; i--) for (int i=doc.articles().count()-1; i>=0; i--)
{ {
curArticle = doc.articles()[i]; curArticle = doc.articles()[i];
if (curArticle.pubDate().daysTo(TQDateTime::tqcurrentDateTime()) < m_articleAge && !m_articles.contains(curArticle)) if (curArticle.pubDate().daysTo(TQDateTime::currentDateTime()) < m_articleAge && !m_articles.contains(curArticle))
{ {
m_articles.prepend(curArticle); m_articles.prepend(curArticle);
emit scanRssArticle(curArticle); emit scanRssArticle(curArticle);
@ -306,8 +306,8 @@ namespace kt
qDebug( "There was and error loading the feed\n"); qDebug( "There was and error loading the feed\n");
} }
disconnect( feedLoader, TQT_SIGNAL( loadingComplete( Loader *, Document, tqStatus ) ), disconnect( feedLoader, TQT_SIGNAL( loadingComplete( Loader *, Document, Status ) ),
this, TQT_SLOT( feedLoaded( Loader *, Document, tqStatus ) ) ); this, TQT_SLOT( feedLoaded( Loader *, Document, Status ) ) );
feedLoader->deleteLater(); feedLoader->deleteLater();
} }

@ -73,7 +73,7 @@ namespace kt
public slots: public slots:
void refreshFeed(); void refreshFeed();
void feedLoaded(Loader *feedLoader, Document doc, tqStatus status); void feedLoaded(Loader *feedLoader, Document doc, Status status);
void clearArticles(); void clearArticles();

@ -152,7 +152,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>90</width> <width>90</width>
<height>21</height> <height>21</height>
@ -252,7 +252,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>60</width> <width>60</width>
<height>21</height> <height>21</height>
@ -600,7 +600,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Preferred</enum> <enum>Preferred</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>50</width> <width>50</width>
<height>21</height> <height>21</height>
@ -614,7 +614,7 @@
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="tqmaximumSize"> <property name="maximumSize">
<size> <size>
<width>60</width> <width>60</width>
<height>32767</height> <height>32767</height>
@ -633,7 +633,7 @@
<property name="name"> <property name="name">
<cstring>seriesBox</cstring> <cstring>seriesBox</cstring>
</property> </property>
<property name="tqmaximumSize"> <property name="maximumSize">
<size> <size>
<width>32000</width> <width>32000</width>
<height>32000</height> <height>32000</height>
@ -664,7 +664,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>21</height> <height>21</height>
@ -910,7 +910,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>170</width> <width>170</width>
<height>21</height> <height>21</height>

@ -302,8 +302,8 @@ namespace kt
regEx.setPattern(*episodeFormats.at(i)); regEx.setPattern(*episodeFormats.at(i));
if (regEx.search(article.title()) >= 0) if (regEx.search(article.title()) >= 0)
{ {
season = (*regEx.tqcapturedTexts().at(1)).toInt(); season = (*regEx.capturedTexts().at(1)).toInt();
episode = (*regEx.tqcapturedTexts().at(2)).toInt(); episode = (*regEx.capturedTexts().at(2)).toInt();
if (!episodeInRange(season,episode,ignoreMatches,alreadyDownloaded)) if (!episodeInRange(season,episode,ignoreMatches,alreadyDownloaded))
{ {
return false; return false;
@ -313,8 +313,8 @@ namespace kt
if (regEx.search(article.link().prettyURL()) >= 0) if (regEx.search(article.link().prettyURL()) >= 0)
{ {
season = (*regEx.tqcapturedTexts().at(1)).toInt(); season = (*regEx.capturedTexts().at(1)).toInt();
episode = (*regEx.tqcapturedTexts().at(2)).toInt(); episode = (*regEx.capturedTexts().at(2)).toInt();
if (!episodeInRange(season,episode,ignoreMatches,alreadyDownloaded)) if (!episodeInRange(season,episode,ignoreMatches,alreadyDownloaded))
{ {
return false; return false;
@ -324,8 +324,8 @@ namespace kt
if (regEx.search(article.description()) >= 0) if (regEx.search(article.description()) >= 0)
{ {
season = (*regEx.tqcapturedTexts().at(1)).toInt(); season = (*regEx.capturedTexts().at(1)).toInt();
episode = (*regEx.tqcapturedTexts().at(2)).toInt(); episode = (*regEx.capturedTexts().at(2)).toInt();
if (!episodeInRange(season,episode,ignoreMatches,alreadyDownloaded)) if (!episodeInRange(season,episode,ignoreMatches,alreadyDownloaded))
{ {
return false; return false;

@ -42,8 +42,8 @@ namespace kt
{ {
public: public:
FilterMatch() { m_season = 0; m_episode = 0; m_time = TQDateTime::tqcurrentDateTime().toString(); m_link=TQString(); }; FilterMatch() { m_season = 0; m_episode = 0; m_time = TQDateTime::currentDateTime().toString(); m_link=TQString(); };
FilterMatch(int season, int episode, TQString link, TQString time = TQDateTime::tqcurrentDateTime().toString()); FilterMatch(int season, int episode, TQString link, TQString time = TQDateTime::currentDateTime().toString());
FilterMatch(const FilterMatch &other); FilterMatch(const FilterMatch &other);
FilterMatch &operator=(const FilterMatch &other); FilterMatch &operator=(const FilterMatch &other);
bool operator==(const FilterMatch &other) const; bool operator==(const FilterMatch &other) const;

@ -59,10 +59,10 @@ namespace kt
} }
void RssLinkDownloader::processLink(KIO::Job* jobtqStatus) void RssLinkDownloader::processLink(KIO::Job* jobStatus)
{ {
if (!jobtqStatus->error()) if (!jobStatus->error())
{ {
//the file downloaded ok - so let's check if it's a torrent //the file downloaded ok - so let's check if it's a torrent
KMimeType linkType = *KMimeType::findByContent(curFile->data()); KMimeType linkType = *KMimeType::findByContent(curFile->data());
@ -100,15 +100,15 @@ namespace kt
hrefText = TQString("HREF=\"?([^\">< ]*)[\" ]"); hrefText = TQString("HREF=\"?([^\">< ]*)[\" ]");
hrefText.setCaseSensitive(false); hrefText.setCaseSensitive(false);
hrefTags.tqcapturedTexts()[0].find(hrefText); hrefTags.capturedTexts()[0].find(hrefText);
//lets get the captured //lets get the captured
TQString hrefLink = hrefText.capturedTexts()[1]; TQString hrefLink = hrefText.capturedTexts()[1];
if (hrefLink.tqstartsWith("/")) if (hrefLink.startsWith("/"))
{ {
hrefLink = url.protocol() + "://" + url.host() + hrefLink; hrefLink = url.protocol() + "://" + url.host() + hrefLink;
} }
else if (!hrefLink.tqstartsWith("http://", false)) else if (!hrefLink.startsWith("http://", false))
{ {
hrefLink = url.url().left(url.url().findRev("/")+1) + hrefLink; hrefLink = url.url().left(url.url().findRev("/")+1) + hrefLink;
} }

@ -59,7 +59,7 @@ namespace kt
public slots: public slots:
void processLink(KIO::Job* jobtqStatus); void processLink(KIO::Job* jobStatus);
void suicide(); void suicide();
signals: signals:

@ -188,7 +188,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Fixed</enum> <enum>Fixed</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
@ -205,7 +205,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>90</height> <height>90</height>

@ -160,7 +160,7 @@ namespace kt
if(!m_enabled) if(!m_enabled)
return; return;
TQDateTime now = TQDateTime::tqcurrentDateTime(); TQDateTime now = TQDateTime::currentDateTime();
TQString prefix = TQString("BWS: %1 :: ").tqarg(now.toString()); TQString prefix = TQString("BWS: %1 :: ").tqarg(now.toString());

@ -12,13 +12,13 @@
<height>530</height> <height>530</height>
</rect> </rect>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="tqmaximumSize"> <property name="maximumSize">
<size> <size>
<width>750</width> <width>750</width>
<height>540</height> <height>540</height>
@ -73,7 +73,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>30</width> <width>30</width>
<height>15</height> <height>15</height>
@ -95,7 +95,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>30</width> <width>30</width>
<height>15</height> <height>15</height>
@ -117,7 +117,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>30</width> <width>30</width>
<height>15</height> <height>15</height>
@ -139,7 +139,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>30</width> <width>30</width>
<height>15</height> <height>15</height>
@ -177,7 +177,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>30</width> <width>30</width>
<height>15</height> <height>15</height>
@ -245,7 +245,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>30</width> <width>30</width>
<height>15</height> <height>15</height>
@ -267,7 +267,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>30</width> <width>30</width>
<height>15</height> <height>15</height>
@ -289,7 +289,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>30</width> <width>30</width>
<height>15</height> <height>15</height>
@ -311,7 +311,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>30</width> <width>30</width>
<height>15</height> <height>15</height>
@ -349,7 +349,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>30</width> <width>30</width>
<height>15</height> <height>15</height>
@ -581,13 +581,13 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>379</width> <width>379</width>
<height>510</height> <height>510</height>
</size> </size>
</property> </property>
<property name="tqmaximumSize"> <property name="maximumSize">
<size> <size>
<width>379</width> <width>379</width>
<height>508</height> <height>508</height>
@ -604,7 +604,7 @@
</property> </property>
<widget class="TQLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>lbltqStatus</cstring> <cstring>lblStatus</cstring>
</property> </property>
<property name="text"> <property name="text">
<string></string> <string></string>
@ -641,7 +641,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>16</height> <height>16</height>
@ -700,7 +700,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>36</width> <width>36</width>
<height>20</height> <height>20</height>
@ -728,7 +728,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>35</width> <width>35</width>
<height>20</height> <height>20</height>

@ -51,7 +51,7 @@ namespace kt
loadDefault(); loadDefault();
lbltqStatus->clear(); lblStatus->clear();
pix_icon->setPixmap(KGlobal::iconLoader()->loadIcon("clock",KIcon::NoGroup)); pix_icon->setPixmap(KGlobal::iconLoader()->loadIcon("clock",KIcon::NoGroup));
@ -162,7 +162,7 @@ namespace kt
stream << (int) schedule.getCategory(i, j); stream << (int) schedule.getCategory(i, j);
file.close(); file.close();
lbltqStatus->setText(i18n("Schedule saved.")); lblStatus->setText(i18n("Schedule saved."));
} }
void BWSPrefPageWidget::loadSchedule(TQString& fn, bool showmsg) void BWSPrefPageWidget::loadSchedule(TQString& fn, bool showmsg)
@ -205,7 +205,7 @@ namespace kt
file.close(); file.close();
m_bwsWidget->setSchedule(schedule); m_bwsWidget->setSchedule(schedule);
lbltqStatus->setText(i18n("Schedule loaded.")); lblStatus->setText(i18n("Schedule loaded."));
} }
void BWSPrefPageWidget::loadDefault() void BWSPrefPageWidget::loadDefault()
@ -228,7 +228,7 @@ namespace kt
ulCat2->setValue(0); ulCat2->setValue(0);
ulCat3->setValue(0); ulCat3->setValue(0);
lbltqStatus->clear(); lblStatus->clear();
} }
void BWSPrefPageWidget::apply() void BWSPrefPageWidget::apply()

@ -72,7 +72,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
@ -89,7 +89,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>80</height> <height>80</height>
@ -108,7 +108,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>40</height> <height>40</height>

@ -74,7 +74,7 @@ namespace kt
getGUI()->addPrefPage(Pref); getGUI()->addPrefPage(Pref);
BWScheduler::instance().setCoreInterface(getCore()); BWScheduler::instance().setCoreInterface(getCore());
TQDateTime now = TQDateTime::tqcurrentDateTime(); TQDateTime now = TQDateTime::currentDateTime();
//each hour //each hour
TQDateTime hour = now.addSecs(3600); TQDateTime hour = now.addSecs(3600);
@ -115,7 +115,7 @@ namespace kt
void SchedulerPlugin::timer_triggered() void SchedulerPlugin::timer_triggered()
{ {
m_timer.changeInterval(3600*1000); m_timer.changeInterval(3600*1000);
TQDateTime now = TQDateTime::tqcurrentDateTime(); TQDateTime now = TQDateTime::currentDateTime();
BWScheduler::instance().trigger(); BWScheduler::instance().trigger();
} }

@ -63,7 +63,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Maximum</enum> <enum>Maximum</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>60</width> <width>60</width>
<height>20</height> <height>20</height>

@ -20,7 +20,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>500</width> <width>500</width>
<height>350</height> <height>350</height>
@ -97,7 +97,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
@ -223,7 +223,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>50</height> <height>50</height>
@ -267,7 +267,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Maximum</enum> <enum>Maximum</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>16</width> <width>16</width>
<height>20</height> <height>20</height>

@ -484,7 +484,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>40</height> <height>40</height>

@ -32,7 +32,7 @@ namespace kt
class XMLContentHandler : public TQXmlDefaultHandler class XMLContentHandler : public TQXmlDefaultHandler
{ {
enum tqStatus enum Status
{ {
TOPLEVEL,ROOT,DEVICE,SERVICE,FIELD,OTHER TOPLEVEL,ROOT,DEVICE,SERVICE,FIELD,OTHER
}; };
@ -40,7 +40,7 @@ namespace kt
TQString tmp; TQString tmp;
UPnPRouter* router; UPnPRouter* router;
UPnPService curr_service; UPnPService curr_service;
TQValueStack<tqStatus> status_stack; TQValueStack<Status> status_stack;
public: public:
XMLContentHandler(UPnPRouter* router); XMLContentHandler(UPnPRouter* router);
virtual ~XMLContentHandler(); virtual ~XMLContentHandler();

@ -109,7 +109,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>70</width> <width>70</width>
<height>20</height> <height>20</height>

@ -248,7 +248,7 @@ namespace kt
void HttpServer::setDefaultResponseHeaders(HttpResponseHeader & hdr,const TQString & content_type,bool with_session_info) void HttpServer::setDefaultResponseHeaders(HttpResponseHeader & hdr,const TQString & content_type,bool with_session_info)
{ {
hdr.setValue("Server","KTorrent/" KT_VERSION_MACRO); hdr.setValue("Server","KTorrent/" KT_VERSION_MACRO);
hdr.setValue("Date",DateTimeToString(TQDateTime::tqcurrentDateTime(Qt::UTC),false)); hdr.setValue("Date",DateTimeToString(TQDateTime::currentDateTime(Qt::UTC),false));
hdr.setValue("Content-Type",content_type); hdr.setValue("Content-Type",content_type);
hdr.setValue("Connection","keep-alive"); hdr.setValue("Connection","keep-alive");
if (with_session_info && session.sessionId && session.logged_in) if (with_session_info && session.sessionId && session.logged_in)
@ -328,7 +328,7 @@ namespace kt
if (path.endsWith("login.html")) if (path.endsWith("login.html"))
{ {
// clear cookie in case of login page // clear cookie in case of login page
TQDateTime dt = TQDateTime::tqcurrentDateTime().addDays(-1); TQDateTime dt = TQDateTime::currentDateTime().addDays(-1);
TQString cookie = TQString("KT_SESSID=666; expires=%1 +0000").tqarg(DateTimeToString(dt,true)); TQString cookie = TQString("KT_SESSID=666; expires=%1 +0000").tqarg(DateTimeToString(dt,true));
rhdr.setValue("Set-Cookie",cookie); rhdr.setValue("Set-Cookie",cookie);
} }
@ -351,7 +351,7 @@ namespace kt
setDefaultResponseHeaders(rhdr,"text/html",true); setDefaultResponseHeaders(rhdr,"text/html",true);
rhdr.setValue("Cache-Control","max-age=0"); rhdr.setValue("Cache-Control","max-age=0");
rhdr.setValue("Last-Modified",DateTimeToString(fi.lastModified(),false)); rhdr.setValue("Last-Modified",DateTimeToString(fi.lastModified(),false));
rhdr.setValue("Expires",DateTimeToString(TQDateTime::tqcurrentDateTime(Qt::UTC).addSecs(3600),false)); rhdr.setValue("Expires",DateTimeToString(TQDateTime::currentDateTime(Qt::UTC).addSecs(3600),false));
hdlr->sendResponse(rhdr); hdlr->sendResponse(rhdr);
return; return;
} }
@ -361,7 +361,7 @@ namespace kt
HttpResponseHeader rhdr(200); HttpResponseHeader rhdr(200);
setDefaultResponseHeaders(rhdr,ExtensionToContentType(ext),true); setDefaultResponseHeaders(rhdr,ExtensionToContentType(ext),true);
rhdr.setValue("Last-Modified",DateTimeToString(fi.lastModified(),false)); rhdr.setValue("Last-Modified",DateTimeToString(fi.lastModified(),false));
rhdr.setValue("Expires",DateTimeToString(TQDateTime::tqcurrentDateTime(Qt::UTC).addSecs(3600),false)); rhdr.setValue("Expires",DateTimeToString(TQDateTime::currentDateTime(Qt::UTC).addSecs(3600),false));
rhdr.setValue("Cache-Control","private"); rhdr.setValue("Cache-Control","private");
if (!hdlr->sendFile(rhdr,path)) if (!hdlr->sendFile(rhdr,path))
{ {

@ -76,7 +76,7 @@ namespace kt
ts.setEncoding( TQTextStream::UnicodeUTF8 ); ts.setEncoding( TQTextStream::UnicodeUTF8 );
ts.writeRawBytes(php_s.data(),off); // first write the opening tag from the script ts.writeRawBytes(php_s.data(),off); // first write the opening tag from the script
php_i->globalInfo(ts); php_i->globalInfo(ts);
php_i->downloadtqStatus(ts); php_i->downloadStatus(ts);
TQMap<TQString,TQString>::const_iterator it; TQMap<TQString,TQString>::const_iterator it;

@ -72,12 +72,12 @@ namespace kt
} }
/*Generate php code /*Generate php code
* function downloadtqStatus() * function downloadStatus()
* { * {
* return array( ... ); * return array( ... );
* } * }
*/ */
void PhpCodeGenerator::downloadtqStatus(TQTextStream & out) void PhpCodeGenerator::downloadStatus(TQTextStream & out)
{ {
TorrentStats stats; TorrentStats stats;
//Priority file_priority; //Priority file_priority;
@ -156,7 +156,7 @@ namespace kt
} }
/*Generate php code /*Generate php code
* function globaltqStatus() * function globalStatus()
* { * {
* return array( ... ); * return array( ... );
* } * }

@ -40,7 +40,7 @@ namespace kt
PhpCodeGenerator(CoreInterface *c); PhpCodeGenerator(CoreInterface *c);
virtual ~PhpCodeGenerator(){} virtual ~PhpCodeGenerator(){}
void downloadtqStatus(TQTextStream & out); void downloadStatus(TQTextStream & out);
void globalInfo(TQTextStream & out); void globalInfo(TQTextStream & out);
private: private:
CoreInterface *core; CoreInterface *core;

@ -20,7 +20,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="tqminimumSize"> <property name="minimumSize">
<size> <size>
<width>500</width> <width>500</width>
<height>350</height> <height>350</height>
@ -92,7 +92,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="tqsizeHint"> <property name="sizeHint">
<size> <size>
<width>54</width> <width>54</width>
<height>21</height> <height>21</height>

@ -1,5 +1,5 @@
<?php <?php
$stats=downloadtqStatus(); $stats=downloadStatus();
$num_torrent=$_REQUEST['torrent']; $num_torrent=$_REQUEST['torrent'];
function cut_name_if_long($string) function cut_name_if_long($string)
@ -61,7 +61,7 @@ $display_name=cut_name_if_long($stats[$num_torrent]['torrent_name']);
<tr> <tr>
<th>Actions</th> <th>Actions</th>
<th>File</th> <th>File</th>
<th>tqStatus</th> <th>Status</th>
<th>Size</th> <th>Size</th>
<th>Complete</th> <th>Complete</th>
</tr> </tr>

@ -1,6 +1,6 @@
<?php <?php
$globalinfo=globalInfo(); $globalinfo=globalInfo();
$stats=downloadtqStatus(); $stats=downloadStatus();
function get_torrent_status_name($status_id) function get_torrent_status_name($status_id)
{ {
@ -18,7 +18,7 @@ function get_torrent_status_name($status_id)
10 => 'Checking Data' 10 => 'Checking Data'
); );
if (array_key_exists($status_id, $table)) return $table[$status_id]; if (array_key_exists($status_id, $table)) return $table[$status_id];
else return 'Not supported tqStatus'; else return 'Not supported Status';
} }
function generate_button_code($img, $alt, $href='') function generate_button_code($img, $alt, $href='')
@ -104,7 +104,7 @@ function generate_button_code($img, $alt, $href='')
<tr> <tr>
<th>Actions</th> <th>Actions</th>
<th>File</th> <th>File</th>
<th>tqStatus</th> <th>Status</th>
<th>Downloaded</th> <th>Downloaded</th>
<th>Size</th> <th>Size</th>
<th>Uploaded</th> <th>Uploaded</th>

@ -18,7 +18,7 @@
<table width="100%"> <table width="100%">
<tbody> <tbody>
<?php <?php
$stats=downloadtqStatus(); $stats=downloadStatus();
$a = 0; $a = 0;
foreach ($stats as $torrent) { foreach ($stats as $torrent) {
echo "<tr>"; echo "<tr>";

@ -8,7 +8,7 @@
<tr> <tr>
<td align="center"><IMG src="ktorrentwebinterfacelogo.png" width="340" height="150" align="top" border="0"></td> <td align="center"><IMG src="ktorrentwebinterfacelogo.png" width="340" height="150" align="top" border="0"></td>
<?php <?php
$stats=downloadtqStatus(); $stats=downloadStatus();
$t=$stats[$_REQUEST['id']]; $t=$stats[$_REQUEST['id']];
echo "<td><strong>ktorrent-><a href=\"interface.php\">transfers</a></strong>->{$t['torrent_name']}</td>"; echo "<td><strong>ktorrent-><a href=\"interface.php\">transfers</a></strong>->{$t['torrent_name']}</td>";
echo "<td><a href=\"torrent.php?id={$_REQUEST['id']}\" >refresh</a></td>"; echo "<td><a href=\"torrent.php?id={$_REQUEST['id']}\" >refresh</a></td>";

Loading…
Cancel
Save