[Korganizer-devel] [Bug 85630] Korganizer is unable to get freebusy information from an eGroupware server

Will Stephenson wstephenson at kde.org
Tue Aug 14 19:12:03 CEST 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=85630         




------- Additional Comments From wstephenson kde org  2007-08-14 19:12 -------
SVN commit 700059 by wstephens:

Port dependent commits 691427 and 691750 by bruno.virlet gmail com to enterprise
branch.  
Fixes Novell bugs 274438 and 274476.
CCBUG:77223
CCBUG:85630
CCBUG:111419


 M  +3 -0      actionmanager.cpp  
 M  +18 -3     freebusymanager.cpp  
 M  +9 -1      freebusymanager.h  
 M  +22 -7     koeditorfreebusy.cpp  
 M  +7 -2      koeditorfreebusy.h  
 M  +16 -0     kogroupware.cpp  
 M  +8 -0      kogroupware.h  


--- branches/kdepim/enterprise/kdepim/korganizer/actionmanager.cpp #700058:700059
 @ -43,6 +43,7  @
 #include "importdialog.h"
 #include "eventarchiver.h"
 #include "stdcalendar.h"
+#include "freebusymanager.h"
 
 #include <libkcal/calendarlocal.h>
 #include <libkcal/calendarresources.h>
 @ -1264,6 +1265,8  @
 
   if ( mResourceView )
     mResourceView->updateView();
+
+  KOGroupware::instance()->freeBusyManager()->setBrokenUrl( false );
 }
 
 void ActionManager::setDestinationPolicy()
--- branches/kdepim/enterprise/kdepim/korganizer/freebusymanager.cpp #700058:700059
 @ -117,7 +117,8  @
 
 FreeBusyManager::FreeBusyManager( QObject *parent, const char *name )
   : QObject( parent, name ),
-    mCalendar( 0 ), mTimerID( 0 ), mUploadingFreeBusy( false )
+    mCalendar( 0 ), mTimerID( 0 ), mUploadingFreeBusy( false ),
+    mBrokenUrl( false )
 {
 }
 
 @ -207,6 +208,11  @
   publishFreeBusy();
 }
 
+void FreeBusyManager::setBrokenUrl( bool isBroken )
+{
+  mBrokenUrl = isBroken;
+}
+
 /*!
   This method is called when the user has selected to publish its
   free/busy list or when the delay have passed.
 @ -226,6 +232,15  @
             "</qt>" ), i18n("No Free/Busy Upload URL") );
     return;
   }
+  if ( mBrokenUrl ) // Url is invalid, don't try again
+    return;
+  if ( !targetURL.isValid() ) {
+     KMessageBox::sorry( 0,
+      i18n( "<qt>The target URL '%1' provided is invalid."
+            "</qt>" ).arg( targetURL.prettyURL() ), i18n("Invalid URL") );
+    mBrokenUrl = true;
+    return;
+  }
   targetURL.setUser( KOPrefs::instance()->mFreeBusyPublishUser );
   targetURL.setPass( KOPrefs::instance()->mFreeBusyPublishPassword );
 
 @ -326,7 +341,7  @
     mUploadingFreeBusy = false;
 }
 
-bool FreeBusyManager::retrieveFreeBusy( const QString &email )
+bool FreeBusyManager::retrieveFreeBusy( const QString &email, bool forceDownload )
 {
   kdDebug(5850) << "FreeBusyManager::retrieveFreeBusy(): " << email << endl;
   if ( email.isEmpty() ) return false;
 @ -338,7 +353,7  @
   }
 
   // Don't download free/busy if the user does not want it.
-  if( !KOPrefs::instance()->mFreeBusyRetrieveAuto ) {
+  if( !KOPrefs::instance()->mFreeBusyRetrieveAuto && !forceDownload) {
     slotFreeBusyDownloadError( email ); // fblist
     return false;
   }
--- branches/kdepim/enterprise/kdepim/korganizer/freebusymanager.h #700058:700059
 @ -95,7 +95,7  @
 
       Return true if a download is initiated, and false otherwise
     */
-    bool retrieveFreeBusy( const QString &email );
+    bool retrieveFreeBusy( const QString &email, bool forceDownload );
 
     void cancelRetrieval();
 
 @ -121,6 +121,12  @
     */
     QString freeBusyDir();
 
+    /**
+      Change the broken Url status
+      mBrokenUrl is used to show the 'broken url popup' only once
+     */
+    void setBrokenUrl( bool isBroken );
+
   public slots:
     // When something changed in the calendar, we get this called
     void slotPerhapsUploadFB();
 @ -166,6 +172,8  @
     QDateTime mNextUploadTime;
     int mTimerID;
     bool mUploadingFreeBusy;
+    bool mBrokenUrl;
+
 };
 
 #endif
--- branches/kdepim/enterprise/kdepim/korganizer/koeditorfreebusy.cpp #700058:700059
 @ -94,10 +94,10  @
     void setUpdateTimerID( int id ) { mTimerID = id; }
     int updateTimerID() const { return mTimerID; }
 
-    void startDownload() {
+    void startDownload( bool forceDownload ) {
       mIsDownloading = true;
       FreeBusyManager *m = KOGroupware::instance()->freeBusyManager();
-      if ( !m->retrieveFreeBusy( attendee()->email() ) )
+      if ( !m->retrieveFreeBusy( attendee()->email(), forceDownload ) )
         mIsDownloading = false;
     }
     void setIsDownloading( bool d ) { mIsDownloading = d; }
 @ -245,7 +245,7  @
 		   i18n("Reloads Free/Busy data for all attendees from "
 		   	"the corresponding servers.") );
   controlLayout->addWidget( button );
-  connect( button, SIGNAL( clicked() ), SLOT( reload() ) );
+  connect( button, SIGNAL( clicked() ), SLOT( manualReload() ) );
 
   mGanttView = new KDGanttView( this, "mGanttView" );
   QWhatsThis::add( mGanttView,
 @ -302,7 +302,7  @
   connect( m, SIGNAL( freeBusyRetrieved( KCal::FreeBusy *, const QString & ) ),
            SLOT( slotInsertFreeBusy( KCal::FreeBusy *, const QString & ) ) );
 
-  connect( &mReloadTimer, SIGNAL( timeout() ), SLOT( reload() ) );
+  connect( &mReloadTimer, SIGNAL( timeout() ), SLOT( autoReload() ) );
 }
 
 KOEditorFreeBusy::~KOEditorFreeBusy()
 @ -420,12 +420,11  @
 
 void KOEditorFreeBusy::timerEvent( QTimerEvent* event )
 {
-  killTimer( event->timerId() );
   FreeBusyItem *item = static_cast<FreeBusyItem *>( mGanttView->firstChild() );
   while( item ) {
     if( item->updateTimerID() == event->timerId() ) {
       item->setUpdateTimerID( 0 );
-      item->startDownload();
+      item->startDownload( mForceDownload );
       return;
     }
     item = static_cast<FreeBusyItem *>( item->nextSibling() );
 @ -649,13 +648,29  @
   mReloadTimer.stop();
 }
 
+void KOEditorFreeBusy::manualReload()
+{
+  mForceDownload = true;
+  reload();
+}
+
+void KOEditorFreeBusy::autoReload()
+{
+  mForceDownload = false;
+  reload();
+}
+
 void KOEditorFreeBusy::reload()
 {
   kdDebug(5850) << "KOEditorFreeBusy::reload()" << endl;
 
   FreeBusyItem *item = static_cast<FreeBusyItem *>( mGanttView->firstChild() );
   while( item ) {
-    updateFreeBusyData( item );
+    if (  mForceDownload )
+      item->startDownload( mForceDownload );
+    else
+      updateFreeBusyData( item );
+
     item = static_cast<FreeBusyItem *>( item->nextSibling() );
   }
 }
--- branches/kdepim/enterprise/kdepim/korganizer/koeditorfreebusy.h #700058:700059
 @ -78,7 +78,10  @
     void slotZoomToTime();
     void slotPickDate();
 
-    void reload();
+    // Force the download of FB informations
+    void manualReload();
+    // Only download FB if the auto-download option is set in config
+    void autoReload();
     void slotIntervalColorRectangleMoved( const QDateTime& start, const QDateTime& end );
 
   protected:
 @ -92,7 +95,7  @
     bool tryDate( FreeBusyItem *attendee,
                   QDateTime &tryFrom, QDateTime &tryTo );
     void updateStatusSummary();
-
+    void reload();
     KDGanttView *mGanttView;
     KDIntervalColorRectangle* mEventRectangle;
     QLabel *mStatusSummaryLabel;
 @ -102,6 +105,8  @
     QDateTime mDtStart, mDtEnd;
 
     QTimer mReloadTimer;
+
+    bool mForceDownload;
 };
 
 #endif
--- branches/kdepim/enterprise/kdepim/korganizer/kogroupware.cpp #700058:700059
 @ -91,6 +91,19  @
   incomingDirChanged( locateLocal( "data", "korganizer/income.delegated/" ) );
 }
 
+void KOGroupware::slotViewNewIncidenceChanger( IncidenceChangerBase* changer )
+{
+    // Call slot perhapsUploadFB if an incidence was added, changed or removed
+    connect( changer, SIGNAL( incidenceAdded( Incidence* ) ),
+             mFreeBusyManager, SLOT( slotPerhapsUploadFB() ) );
+    connect( changer, SIGNAL( incidenceChanged( Incidence*, Incidence*, int ) ),
+             mFreeBusyManager, SLOT( slotPerhapsUploadFB() ) );
+    connect( changer, SIGNAL( incidenceChanged( Incidence*, Incidence* ) ),
+             mFreeBusyManager, SLOT( slotPerhapsUploadFB() ) ) ;
+    connect( changer, SIGNAL( incidenceDeleted( Incidence * ) ),
+             mFreeBusyManager, SLOT( slotPerhapsUploadFB() ) );
+}
+
 FreeBusyManager *KOGroupware::freeBusyManager()
 {
   if ( !mFreeBusyManager ) {
 @ -98,6 +111,9  @
     mFreeBusyManager->setCalendar( mCalendar );
     connect( mCalendar, SIGNAL( calendarChanged() ),
              mFreeBusyManager, SLOT( slotPerhapsUploadFB() ) );
+    connect( mView, SIGNAL( newIncidenceChanger( IncidenceChangerBase* ) ),
+             this, SLOT( slotViewNewIncidenceChanger( IncidenceChangerBase* ) ) );
+    slotViewNewIncidenceChanger( mView->incidenceChanger() );
   }
 
   return mFreeBusyManager;
--- branches/kdepim/enterprise/kdepim/korganizer/kogroupware.h #700058:700059
 @ -53,6 +53,12  @
 class CalendarView;
 class FreeBusyManager;
 
+namespace KOrg {
+class IncidenceChangerBase;
+}
+
+using namespace KOrg;
+
 class KOGroupware : public QObject
 {
     Q_OBJECT
 @ -80,6 +86,8  @
     /** Handle iCals given by KMail. */
     void incomingDirChanged( const QString& path );
 
+    /** Updates some slot connections when the view incidence changer changes */
+    void slotViewNewIncidenceChanger( IncidenceChangerBase* changer );
   protected:
     KOGroupware( CalendarView*, KCal::CalendarResources* );


More information about the Korganizer-devel mailing list