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

List:       kde-core-devel
Subject:    patch: kshortcut.cpp, kcommand.cpp, kkeydialog.h
From:       Ellis Whitehead <ellis () kde ! org>
Date:       2002-03-04 11:15:51
[Download RAW message or body]

Remove private class from KKey.  A key can be fully defined by two integer values.  
This won't change, so no need to have an extra pointer for every key.  BIC.

Index: kdelibs/kdecore/kshortcut.h
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kshortcut.h,v
retrieving revision 1.10
diff -u -3 -d -p -b -B -r1.10 kshortcut.h
--- kdelibs/kdecore/kshortcut.h	2002/02/19 18:24:54	1.10
+++ kdelibs/kdecore/kshortcut.h	2002/03/04 10:23:19
@@ -75,6 +75,7 @@ class KKey

 	/** @internal */
 	uint sym() const;
+	/** @internal */
 	uint modFlags() const;

  // Comparison Methods
@@ -115,7 +116,6 @@ class KKey
 	uint m_mod;
 
  private:
-	class KKeyPrivate* d;
 	friend class KKeyNative;
 };



The proper string for Undo is &Undo instead of Und&o.

Index: kcommand.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kcommand.cpp,v
retrieving revision 1.14
diff -u -3 -d -p -b -B -r1.14 kcommand.cpp
--- kcommand.cpp        2002/03/04 00:51:47     1.14
+++ kcommand.cpp        2002/03/04 10:31:16
@@ -83,7 +83,7 @@ KCommandHistory::KCommandHistory(KAction
     d=new KCommandHistoryPrivate();
     if (withMenus)
     {
-        KToolBarPopupAction * undo = new KToolBarPopupAction( i18n("Und&o"), "undo",
+        KToolBarPopupAction * undo = new KToolBarPopupAction( i18n("&Undo"), "undo",
                                           KStdAccel::key(KStdAccel::Undo), this, SLOT( undo() ),
                                           actionCollection, KStdAction::stdName( KStdAction::Undo ) );
         connect( undo->popupMenu(), SIGNAL( aboutToShow() ), this, SLOT( slotUndoAboutToShow() ) );





Add documentation (thanks to Andreas)
Remove unused member variables in KKeyDialog. (BIC)

Index: kdelibs/kdeui/kkeydialog.h
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kkeydialog.h,v
retrieving revision 1.59
diff -u -3 -d -p -b -B -r1.59 kkeydialog.h
--- kdelibs/kdeui/kkeydialog.h	2002/03/04 00:51:49	1.59
+++ kdelibs/kdeui/kkeydialog.h	2002/03/04 10:23:19
@@ -63,7 +63,6 @@ class KKeyChooser : public QWidget
 	/**
 	 * Constructor.
 	 *
-	 * @param aKeyDict A dictionary (@ref QMap) of key definitons.
 	 * @param bAllowLetterShortcuts Set to false if unmodified alphanumeric
 	 *  keys ('A', '1', etc.) are not permissible shortcuts.
 	 **/
@@ -75,6 +74,10 @@ class KKeyChooser : public QWidget

 	virtual ~KKeyChooser();

+	/**
+	 * Insert an action collection, i.e. add all its actions to the ones
+	 * already associated with the KKeyChooser object.
+	 */
 	bool insert( KActionCollection* );

 	void syncToConfig( const QString& sConfigGroup, KConfigBase* pConfig, bool bClearUnset );
@@ -104,10 +107,12 @@ class KKeyChooser : public QWidget
 	 * Set all keys to their default values (bindings).
 	 **/
 	void allDefault();
-	// Whether to use the 3 or 4 modifier key scheme.
-	//virtual void allDefault( bool useFourModifierKeys );
-	// This determines which default is used when the 'Default' button is
-	//  clicked.
+
+	/**
+	 * Specifies whether to use the 3 or 4 modifier key scheme.
+	 * This determines which default is used when the 'Default' button is
+	 * clicked.
+	 */
 	void setPreferFourModifierKeys( bool preferFourModifierKeys );

  protected:
@@ -199,7 +204,7 @@ typedef KKeyChooser KKeyChooser;
  * }
  * </pre>
  *
- * This will also implicitly save the settings. If you don't want this,
+ * This will also implicitly commit and save the settings. If you don't want this,
  * you can call
  *
  * <pre>
@@ -221,8 +226,17 @@ class KKeyDialog : public KDialogBase
 {
   Q_OBJECT

-public:
+ public:
+	/**
+	 * Constructs a KKeyDialog called @p name as a child of @p parent.
+	 * Set @p bAllowLetterShortcuts to false if unmodified alphanumeric
+	 * keys ('A', '1', etc.) are not permissible shortcuts.
+	 */
 	KKeyDialog( bool bAllowLetterShortcuts = true, QWidget* parent = 0, const char* name = 0 );
+
+	/**
+	 * Destructor. Deletes all resources used by a KKeyDialog object.
+	 */
 	virtual ~KKeyDialog();

 	/**
@@ -234,7 +248,14 @@ public:
          * @return true :)
          */
 	bool insert( KActionCollection* );
+
 	bool configure( bool bSaveSettings = true );
+
+	/**
+	 * Commit key setting changes so that changed settings actually become active.
+	 * This method is implicitly called from @ref KKeyConfig::configure if
+	 * @p bSaveSettings is true.
+	 */
 	void commitChanges();

 	/**
@@ -244,37 +265,48 @@ public:
 	 * @return Accept if the dialog was closed with OK, Reject otherwise.
 	 **/
 	static int configure( KAccel* keys, QWidget* parent = 0, bool bSaveSettings = true );
+
+	/**
+	 * This is an overloaded member function, provided for convenience.
+	 * It behaves essentially like the above function.
+	 */
 	static int configure( KGlobalAccel* keys, QWidget* parent = 0, bool bSaveSettings = true );
+
 	/**
-	 * Pops up a modal dialog for configuring key settings. The dialog is initialized
+	 * This is an overloaded member function, provided for convenience.
+	 * It behaves essentially like the above function.
+	 * The dialog is initialized
 	 * from an action collection (for XMLGUI based applications).
-	 * @return Accept if the dialog was closed with OK, Reject otherwise.
 	 **/
 	static int configure( KActionCollection* coll,
 		QWidget* parent = 0, bool bSaveSettings = true );
 
-	/** @deprecated. Obsolete. */
+	/**
+	 * @deprecated Obsolete.
+	 * Please use @ref KKeyDialog::configure instead
+	 */
 	static int configureKeys( KAccel* keys, bool save_settings = true, QWidget* parent = 0 )
 		{ return configure( keys, parent, save_settings ); }
-	/** @deprecated. Obsolete. */
+	/**
+	 * @deprecated Obsolete.
+	 * Please use @ref KKeyDialog::configure instead
+	 */
 	static int configureKeys( KGlobalAccel* keys, bool save_settings = true, QWidget* parent = 0 )
 		{ return configure( keys, parent, save_settings ); }
-	/** @deprecated. Obsolete. */
+	/**
+	 * @deprecated Obsolete.
+	 * Please use @ref KKeyDialog::configure instead
+	 */
 	static int configureKeys( KActionCollection* coll, const QString& /*xmlfile*/,
 		bool save_settings = true, QWidget* parent = 0 )
 		{ return configure( coll, parent, save_settings ); }
-
-private:
-	KKeyChooser* m_pKeyChooser;
-	QPushButton* bDefaults;
-	QPushButton* bOk;
-	QPushButton* bCancel;
-	QPushButton* bHelp;

-protected:
+ protected:
 	virtual void virtual_hook( int id, void* data );
-private:
+
+ private:
 	class KKeyDialogPrivate* d;
+	KKeyChooser* m_pKeyChooser;
 };


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

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