]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/selectionmode/actionwithwidget.h
Add clang-format and format code as in Frameworks
[dolphin.git] / src / selectionmode / actionwithwidget.h
index 62dad0fc1df38659952a88a0924126e38c40f75a..9b83022deaffdcbe913bce5911441c7fd1365a53 100644 (file)
 
 class QAbstractButton;
 
+namespace SelectionMode
+{
+
 /**
  * @brief Small wrapper/helper class that contains an action and its widget.
  *
  * This class takes neither the responsibility for deleting its action() nor its widget().
+ *
+ * This class is only used from BottomBarContentsContainer currently.
+ * @see BottomBarContentsContainer
  */
 class ActionWithWidget
 {
@@ -25,9 +31,9 @@ public:
     ActionWithWidget(QAction *action);
 
     /**
-     * Connect @p action and @p button using copyActionDataToButton() and the
-     * wraps the two together in the ActionWithWidget object.
-     * ActionWithWidget doesn't take any ownership.
+     * Connect @p action and @p button using copyActionDataToButton() and
+     * wraps the two together in a ActionWithWidget object.
+     * ActionWithWidget doesn't take any ownership over the parameters.
      *
      * @see copyActionDataToButton()
      *
@@ -35,14 +41,16 @@ public:
      */
     ActionWithWidget(QAction *action, QAbstractButton *button);
 
-    /** @returns the action of this object. Crashes if that action has been deleted elsewhere in the meantime. */
-    inline QAction *action() {
+    /** @returns the action of this object. */
+    inline QAction *action()
+    {
         Q_CHECK_PTR(m_action);
         return m_action;
     };
 
     /** @returns the widget of this object. */
-    inline QWidget *widget() {
+    inline QWidget *widget()
+    {
         return m_widget;
     }
 
@@ -55,7 +63,8 @@ public:
     QWidget *newWidget(QWidget *parent);
 
     /** returns true if the widget exists and is visible. false otherwise. */
-    inline bool isWidgetVisible() const {
+    inline bool isWidgetVisible() const
+    {
         return m_widget && m_widget->isVisible();
     };
 
@@ -66,7 +75,7 @@ private:
 
 /**
  * A small helper method.
- * @return a button with the correct styling for the general mode of the SelectionModeBottomBar which can be added to its layout.
+ * @return a button with the correct styling for the general mode of the BottomBarContentsContainer which can be added to its layout.
  */
 QAbstractButton *newButtonForAction(QAction *action, QWidget *parent);
 
@@ -83,4 +92,6 @@ QAbstractButton *newButtonForAction(QAction *action, QWidget *parent);
  */
 void copyActionDataToButton(QAbstractButton *button, QAction *action);
 
+}
+
 #endif // ACTIONWITHWIDGET_H