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

List:       kde-core-devel
Subject:    =?utf-8?q?=5Bkdelibs=5D_kdeui/widgets=3A_Shorten_length_of_Messa?=
From:       Aurélien Gâteau <agateau () kde ! org>
Date:       2011-05-11 4:47:06
Message-ID: 20110511044706.210F0A60A6 () git ! kde ! org
[Download RAW message or body]

Git commit a7801bf4fd347462840df1a62e718f77cf489a5b by Aurélien Gâteau.
Committed on 11/05/2011 at 06:41.
Pushed by gateau into branch 'master'.

Shorten length of MessageType enums

KMessageWidget::MessageType enums were annoying to type because they are
quite long. I shortened them by removing the "MessageType" part of them, so
KMessageWidget::PositiveMessageType is now KMessageWidget::Positive.

Longer enums are still available if KDE_NO_DEPRECATED is not defined. I
plan to drop them before API freeze.

CCMAIL: afiestas@kde.org
CCMAIL: kde-core-devel@kde.org

M  +5    -5    kdeui/widgets/kmessagewidget.cpp     
M  +11   -4    kdeui/widgets/kmessagewidget.h     

http://commits.kde.org/kdelibs/a7801bf4fd347462840df1a62e718f77cf489a5b

diff --git a/kdeui/widgets/kmessagewidget.cpp b/kdeui/widgets/kmessagewidget.cpp
index 7ef71f1..ec222fb 100644
--- a/kdeui/widgets/kmessagewidget.cpp
+++ b/kdeui/widgets/kmessagewidget.cpp
@@ -91,7 +91,7 @@ void KMessageWidgetPrivate::init(KMessageWidget *q_ptr)
     closeButton->setAutoRaise(true);
     closeButton->setDefaultAction(closeAction);
 
-    q->setMessageType(KMessageWidget::InformationMessageType);
+    q->setMessageType(KMessageWidget::Information);
 }
 
 void KMessageWidgetPrivate::createLayout()
@@ -226,23 +226,23 @@ void KMessageWidget::setMessageType(KMessageWidget::MessageType type)
     KColorScheme::ForegroundRole fgRole;
     KColorScheme::ColorSet colorSet = KColorScheme::Window;
     switch (type) {
-    case PositiveMessageType:
+    case Positive:
         icon = KIcon("dialog-ok");
         bgRole = KColorScheme::PositiveBackground;
         fgRole = KColorScheme::PositiveText;
         break;
-    case InformationMessageType:
+    case Information:
         icon = KIcon("dialog-information");
         bgRole = KColorScheme::NormalBackground;
         fgRole = KColorScheme::NormalText;
         colorSet = KColorScheme::Tooltip;
         break;
-    case WarningMessageType:
+    case Warning:
         icon = KIcon("dialog-warning");
         bgRole = KColorScheme::NeutralBackground;
         fgRole = KColorScheme::NeutralText;
         break;
-    case ErrorMessageType:
+    case Error:
         icon = KIcon("dialog-error");
         bgRole = KColorScheme::NegativeBackground;
         fgRole = KColorScheme::NegativeText;
diff --git a/kdeui/widgets/kmessagewidget.h b/kdeui/widgets/kmessagewidget.h
index 2d6a281..7eab4f9 100644
--- a/kdeui/widgets/kmessagewidget.h
+++ b/kdeui/widgets/kmessagewidget.h
@@ -100,10 +100,17 @@ class KDEUI_EXPORT KMessageWidget : public QFrame
     Q_PROPERTY(MessageType messageType READ messageType WRITE setMessageType)
 public:
     enum MessageType {
-        PositiveMessageType,
-        InformationMessageType,
-        WarningMessageType,
-        ErrorMessageType
+        Positive,
+        Information,
+        Warning,
+        Error
+#ifndef KDE_NO_DEPRECATED
+        ,
+        PositiveMessageType = Positive,
+        InformationMessageType = Information,
+        WarningMessageType = Warning,
+        ErrorMessageType = Error
+#endif
     };
 
     /**


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

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