-rw-r--r-- | libkcal/incidence.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 4643a3a..201f593 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp | |||
@@ -99,9 +99,38 @@ Incidence::~Incidence() | |||
99 | if ( mRecurrence ) | 99 | if ( mRecurrence ) |
100 | delete mRecurrence; | 100 | delete mRecurrence; |
101 | 101 | ||
102 | } | 102 | } |
103 | QString Incidence::durationText() | ||
104 | { | ||
105 | return "---"; | ||
106 | } | ||
107 | QString Incidence::durationText4Time( int offset ) | ||
108 | { | ||
109 | int min = offset/60; | ||
110 | int hours = min /60; | ||
111 | min = min % 60; | ||
112 | int days = hours /24; | ||
113 | hours = hours % 24; | ||
114 | |||
115 | if ( doesFloat() || ( min == 0 && hours == 0 ) ) { | ||
116 | if ( days == 1 ) | ||
117 | return "1" + i18n(" day"); | ||
118 | else | ||
119 | return QString::number( days )+ i18n(" days"); | ||
103 | 120 | ||
121 | } | ||
122 | QString message = QString::number ( hours ) +":"; | ||
123 | if ( min < 10 ) message += "0"; | ||
124 | message += QString::number ( min ); | ||
125 | if ( days > 0 ) { | ||
126 | if ( days == 1 ) | ||
127 | message = "1" + i18n(" day") + " "+message; | ||
128 | else | ||
129 | message = QString::number( days )+ i18n(" days") + " "+message; | ||
130 | } | ||
131 | return message; | ||
132 | } | ||
104 | bool Incidence::isHoliday() const | 133 | bool Incidence::isHoliday() const |
105 | { | 134 | { |
106 | return mHoliday; | 135 | return mHoliday; |
107 | } | 136 | } |