summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimtodo.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/libopie2/opiepim/core/opimtodo.cpp b/libopie2/opiepim/core/opimtodo.cpp
index 16ca987..5bdc648 100644
--- a/libopie2/opiepim/core/opimtodo.cpp
+++ b/libopie2/opiepim/core/opimtodo.cpp
@@ -116,8 +116,12 @@ OPimTodo::OPimTodo( bool completed, int priority,
data->date = date;
data->isCompleted = completed;
data->hasDate = hasDate;
+ if ( priority < 1 )
+ priority = 1;
+ else if ( priority > 5 )
+ priority = 5;
data->priority = priority;
data->sum = summary;
data->prog = progress;
data->desc = Qtopia::simplifyMultiLineSpace( description );
@@ -138,8 +142,12 @@ OPimTodo::OPimTodo( bool completed, int priority,
data->date = date;
data->isCompleted = completed;
data->hasDate = hasDate;
+ if ( priority < 1 )
+ priority = 1;
+ else if ( priority > 5 )
+ priority = 5;
data->priority = priority;
data->sum = summary;
data->prog = progress;
data->desc = Qtopia::simplifyMultiLineSpace( description );
@@ -338,8 +346,12 @@ void OPimTodo::setSummary( const QString& sum )
void OPimTodo::setPriority( int prio )
{
changeOrModify();
+ if ( prio < 1 )
+ prio = 1;
+ else if ( prio > 5 )
+ prio = 5;
data->priority = prio;
}