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

List:       kde-commits
Subject:    kdepim/libkdepim
From:       Bram Schoenmakers <bramschoenmakers () kde ! nl>
Date:       2004-06-14 21:31:16
Message-ID: 20040614213116.D090C9980 () office ! kde ! org
[Download RAW message or body]

CVS commit by bram: 

Updates on KDatePickerPopup:

o #if 0'd method setItems() which makes applications (KOrganizer) crash. Not a good \
idea to make this method available until this is fixed.

o Minor changes


  M +10 -10    kdatepickerpopup.cpp   1.7
  M +8 -6      kdatepickerpopup.h   1.6


--- kdepim/libkdepim/kdatepickerpopup.cpp  #1.6:1.7
@@ -2,5 +2,5 @@
   This file is part of libkdepim.
 
-  Copyright (c) 2004 Bram Schoenmakers <bram_s@softhome.net>
+  Copyright (c) 2004 Bram Schoenmakers <bramschoenmakers@kde.nl>
 
   This library is free software; you can redistribute it and/or
@@ -24,5 +24,4 @@
 
 #include <klocale.h>
-#include <kdatepicker.h>
 
 #include "kdatepickerpopup.h"
@@ -34,5 +33,5 @@ KDatePickerPopup::KDatePickerPopup( int 
   mItems = items;
 
-  mDatePicker = new KDatePicker( this, QDate::currentDate(), 0 );
+  mDatePicker = new KDatePicker();
   mDatePicker->setCloseButton( false );
 
@@ -52,12 +51,12 @@ void KDatePickerPopup::buildMenu()
   clear();
 
-  if ( ( mItems & DatePicker ) == DatePicker ) {
+  if ( mItems & DatePicker ) {
     insertItem( mDatePicker );
 
-  if ( ( mItems & NoDate ) == NoDate || ( mItems & Words ) == Words )
+    if ( ( mItems & NoDate ) || ( mItems & Words ) )
     insertSeparator();
   }
 
-  if ( ( mItems & Words ) == Words ) {
+  if ( mItems & Words ) {
     insertItem( i18n("&Today"), this, SLOT( slotToday() ) );
     insertItem( i18n("To&morrow"), this, SLOT( slotTomorrow() ) );
@@ -67,11 +66,10 @@ void KDatePickerPopup::buildMenu()
     insertItem( i18n("Next M&onth"), this, SLOT( slotNextMonth() ) );
 
-    if ( ( mItems & NoDate ) == NoDate )
+    if ( mItems & NoDate )
       insertSeparator();
   }
 
-  if ( ( mItems & NoDate ) == NoDate ) {
+  if ( mItems & NoDate )
     insertItem( i18n("No Date"), this, SLOT( slotNoDate() ) );
-  }
 }
 
@@ -86,4 +84,5 @@ KDatePicker *KDatePickerPopup::datePicke
 }
 
+#if 0
 void KDatePickerPopup::setItems( int items )
 {
@@ -91,4 +90,5 @@ void KDatePickerPopup::setItems( int ite
   buildMenu();
 }
+#endif
 
 void KDatePickerPopup::slotDateChanged( QDate date )

--- kdepim/libkdepim/kdatepickerpopup.h  #1.5:1.6
@@ -2,5 +2,5 @@
   This file is part of libkdepim.
 
-  Copyright (c) 2004 Bram Schoenmakers <bram_s@softhome.net>
+  Copyright (c) 2004 Bram Schoenmakers <bramschoenmakers@kde.nl>
 
   This library is free software; you can redistribute it and/or
@@ -27,6 +27,4 @@
 #include <kdatepicker.h>
 
-class KDatePicker;
-
 /**
    @short This menu helps the user to select a date quickly.
@@ -48,5 +46,5 @@ class KDatePickerPopup: public QPopupMen
     Q_OBJECT
   public:
-    enum { NoDate, DatePicker, Words };
+    enum { NoDate = 1, DatePicker = 2, Words = 4 };
 
     /**
@@ -69,9 +67,13 @@ class KDatePickerPopup: public QPopupMen
     KDatePicker *datePicker() const;
 
-    /** Set items which should be shown and rebuilds the menu afterwards.
+    void setDate( const QDate &date );
+
+#if 0
+    /** Set items which should be shown and rebuilds the menu afterwards. Only if \
                the menu is not visible.
     @param items List of all desirable items, separated with a bitwise OR.
     */
     void setItems( int items = 1 );
-    /** @return To be written */
+#endif
+    /** @return Returns the bitwise result of the active items in the popup. */
     int items() const { return mItems; }
 


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

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