loadCache();
// load favorites
- loadFavorites();
+// loadFavorites();
// and a status bar
statusBar()->show();
KitaMainWindow::~KitaMainWindow()
{
- saveFavorites();
+// saveFavorites();
saveCache();
writeConfig(KGlobal::config());
void KitaMainWindow::loadFavorites()
{
+ QString favoritesConfigPath = locateLocal("appdata", "favorites.xml");
+ QFile file( favoritesConfigPath );
+ if( file.open(IO_ReadOnly) ) {
+ FavoriteThreads::fromXml( QString::fromUtf8( file.readAll().data() ) );
+ }
}
void KitaMainWindow::saveFavorites()
{
+ QString favoritesConfigPath = locateLocal("appdata", "favorites.xml");
+ QFile file( favoritesConfigPath );
+ if( file.open(IO_WriteOnly) ) {
+ QTextStream stream(&file);
+ stream << (const char *)(FavoriteThreads::getInstance()->toXml().utf8());
+ qDebug("'%s'", (const char *)FavoriteThreads::getInstance()->toXml().local8Bit() );
+ }
}
#include "kita.moc"