On Friday 01 February 2008, Laurent Montel wrote: > SVN commit 769487 by mlaurent: > > Make migration. > if ktimertracker dir is empty we didn't launch it > look at if karm/karm.ics exists > => use it > otherwise create default file. > Now I can have my history. > (I will backport it if it's correct) > > > M +16 -6 main.cpp > > > --- trunk/KDE/kdepim/ktimetracker/main.cpp #769486:769487 > @@ -21,7 +21,7 @@ > */ > > #include > - > +#include > #include > #include > #include > @@ -31,8 +31,8 @@ > > #include "version.h" > #include "mainwindow.h" > +#include > > - > namespace > { > const char* description = I18N_NOOP("KDE Time tracker tool"); > @@ -71,10 +71,10 @@ > KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); > > MainWindow *mainWindow; > - if ( args->count() > 0 ) > + if ( args->count() > 0 ) > { > QString icsfile = args->arg( 0 ); > - > + > KUrl* icsfileurl=new KUrl(args->arg( 0 )); > if (( icsfileurl->protocol() == "http" ) || ( icsfileurl->protocol() == "ftp" ) || ( icsfileurl->isLocalFile() )) > { > @@ -90,8 +90,18 @@ > } > else > { > - mainWindow = new MainWindow( KStandardDirs::locateLocal( "appdata", > - QString::fromLatin1( "karm.ics" ) ) ); > + KStandardDirs tmp; > + tmp.localkdedir(); no-op > + QString newKarmFile(tmp.localkdedir() + "/share/apps/ktimetracker/karm.ics" ); KStandardDirs::locate("data","ktimetracker/karm.ics") > + if ( !QFile::exists( newKarmFile ) ) > + { > + QFile oldFile( tmp.localkdedir() + "/share/apps/karm/karm.ics" ); KStandardDirs::locate("data","karm/karm.ics") > + if ( oldFile.exists() ) > + oldFile.copy( newKarmFile ); > + else > + newKarmFile = KStandardDirs::locateLocal( "appdata", QString::fromLatin1( "karm.ics" ) ); > + } > + mainWindow = new MainWindow( newKarmFile ); > } > > if (kapp->isSessionRestored() && KMainWindow::canBeRestored( 1 )) > > -- David Faure, faure@kde.org, dfaure@klaralvdalens-datakonsult.se KDE/KOffice developer, Qt consultancy projects Klarälvdalens Datakonsult AB, Platform-independent software solutions