propertyWidget->threadURLLabel->setText( datURL.url() );
propertyWidget->threadNameLabel->setText( Kita::DatManager::threadName( datURL ) );
propertyWidget->cachePathLabel->setText( Kita::DatManager::getCachePath( datURL ) );
+ propertyWidget->indexPathLabel->setText( Kita::DatManager::getCacheIndexPath( datURL ) );
propertyWidget->show();
}
break;
return baseDir() + path;
}
+QString Cache::getIndexPath( const KURL& datURL )
+{
+ QString path = getPath( datURL );
+ if ( path == QString::null ) {
+ return QString::null;
+ } else {
+ return path + ".idx";
+ }
+}
/*------------------------------------*/
/* for Image files */
/* private */
QString Cache::getImgBaseDir()
{
- QString basedir = baseDir() + "image/";
+ QString basedir = baseDir() + "image/";
return basedir;
}
host.replace( QChar( '.' ), QChar( '_' ) );
QString filename = url.fileName().lower();
-
- return host + "_" + hashString( url ) + filename;
+
+ return host + "_" + hashString( url ) + filename;
}
class Cache
{
static QString baseDir();
- static QString subDir( const KURL& url );
- static QString hashString( const KURL& url );
- static QString getImgBaseDir();
- static QString getImgFileName( const KURL& src);
+ static QString subDir( const KURL& url );
+ static QString hashString( const KURL& url );
+ static QString getImgBaseDir();
+ static QString getImgFileName( const KURL& src );
public:
- static QString getPath( const KURL& url );
- static QString getImgPath( const KURL& url);
- static QString getImgIdxPath( const KURL& url);
+ static QString getPath( const KURL& datURL );
+ static QString getIndexPath( const KURL& datURL );
+ static QString getImgPath( const KURL& url );
+ static QString getImgIdxPath( const KURL& url );
};
}
return Kita::Cache::getPath( datURL );
}
+const QString DatManager::getCacheIndexPath( const KURL& url )
+{
+ QMutexLocker locker( &m_mutex );
+
+ KURL datURL = Kita::ParseMisc::parseURLonly( url );
+ return Kita::Cache::getIndexPath( datURL );
+}
+
/*---------------------------------------*/
/* HTML data */
static const QString boardID( const KURL& url );
static const QString getCachePath( const KURL& url );
+ static const QString getCacheIndexPath( const KURL& url );
/* HTML data */
static QString getHtml( const KURL& url, int startnum, int endnum );
<x>0</x>
<y>0</y>
<width>790</width>
- <height>492</height>
+ <height>494</height>
</rect>
</property>
<property name="caption">
</widget>
<widget class="QLabel">
<property name="name">
+ <cstring>threadURLLabel</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>130</x>
+ <y>10</y>
+ <width>650</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>threadNameLabel</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>130</x>
+ <y>40</y>
+ <width>650</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
<cstring>cachePathLabel0</cstring>
</property>
<property name="geometry">
</widget>
<widget class="QLabel">
<property name="name">
- <cstring>threadURLLabel</cstring>
+ <cstring>cachePathLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>130</x>
- <y>10</y>
+ <y>70</y>
<width>650</width>
<height>20</height>
</rect>
</widget>
<widget class="QLabel">
<property name="name">
- <cstring>threadNameLabel</cstring>
+ <cstring>indexPathLabel0</cstring>
</property>
<property name="geometry">
<rect>
- <x>130</x>
- <y>40</y>
- <width>650</width>
+ <x>10</x>
+ <y>100</y>
+ <width>110</width>
<height>20</height>
</rect>
</property>
<property name="text">
- <string></string>
+ <string>Index Path</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
- <cstring>cachePathLabel</cstring>
+ <cstring>indexPathLabel</cstring>
</property>
<property name="geometry">
<rect>
<x>130</x>
- <y>70</y>
+ <y>100</y>
<width>650</width>
<height>20</height>
</rect>