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

List:       kde-pim
Subject:    [Kde-pim] Karm patch (fwd)
From:       tomas pospisek <tpo2 () sourcepole ! ch>
Date:       2003-12-05 18:28:56
[Download RAW message or body]

Forwarding to the kdepim list (Mark Bucciarelli is currently the karm
maintainer)

---------- Forwarded message ----------
Date: Fri, 5 Dec 2003 18:05:10 +0100
From: Willi Richert <w.richert@gmx.net>
To: Tomas Pospisek
Cc: Scott Monachello
Subject: Karm patch

Hi,

since kde3.2 CVS head is compilable for me now, if resolved the issues in the
karm TODO:

  * Willi said he'd push:

    // If all available desktops are checked, disable auto tracking,
    // since it makes no sense to track for every desktop.
    if (dl.size() == (unsigned int)desktopCount)
      dl.clear();

    from TaskView::editTask into addtaskdialog.

==> Seems to be resolved now.

  * The runtime warnings still need to be fixed.

==> No warnings for me.

  * the desktop tracker is not able to handle a changing number of
    desktops (i.e. if we add or remove a desktop)

==> The attached patch will hopefully do it. I created it using cvs diff >
file. I hope it is the correct format for you.

Have fun,
wr

-- 
A fool with a tool is just a fool. With a tool.

["will-karm.patch" (TEXT/X-DIFF)]

? .TODO.swp
? karm.kdevelop
? will-karm.patch
Index: edittaskdialog.cpp
===================================================================
RCS file: /home/kde/kdepim/karm/edittaskdialog.cpp,v
retrieving revision 1.4
diff -u -3 -p -r1.4 edittaskdialog.cpp
--- edittaskdialog.cpp	25 Oct 2003 20:54:17 -0000	1.4
+++ edittaskdialog.cpp	5 Dec 2003 16:59:46 -0000
@@ -40,7 +40,7 @@
 
 #include "edittaskdialog.h"
 #include "ktimewidget.h"
-
+#include "kdebug.h"
 
 EditTaskDialog::EditTaskDialog( QString caption, bool editDlg,
                                 DesktopList* desktopList)
@@ -123,17 +123,30 @@ EditTaskDialog::EditTaskDialog( QString 
   _diffTW = new KArmTimeWidget( page, "_sessionAddTW" );
   lay4->addWidget( _diffTW );
 
-  {
-    KWinModule k(0, KWinModule::INFO_DESKTOP);
-    desktopCount = k.numberOfDesktops();
+  desktopCount = getDesktopCount();
+  
+  // If desktopList contains higher numbered desktops than desktopCount then
+  // delete thos from desktopList. This may be the case if the user has
+  // configured virtual desktops.
+  if ((desktopList!=0) && (desktopList->size()>0)) {
+      DesktopList::iterator it = desktopList->begin();
+    while (it != desktopList->end()) {
+	if (*it > desktopCount-1)
+	    it = desktopList->erase(it);	    
+	else
+	    it++;
+      
+    }
   }
 
   // The "Choose Desktop" checkbox
   lay1->addSpacing(10);
   lay1->addStretch(1);
+  
   _desktopCB = new QCheckBox(i18n("A&uto tracking"), page);
   _desktopCB->setEnabled(true);
   lay1->addWidget(_desktopCB);
+  
   QGroupBox* groupBox;
   {
     int lines = (int)(desktopCount/2);
@@ -153,7 +166,6 @@ EditTaskDialog::EditTaskDialog( QString 
 
     lay6->addWidget(_deskBox[i]);
   }
-
   // check specified Desktop Check Boxes
   bool enableDesktops = false;
 
@@ -166,12 +178,11 @@ EditTaskDialog::EditTaskDialog( QString 
     enableDesktops = true;
   }
   // if some desktops were specified, then enable the parent box
-
   _desktopCB->setChecked(enableDesktops);
 
   for (int i=0; i<desktopCount; i++)
     _deskBox[i]->setEnabled(enableDesktops);
-
+  
   connect(_desktopCB, SIGNAL(clicked()), this, SLOT(slotAutoTrackingPressed()));
 
   KIconLoader loader;
@@ -225,6 +236,12 @@ EditTaskDialog::EditTaskDialog( QString 
                          "session."));
   QWhatsThis::add( _diffTW, i18n( "Specify how much time to add or subtract "
                                   "to the overall and session time"));
+}
+
+int EditTaskDialog::getDesktopCount()
+{
+  KWinModule k(0, KWinModule::INFO_DESKTOP);
+  return k.numberOfDesktops();
 }
 
 void EditTaskDialog::enterWhatsThis() 
Index: edittaskdialog.h
===================================================================
RCS file: /home/kde/kdepim/karm/edittaskdialog.h,v
retrieving revision 1.1
diff -u -3 -p -r1.1 edittaskdialog.h
--- edittaskdialog.h	29 May 2003 20:19:13 -0000	1.1
+++ edittaskdialog.h	5 Dec 2003 16:59:46 -0000
@@ -61,6 +61,9 @@ class EditTaskDialog : public KDialogBas
 
     void enterWhatsThis();
 
+  protected:
+    int getDesktopCount();
+
   private:
     QLineEdit* _name;
     KArmTimeWidget* _timeTW;


_______________________________________________
kde-pim mailing list
kde-pim@mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/

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

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