-rw-r--r-- | korganizer/kotodoviewitem.cpp | 2 | ||||
-rw-r--r-- | libkcal/todo.cpp | 16 | ||||
-rw-r--r-- | microkde/kglobalsettings.cpp | 10 | ||||
-rw-r--r-- | microkde/kglobalsettings.h | 1 |
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() else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); keyd = ""; keyt = ""; if (mTodo->isRunning() ) { QDate d = mTodo->runStart().date(); QTime t = mTodo->runStart().time(); skeyt.sprintf("%02d%02d",t.hour(),t.minute()); skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); - keyd = KGlobal::locale()->formatDate( d ); + keyd = KGlobal::locale()->formatDate( d , true); keyt = KGlobal::locale()->formatTime( t ); } else { if (mTodo->hasStartDate()) { keyd = mTodo->dtStartDateStr(); QDate d = mTodo->dtStart().date(); skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); if ( !mTodo->doesFloat()) { keyt = mTodo->dtStartTimeStr(); 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 @@ This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <kglobal.h> +#include <kglobalsettings.h> #include <klocale.h> #include <kdebug.h> +#include <qregexp.h> #include "todo.h" using namespace KCal; Todo::Todo(): Incidence() { // mStatus = TENTATIVE; mHasDueDate = false; setHasStartDate( false ); mCompleted = getEvenTime(QDateTime::currentDateTime()); @@ -66,25 +68,37 @@ void Todo::setRunning( bool run ) mRunning = run; if ( mRunning ) { mRunSaveTimer->start( 1000 * 60 * 5 ); // 5 min mRunStart = QDateTime::currentDateTime(); } else { mRunSaveTimer->stop(); saveRunningInfoToFile(); } } void Todo::saveRunningInfoToFile() { - qDebug("Todo::saveRunningInfoToFile() "); + qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); + + QString dir = KGlobalSettings::timeTrackerDir(); + qDebug("%s ", dir.latin1()); + QString file = "%1-%2-%3-%4-%5-%6-%7.tt"; + + 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 ); + file.replace ( QRegExp (" "), "0" ); + file = dir +"/" +file; + qDebug("%s ", file.latin1()); + + + } int Todo::runTime() { if ( !mRunning ) return 0; return mRunStart.secsTo( QDateTime::currentDateTime() ); } bool Todo::hasRunningSub() { if ( mRunning ) 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() size = 10; } #ifndef DESKTOP_VERSION else if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) size = 18; #endif QFont f = QApplication::font(); if ( f.pointSize() > size ) f.setPointSize( size ); return f; } + +QString KGlobalSettings::timeTrackerDir() +{ + static QString dir; + if ( dir.isEmpty() ) { + dir = locateLocal( "data", "timetracker" ); + } + return dir; +} + QFont KGlobalSettings::toolBarFont() { return QApplication::font(); } QColor KGlobalSettings::toolBarHighlightColor() { return QColor( "black" ); } QRect KGlobalSettings::desktopGeometry( QWidget * ) { 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 @@ #define KDE_DEFAULT_SINGLECLICK true class KGlobalSettings { public: static QFont generalFont(); static QFont generalMaxFont(); static QFont toolBarFont(); static QColor toolBarHighlightColor(); static QRect desktopGeometry( QWidget * ); + static QString timeTrackerDir(); /** * Returns whether KDE runs in single (default) or double click * mode. * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html * @return true if single click mode, or false if double click mode. **/ static bool singleClick(); }; #endif |