summaryrefslogtreecommitdiffstats
path: root/knotes
diff options
context:
space:
mode:
authorEmanoil Kotsev <deloptes@gmail.com>2020-02-29 18:39:20 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-02-29 18:39:20 +0900
commit094f8d9a878ff83db4e3bdd5ca2bcb273f96c7ea (patch)
tree16d3fab3f49d54c78019802c505df10a697157da /knotes
parent0087f22b7304e93164515e04ade0a24f2538e40e (diff)
downloadtdepim-094f8d9a878ff83db4e3bdd5ca2bcb273f96c7ea.tar.gz
tdepim-094f8d9a878ff83db4e3bdd5ca2bcb273f96c7ea.zip
Extended the interface of KNotes with getLastModified method. This
relates to bug 2691. Signed-off-by: Emanoil Kotsev <deloptes@gmail.com> Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'knotes')
-rw-r--r--knotes/KNotesAppIface.h7
-rw-r--r--knotes/KNotesIface.h7
-rw-r--r--knotes/knote.cpp5
-rw-r--r--knotes/knote.h1
-rw-r--r--knotes/knotesapp.cpp9
-rw-r--r--knotes/knotesapp.h1
6 files changed, 30 insertions, 0 deletions
diff --git a/knotes/KNotesAppIface.h b/knotes/KNotesAppIface.h
index ad24a58b..dea2881e 100644
--- a/knotes/KNotesAppIface.h
+++ b/knotes/KNotesAppIface.h
@@ -34,6 +34,7 @@
#include <tqstring.h>
#include <tqmap.h>
+#include <tqdatetime.h>
#include <dcopobject.h>
@@ -210,6 +211,12 @@ k_dcop:
* new as well!) and false if the note is not modified or doesn't exist
*/
virtual bool isModified( const TQString& app, const TQString& noteId ) const = 0;
+
+ /**
+ * Get the last modified time of a note
+ * @return the last modified time as a TQDateTime
+ */
+ virtual TQDateTime getLastModified( const TQString& noteId ) const = 0;
};
#endif
diff --git a/knotes/KNotesIface.h b/knotes/KNotesIface.h
index 1fba1860..62479098 100644
--- a/knotes/KNotesIface.h
+++ b/knotes/KNotesIface.h
@@ -24,6 +24,7 @@
#include <tqstring.h>
#include <tqmap.h>
+#include <tqdatetime.h>
#include <dcopobject.h>
@@ -98,6 +99,12 @@ k_dcop:
* @return the body as a TQString
*/
virtual TQString text( const TQString& noteId ) const = 0;
+
+ /**
+ * Get the last modified time of a note
+ * @return the last modified time as a TQDateTime
+ */
+ virtual TQDateTime getLastModified( const TQString& noteId ) const = 0;
};
#endif
diff --git a/knotes/knote.cpp b/knotes/knote.cpp
index 4f70848b..e20b52ef 100644
--- a/knotes/knote.cpp
+++ b/knotes/knote.cpp
@@ -453,6 +453,11 @@ TQString KNote::noteId() const
return m_journal->uid();
}
+TQDateTime KNote::getLastModified() const
+{
+ return m_journal->lastModified();
+}
+
TQString KNote::name() const
{
return m_label->text();
diff --git a/knotes/knote.h b/knotes/knote.h
index 43444b99..201c7f79 100644
--- a/knotes/knote.h
+++ b/knotes/knote.h
@@ -77,6 +77,7 @@ public:
void find( const TQString& pattern, long options );
bool isModified() const;
+ TQDateTime getLastModified() const;
void sync( const TQString& app );
bool isNew( const TQString& app ) const;
diff --git a/knotes/knotesapp.cpp b/knotes/knotesapp.cpp
index 5cc2635c..2a4e84b1 100644
--- a/knotes/knotesapp.cpp
+++ b/knotes/knotesapp.cpp
@@ -342,6 +342,15 @@ TQMap<TQString,TQString> KNotesApp::notes() const
return notes;
}
+TQDateTime KNotesApp::getLastModified( const TQString& id ) const
+{
+ KNote* note = m_noteList[id];
+ TQDateTime d;
+ if ( note )
+ d = note->getLastModified();
+ return d;
+}
+
TQString KNotesApp::name( const TQString& id ) const
{
KNote* note = m_noteList[id];
diff --git a/knotes/knotesapp.h b/knotes/knotesapp.h
index 0888e20b..649b4b0b 100644
--- a/knotes/knotesapp.h
+++ b/knotes/knotesapp.h
@@ -90,6 +90,7 @@ public:
void sync( const TQString& app );
bool isNew( const TQString& app, const TQString& id ) const;
bool isModified( const TQString& app, const TQString& id ) const;
+ TQDateTime getLastModified( const TQString& noteId ) const;
bool commitData( TQSessionManager& );