summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kotodoviewitem.cpp2
-rw-r--r--libkcal/todo.cpp16
-rw-r--r--microkde/kglobalsettings.cpp10
-rw-r--r--microkde/kglobalsettings.h1
4 files changed, 27 insertions, 2 deletions
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index 66f8d06..8cb6b83 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -120,25 +120,25 @@ void KOTodoViewItem::construct()
120 else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); 120 else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt);
121 121
122 122
123 123
124 keyd = ""; 124 keyd = "";
125 keyt = ""; 125 keyt = "";
126 126
127 if (mTodo->isRunning() ) { 127 if (mTodo->isRunning() ) {
128 QDate d = mTodo->runStart().date(); 128 QDate d = mTodo->runStart().date();
129 QTime t = mTodo->runStart().time(); 129 QTime t = mTodo->runStart().time();
130 skeyt.sprintf("%02d%02d",t.hour(),t.minute()); 130 skeyt.sprintf("%02d%02d",t.hour(),t.minute());
131 skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); 131 skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
132 keyd = KGlobal::locale()->formatDate( d ); 132 keyd = KGlobal::locale()->formatDate( d , true);
133 keyt = KGlobal::locale()->formatTime( t ); 133 keyt = KGlobal::locale()->formatTime( t );
134 134
135 } else { 135 } else {
136 136
137 if (mTodo->hasStartDate()) { 137 if (mTodo->hasStartDate()) {
138 keyd = mTodo->dtStartDateStr(); 138 keyd = mTodo->dtStartDateStr();
139 QDate d = mTodo->dtStart().date(); 139 QDate d = mTodo->dtStart().date();
140 skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); 140 skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
141 141
142 if ( !mTodo->doesFloat()) { 142 if ( !mTodo->doesFloat()) {
143 keyt = mTodo->dtStartTimeStr(); 143 keyt = mTodo->dtStartTimeStr();
144 QTime t = mTodo->dtStart().time(); 144 QTime t = mTodo->dtStart().time();
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 7dee4cd..c008fe1 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -10,26 +10,28 @@
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <kglobal.h> 21#include <kglobal.h>
22#include <kglobalsettings.h>
22#include <klocale.h> 23#include <klocale.h>
23#include <kdebug.h> 24#include <kdebug.h>
25#include <qregexp.h>
24 26
25#include "todo.h" 27#include "todo.h"
26 28
27using namespace KCal; 29using namespace KCal;
28 30
29Todo::Todo(): Incidence() 31Todo::Todo(): Incidence()
30{ 32{
31// mStatus = TENTATIVE; 33// mStatus = TENTATIVE;
32 34
33 mHasDueDate = false; 35 mHasDueDate = false;
34 setHasStartDate( false ); 36 setHasStartDate( false );
35 mCompleted = getEvenTime(QDateTime::currentDateTime()); 37 mCompleted = getEvenTime(QDateTime::currentDateTime());
@@ -66,25 +68,37 @@ void Todo::setRunning( bool run )
66 mRunning = run; 68 mRunning = run;
67 if ( mRunning ) { 69 if ( mRunning ) {
68 mRunSaveTimer->start( 1000 * 60 * 5 ); // 5 min 70 mRunSaveTimer->start( 1000 * 60 * 5 ); // 5 min
69 mRunStart = QDateTime::currentDateTime(); 71 mRunStart = QDateTime::currentDateTime();
70 } else { 72 } else {
71 mRunSaveTimer->stop(); 73 mRunSaveTimer->stop();
72 saveRunningInfoToFile(); 74 saveRunningInfoToFile();
73 } 75 }
74} 76}
75 77
76void Todo::saveRunningInfoToFile() 78void Todo::saveRunningInfoToFile()
77{ 79{
78 qDebug("Todo::saveRunningInfoToFile() "); 80 qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1());
81
82 QString dir = KGlobalSettings::timeTrackerDir();
83 qDebug("%s ", dir.latin1());
84 QString file = "%1-%2-%3-%4-%5-%6-%7.tt";
85
86 file = file.arg( mRunStart.date().year(), 4).arg( mRunStart.date().month(),2 ).arg( mRunStart.date().day(), 2 ).arg( mRunStart.time().hour(),2 ).arg( mRunStart.time().minute(),2 ).arg( mRunStart.time().second(),2 ).arg( mRunStart.time().msec(), 3 );
87 file.replace ( QRegExp (" "), "0" );
88 file = dir +"/" +file;
89 qDebug("%s ", file.latin1());
90
91
92
79} 93}
80 94
81int Todo::runTime() 95int Todo::runTime()
82{ 96{
83 if ( !mRunning ) 97 if ( !mRunning )
84 return 0; 98 return 0;
85 return mRunStart.secsTo( QDateTime::currentDateTime() ); 99 return mRunStart.secsTo( QDateTime::currentDateTime() );
86} 100}
87bool Todo::hasRunningSub() 101bool Todo::hasRunningSub()
88{ 102{
89 if ( mRunning ) 103 if ( mRunning )
90 return true; 104 return true;
diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp
index b837b23..e54b0d9 100644
--- a/microkde/kglobalsettings.cpp
+++ b/microkde/kglobalsettings.cpp
@@ -28,24 +28,34 @@ QFont KGlobalSettings::generalMaxFont()
28 size = 10; 28 size = 10;
29 } 29 }
30#ifndef DESKTOP_VERSION 30#ifndef DESKTOP_VERSION
31 else 31 else
32 if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) 32 if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 )
33 size = 18; 33 size = 18;
34#endif 34#endif
35 QFont f = QApplication::font(); 35 QFont f = QApplication::font();
36 if ( f.pointSize() > size ) 36 if ( f.pointSize() > size )
37 f.setPointSize( size ); 37 f.setPointSize( size );
38 return f; 38 return f;
39} 39}
40
41QString KGlobalSettings::timeTrackerDir()
42{
43 static QString dir;
44 if ( dir.isEmpty() ) {
45 dir = locateLocal( "data", "timetracker" );
46 }
47 return dir;
48}
49
40QFont KGlobalSettings::toolBarFont() 50QFont KGlobalSettings::toolBarFont()
41{ 51{
42 return QApplication::font(); 52 return QApplication::font();
43} 53}
44 54
45QColor KGlobalSettings::toolBarHighlightColor() 55QColor KGlobalSettings::toolBarHighlightColor()
46{ 56{
47 return QColor( "black" ); 57 return QColor( "black" );
48} 58}
49 59
50QRect KGlobalSettings::desktopGeometry( QWidget * ) 60QRect KGlobalSettings::desktopGeometry( QWidget * )
51{ 61{
diff --git a/microkde/kglobalsettings.h b/microkde/kglobalsettings.h
index 075bb1c..3eeda35 100644
--- a/microkde/kglobalsettings.h
+++ b/microkde/kglobalsettings.h
@@ -8,24 +8,25 @@
8#define KDE_DEFAULT_SINGLECLICK true 8#define KDE_DEFAULT_SINGLECLICK true
9 9
10 10
11class KGlobalSettings 11class KGlobalSettings
12{ 12{
13 public: 13 public:
14 static QFont generalFont(); 14 static QFont generalFont();
15 static QFont generalMaxFont(); 15 static QFont generalMaxFont();
16 static QFont toolBarFont(); 16 static QFont toolBarFont();
17 17
18 static QColor toolBarHighlightColor(); 18 static QColor toolBarHighlightColor();
19 static QRect desktopGeometry( QWidget * ); 19 static QRect desktopGeometry( QWidget * );
20 static QString timeTrackerDir();
20 21
21 /** 22 /**
22 * Returns whether KDE runs in single (default) or double click 23 * Returns whether KDE runs in single (default) or double click
23 * mode. 24 * mode.
24 * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html 25 * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html
25 * @return true if single click mode, or false if double click mode. 26 * @return true if single click mode, or false if double click mode.
26 **/ 27 **/
27 static bool singleClick(); 28 static bool singleClick();
28 29
29}; 30};
30 31
31#endif 32#endif