QString ThreadAccess::get()
{
- if ( KURL( m_thread.datURL() ).protocol() != "k2ch" ) {
+ if ( KURL( m_thread->datURL() ).protocol() != "k2ch" ) {
KIO::SlaveConfig::self() ->setConfigData( "http",
- KURL( m_thread.datURL() ).host(),
+ KURL( m_thread->datURL() ).host(),
"UserAgent",
QString( "Monazilla/1.00 (Kita/%1)" ).arg( VERSION ) );
}
- KIO::TransferJob* job = KIO::get( m_thread.datURL(), true, true );
+ KIO::TransferJob* job = KIO::get( m_thread->datURL(), true, true );
m_currentJob = job;
connect( job, SIGNAL( data( KIO::Job*, const QByteArray& ) ),
void ThreadAccess::slotRedirection( KIO::Job *, const KURL & newURL )
{
kdDebug() << "Redirected to newURL: " << newURL.url() << endl;
- Kita::Board::setName( datToBoard( newURL.url() ), m_thread.boardName() );
- m_thread = Kita::Thread( newURL.url() );
+ Kita::Board::setName( datToBoard( newURL.url() ), m_thread->boardName() );
+ m_thread = Kita::Thread::getByURL( newURL.url() );
emit redirection( newURL.url() );
}
class Thread
{
Thread( const QString& datURL, const QString& threadName = QString::null );
- friend class ThreadAccess;
- friend class ThreadXmlParser;
- public:
Thread();
+ public:
~Thread();
const QString& datURL() const;
Q_OBJECT
public:
- ThreadAccess( const Thread& thread ) : m_thread( thread ) {};
+ ThreadAccess( const Thread* thread ) : m_thread( thread ) {};
~ThreadAccess() {};
QString get();
private:
void enter_loop();
- Thread m_thread;
+ const Thread* m_thread;
KIO::Job* m_currentJob;
QCString m_threadData;
QString m_header;
m_thread = const_cast<Kita::Thread *>( thread );
- m_access = new Kita::ThreadAccess( *thread );
+ m_access = new Kita::ThreadAccess( thread );
connect( m_access, SIGNAL( redirection( const QString& ) ),
SIGNAL( setLocationBarURL( const QString& ) ) );
QString result = m_access->get();