Changeset 55498 in webkit


Ignore:
Timestamp:
Mar 3, 2010 7:13:57 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-03-03 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>

Reviewed by Simon Hausmann.

Add a missing 'm_' to class variables names.

[Qt] QtLauncher is not respecting class variable names
https://bugs.webkit.org/show_bug.cgi?id=35542

  • QtLauncher/main.cpp: (LauncherWindow::LauncherWindow): (LauncherWindow::init): (LauncherWindow::sendTouchEvent): (LauncherWindow::eventFilter): (LauncherWindow::zoomIn): (LauncherWindow::zoomOut): (LauncherWindow::resetZoom): (LauncherWindow::setEditable): (LauncherWindow::setTouchMocking): (LauncherWindow::initializeView): (LauncherWindow::createChrome):
Location:
trunk/WebKitTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r55489 r55498  
     12010-03-03  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
     2
     3        Reviewed by Simon Hausmann.
     4
     5        Add a missing 'm_' to class variables names.
     6
     7        [Qt] QtLauncher is not respecting class variable names
     8        https://bugs.webkit.org/show_bug.cgi?id=35542
     9
     10        * QtLauncher/main.cpp:
     11        (LauncherWindow::LauncherWindow):
     12        (LauncherWindow::init):
     13        (LauncherWindow::sendTouchEvent):
     14        (LauncherWindow::eventFilter):
     15        (LauncherWindow::zoomIn):
     16        (LauncherWindow::zoomOut):
     17        (LauncherWindow::resetZoom):
     18        (LauncherWindow::setEditable):
     19        (LauncherWindow::setTouchMocking):
     20        (LauncherWindow::initializeView):
     21        (LauncherWindow::createChrome):
     22
    1232010-03-03  Alexey Proskuryakov  <ap@apple.com>
    224
  • trunk/WebKitTools/QtLauncher/main.cpp

    r55460 r55498  
    128128
    129129private:
    130     QVector<int> zoomLevels;
    131     int currentZoom;
     130    QVector<int> m_zoomLevels;
     131    int m_currentZoom;
    132132
    133133    QWidget* m_view;
    134     WebInspector* inspector;
    135 
    136     QAction* formatMenuAction;
    137     QAction* flipAnimated;
    138     QAction* flipYAnimated;
     134    WebInspector* m_inspector;
     135
     136    QAction* m_formatMenuAction;
     137    QAction* m_flipAnimated;
     138    QAction* m_flipYAnimated;
    139139
    140140#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
    141     QList<QTouchEvent::TouchPoint> touchPoints;
    142     bool touchMocking;
     141    QList<QTouchEvent::TouchPoint> m_touchPoints;
     142    bool m_touchMocking;
    143143#endif
    144144
     
    150150LauncherWindow::LauncherWindow(LauncherWindow* other, bool shareScene)
    151151    : MainWindow()
    152     , currentZoom(100)
     152    , m_currentZoom(100)
    153153    , m_view(0)
    154     , inspector(0)
    155     , formatMenuAction(0)
    156     , flipAnimated(0)
    157     , flipYAnimated(0)
     154    , m_inspector(0)
     155    , m_formatMenuAction(0)
     156    , m_flipAnimated(0)
     157    , m_flipYAnimated(0)
    158158{
    159159    if (other) {
     
    198198      page()->settings()->setInspectorUrl(gInspectorUrl);
    199199
    200     inspector = new WebInspector(splitter);
    201     inspector->setPage(page());
    202     inspector->hide();
    203     connect(this, SIGNAL(destroyed()), inspector, SLOT(deleteLater()));
     200    m_inspector = new WebInspector(splitter);
     201    m_inspector->setPage(page());
     202    m_inspector->hide();
     203    connect(this, SIGNAL(destroyed()), m_inspector, SLOT(deleteLater()));
    204204
    205205    // the zoom values are chosen to be like in Mozilla Firefox 3
    206     zoomLevels << 30 << 50 << 67 << 80 << 90;
    207     zoomLevels << 100;
    208     zoomLevels << 110 << 120 << 133 << 150 << 170 << 200 << 240 << 300;
     206    m_zoomLevels << 30 << 50 << 67 << 80 << 90;
     207    m_zoomLevels << 100;
     208    m_zoomLevels << 110 << 120 << 133 << 150 << 170 << 200 << 240 << 300;
    209209
    210210    grabZoomKeys(true);
     
    283283void LauncherWindow::sendTouchEvent()
    284284{
    285     if (touchPoints.isEmpty())
     285    if (m_touchPoints.isEmpty())
    286286        return;
    287287
    288288    QEvent::Type type = QEvent::TouchUpdate;
    289     if (touchPoints.size() == 1) {
    290         if (touchPoints[0].state() == Qt::TouchPointReleased)
     289    if (m_touchPoints.size() == 1) {
     290        if (m_touchPoints[0].state() == Qt::TouchPointReleased)
    291291            type = QEvent::TouchEnd;
    292         else if (touchPoints[0].state() == Qt::TouchPointPressed)
     292        else if (m_touchPoints[0].state() == Qt::TouchPointPressed)
    293293            type = QEvent::TouchBegin;
    294294    }
    295295
    296296    QTouchEvent touchEv(type);
    297     touchEv.setTouchPoints(touchPoints);
     297    touchEv.setTouchPoints(m_touchPoints);
    298298    QCoreApplication::sendEvent(page(), &touchEv);
    299299
    300300    // After sending the event, remove all touchpoints that were released
    301     if (touchPoints[0].state() == Qt::TouchPointReleased)
    302         touchPoints.removeAt(0);
    303     if (touchPoints.size() > 1 && touchPoints[1].state() == Qt::TouchPointReleased)
    304         touchPoints.removeAt(1);
     301    if (m_touchPoints[0].state() == Qt::TouchPointReleased)
     302        m_touchPoints.removeAt(0);
     303    if (m_touchPoints.size() > 1 && m_touchPoints[1].state() == Qt::TouchPointReleased)
     304        m_touchPoints.removeAt(1);
    305305}
    306306
    307307bool LauncherWindow::eventFilter(QObject* obj, QEvent* event)
    308308{
    309     if (!touchMocking || obj != m_view)
     309    if (!m_touchMocking || obj != m_view)
    310310        return QObject::eventFilter(obj, event);
    311311
     
    334334
    335335        // If the point already exists, update it. Otherwise create it.
    336         if (touchPoints.size() > 0 && !touchPoints[0].id())
    337             touchPoints[0] = touchPoint;
    338         else if (touchPoints.size() > 1 && !touchPoints[1].id())
    339             touchPoints[1] = touchPoint;
     336        if (m_touchPoints.size() > 0 && !m_touchPoints[0].id())
     337            m_touchPoints[0] = touchPoint;
     338        else if (m_touchPoints.size() > 1 && !m_touchPoints[1].id())
     339            m_touchPoints[1] = touchPoint;
    340340        else
    341             touchPoints.append(touchPoint);
     341            m_touchPoints.append(touchPoint);
    342342
    343343        sendTouchEvent();
     
    347347
    348348        // If the keyboard point is already pressed, release it.
    349         // Otherwise create it and append to touchPoints.
    350         if (touchPoints.size() > 0 && touchPoints[0].id() == 1) {
    351             touchPoints[0].setState(Qt::TouchPointReleased);
     349        // Otherwise create it and append to m_touchPoints.
     350        if (m_touchPoints.size() > 0 && m_touchPoints[0].id() == 1) {
     351            m_touchPoints[0].setState(Qt::TouchPointReleased);
    352352            sendTouchEvent();
    353         } else if (touchPoints.size() > 1 && touchPoints[1].id() == 1) {
    354             touchPoints[1].setState(Qt::TouchPointReleased);
     353        } else if (m_touchPoints.size() > 1 && m_touchPoints[1].id() == 1) {
     354            m_touchPoints[1].setState(Qt::TouchPointReleased);
    355355            sendTouchEvent();
    356356        } else {
     
    361361            touchPoint.setPos(m_view->mapFromGlobal(QCursor::pos()));
    362362            touchPoint.setPressure(1);
    363             touchPoints.append(touchPoint);
     363            m_touchPoints.append(touchPoint);
    364364            sendTouchEvent();
    365365
    366366            // After sending the event, change the touchpoint state to stationary
    367             touchPoints.last().setState(Qt::TouchPointStationary);
     367            m_touchPoints.last().setState(Qt::TouchPointStationary);
    368368        }
    369369    }
     
    397397void LauncherWindow::zoomIn()
    398398{
    399     int i = zoomLevels.indexOf(currentZoom);
     399    int i = m_zoomLevels.indexOf(m_currentZoom);
    400400    Q_ASSERT(i >= 0);
    401     if (i < zoomLevels.count() - 1)
    402         currentZoom = zoomLevels[i + 1];
    403 
    404     page()->mainFrame()->setZoomFactor(qreal(currentZoom) / 100.0);
     401    if (i < m_zoomLevels.count() - 1)
     402        m_currentZoom = m_zoomLevels[i + 1];
     403
     404    page()->mainFrame()->setZoomFactor(qreal(m_currentZoom) / 100.0);
    405405}
    406406
    407407void LauncherWindow::zoomOut()
    408408{
    409     int i = zoomLevels.indexOf(currentZoom);
     409    int i = m_zoomLevels.indexOf(m_currentZoom);
    410410    Q_ASSERT(i >= 0);
    411411    if (i > 0)
    412         currentZoom = zoomLevels[i - 1];
    413 
    414     page()->mainFrame()->setZoomFactor(qreal(currentZoom) / 100.0);
     412        m_currentZoom = m_zoomLevels[i - 1];
     413
     414    page()->mainFrame()->setZoomFactor(qreal(m_currentZoom) / 100.0);
    415415}
    416416
    417417void LauncherWindow::resetZoom()
    418418{
    419     currentZoom = 100;
     419    m_currentZoom = 100;
    420420    page()->mainFrame()->setZoomFactor(1.0);
    421421}
     
    455455{
    456456    page()->setContentEditable(on);
    457     formatMenuAction->setVisible(on);
     457    m_formatMenuAction->setVisible(on);
    458458}
    459459
     
    494494{
    495495#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
    496     touchMocking = on;
     496    m_touchMocking = on;
    497497#endif
    498498}
     
    522522        view->setPage(page());
    523523
    524         if (flipAnimated)
    525             connect(flipAnimated, SIGNAL(triggered()), view, SLOT(animatedFlip()));
    526 
    527         if (flipYAnimated)
    528             connect(flipYAnimated, SIGNAL(triggered()), view, SLOT(animatedYFlip()));
     524        if (m_flipAnimated)
     525            connect(m_flipAnimated, SIGNAL(triggered()), view, SLOT(animatedFlip()));
     526
     527        if (m_flipYAnimated)
     528            connect(m_flipYAnimated, SIGNAL(triggered()), view, SLOT(animatedYFlip()));
    529529
    530530        m_view = view;
     
    533533#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
    534534    m_view->installEventFilter(this);
    535     touchMocking = false;
     535    m_touchMocking = false;
    536536#endif
    537537}
     
    587587
    588588    QMenu* formatMenu = new QMenu("F&ormat", this);
    589     formatMenuAction = menuBar()->addMenu(formatMenu);
    590     formatMenuAction->setVisible(false);
     589    m_formatMenuAction = menuBar()->addMenu(formatMenu);
     590    m_formatMenuAction->setVisible(false);
    591591    formatMenu->addAction(page()->action(QWebPage::ToggleBold));
    592592    formatMenu->addAction(page()->action(QWebPage::ToggleItalic));
     
    603603    QMenu* toolsMenu = menuBar()->addMenu("&Develop");
    604604    toolsMenu->addAction("Select Elements...", this, SLOT(selectElements()));
    605     QAction* showInspectorAction = toolsMenu->addAction("Show Web Inspector", inspector, SLOT(setVisible(bool)), QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_I));
     605    QAction* showInspectorAction = toolsMenu->addAction("Show Web Inspector", m_inspector, SLOT(setVisible(bool)), QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_I));
    606606    showInspectorAction->setCheckable(true);
    607     showInspectorAction->connect(inspector, SIGNAL(visibleChanged(bool)), SLOT(setChecked(bool)));
     607    showInspectorAction->connect(m_inspector, SIGNAL(visibleChanged(bool)), SLOT(setChecked(bool)));
    608608
    609609#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
     
    632632    graphicsViewMenu->addSeparator();
    633633
    634     flipAnimated = graphicsViewMenu->addAction("Animated Flip");
    635     flipAnimated->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
    636     flipAnimated->setEnabled(isGraphicsBased());
    637 
    638     flipYAnimated = graphicsViewMenu->addAction("Animated Y-Flip");
    639     flipYAnimated->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
    640     flipYAnimated->setEnabled(isGraphicsBased());
     634    m_flipAnimated = graphicsViewMenu->addAction("Animated Flip");
     635    m_flipAnimated->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
     636    m_flipAnimated->setEnabled(isGraphicsBased());
     637
     638    m_flipYAnimated = graphicsViewMenu->addAction("Animated Y-Flip");
     639    m_flipYAnimated->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
     640    m_flipYAnimated->setEnabled(isGraphicsBased());
    641641
    642642    if (isGraphicsBased()) {
    643643        WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view);
    644         connect(flipAnimated, SIGNAL(triggered()), view, SLOT(animatedFlip()));
    645         connect(flipYAnimated, SIGNAL(triggered()), view, SLOT(animatedYFlip()));
     644        connect(m_flipAnimated, SIGNAL(triggered()), view, SLOT(animatedFlip()));
     645        connect(m_flipYAnimated, SIGNAL(triggered()), view, SLOT(animatedYFlip()));
    646646    }
    647647
Note: See TracChangeset for help on using the changeset viewer.