[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/3.5/kdepim/kontact/plugins/knotes (silent)
From: Michael Brade <brade () kde ! org>
Date: 2006-02-20 20:09:03
Message-ID: 1140466143.110833.22728.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 511739 by brade:
SVN_SILENT Update year.
M +2 -0 Makefile.am
M +20 -3 knotes_part.cpp
M +1 -1 knotes_part.h
M +1 -1 knotes_part_p.h
--- branches/KDE/3.5/kdepim/kontact/plugins/knotes/Makefile.am #511738:511739
@@ -5,6 +5,8 @@
libkontact_knotesplugin_la_LIBADD = $(top_builddir)/kontact/interfaces/libkpinterfaces.la \
$(LIB_KPARTS) $(top_builddir)/libkdepim/libkdepim.la \
$(top_builddir)/libkcal/libkcal.la -lkresources \
+ $(top_builddir)/knotes/libknoteslegacy.la \
+ $(top_builddir)/knotes/libknotesconfig.la \
$(top_builddir)/knotes/libknotesresources.la \
$(top_builddir)/knotes/libknoteseditor.la
--- branches/KDE/3.5/kdepim/kontact/plugins/knotes/knotes_part.cpp #511738:511739
@@ -30,6 +30,9 @@
#include <libkdepim/infoextension.h>
#include <libkdepim/sidebarextension.h>
+#include <libkcal/calendarlocal.h>
+
+#include "knotes/knoteslegacy.h"
#include "knotes/resourcemanager.h"
#include "knotes_part.h"
@@ -49,14 +52,13 @@
setInstance( new KInstance( "knotes" ) );
// create the actions
- new KAction( i18n( "&New..." ), "knotes", CTRL+Key_N, this, SLOT( newNote() ),
+ new KAction( i18n( "&New" ), "knotes", CTRL+Key_N, this, SLOT( newNote() ),
actionCollection(), "file_new" );
- new KAction( i18n( "Rename" ), "text", this, SLOT( renameNote() ),
+ new KAction( i18n( "Rename..." ), "text", this, SLOT( renameNote() ),
actionCollection(), "edit_rename" );
new KAction( i18n( "Delete" ), "editdelete", Key_Delete, this, SLOT( killSelectedNotes() ),
actionCollection(), "edit_delete" );
- // TODO styleguide: s/New.../New/, s/Rename/Rename.../
// TODO icons: s/editdelete/knotes_delete/ or the other way round in knotes
// set the view up
@@ -88,6 +90,9 @@
setWidget( mNotesView );
setXMLFile( "knotes_part.rc" );
+ // clean up old config files
+ KNotesLegacy::cleanUp();
+
// connect the resource manager
connect( mManager, SIGNAL( sigRegisteredNote( KCal::Journal* ) ),
this, SLOT( createNote( KCal::Journal* ) ) );
@@ -96,6 +101,18 @@
// read the notes
mManager->load();
+
+ // read the old config files, convert and add them
+ KCal::CalendarLocal calendar( QString::fromLatin1( "UTC" ) );
+ if ( KNotesLegacy::convert( &calendar ) )
+ {
+ KCal::Journal::List notes = calendar.journals();
+ KCal::Journal::List::ConstIterator it;
+ for ( it = notes.begin(); it != notes.end(); ++it )
+ mManager->addNewNote( *it );
+
+ mManager->save();
+ }
}
KNotesPart::~KNotesPart()
--- branches/KDE/3.5/kdepim/kontact/plugins/knotes/knotes_part.h #511738:511739
@@ -1,7 +1,7 @@
/*
This file is part of the KDE project
Copyright (C) 2002 Daniel Molkentin <molkentin@kde.org>
- Copyright (C) 2004 Michael Brade <brade@kde.org>
+ Copyright (C) 2004-2006 Michael Brade <brade@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
--- branches/KDE/3.5/kdepim/kontact/plugins/knotes/knotes_part_p.h #511738:511739
@@ -76,7 +76,7 @@
return mJournal;
}
- virtual void setText( const QString & text )
+ virtual void setText( const QString& text )
{
KIconViewItem::setText( text );
mJournal->setSummary( text );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic