KURL newURL;
newURL.setProtocol( protocol );
newURL.setHost( host );
- newURL.addPath( QString( "/test/read.cgi/%2/%3/" )
- .arg( board ).arg( datName ) );
+
+ // FIXME: TOOOOOOOOOOOOOOOOOOOOOO ugly.
+ QRegExp host_machibbs( ".*\\.machi\\.to" );
+ if ( host_machibbs.search( host ) != -1 ) {
+ newURL.addPath( "/bbs/read.pl" );
+ newURL.addQueryItem( "BBS", board );
+ newURL.addQueryItem( "KEY", datName );
+ } else {
+ newURL.addPath( QString( "/test/read.cgi/%2/%3/" )
+ .arg( board ).arg( datName ) );
+ }
return newURL.url();
}
m_boardURL2 = "http://pc.2ch.net/linux";
m_boardURL2_k2ch = "k2ch://pc.2ch.net/linux";
+ // FIXME: invalid dat url.
+ m_machibbsDatURL = "http://kanto.machi.to/kana/dat/1234567890.cgi";
+
+ m_machibbsThreadURL = "http://kanto.machi.to/bbs/read.pl?BBS=kana&KEY=1234567890";
+
// relative path.
m_cachePath = QString( "pc.2ch.net/linux/1022744633.dat" );
}
{
CPPUNIT_ASSERT_EQUAL( m_threadURL, Kita::datToThread( m_datURL ) );
CPPUNIT_ASSERT_EQUAL( m_threadURL_k2ch, Kita::datToThread( m_datURL_k2ch ) );
+ CPPUNIT_ASSERT_EQUAL( m_machibbsThreadURL, Kita::datToThread( m_machibbsDatURL ) );
}
void URLConvertTest::testThreadToDat()
QString m_boardURL2_k2ch;
QString m_cachePath;
QString m_cachePath_k2ch;
+
+ QString m_machibbsDatURL;
+ QString m_machibbsThreadURL;
public:
void setUp();