#include <kio/slaveconfig.h>
#include <kio/jobclasses.h>
#include <kio/scheduler.h>
+#include <kio/netaccess.h>
#include <qwidget.h>
#include <qapplication.h>
ok = false;
if ( ok ) {
- if ( m_orgData && responseCode() == 206 ) {
+ if ( m_orgData && responseCode() == 304 ) {
+ // datÍî¤Á¤é¤·¤¾ì¹ç
+ m_threadData = m_orgData;
+ } else if ( m_orgData && responseCode() == 206 ) {
QCString orgData = QCString( m_orgData, strlen( m_orgData ) );
m_threadData = orgData + m_threadData;
}
{
m_orgData = getCacheData( m_thread->datURL() );
+ // copy original cache file
+ QString cachePath = getCachePath( m_thread->datURL() );
+ QString backupPath = cachePath + ".kita_backup";
+ KIO::NetAccess::copy( cachePath, backupPath );
+
if ( KURL( m_thread->datURL() ).protocol() != "k2ch" ) {
KIO::SlaveConfig::self() ->setConfigData( "http",
KURL( m_thread->datURL() ).host(),
enter_loop();
writeCacheData( m_thread->datURL() );
+ KIO::NetAccess::del( backupPath );
QCp932Codec codec;
return codec.toUnicode( m_threadData );
void ThreadAccess::slotRedirection( KIO::Job *, const KURL & newURL )
{
+ // datÍî¤Á¤·¤Æ¤ë¤È»×¤ï¤ì¤ë¤Î¤Ç¥¥ã¥Ã¥·¥å¤ò¸µ¤ËÌ᤹
+ QString cachePath = getCachePath( m_thread->datURL() );
+ QString backupPath = cachePath + ".kita_backup";
+ KIO::NetAccess::copy( backupPath, cachePath );
+ KIO::NetAccess::del( backupPath );
+/*
kdDebug() << "Redirected to newURL: " << newURL.url() << endl;
Kita::Board::setName( datToBoard( newURL.url() ), m_thread->boardName() );
m_thread = Kita::Thread::getByURL( newURL.url() );
- emit redirection( newURL.url() );
+ emit redirection( newURL.url() );*/
}
void ThreadAccess::slotReceiveThreadData( KIO::Job*, const QByteArray& data )