[Kita-svn] [2438] - use KMessageBox instead of QMessageBox

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 7月 19日 (日) 07:41:39 JST


Revision: 2438
          http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2438
Author:   nogu
Date:     2009-07-19 07:41:39 +0900 (Sun, 19 Jul 2009)

Log Message:
-----------
- use KMessageBox instead of QMessageBox
- the name of member variables should not begin with an uppercase letter

Modified Paths:
--------------
    kita/branches/KITA-KDE4/kita/src/threadview.cpp
    kita/branches/KITA-KDE4/kita/src/threadview.h

Modified: kita/branches/KITA-KDE4/kita/src/threadview.cpp
===================================================================
--- kita/branches/KITA-KDE4/kita/src/threadview.cpp	2009-07-18 22:26:22 UTC (rev 2437)
+++ kita/branches/KITA-KDE4/kita/src/threadview.cpp	2009-07-18 22:41:39 UTC (rev 2438)
@@ -42,7 +42,7 @@
 
     /* copied from Base class */
     setFocusPolicy(Qt::ClickFocus);
-    ThreadViewBaseLayout = new QVBoxLayout(this); 
+    threadViewBaseLayout = new QVBoxLayout(this); 
 
     layout2 = new QHBoxLayout(0); 
     layout2->setSpacing(6);
@@ -51,27 +51,27 @@
     writeButton->setEnabled(false);
     layout2->addWidget(writeButton);
 
-    SearchCombo = new KComboBox(this);
-    SearchCombo->setMinimumSize(QSize(200, 0));
-    SearchCombo->setEditable(true);
-    SearchCombo->setMaxVisibleItems(10);
-    SearchCombo->setMaxCount(15);
-    SearchCombo->setInsertPolicy(KComboBox::InsertAtTop);
-    SearchCombo->setDuplicatesEnabled(false);
-    layout2->addWidget(SearchCombo);
+    searchCombo = new KComboBox(this);
+    searchCombo->setMinimumSize(QSize(200, 0));
+    searchCombo->setEditable(true);
+    searchCombo->setMaxVisibleItems(10);
+    searchCombo->setMaxCount(15);
+    searchCombo->setInsertPolicy(KComboBox::InsertAtTop);
+    searchCombo->setDuplicatesEnabled(false);
+    layout2->addWidget(searchCombo);
 
-    HighLightButton = new QToolButton(this);
-    HighLightButton->setCheckable(true);
-    layout2->addWidget(HighLightButton);
+    highLightButton = new QToolButton(this);
+    highLightButton->setCheckable(true);
+    layout2->addWidget(highLightButton);
 
-    BookmarkButton = new QToolButton(this);
-    BookmarkButton->setEnabled(false);
-    BookmarkButton->setCheckable(true);
-    layout2->addWidget(BookmarkButton);
+    bookmarkButton = new QToolButton(this);
+    bookmarkButton->setEnabled(false);
+    bookmarkButton->setCheckable(true);
+    layout2->addWidget(bookmarkButton);
 
-    ReloadButton = new QToolButton(this);
-    ReloadButton->setEnabled(false);
-    layout2->addWidget(ReloadButton);
+    reloadButton = new QToolButton(this);
+    reloadButton->setEnabled(false);
+    layout2->addWidget(reloadButton);
 
     gotoCombo = new KComboBox(this);
     gotoCombo->setMinimumSize(QSize(200, 0));
@@ -86,12 +86,12 @@
     closeButton = new QToolButton(this);
     closeButton->setEnabled(false);
     layout2->addWidget(closeButton);
-    ThreadViewBaseLayout->addLayout(layout2);
+    threadViewBaseLayout->addLayout(layout2);
 
     threadFrame = new QFrame(this);
     threadFrame->setFrameShape(QFrame::StyledPanel);
     threadFrame->setFrameShadow(QFrame::Raised);
-    ThreadViewBaseLayout->addWidget(threadFrame);
+    threadViewBaseLayout->addWidget(threadFrame);
     resize(QSize(870, 480).expandedTo(minimumSizeHint()));
     setAttribute(Qt::WA_WState_Polished);
     /* copy end */
@@ -101,9 +101,9 @@
     aLayout->addWidget(m_threadPart->view());
 
     {
-        HighLightButton->setIcon(SmallIcon("help-hint"));
-        ReloadButton->setIcon(SmallIcon("view-refresh"));
-        BookmarkButton->setIcon(SmallIcon("bookmark-new"));
+        highLightButton->setIcon(SmallIcon("help-hint"));
+        reloadButton->setIcon(SmallIcon("view-refresh"));
+        bookmarkButton->setIcon(SmallIcon("bookmark-new"));
         writeButton->setIcon(SmallIcon("draw-freehand"));
         deleteButton->setIcon(SmallIcon("trash-empty"));
         closeButton->setIcon(SmallIcon("tab-close"));
@@ -126,11 +126,11 @@
     connect(m_threadPart, SIGNAL(mousePressed()),
              SLOT(setFocus()));
 
-    connect(BookmarkButton, SIGNAL(toggled(bool)),
+    connect(bookmarkButton, SIGNAL(toggled(bool)),
              SLOT(slotBookmarkButtonClicked(bool)));
-    connect(SearchCombo, SIGNAL(activated(int)),
+    connect(searchCombo, SIGNAL(activated(int)),
              SLOT(slotSearchButton()));
-    connect(ReloadButton, SIGNAL(clicked()),
+    connect(reloadButton, SIGNAL(clicked()),
              SLOT(slotReloadButton()));
     connect(gotoCombo, SIGNAL(activated(int)),
              SLOT(slotComboActivated(int)));
@@ -189,23 +189,23 @@
 void ThreadView::updateButton()
 {
     writeButton->setEnabled(true);
-    BookmarkButton->setEnabled(true);
-    ReloadButton->setEnabled(true);
+    bookmarkButton->setEnabled(true);
+    reloadButton->setEnabled(true);
     deleteButton->setEnabled(true);
     closeButton->setEnabled(true);
 
-    if (HighLightButton->isChecked()) {
-        HighLightButton->toggle();
+    if (highLightButton->isChecked()) {
+        highLightButton->toggle();
     }
 
     // don't emit SIGNAL(toggled())
-    disconnect(BookmarkButton, SIGNAL(toggled(bool)), this, SLOT(slotBookmarkButtonClicked(bool)));
+    disconnect(bookmarkButton, SIGNAL(toggled(bool)), this, SLOT(slotBookmarkButtonClicked(bool)));
     if (FavoriteThreads::getInstance() ->contains(m_datURL.prettyUrl())) {
-        BookmarkButton->setChecked(true);
+        bookmarkButton->setChecked(true);
     } else {
-        BookmarkButton->setChecked(false);
+        bookmarkButton->setChecked(false);
     }
-    connect(BookmarkButton, SIGNAL(toggled(bool)), SLOT(slotBookmarkButtonClicked(bool)));
+    connect(bookmarkButton, SIGNAL(toggled(bool)), SLOT(slotBookmarkButtonClicked(bool)));
 }
 
 
@@ -220,13 +220,13 @@
 
 void ThreadView::insertSearchCombo()
 {
-    for (int count = 0; count < SearchCombo->count(); ++count) {
-        if (SearchCombo->itemText(count) == SearchCombo->currentText()) {
+    for (int count = 0; count < searchCombo->count(); ++count) {
+        if (searchCombo->itemText(count) == searchCombo->currentText()) {
             // found
             return ;
         }
     }
-    SearchCombo->addItem(SearchCombo->currentText());
+    searchCombo->addItem(searchCombo->currentText());
 }
 
 void ThreadView::slotPopupMenu(KXMLGUIClient* client, const QPoint& global, const KUrl& url, const QString& mimeType, mode_t mode)
@@ -240,7 +240,7 @@
 void ThreadView::setFont(const QFont& font)
 {
     //  m_threadPart->setStandardFont(font.family());
-    SearchCombo->setFont(font);
+    searchCombo->setFont(font);
 
     DOM::CSSStyleDeclaration style = m_threadPart->htmlDocument().body().style();
     style.setProperty("font-family", font.family(), "");
@@ -256,8 +256,8 @@
 
 void ThreadView::focusSearchCombo()
 {
-    if (! SearchCombo->hasFocus()) {
-        SearchCombo->setFocus();
+    if (! searchCombo->hasFocus()) {
+        searchCombo->setFocus();
     } else {
         setFocus();
     }
@@ -355,7 +355,7 @@
     }
 
     /* unforcus search combo */
-    if (SearchCombo->hasFocus()) {
+    if (searchCombo->hasFocus()) {
         setFocus();
         return ;
     }
@@ -453,14 +453,14 @@
 {
     if (m_datURL.isEmpty()) return ; /* Nothing is shown on the screen.*/
 
-    QString str = SearchCombo->currentText();
+    QString str = searchCombo->currentText();
     if (str.at(0) == ':') {
 
         /* show res popup */
         if (str.at(1) == 'p') {
             int refNum = str.mid(2).toInt();
-            QPoint pos = mapToGlobal(SearchCombo->pos());
-            pos.setY(pos.y() + SearchCombo->height() / 2);
+            QPoint pos = mapToGlobal(searchCombo->pos());
+            pos.setY(pos.y() + searchCombo->height() / 2);
             m_threadPart->slotShowResPopup(pos , refNum, refNum);
             return ;
         }
@@ -474,7 +474,7 @@
         /* jump */
         QString anc = str.mid(1);
         m_threadPart->gotoAnchor(anc, false);
-        SearchCombo->setFocus();
+        searchCombo->setFocus();
         return ;
     }
 
@@ -491,14 +491,14 @@
     if (m_datURL.isEmpty()) return ; /* Nothing is shown on the screen.*/
 
     /* jump */
-    QString str = SearchCombo->currentText();
+    QString str = searchCombo->currentText();
     if (str.isEmpty()) return ;
     if (str.isEmpty()) return ;
     if (str.at(0) == ':') return ;
     if (str.at(0) == '?') return ;
 
     QStringList query;
-    query += SearchCombo->currentText();
+    query += searchCombo->currentText();
     int ResNum = DatManager::getResNum(m_datURL);
     for (int i = 1; i <= ResNum; i++) {
 
@@ -508,9 +508,9 @@
             if (m_viewmode == VIEWMODE_MAINVIEW) m_threadPart->showAll();
 
             insertSearchCombo();
-            QStringList list = parseSearchQuery(SearchCombo->currentText());
-            m_threadPart->findText(SearchCombo->currentText(), rev);
-            SearchCombo->setFocus();
+            QStringList list = parseSearchQuery(searchCombo->currentText());
+            m_threadPart->findText(searchCombo->currentText(), rev);
+            searchCombo->setFocus();
 
             return ;
         }
@@ -543,16 +543,15 @@
 
 void ThreadView::slotDeleteButtonClicked()
 {
-    if (m_datURL.isEmpty()) return ;
+    if (m_datURL.isEmpty())
+        return;
 
     int rescode = DatManager::getResponseCode(m_datURL);
     if ((rescode != 200 && rescode != 206)
-            || FavoriteThreads::getInstance() ->contains(m_datURL.prettyUrl())) {
-        if (QMessageBox::warning(this,
-                                   "Kita",
-                                   i18n("Do you want to delete Log ?"),
-                                   QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Default)
-                != QMessageBox::Ok) return ;
+            || FavoriteThreads::getInstance()->contains(m_datURL.prettyUrl())) {
+        if (KMessageBox::warningYesNo(this, i18n("Do you want to delete Log ?"),
+                "Kita") != KMessageBox::Ok)
+            return;
     }
 
     if (DatManager::deleteCache(m_datURL)) {

Modified: kita/branches/KITA-KDE4/kita/src/threadview.h
===================================================================
--- kita/branches/KITA-KDE4/kita/src/threadview.h	2009-07-18 22:26:22 UTC (rev 2437)
+++ kita/branches/KITA-KDE4/kita/src/threadview.h	2009-07-18 22:41:39 UTC (rev 2438)
@@ -100,15 +100,15 @@
         int m_rescode;
 
         QToolButton* writeButton;
-        KComboBox* SearchCombo;
-        QToolButton* HighLightButton;
-        QToolButton* BookmarkButton;
-        QToolButton* ReloadButton;
+        KComboBox* searchCombo;
+        QToolButton* highLightButton;
+        QToolButton* bookmarkButton;
+        QToolButton* reloadButton;
         KComboBox* gotoCombo;
         QToolButton* deleteButton;
         QToolButton* closeButton;
         QFrame* threadFrame;
-        QVBoxLayout* ThreadViewBaseLayout;
+        QVBoxLayout* threadViewBaseLayout;
         QHBoxLayout* layout2;
         QSpacerItem* spacer2;
 




Kita-svn メーリングリストの案内
Back to archive index