#include "libkita/favoritethreads.h"
#include "libkita/board.h"
+#include "libkita/kita_misc.h"
#include "kitacacheinfo.h"
#include <qmap.h>
kdDebug() << "datURL = " << datURL.url() << endl;
Kita::Board board = Kita::Board( KURL( datURL, ".." ) );
kdDebug() << "board.url = " << board.url().url() << endl;
- Kita::Thread thread( board.name(), datURL );
+ Kita::Board::setName( Kita::datToBoard( datURL.url() ), board.name() );
+ Kita::Thread thread( datURL );
kdDebug() << "thread.url = %s" << thread.url() << endl;
thread.setName( item->text( Row_Subject ) );
thread.setResNum( item->text( Row_Read ).toInt() );
void KitaMainWindow::bookmark( const Kita::Thread& thread, bool on )
{
- Kita::Thread* t = new Kita::Thread( thread.boardName(), thread.datURL(), thread.name(), thread.resNum() );
+ Kita::Thread* t = new Kita::Thread( thread.datURL(), thread.name(), thread.resNum() );
FavoriteThreads* favorite = FavoriteThreads::getInstance();
if( on ) {
#include "kitacacheinfo.h"
#include "part/kita2ch.h"
#include "libkita/thread.h"
+#include "libkita/kita_misc.h"
enum SubjectViewRows {
Row_Mark,
KURL datURL = m_board.url();
datURL.addPath("/dat/" + datName);
- Kita::Thread* thread = new Kita::Thread( m_board.name(), datURL,
+ Kita::Board::setName( Kita::datToBoard( datURL.url() ), m_board.name() );
+ Kita::Thread* thread = new Kita::Thread( datURL,
item->text( Row_Subject ),
item->text( Row_Read ).toInt() );
KURL datURL = m_board.url();
datURL.addPath("/dat/" + datName);
- Kita::Thread thread( m_board.name(), datURL );
+ Kita::Board::setName( Kita::datToBoard( datURL.url() ), m_board.name() );
+ Kita::Thread thread( datURL );
thread.setName( item->text( Row_Subject ) );
thread.setResNum( item->text( Row_Read ).toInt() );
#include <qregexp.h>
#include <qdict.h>
+#include "kita_misc.h"
+
#include "qcp932codec.h"
using namespace Kita;
KURL datURL = m_boardURL;
datURL.addPath("/dat/" + fname);
- Kita::Thread* thread = new Kita::Thread( name(), datURL, subject, num.toInt());
+ Kita::Board::setName( datToBoard( datURL.url() ), name() );
+ Kita::Thread* thread = new Kita::Thread( datURL, subject, num.toInt());
threadList.append(thread);
}
}
m_inThread = false;
m_threadParser->endElement( namespaceURI, localName, qName );
Kita::Thread thread = m_threadParser->getThread();
- m_threadList.append( new Kita::Thread( thread.boardName(), thread.datURL(), thread.name(), thread.resNum() ) );
+ m_threadList.append( new Kita::Thread( thread.datURL(), thread.name(), thread.resNum() ) );
delete m_threadParser;
m_threadParser = 0;
void ThreadTest::setUp()
{
- m_normal = new Thread( "Linux",
+ Kita::Board::setName( "http://pc.2ch.net/linux/", "Linux" );
+ m_normal = new Thread(
KURL( "http://pc.2ch.net/linux/dat/1069738960.dat" ),
"Kita - 2ch client for KDE",
0 );
m_boardName = QString::null;
}
-Thread::Thread( const QString& boardName, const KURL& datURL, const QString& threadName, int resNum )
+/*Thread::Thread( const QString& boardName, const KURL& datURL, const QString& threadName, int resNum )
: m_datURL( datURL ), m_threadName( threadName ), m_resNum( resNum )
{
m_boardName = boardName;
Kita::Board::setName( boardURL(), boardName );
-}
+}*/
Thread::Thread( const KURL& datURL, const QString& threadName, int resNum )
: m_datURL( datURL ), m_threadName( threadName ), m_resNum( resNum )
m_boardParser->endElement( namespaceURI, localName, qName );
} else if( localName == "thread" ) {
m_inThread = false;
- m_thread = Kita::Thread( m_board->name(), KURL( m_datUrlStr ), m_threadName, m_resNum );
+ Kita::Board::setName( datToBoard( m_datUrlStr ), m_board->name() );
+ m_thread = Kita::Thread( KURL( m_datUrlStr ), m_threadName, m_resNum );
m_isValid = true;
// create thread;
} else if( localName == "daturl" ) {
void ThreadAccess::slotRedirection(KIO::Job *, const KURL & newURL)
{
kdDebug() << "Redirected to newURL: " << newURL.url() << endl;
- m_thread = Kita::Thread( m_thread.boardName(), newURL);
+ Kita::Board::setName( datToBoard( newURL.url() ), m_thread.boardName() );
+ m_thread = Kita::Thread( newURL);
emit redirection( newURL.url() );
}
instance = new ThreadFactory();
}
- Thread* new_thread = new Thread( thread.boardName(), thread.datURL(), thread.name(), thread.resNum() );
+ Thread* new_thread = new Thread( thread.datURL(), thread.name(), thread.resNum() );
instance->m_dict.insert( thread.datURL().url(), new_thread );
}
public:
Thread();
Thread( const Thread& obj );
- Thread( const QString& boardName, const KURL& datURL, const QString& threadName = QString::null, int resNum = 0 );
+// Thread( const QString& boardName, const KURL& datURL, const QString& threadName = QString::null, int resNum = 0 );
Thread( const KURL& datURL, const QString& threadName = QString::null, int resNum = 0 );
~Thread();
Thread& operator=( const Thread& obj );
this, SLOT( slotOpenURLResult() ) );
Kita::Board board( m_url.upURL().upURL() );
- m_threadview->showThread( Kita::Thread( board.name(), m_url ) );
+ Kita::Board::setName( board.url().url(), board.name() );
+ m_threadview->showThread( Kita::Thread( m_url ) );
emit started( 0 );
return true;
}