[vlc-commits] Qt: rename utility classes

Jean-Baptiste Kempf git at videolan.org
Sun Feb 20 18:15:19 CET 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Feb 20 12:07:48 2011 +0100| [f043388ca8a1f7adab5fb2fa95dcc723e04d454b] | committer: Jean-Baptiste Kempf

Qt: rename utility classes

Depending whether they are VLC specific or not

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f043388ca8a1f7adab5fb2fa95dcc723e04d454b
---

 modules/gui/qt4/components/playlist/selector.cpp |    4 ++--
 modules/gui/qt4/components/playlist/selector.hpp |    6 +++---
 modules/gui/qt4/ui/messages_panel.ui             |    4 ++--
 modules/gui/qt4/util/customwidgets.cpp           |   12 ++++++------
 modules/gui/qt4/util/customwidgets.hpp           |   14 +++++++-------
 modules/gui/qt4/util/searchlineedit.cpp          |    2 +-
 modules/gui/qt4/util/searchlineedit.hpp          |    4 ++--
 7 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/selector.cpp b/modules/gui/qt4/components/playlist/selector.cpp
index fcd4ae7..32bf8e6 100644
--- a/modules/gui/qt4/components/playlist/selector.cpp
+++ b/modules/gui/qt4/components/playlist/selector.cpp
@@ -54,7 +54,7 @@ void SelectorActionButton::paintEvent( QPaintEvent *event )
     int frame = style()->pixelMetric( QStyle::PM_DefaultFrameWidth, 0, this );
     p.drawLine( rect().topLeft() + QPoint( 0, frame ),
                 rect().bottomLeft() - QPoint( 0, frame ) );
-    QVLCFramelessButton::paintEvent( event );
+    QFramelessButton::paintEvent( event );
 }
 
 PLSelItem::PLSelItem ( QTreeWidgetItem *i, const QString& text )
@@ -64,7 +64,7 @@ PLSelItem::PLSelItem ( QTreeWidgetItem *i, const QString& text )
     layout->setContentsMargins(0,0,0,0);
     layout->addSpacing( 3 );
 
-    lbl = new QVLCElidingLabel( text );
+    lbl = new QElidingLabel( text );
     layout->addWidget(lbl, 1);
 
     int height = qMax( 22, fontMetrics().height() + 8 );
diff --git a/modules/gui/qt4/components/playlist/selector.hpp b/modules/gui/qt4/components/playlist/selector.hpp
index f040d8f..d97335e 100644
--- a/modules/gui/qt4/components/playlist/selector.hpp
+++ b/modules/gui/qt4/components/playlist/selector.hpp
@@ -30,7 +30,7 @@
 #endif
 
 #include "qt4.hpp"
-#include "util/customwidgets.hpp" /* QVLCFramelessButton */
+#include "util/customwidgets.hpp" /* QFramelessButton */
 
 #include <QTreeWidget>
 
@@ -68,7 +68,7 @@ enum ItemAction {
 };
 
 
-class SelectorActionButton : public QVLCFramelessButton
+class SelectorActionButton : public QFramelessButton
 {
 protected:
     virtual void paintEvent( QPaintEvent * );
@@ -101,7 +101,7 @@ private:
     inline void leaveEvent( QEvent* ){ hideAction(); }
 
     QTreeWidgetItem*     qitem;
-    QVLCFramelessButton* lblAction;
+    QFramelessButton* lblAction;
     QLabel*              lbl;
     QHBoxLayout*         layout;
 };
diff --git a/modules/gui/qt4/ui/messages_panel.ui b/modules/gui/qt4/ui/messages_panel.ui
index 2d6db82..e0a4329 100644
--- a/modules/gui/qt4/ui/messages_panel.ui
+++ b/modules/gui/qt4/ui/messages_panel.ui
@@ -49,7 +49,7 @@
         </widget>
        </item>
        <item row="1" column="1">
-        <widget class="DebugLevelSpinBox" name="verbosityBox">
+        <widget class="QVLCDebugLevelSpinBox" name="verbosityBox">
          <property name="wrapping">
           <bool>true</bool>
          </property>
@@ -119,7 +119,7 @@
  </widget>
  <customwidgets>
   <customwidget>
-   <class>DebugLevelSpinBox</class>
+   <class>QVLCDebugLevelSpinBox</class>
    <extends>QSpinBox</extends>
    <header>util/customwidgets.hpp</header>
   </customwidget>
diff --git a/modules/gui/qt4/util/customwidgets.cpp b/modules/gui/qt4/util/customwidgets.cpp
index 8adcae0..b7245cc 100644
--- a/modules/gui/qt4/util/customwidgets.cpp
+++ b/modules/gui/qt4/util/customwidgets.cpp
@@ -38,13 +38,13 @@
 #include <QPixmap>
 #include <vlc_keys.h>
 
-QVLCFramelessButton::QVLCFramelessButton( QWidget *parent )
+QFramelessButton::QFramelessButton( QWidget *parent )
                     : QPushButton( parent )
 {
     setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
 }
 
-void QVLCFramelessButton::paintEvent( QPaintEvent * )
+void QFramelessButton::paintEvent( QPaintEvent * )
 {
     QPainter painter( this );
     QPixmap pix = icon().pixmap( size() );
@@ -52,17 +52,17 @@ void QVLCFramelessButton::paintEvent( QPaintEvent * )
     painter.drawPixmap( QRect( pos.x(), pos.y(), pix.width(), pix.height() ), pix );
 }
 
-QVLCElidingLabel::QVLCElidingLabel( const QString &s, Qt::TextElideMode mode, QWidget * parent )
+QElidingLabel::QElidingLabel( const QString &s, Qt::TextElideMode mode, QWidget * parent )
                  : elideMode( mode ), QLabel( s, parent )
 { }
 
-void QVLCElidingLabel::setElideMode( Qt::TextElideMode mode )
+void QElidingLabel::setElideMode( Qt::TextElideMode mode )
 {
     elideMode = mode;
     repaint();
 }
 
-void QVLCElidingLabel::paintEvent( QPaintEvent * event )
+void QElidingLabel::paintEvent( QPaintEvent * event )
 {
     QPainter p( this );
     int space = frameWidth() + margin();
@@ -70,7 +70,7 @@ void QVLCElidingLabel::paintEvent( QPaintEvent * event )
     p.drawText( r, fontMetrics().elidedText( text(), elideMode, r.width() ), alignment() );
 }
 
-QString DebugLevelSpinBox::textFromValue( int v ) const
+QString QVLCDebugLevelSpinBox::textFromValue( int v ) const
 {
     QString const texts[] = {
     /* Note that min level 0 is 'errors' in Qt Ui
diff --git a/modules/gui/qt4/util/customwidgets.hpp b/modules/gui/qt4/util/customwidgets.hpp
index ad16de0..f8416e4 100644
--- a/modules/gui/qt4/util/customwidgets.hpp
+++ b/modules/gui/qt4/util/customwidgets.hpp
@@ -36,21 +36,21 @@
 #include <QTimer>
 class QPixmap;
 
-class QVLCFramelessButton : public QPushButton
+class QFramelessButton : public QPushButton
 {
     Q_OBJECT
 public:
-    QVLCFramelessButton( QWidget *parent = NULL );
+    QFramelessButton( QWidget *parent = NULL );
     virtual QSize sizeHint() const { return iconSize(); }
 protected:
     virtual void paintEvent( QPaintEvent * event );
 };
 
 
-class QVLCElidingLabel : public QLabel
+class QElidingLabel : public QLabel
 {
 public:
-    QVLCElidingLabel( const QString &s = QString(),
+    QElidingLabel( const QString &s = QString(),
                       Qt::TextElideMode mode = Qt::ElideRight,
                       QWidget * parent = NULL );
     void setElideMode( Qt::TextElideMode );
@@ -71,14 +71,14 @@ public:
     }
 };
 
-class DebugLevelSpinBox : public QSpinBox
+class QVLCDebugLevelSpinBox : public QSpinBox
 {
     Q_OBJECT
 public:
-    DebugLevelSpinBox( QWidget *parent ) : QSpinBox( parent ) { };
+    QVLCDebugLevelSpinBox( QWidget *parent ) : QSpinBox( parent ) { };
 protected:
     virtual QString textFromValue( int ) const;
-    /* DebugLevelSpinBox is read-only */
+    /* QVLCDebugLevelSpinBox is read-only */
     virtual int valueFromText( const QString& ) const { return -1; }
 };
 
diff --git a/modules/gui/qt4/util/searchlineedit.cpp b/modules/gui/qt4/util/searchlineedit.cpp
index 1b5f4e1..58b8251 100644
--- a/modules/gui/qt4/util/searchlineedit.cpp
+++ b/modules/gui/qt4/util/searchlineedit.cpp
@@ -106,7 +106,7 @@ void ClickLineEdit::focusOutEvent( QFocusEvent *ev )
 #ifndef Q_WS_MAC
 SearchLineEdit::SearchLineEdit( QWidget *parent ) : QLineEdit( parent )
 {
-    clearButton = new QVLCFramelessButton( this );
+    clearButton = new QFramelessButton( this );
     clearButton->setIcon( QIcon( ":/toolbar/clear" ) );
     clearButton->setIconSize( QSize( 16, 16 ) );
     clearButton->setCursor( Qt::ArrowCursor );
diff --git a/modules/gui/qt4/util/searchlineedit.hpp b/modules/gui/qt4/util/searchlineedit.hpp
index 3e81464..aa4f2c5 100644
--- a/modules/gui/qt4/util/searchlineedit.hpp
+++ b/modules/gui/qt4/util/searchlineedit.hpp
@@ -69,7 +69,7 @@ private:
 #endif
 
 #ifndef Q_WS_MAC
-class QVLCFramelessButton;
+class QFramelessButton;
 class SearchLineEdit : public QLineEdit
 {
     Q_OBJECT
@@ -82,7 +82,7 @@ private:
     void focusOutEvent( QFocusEvent *event );
     void paintEvent( QPaintEvent *event );
     void setMessageVisible( bool on );
-    QVLCFramelessButton   *clearButton;
+    QFramelessButton   *clearButton;
     bool message;
 
 public slots:



More information about the vlc-commits mailing list