[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kdeui/widgets
From:       Olivier Goffart <ogoffart () kde ! org>
Date:       2007-01-02 10:52:58
Message-ID: 1167735178.691535.17430.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 618864 by ogoffart:

make use of d pointer for every members

 M  +47 -32    klineedit.cpp  
 M  +2 -8      klineedit.h  


--- trunk/KDE/kdelibs/kdeui/widgets/klineedit.cpp #618863:618864
@@ -109,11 +109,16 @@
     bool enableClickMsg:1;
     bool drawClickMsg:1;
 
+    bool bEnableMenu :1; 
+    bool possibleTripleClick :1;  // set in mousePressEvent, deleted in \
tripleClickTimeout +
     bool clickInClear:1;
     int  clickButtonState;
     QLabel* clearButton;
 
     KCompletionBox *completionBox;
+
+    QAction *noCompletionAction, *shellCompletionAction, *autoCompletionAction, \
*popupCompletionAction, *shortAutoCompletionAction, *popupAutoCompletionAction, \
*defaultAction;  };
 
 bool KLineEdit::KLineEditPrivate::backspacePerformsCompletion = false;
@@ -140,7 +145,7 @@
 
 void KLineEdit::init()
 {
-    possibleTripleClick = false;
+    d->possibleTripleClick = false;
     d->bgRole = backgroundRole();
 
     // Enable the context menu by default.
@@ -926,7 +931,7 @@
 {
     if ( e->button() == Qt::LeftButton  )
     {
-        possibleTripleClick=true;
+        d->possibleTripleClick=true;
         QTimer::singleShot( QApplication::doubleClickInterval(),this,
                             SLOT(tripleClickTimeout()) );
     }
@@ -941,11 +946,11 @@
         d->clickInClear = d->clearButton->underMouse();
 
         if ( d->clickInClear ) {
-            possibleTripleClick = false;
+            d->possibleTripleClick = false;
         }
     }
 
-    if ( e->button() == Qt::LeftButton && possibleTripleClick ) {
+    if ( e->button() == Qt::LeftButton && d->possibleTripleClick ) {
         selectAll();
         e->accept();
         return;
@@ -978,12 +983,12 @@
 
 void KLineEdit::tripleClickTimeout()
 {
-    possibleTripleClick=false;
+    d->possibleTripleClick=false;
 }
 
 void KLineEdit::contextMenuEvent(QContextMenuEvent *e)
 {
-    if (!m_bEnableMenu)
+    if (!d->bEnableMenu)
         return;
     QMenu *popup = createStandardContextMenu();
     QList<QAction *> lstAction = popup->actions ();
@@ -1012,34 +1017,34 @@
         popup->addSeparator();
 
         QActionGroup* ag = new QActionGroup( this );
-        noCompletionAction = ag->addAction( i18n("None"));
-        shellCompletionAction = ag->addAction( i18n("Manual") );
-        autoCompletionAction = ag->addAction( i18n("Automatic") );
-        popupCompletionAction = ag->addAction( i18n("Dropdown List") );
-        shortAutoCompletionAction = ag->addAction( i18n("Short Automatic") );
-        popupAutoCompletionAction = ag->addAction( i18n("Dropdown List && \
Automatic")); +        d->noCompletionAction = ag->addAction( i18n("None"));
+        d->shellCompletionAction = ag->addAction( i18n("Manual") );
+        d->autoCompletionAction = ag->addAction( i18n("Automatic") );
+        d->popupCompletionAction = ag->addAction( i18n("Dropdown List") );
+        d->shortAutoCompletionAction = ag->addAction( i18n("Short Automatic") );
+        d->popupAutoCompletionAction = ag->addAction( i18n("Dropdown List && \
Automatic"));  subMenu->addActions( ag->actions() );
 
         //subMenu->setAccel( KStandardShortcut::completion(), ShellCompletion );
 
-        shellCompletionAction->setCheckable(true);
-        noCompletionAction->setCheckable(true);
-        popupCompletionAction->setCheckable(true);
-        autoCompletionAction->setCheckable(true);
-        shortAutoCompletionAction->setCheckable(true);
-        popupAutoCompletionAction->setCheckable(true);
+        d->shellCompletionAction->setCheckable(true);
+        d->noCompletionAction->setCheckable(true);
+        d->popupCompletionAction->setCheckable(true);
+        d->autoCompletionAction->setCheckable(true);
+        d->shortAutoCompletionAction->setCheckable(true);
+        d->popupAutoCompletionAction->setCheckable(true);
 
         KGlobalSettings::Completion mode = completionMode();
-        noCompletionAction->setChecked( mode == KGlobalSettings::CompletionNone );
-        shellCompletionAction->setChecked( mode == KGlobalSettings::CompletionShell \
                );
-        popupCompletionAction->setChecked( mode == KGlobalSettings::CompletionPopup \
                );
-        autoCompletionAction->setChecked(  mode == KGlobalSettings::CompletionAuto \
                );
-        shortAutoCompletionAction->setChecked( mode == \
                KGlobalSettings::CompletionMan );
-        popupAutoCompletionAction->setChecked( mode == \
KGlobalSettings::CompletionPopupAuto ); +        d->noCompletionAction->setChecked( \
mode == KGlobalSettings::CompletionNone ); +        \
d->shellCompletionAction->setChecked( mode == KGlobalSettings::CompletionShell ); +   \
d->popupCompletionAction->setChecked( mode == KGlobalSettings::CompletionPopup ); +   \
d->autoCompletionAction->setChecked(  mode == KGlobalSettings::CompletionAuto ); +    \
d->shortAutoCompletionAction->setChecked( mode == KGlobalSettings::CompletionMan ); + \
d->popupAutoCompletionAction->setChecked( mode == \
KGlobalSettings::CompletionPopupAuto );  if ( mode != \
KGlobalSettings::completionMode() )  {
             subMenu->addSeparator();
-            defaultAction = subMenu->addAction( i18n("Default") );
+            d->defaultAction = subMenu->addAction( i18n("Default") );
         }
     }
 
@@ -1056,31 +1061,31 @@
 {
     KGlobalSettings::Completion oldMode = completionMode();
 
-    if( act == noCompletionAction )
+    if( act == d->noCompletionAction )
     {
         setCompletionMode( KGlobalSettings::CompletionNone );
     }
-    else if( act ==  shellCompletionAction)
+    else if( act ==  d->shellCompletionAction)
     {
         setCompletionMode( KGlobalSettings::CompletionShell );
     }
-    else if( act == autoCompletionAction)
+    else if( act == d->autoCompletionAction)
     {
         setCompletionMode( KGlobalSettings::CompletionAuto );
     }
-    else if( act == popupCompletionAction)
+    else if( act == d->popupCompletionAction)
     {
         setCompletionMode( KGlobalSettings::CompletionPopup );
     }
-    else if( act == shortAutoCompletionAction)
+    else if( act == d->shortAutoCompletionAction)
     {
         setCompletionMode( KGlobalSettings::CompletionMan );
     }
-    else if( act == popupAutoCompletionAction)
+    else if( act == d->popupAutoCompletionAction)
     {
         setCompletionMode( KGlobalSettings::CompletionPopupAuto );
     }
-    else if( act == defaultAction )
+    else if( act == d->defaultAction )
     {
         setCompletionMode( KGlobalSettings::completionMode() );
     }
@@ -1507,3 +1512,13 @@
     d->drawClickMsg = text().isEmpty();
     update();
 }
+
+void KLineEdit::setContextMenuEnabled( bool showMenu )
+{
+    d->bEnableMenu = showMenu;
+}
+
+bool KLineEdit::isContextMenuEnabled() const
+{
+    return  d->bEnableMenu;
+}
--- trunk/KDE/kdelibs/kdeui/widgets/klineedit.h #618863:618864
@@ -207,12 +207,12 @@
     *
     * @param showMenu If @p true, show the context menu.
     */
-    virtual void setContextMenuEnabled( bool showMenu ) {  m_bEnableMenu = showMenu; \
} +    virtual void setContextMenuEnabled( bool showMenu );
 
     /**
      * Returns @p true when the context menu is enabled.
      */
-    bool isContextMenuEnabled() const { return m_bEnableMenu; }
+    bool isContextMenuEnabled() const;
 
     /**
      * Enables/Disables handling of URL drops. If enabled and the user
@@ -585,12 +585,6 @@
      **/
     void updateClearButton();
 
-    bool m_bEnableMenu;
-
-    bool possibleTripleClick;  // set in mousePressEvent, deleted in \
                tripleClickTimeout
-
-    QAction *noCompletionAction, *shellCompletionAction, *autoCompletionAction, \
*popupCompletionAction, *shortAutoCompletionAction, *popupAutoCompletionAction, \
                *defaultAction;
-
 private:
     class KLineEditPrivate;
     KLineEditPrivate *const d;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic