summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt4
-rw-r--r--korganizer/calendarview.cpp64
-rw-r--r--korganizer/koagenda.cpp4
-rw-r--r--korganizer/koagenda.h1
-rw-r--r--korganizer/komonthview.cpp5
5 files changed, 17 insertions, 61 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 814c541..aa4a89a 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,57 +1,57 @@
Info about the changes in new versions of KDE-Pim/Pi
********** VERSION 2.1.14 ************
Added some buttons to the KO/Pi Quick-todo line to make it possible to quickly access some todo view layout settings like display all flat/open/close and hide/show running/done.
Added a button to add a subtodo quickly.
-Added a possibility to search for conflicting events. (In the Action menu. Keyboard shortcut "q" ).
-
+Added a possibility to search for conflicting events. (In the Action menu. Keyboard shortcut "q", shift+q or ctrl +q ).
+Added an option to change the layout of the list week to column mode.
********** VERSION 2.1.13 ************
Fixed a problem in KA/Pi search.
Fixed some minor problems in KO/Pi.
Added calendar selection possibility to the todo view popup and to the event/todo/journal editor.
Fixed memory usage problems in KA/Pi:
When loading data KA/Pi did load the file data twice.
Example:
A 600k file did consume 1200k memory during loading process.
This is fixed, it does now consume only 600k during loading process.
When saving data KA/Pi did consume a lot of memory for the data parsing during the save process.
This is fixed.
Example:
Before saving a 600k file KA/Pi did consume 21.7 Meg of Ram.
When saving KA/Pi did consume 28.6 Meg of Ram. That causes a crash on the Zaurus because there was no memeory left in the system.
Now KA/Pi is consuming on saving the same data 22.0 Meg of Ram during the save process.
Note: The memory usage of KA/Pi after the data is loaded/saved has not changed.
The saving of data may be a bit slower now.
Fixed memory usage problems in KO/Pi:
When KO/Pi did save the data to file, it did not release the used buffers after saving.
The used buffer was released after saving the next time, but there was new buffer space allocated again on that save operation.
This is fixed.
Example:
When saving a 400k file KO/Pi do now use 400k less memory now.
Optimized memory usage in KO/Pi Agenda view:
KO/Pi is storing some paint information in extra buffers for faster repainting of the agenda view.
These buffers were not made smaller (i.e. downsized) because of performance reasons.
The handling of these buffers are now much smarter:
Two (of six) buffers are removed completely.
The remaing four buffers are now downsized after not using the agenda view for 45 seconds.
Such that the memory usage of KO/Pi is smaller now in general ( because 2 buffers are removed) and is much smaller when not using the agenda view. That is very important when using fastload for KO/Pi.
Worst case example ( for a maximum size agenda content):
When resizing the agenda content to a large scale, KO/Pi did use 17Meg of mem ( and did not use less memory until it was stopped). Now KO/Pi is using on the same operation only 14.3 Meg of mem and after 45 seconds not using the agenda view it uses only 9.4 Meg of mem.
When switching to an unused Agenda view now KO/Pi is upizing the buffers again. This takes less than a second. Such that switching to Agenda view (after not using it for more than 45 seconds) is now a bit slower.
Summary:
Many memory wasting problems of KA/Pi and KO/Pi fixed such that it is better to use on the Zaurus.
********** VERSION 2.1.12 ************
KO/Pi:
Many small usability fixes, e.g. rearranged the popup menus such that they are better to use on the Zaurus.
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 426e8f9..2582931 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -59,96 +59,97 @@
#include <kconfig.h>
#include <libkdepim/ksyncprefsdialog.h>
#include <krun.h>
#include <kdirwatch.h>
#include <libkdepim/kdatepicker.h>
#include <libkdepim/ksyncprofile.h>
#include <libkdepim/kpimglobalprefs.h>
#include <libkcal/vcaldrag.h>
#include <libkcal/icaldrag.h>
#include <libkcal/icalformat.h>
#include <libkcal/vcalformat.h>
#include <libkcal/scheduler.h>
#include <libkcal/calendarlocal.h>
#include <libkcal/journal.h>
#include <libkcal/calfilter.h>
#include <libkcal/attendee.h>
#include <libkcal/dndfactory.h>
#include <libkcal/freebusy.h>
#include <libkcal/filestorage.h>
#include <libkcal/calendarresources.h>
#include <libkcal/qtopiaformat.h>
#include "../kalarmd/alarmdialog.h"
#ifndef DESKTOP_VERSION
#include <libkcal/sharpformat.h>
#include <externalapphandler.h>
#endif
#include <libkcal/phoneformat.h>
#ifndef KORG_NOMAIL
#include "komailclient.h"
#endif
#ifndef KORG_NOPRINTER
#include "calprinter.h"
#endif
#ifndef KORG_NOPLUGINS
#include "kocore.h"
#endif
#include "koeventeditor.h"
#include "kotodoeditor.h"
#include "koprefs.h"
#include "koeventviewerdialog.h"
#include "publishdialog.h"
#include "kofilterview.h"
#include "koglobals.h"
#include "koviewmanager.h"
#include "koagendaview.h"
+#include "koagenda.h"
#include "kodialogmanager.h"
#include "outgoingdialog.h"
#include "incomingdialog.h"
#include "datenavigatorcontainer.h"
#include "statusdialog.h"
#include "kdatenavigator.h"
#include "kotodoview.h"
#include "datenavigator.h"
#include "resourceview.h"
#include "navigatorbar.h"
#include "searchdialog.h"
#include "mainwindow.h"
#include "categoryeditdialog.h"
#include "calendarview.h"
#ifndef DESKTOP_VERSION
#include <qtopia/alarmserver.h>
#endif
#ifndef _WIN32_
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#else
#include <qprocess.h>
#endif
#ifdef DESKTOP_VERSION
#include <kabc/stdaddressbook.h>
#endif
using namespace KOrg;
using namespace KCal;
extern int globalFlagBlockAgenda;
extern int globalFlagBlockStartup;
MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms,QDateTime start ) : QTextBrowser(parent)
{
mAlarms = alarms;
viewport()->setBackgroundColor( QColor( 255, 255, 255 ) );
QString mText = "<table width=\"100%\">\n";
//mText += "<tr bgcolor=\"#3679AD\"><td><h2>";
#ifdef DESKTOP_VERSION
mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>";
#else
mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h3>";
#endif
// mText += "<img src=\"";
@@ -618,210 +619,157 @@ void CalendarView::init()
connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate)));
mEventEditor = mDialogManager->getEventEditor();
mTodoEditor = mDialogManager->getTodoEditor();
mFlagEditDescription = false;
mSuspendTimer = new QTimer( this );
mAlarmTimer = new QTimer( this );
mRecheckAlarmTimer = new QTimer( this );
connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) );
connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) );
connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) );
mAlarmDialog = new AlarmDialog( this );
connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) );
mAlarmDialog->setServerNotification( false );
mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
#ifndef DESKTOP_VERSION
//US listen for arriving address resultsets
connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
#endif
mDateNavigator->setCalendar( mCalendar );
}
CalendarView::~CalendarView()
{
// kdDebug() << "~CalendarView()" << endl;
//qDebug("CalendarView::~CalendarView() ");
delete mDialogManager;
delete mViewManager;
delete mStorage;
delete mDateFrame ;
delete mEventViewerDialog;
//kdDebug() << "~CalendarView() done" << endl;
}
void CalendarView::nextConflict( bool all, bool allday )
{
QPtrList<Event> testlist = mCalendar->events();
Event * test = testlist.first();
while ( test ) {
test->setTagged( false );
test = testlist.next();
}
- QDateTime startDT = QDateTime (mNavigator->selectedDates().first().addDays(1), QTime ( 0,0,0));
+ QTime st ( 0,0,0);
+ if ( mViewManager->currentView() == mViewManager->agendaView() )
+ st = mViewManager->agendaView()->agenda()->getEndTime();
+ //qDebug("time %s ", st.toString().latin1());
+ QDateTime startDT = QDateTime (mNavigator->selectedDates().first(),st);
QDateTime conflict;
QDateTime retVal;
bool found = false;
Event * cE = 0;
Event * cE2 = 0;
QPtrList<Event> testlist2 = testlist;
test = testlist.first();
bool skip = false;
while ( test ) {
skip = false;
if ( !all ) skip = ( allday != test->doesFloat() );
if ( !skip ) {
Event * test2 = testlist2.first();
while ( test2 ) {
skip = false;
if ( !all ) skip = ( allday != test2->doesFloat() );
if ( !skip ) {
if ( !test2->isTagged() ) {
if ( test->isOverlapping ( test2, &retVal, &startDT ) ) {
//qDebug("overlap ");
if ( ! found ) {
if ( retVal >= startDT ) {
conflict = retVal;
cE = test;
cE2 = test2;
found = true;
}
} else {
if ( retVal >= startDT && retVal < conflict ) {
conflict = retVal;
cE = test;
cE2 = test2;
}
}
}
}
}
test2 = testlist2.next();
}
}
test->setTagged( true );
test = testlist.next();
}
if ( found ) {
if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
mViewManager->showDayView();
mNavigator->slotDaySelect( conflict.date() );
int hour = conflict.time().hour();
mViewManager->agendaView()->setStartHour( hour );
topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( cE->summary().left( 20 ) ).arg( cE2->summary().left( 20 ) ) );
return;
}
topLevelWidget()->setCaption( i18n("No conflict found") );
qDebug("No conflict found ");
return;
-
-
-
-
-
-#if 0
-
-
- QDate end = start.addDays( 365*2);
- while ( start < end ) {
- QPtrList<Event> eventList = calendar()->events( start );
- Event * ev = eventList.first();
- QPtrList<Event> test = eventList;
- while ( ev ) {
- //qDebug("found %d on %s ", eventList.count(), start.toString().latin1());
- Event * t_ev = test.first();
- QDateTime es = ev->dtStart();
- QDateTime ee = ev->dtEnd();
- if ( ev->doesFloat() )
- ee = ee.addDays( 1 );
- if ( ! all ) {
- if ( ev->doesFloat() != allday )
- t_ev = 0;
- }
- while ( t_ev ) {
- bool skip = false;
- if ( ! all ) {
- if ( t_ev->doesFloat() != allday )
- skip = true;
- }
- if ( !skip && ev != t_ev ) {
- QDateTime ets = t_ev->dtStart();
- QDateTime ete = t_ev->dtEnd();
- if ( t_ev->doesFloat() )
- ete = ete.addDays( 1 );
- //qDebug("test %s -- %s -------- %s -- %s ", es.toString().latin1() , ee.toString().latin1(), ets.toString().latin1() , ete.toString().latin1() );
- if ( es < ete && ets < ee ) {
- if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
- mViewManager->showDayView();
- mNavigator->slotDaySelect( start );
- int hour = es.time().hour();
- if ( ets > es )
- hour = ets.time().hour();
- mViewManager->agendaView()->setStartHour( hour );
- topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( ev->summary().left( 20 ) ).arg( t_ev->summary().left( 20 ) ) );
- return;
- }
- }
- t_ev = test.next();
- }
- ev = eventList.next();
- }
- start = start.addDays( 1 );
- }
- topLevelWidget()->setCaption( i18n("No conflict found within the next two years") );
- qDebug("No conflict found ");
-#endif
}
void CalendarView::conflictAll()
{
nextConflict ( true, true );
}
void CalendarView::conflictAllday()
{
nextConflict ( false, true );
}
void CalendarView::conflictNotAll()
{
nextConflict ( false, false );
}
void CalendarView::setCalReadOnly( int id, bool readO )
{
if ( readO ) {
emit save();
}
mCalendar->setReadOnly( id, readO );
}
void CalendarView::setScrollBarStep(int val )
{
#ifdef DESKTOP_VERSION
mDateScrollBar->setLineStep ( val );
#endif
}
void CalendarView::scrollBarValue(int val )
{
#ifdef DESKTOP_VERSION
if ( QApplication::desktop()->width() < 800 ) return;
static bool block = false;
if ( block ) return;
block = true;
int count = mNavigator->selectedDates().count();
int day = mNavigator->selectedDates().first().dayOfYear();
int stepdays = val;
if ( mDateScrollBar->lineStep () <= count ) {
//val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
//qDebug("VAL %d ",val );
stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
stepdays = day+stepdays;
if ( stepdays < 0 ) stepdays = 0;
}
if ( stepdays == day ) {
block = false;
return;
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index b290020..779f12e 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -1588,96 +1588,100 @@ void KOAgenda::contentsToGrid (int x, int y, int& gx, int& gy)
*/
void KOAgenda::gridToContents (int gx, int gy, int& x, int& y)
{
x = KOGlobals::self()->reverseLayout() ? (mColumns - 1 - gx)*mGridSpacingX:
gx*mGridSpacingX;
y = gy*mGridSpacingY;
}
/*
Return Y coordinate corresponding to time. Coordinates are rounded to fit into
the grid.
*/
int KOAgenda::timeToY(const QTime &time)
{
int minutesPerCell = 24 * 60 / mRows;
int timeMinutes = time.hour() * 60 + time.minute();
int Y = (timeMinutes + (minutesPerCell / 2)) / minutesPerCell;
return Y;
}
/*
Return time corresponding to cell y coordinate. Coordinates are rounded to
fit into the grid.
*/
QTime KOAgenda::gyToTime(int gy)
{
int secondsPerCell = 24 * 60 * 60/ mRows;
int timeSeconds = secondsPerCell * gy;
QTime time( 0, 0, 0 );
if ( timeSeconds < 24 * 60 * 60 ) {
time = time.addSecs(timeSeconds);
} else {
time.setHMS( 23, 59, 59 );
}
return time;
}
void KOAgenda::setStartHour(int startHour)
{
int startCell = startHour * mRows / 24;
setContentsPos(0,startCell * gridSpacingY());
}
+QTime KOAgenda::getEndTime()
+{
+ return QTime ( (contentsY ()+viewport()->height())*24/contentsHeight ()+1,0,0);
+}
void KOAgenda::hideUnused()
{
// experimental only
// return;
KOAgendaItem *item;
for ( item=mUnusedItems.first(); item != 0; item=mUnusedItems.next() ) {
item->hide();
}
}
KOAgendaItem *KOAgenda::getNewItem(Incidence * event,QDate qd, QWidget* view)
{
KOAgendaItem *fi;
for ( fi=mUnusedItems.first(); fi != 0; fi=mUnusedItems.next() ) {
if ( fi->incidence() == event ) {
mUnusedItems.remove();
fi->init( event, qd );
return fi;
}
}
fi=mUnusedItems.first();
if ( fi ) {
mUnusedItems.remove();
fi->init( event, qd );
return fi;
}
// qDebug("new KOAgendaItem ");
KOAgendaItem* agendaItem = new KOAgendaItem( event, qd, view, mAllDayMode );
agendaItem->installEventFilter(this);
addChild(agendaItem,0,0);
return agendaItem;
}
KOAgendaItem * KOAgenda::getItemForTodo ( Todo * todo )
{
KOAgendaItem *item;
for ( item=mItems.first(); item != 0; item=mItems.next() ) {
if ( item->incidence() == todo ) {
mItems.remove();
return item;
}
}
return 0;
}
diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h
index 0e3aed8..86cf2f4 100644
--- a/korganizer/koagenda.h
+++ b/korganizer/koagenda.h
@@ -82,96 +82,97 @@ class KOAgenda : public QScrollView
virtual bool eventFilter ( QObject *, QEvent * );
void contentsToGrid (int x, int y, int& gx, int& gy);
void gridToContents (int gx, int gy, int& x, int& y);
int timeToY (const QTime &time);
QTime gyToTime (int y);
void setStartHour(int startHour);
KOAgendaItem *insertItem (Incidence *event,QDate qd,int X,int YTop,int YBottom);
KOAgendaItem *insertAllDayItem (Incidence *event,QDate qd,int XBegin,int XEnd);
void insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd,
int YTop,int YBottom);
void changeColumns(int columns);
int columns() { return mColumns; }
int rows() { return mRows; }
int gridSpacingX() const { return mGridSpacingX; }
int gridSpacingY() const { return mGridSpacingY; }
// virtual QSizePolicy sizePolicy() const;
void clear();
void clearSelection();
void hideUnused();
/** Calculates the minimum width */
virtual int minimumWidth() const;
/** Update configuration from preference settings */
void updateConfig();
void checkScrollBoundaries();
void setHolidayMask(QMemArray<bool> *);
void setDateList(const DateList &selectedDates);
DateList dateList() const;
void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false);
void finishUpdate();
void printSelection();
void storePosition();
void restorePosition();
void setPopup( KOEventPopupMenu * p ) { mAllAgendaPopup = p; }
void shrinkPixmap();
+ QTime getEndTime();
public slots:
void slotContentMove(int,int);
void categoryChanged(Incidence * inc);
void slotClearSelection();
void popupMenu();
void newItem( int );
void moveChild( QWidget *, int, int );
void scrollUp();
void scrollDown();
void updateTodo( Todo * t, int , bool );
void popupAlarm();
void checkScrollBoundaries(int);
/** Deselect selected items. This function does not emit any signals. */
void deselectItem();
/** Select item. If the argument is 0, the currently selected item gets
deselected. This function emits the itemSelected(bool) signal to inform
about selection/deseelction of events. */
void selectItem(KOAgendaItem *);
void finishResize();
signals:
void signalClearSelection();
void showDateView( int, int);
void newEventSignal();
void newEventSignal(int gx,int gy);
void newTodoSignal(int gx,int gy);
void newEventSignal(int gxStart, int gyStart, int gxEnd, int gyEnd);
void newTimeSpanSignal(int gxStart, int gyStart, int gxEnd, int gyEnd);
void newStartSelectSignal();
void showIncidenceSignal(Incidence *);
void editIncidenceSignal(Incidence *);
void deleteIncidenceSignal(Incidence *);
void showIncidencePopupSignal(Incidence *);
void itemModified(KOAgendaItem *item, int );
void incidenceSelected(Incidence *);
void lowerYChanged(int);
void upperYChanged(int);
void startDragSignal(Incidence *);
void addToCalSignal(Incidence *, Incidence *);
void resizedSignal();
void updateViewSignal();
void sendPing();
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 53bbe28..b5a59af 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -1795,99 +1795,102 @@ void KOMonthView::setKeyBoardFocus()
}
else {
shootAgain = !mWeekLabels[mNumWeeks]->hasFocus();
mWeekLabels[mNumWeeks]->setFocus();
}
--mKBFcounter;
if ( shootAgain && mKBFcounter > 0 ) {
QTimer::singleShot( 50, this, SLOT ( setKeyBoardFocus() ) );
}
}
void KOMonthView::setKeyBFocus()
{
//qDebug("KOMonthView::setKeyBFocus() ");
mKBFcounter = 10;
QTimer::singleShot( 0, this, SLOT ( setKeyBoardFocus() ) );
}
void KOMonthView::resizeEvent(QResizeEvent * e)
{
//qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height());
if ( isVisible() ) {
//qDebug("KOMonthView::isVisible ");
slotComputeLayout();
} else
mComputeLayoutTimer->start( 100 );
if ( e )
KOEventView::resizeEvent( e );
}
void KOMonthView::slotComputeLayout()
{
mComputeLayoutTimer->stop();
//qDebug("KOMonthView::Post - resizeEvent %d %d ", width(), height() );
computeLayout();
clPending = true;
setKeyBFocus();
}
void KOMonthView::doComputeLayoutWeek()
{
int daysToShow;
bool combinedSatSun = false;
if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) {
daysToShow = 6;
combinedSatSun = true;
}
int wid = width();//e
int hei = height()-1-mNavigatorBar->height();
+#ifdef DESKTOP_VERSION
if ( !KOPrefs::instance()->mMonthViewWeekRowlayout ) {
daysToShow = 2;
- } else {
+ } else
+#endif
+ {
if ( wid < hei )
daysToShow = 2;
else
daysToShow = 3;
}
bool landscape = (daysToShow == 3);
mShowSatSunComp = true;
combinedSatSun = true;
//qDebug("KOMonthView::computeLayout() WWW ------------------------------------ ");
QFontMetrics fm ( mWeekLabels[0]->font() );
int weeklabelwid = fm.width( "888" );
wid -= weeklabelwid;
int colWid = wid / daysToShow;
int dayLabelHei = mDayLabelsW[0]->sizeHint().height();
int cellHei = (hei - (5- daysToShow )*dayLabelHei) /(5- daysToShow );
int colModulo = wid % daysToShow;
int rowModulo = (hei- (5- daysToShow )*dayLabelHei) % daysToShow-1;
//qDebug("rowmod %d ", rowModulo);
int i;
int x,y,w,h;
x= 0;
y= 0;
w = colWid;
h = dayLabelHei ;
for ( i = 0; i < 7; i++) {
if ( i && !( i % daysToShow) && i < 6) {
y += hei/(5-daysToShow);
x = 0;
w = colWid;
}
if ( ((i) % daysToShow) >= daysToShow-colModulo ) {
++w;
}
int xC,yC,wC,hC;
if ( i >= 5 ) {
int wi = width() - x - weeklabelwid;
if ( i == 5 ) {
xC = x+weeklabelwid;
yC = y;
wC = wi/2+wi%2;
hC = h;
} else {
xC = x+weeklabelwid;
yC = y;
wC = wi;
hC = h;