OSDN Git Service

reformat
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Mon, 15 Dec 2003 13:44:41 +0000 (13:44 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Mon, 15 Dec 2003 13:44:41 +0000 (13:44 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@681 56b19765-1e22-0410-a548-a0f45d66c51a

kita/src/kitaboardview.cpp

index 37fbd49..92bc63a 100644 (file)
 #include "libkita/category.h"
 
 
-KitaBoardView::KitaBoardView(QWidget *parent, const char *name)
+KitaBoardView::KitaBoardView( QWidget *parent, const char *name )
     : KitaBoardViewBase(parent, name)
 {
-  m_boardList->setSorting(-1);
-  m_boardList->addColumn("name");
-  connect(m_boardList, SIGNAL(executed(QListViewItem*)), SLOT( loadBoard(QListViewItem*) ));
+  m_boardList->setSorting( -1 );
+  m_boardList->addColumn( "name" );
+  connect( m_boardList, SIGNAL( executed( QListViewItem* ) ), SLOT( loadBoard( QListViewItem* ) ) );
   connect( m_boardList, SIGNAL( contextMenuRequested( QListViewItem*, const QPoint&, int ) ),
                         SLOT( slotContextMenuRequested( QListViewItem*, const QPoint&, int ) ) );
 }
@@ -42,24 +42,24 @@ KitaBoardView::KitaBoardView(QWidget *parent, const char *name)
 KitaBoardView::~KitaBoardView()
 {}
 
-QString KitaBoardView::getCategory(const QString& line) const
+QString KitaBoardView::getCategory( const QString& line ) const
 {
-  QRegExp regexp("<BR><BR><B>(.*)</B><BR>", false);
-  if(regexp.search(line) != -1) {
+  QRegExp regexp( "<BR><BR><B>(.*)</B><BR>", false );
+  if(regexp.search( line ) != -1) {
     return regexp.cap(1);
   } else {
     return QString::null;
   }
 }
 
-Kita::Board* KitaBoardView::getBoard(const QString& line) const
+Kita::Board* KitaBoardView::getBoard( const QString& line ) const
 {
-  QRegExp regexp("<A HREF=(.*)>(.*)</A>", false);
+  QRegExp regexp( "<A HREF=(.*)>(.*)</A>", false );
   if( regexp.search(line) != -1 ) {
     QString board_url = regexp.cap(1);
     QString board_title = regexp.cap(2);
     Kita::Board::setName( board_url, board_title );
-    return new Kita::Board(board_url, board_title);
+    return new Kita::Board( board_url, board_title );
   } else {
     return new Kita::Board( "" );
   }
@@ -105,7 +105,7 @@ void KitaBoardView::loadBoardList()
   m_boardList->clear();
 
   KListViewItem* previous = 0;
-  for(Kita::Category* category = categoryList.first(); category; category = categoryList.next())
+  for( Kita::Category* category = categoryList.first(); category; category = categoryList.next() )
   {
     QPtrList<Kita::Board> board_list = category->getBoardList();
 
@@ -113,26 +113,23 @@ void KitaBoardView::loadBoardList()
       continue;
     }
 
-    KListViewItem* categoryItem = new KListViewItem(m_boardList, previous, category->name());
+    KListViewItem* categoryItem = new KListViewItem( m_boardList, previous, category->name() );
 
     KListViewItem* previousBoard = 0;
     QPtrListIterator<Kita::Board> it( board_list );
     for(; *it; ++it)
     {
       Kita::Board* board = *it;
-      previousBoard = new KListViewItem(categoryItem, previousBoard, board->name(), board->url());
+      previousBoard = new KListViewItem( categoryItem, previousBoard, board->name(), board->url() );
     }
     previous = categoryItem;
   }
 }
 
-QPtrList<Kita::Category> KitaBoardView::getCategoryList(const QString& html) const
+QPtrList<Kita::Category> KitaBoardView::getCategoryList( const QString& html ) const
 {
   QPtrList<Kita::Category> result;
 
-  // XXX: maybe crash
-  //  result.setAutoDelete( true );
-
   QStringList lines = QStringList::split("\n", html);
   QStringList::iterator it;
 
@@ -140,8 +137,8 @@ QPtrList<Kita::Category> KitaBoardView::getCategoryList(const QString& html) con
   for(it = lines.begin(); it != lines.end(); ++it) {
     QString category_name = getCategory(*it);
     if( category_name != QString::null ) {
-      current_category = new Kita::Category(category_name);
-      result.append(current_category);
+      current_category = new Kita::Category( category_name );
+      result.append( current_category );
     } else {
       Kita::Board* board = getBoard(*it);