summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagenda.cpp35
-rw-r--r--korganizer/koagenda.h3
-rw-r--r--korganizer/koagendaview.cpp20
-rw-r--r--korganizer/koagendaview.h1
4 files changed, 43 insertions, 16 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index c339b57..662576f 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -62,3 +62,3 @@ extern int globalFlagBlockStartup;
-bool KOAgenda::mInvalidPixmap = false;
+
////////////////////////////////////////////////////////////////////////////
@@ -332,2 +332,3 @@ void KOAgenda::slotContentMove(int,int)
{
+ emit sendPing();
if ( mActionType == NOP )
@@ -440,2 +441,11 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
{
+
+ if ( mInvalidPixmap ) {
+ mInvalidPixmap = false;
+ qDebug("InvalidPixmap ");
+ computeSizes();
+ emit updateViewSignal();
+ return true;
+ }
+ emit sendPing();
static int startX = 0;
@@ -1269,3 +1279,4 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
qDebug("InvalidPixmap ");
- QTimer::singleShot( 0, this, SIGNAL( updateViewSignal() ));
+ computeSizes();
+ emit updateViewSignal();
return;
@@ -1276,5 +1287,8 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
//qDebug("KOAgenda::drawContents ");
- if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() )
- ;//drawContentsToPainter();
-
+#if 0
+ if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) {
+ qDebug("WAU ");
+ drawContentsToPainter();
+ }
+#endif
QPaintDevice* pd = p->device();
@@ -1322,6 +1336,9 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
} else {
-
- if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() )
- ;//drawContentsToPainter();
-
+#if 0
+ qDebug("mCurPixWid %d %d ",mCurPixWid, contentsWidth() );
+ if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) {
+ qDebug("WAUWAU ");
+ drawContentsToPainter();
+ }
+#endif
QPaintDevice* pd = p->device();
diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h
index 5d813b2..0e3aed8 100644
--- a/korganizer/koagenda.h
+++ b/korganizer/koagenda.h
@@ -77,3 +77,3 @@ class KOAgenda : public QScrollView
virtual ~KOAgenda();
- static bool mInvalidPixmap;
+ bool mInvalidPixmap;
@@ -176,2 +176,3 @@ class KOAgenda : public QScrollView
void updateViewSignal();
+ void sendPing();
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 488d9d4..1b21a71 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -78,3 +78,3 @@ using namespace KOrg;
-#define IDLETIMEOUT 3
+#define IDLETIMEOUT 15
@@ -578,2 +578,6 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
+ connect( mAllDayAgenda, SIGNAL( sendPing() ),this, SLOT( startIdleTimeout()) );
+ connect( mAgenda, SIGNAL( sendPing() ), this, SLOT( startIdleTimeout()) );
+
+
mIdleTimer = new QTimer ( this );;
@@ -581,2 +585,7 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
}
+void KOAgendaView::startIdleTimeout()
+{
+ mIdleStart = QDateTime::currentDateTime();
+ mIdleTimer->start( IDLETIMEOUT * 1000 );
+}
void KOAgendaView::slotIdleTimeout()
@@ -587,7 +596,7 @@ void KOAgendaView::slotIdleTimeout()
bool isActice = topLevelWidget()->isActiveWindow();
- qDebug("KO: Active Window %d ", isActice);
+ qDebug("KO: Active Window %d %d", isActice, isVisible());
// we do nothing if we wake up from a suspend
- if ( secsfromstart > IDLETIMEOUT + 50 && isActice ) {
+ if ( secsfromstart > IDLETIMEOUT + 30 && isActice ) {
qDebug("KO: Wakeup from suspend ");
- mIdleTimer->start( IDLETIMEOUT * 1000 );
+ startIdleTimeout();
return;
@@ -1323,4 +1332,3 @@ void KOAgendaView::fillAgenda()
repaintAgenda();
- mIdleTimer->start ( IDLETIMEOUT *1000 );
- mIdleStart = QDateTime::currentDateTime();
+ startIdleTimeout();
onlyOne = false;
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h
index effd7a3..4b7ef5b 100644
--- a/korganizer/koagendaview.h
+++ b/korganizer/koagendaview.h
@@ -213,2 +213,3 @@ class KOAgendaView : public KOEventView {
void fillAgenda();
+ void startIdleTimeout();