| Summary: | default duration time is ignored when creating new event | ||
|---|---|---|---|
| Product: | [Applications] korganizer | Reporter: | Andreas.von.Rueden |
| Component: | general | Assignee: | Reinhold Kainhofer <reinhold> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | sridhar+bugs |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | openSUSE | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Andreas.von.Rueden
2004-11-10 22:58:15 UTC
No bug - appears only when entering event by mouse in day- or weekdisplay. I beg to differ. This IS a bug because it is not the behaviour that one would expect. Double-clicking in the Day View pane should honour the user-defined default setting, not impose its own. See the discussion at http://bugs.gentoo.org/show_bug.cgi?id=82234 for details. Reopening, we need to find a consistent solution... SVN commit 438147 by kainhofe:
In the agenda view, when only one cell (=15 minutes) is selected, use the default duration for a new event instead. The old way was particularly confusing when you double-clicked into the agenda and a 15-minutes event was generated instead of a 2-hour one.
BUG:93064
M +19 -7 koagendaview.cpp
--- trunk/KDE/kdepim/korganizer/koagendaview.cpp #438146:438147
@@ -142,12 +142,12 @@
int timeHeight = fm.ascent();
QFont nFont = font();
p->setFont( font() );
-
+
if (!KGlobal::locale()->use12Clock()) {
suffix = "00";
} else
if (cell > 11) suffix = "pm";
-
+
if ( timeHeight > mCellHeight ) {
timeHeight = mCellHeight-1;
int pointS = nFont.pointSize();
@@ -161,13 +161,13 @@
fm = QFontMetrics( nFont );
timeHeight = fm.ascent();
}
- //timeHeight -= (timeHeight/4-2);
+ //timeHeight -= (timeHeight/4-2);
QFont sFont = nFont;
sFont.setPointSize( sFont.pointSize()/2 );
QFontMetrics fmS( sFont );
int startW = mMiniWidth - frameWidth()-2 ;
int tw2 = fmS.width(suffix);
- int divTimeHeight = (timeHeight-1) /2 - 1;
+ int divTimeHeight = (timeHeight-1) /2 - 1;
//testline
//p->drawLine(0,0,0,contentsHeight());
while (y < cy + ch+mCellHeight) {
@@ -186,7 +186,7 @@
int offset = startW - timeWidth - tw2 -1 ;
p->setFont( nFont );
p->drawText( offset, y+timeHeight, hour);
- p->setFont( sFont );
+ p->setFont( sFont );
offset = startW - tw2;
p->drawText( offset, y+timeHeight-divTimeHeight, suffix);
@@ -856,8 +856,20 @@
bool &allDay )
{
if ( selectionStart().isValid() ) {
- startDt = selectionStart();
- endDt = selectionEnd();
+ QDateTime start = selectionStart();
+ QDateTime end = selectionEnd();
+
+ if ( start.secsTo( end ) == 15*60 ) {
+ // One cell in the agenda view selected, e.g.
+ // because of a double-click, => Use the default duration
+ QTime defaultDuration( KOPrefs::instance()->mDefaultDuration.time() );
+ int addSecs = ( defaultDuration.hour()*3600 ) +
+ ( defaultDuration.minute()*60 );
+ end = start.addSecs( addSecs );
+ }
+
+ startDt = start;
+ endDt = end;
allDay = selectedIsAllDay();
return true;
}
|