By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release. View | Details | Raw Unified | Return to bug 2691
Collapse All | Expand All

(-)a/../tmp/tdepim/knotes/KNotesAppIface.h (+7 lines)
Lines 33-38 Link Here
33
#define __KNotesAppIface_h__
33
#define __KNotesAppIface_h__
34
34
35
#include <tqstring.h>
35
#include <tqstring.h>
36
#include <tqdatetime.h>
36
#include <tqmap.h>
37
#include <tqmap.h>
37
38
38
#include <dcopobject.h>
39
#include <dcopobject.h>
Lines 82-87 k_dcop: Link Here
82
    virtual TQMap<TQString,TQString> notes() const = 0;
83
    virtual TQMap<TQString,TQString> notes() const = 0;
83
84
84
    /**
85
    /**
86
     * Get the last modified time of a note
87
     * @return the last modified as a TQDateTime 
88
     */
89
    virtual TQDateTime getLastModified( const TQString& noteId ) const = 0;
90
91
    /**
85
     * Changes the title/name of a note.
92
     * Changes the title/name of a note.
86
     * @param noteId the id of the note to be modified
93
     * @param noteId the id of the note to be modified
87
     * @param newName the new title
94
     * @param newName the new title
(-)a/../tmp/tdepim/knotes/KNotesIface.h (+8 lines)
Lines 23-28 Link Here
23
#define __KNotesIface_h__
23
#define __KNotesIface_h__
24
24
25
#include <tqstring.h>
25
#include <tqstring.h>
26
#include <tqdatetime.h>
26
#include <tqmap.h>
27
#include <tqmap.h>
27
28
28
#include <dcopobject.h>
29
#include <dcopobject.h>
Lines 98-103 k_dcop: Link Here
98
     * @return the body as a TQString
99
     * @return the body as a TQString
99
     */
100
     */
100
    virtual TQString text( const TQString& noteId ) const = 0;
101
    virtual TQString text( const TQString& noteId ) const = 0;
102
103
    /**
104
     * Get the last modified time of a note
105
     * @return the last modified as a TQDateTime 
106
     */
107
    virtual TQDateTime getLastModified( const TQString& noteId ) const = 0;
108
101
};
109
};
102
110
103
#endif
111
#endif
(-)a/../tmp/tdepim/knotes/knote.cpp (-2 / +23 lines)
Lines 153-158 KNote::KNote( TQDomDocument buildDoc, Journal *j, TQWidget *parent, const char * Link Here
153
    m_label->setLineWidth( 0 );
153
    m_label->setLineWidth( 0 );
154
    m_label->installEventFilter( this );  // receive events (for dragging & action menu)
154
    m_label->installEventFilter( this );  // receive events (for dragging & action menu)
155
    setName( m_journal->summary() );      // don't worry, no signals are connected at this stage yet
155
    setName( m_journal->summary() );      // don't worry, no signals are connected at this stage yet
156
    m_lastmodified = m_journal->lastModified();
156
157
157
    m_button = new KNoteButton( "knotes_close", this );
158
    m_button = new KNoteButton( "knotes_close", this );
158
    connect( m_button, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT(slotClose()) );
159
    connect( m_button, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT(slotClose()) );
Lines 383-388 void KNote::changeJournal(KCal::Journal *journal) Link Here
383
   m_journal = journal;
384
   m_journal = journal;
384
   m_editor->setText( m_journal->description() );
385
   m_editor->setText( m_journal->description() );
385
   m_label->setText( m_journal->summary() );
386
   m_label->setText( m_journal->summary() );
387
   m_lastmodified = m_journal->lastModified();
386
   updateLabelAlignment();
388
   updateLabelAlignment();
387
}
389
}
388
390
Lines 425-436 void KNote::saveData(bool update) Link Here
425
{
427
{
426
    m_journal->setSummary( m_label->text() );
428
    m_journal->setSummary( m_label->text() );
427
    m_journal->setDescription( m_editor->text() );
429
    m_journal->setDescription( m_editor->text() );
430
431
    m_lastmodified = TQDateTime::currentDateTime();
432
// this will be set when saving the journal
433
//    m_journal->setLastModified(m_lastmodified);
434
428
    m_journal->setCustomProperty( "KNotes", "FgColor", m_config->fgColor().name() );
435
    m_journal->setCustomProperty( "KNotes", "FgColor", m_config->fgColor().name() );
429
    m_journal->setCustomProperty( "KNotes", "BgColor", m_config->bgColor().name() );
436
    m_journal->setCustomProperty( "KNotes", "BgColor", m_config->bgColor().name() );
430
    m_journal->setCustomProperty( "KNotes", "RichText", m_config->richText() ? "true" : "false" );
437
    m_journal->setCustomProperty( "KNotes", "RichText", m_config->richText() ? "true" : "false" );
438
439
//    kdDebug(5500) << "KNote::saveData(lastModified) : " << m_journal->lastModified() << endl;
440
431
    if(update) {
441
    if(update) {
432
    emit sigDataChanged( noteId() );
442
     emit sigDataChanged( noteId() );
433
    m_editor->setModified( false );
443
     m_editor->setModified( false );
434
    }
444
    }
435
}
445
}
436
446
Lines 453-458 TQString KNote::noteId() const Link Here
453
    return m_journal->uid();
463
    return m_journal->uid();
454
}
464
}
455
465
466
TQDateTime KNote::getLastModified() const
467
{
468
    return m_lastmodified;
469
}
470
471
void KNote::setJournalLastModified(const TQDateTime &dt)
472
{
473
    m_journal->setLastModified(dt);
474
}
475
456
TQString KNote::name() const
476
TQString KNote::name() const
457
{
477
{
458
    return m_label->text();
478
    return m_label->text();
Lines 1363-1368 bool KNote::eventFilter( TQObject *o, TQEvent *ev ) Link Here
1363
                 fe->reason() != TQFocusEvent::Mouse ) {
1383
                 fe->reason() != TQFocusEvent::Mouse ) {
1364
                updateFocus();
1384
                updateFocus();
1365
                if ( isModified() ) {
1385
                if ( isModified() ) {
1386
//        		kdDebug(5500) << "KNote::eventFilter() modified true" << endl;
1366
			saveConfig();
1387
			saveConfig();
1367
                        if ( !m_blockEmitDataChanged )
1388
                        if ( !m_blockEmitDataChanged )
1368
                            saveData();
1389
                            saveData();
(-)a/../tmp/tdepim/knotes/knote.h (+12 lines)
Lines 63-68 public: Link Here
63
63
64
    TQString noteId() const;
64
    TQString noteId() const;
65
65
66
    /**
67
     * Get the last modification date of a note
68
     * @return the last modification date as a TQDateTime 
69
     */
70
    TQDateTime getLastModified() const;
71
72
    /**
73
     * Set the last modified field in the journal
74
     */
75
    void setJournalLastModified( const TQDateTime& dt );
76
66
    TQString name() const;
77
    TQString name() const;
67
    TQString text() const;
78
    TQString text() const;
68
    TQString plainText() const;
79
    TQString plainText() const;
Lines 164-169 private: Link Here
164
175
165
    KNoteConfig   *m_config;
176
    KNoteConfig   *m_config;
166
    KCal::Journal *m_journal;
177
    KCal::Journal *m_journal;
178
    TQDateTime m_lastmodified;
167
179
168
    KFind         *m_find;
180
    KFind         *m_find;
169
181
(-)a/../tmp/tdepim/knotes/knotesapp.cpp (-1 / +18 lines)
Lines 342-347 TQMap<TQString,TQString> KNotesApp::notes() const Link Here
342
    return notes;
342
    return notes;
343
}
343
}
344
344
345
TQDateTime KNotesApp::getLastModified( const TQString& id ) const
346
{
347
    KNote* note = m_noteList[id];
348
    TQDateTime d;
349
    if ( note )
350
        d = note->getLastModified();
351
    if (!d.isValid())
352
        d.setTime_t(0);
353
    return d;
354
}
355
345
TQString KNotesApp::name( const TQString& id ) const
356
TQString KNotesApp::name( const TQString& id ) const
346
{
357
{
347
    KNote* note = m_noteList[id];
358
    KNote* note = m_noteList[id];
Lines 644-650 void KNotesApp::createNote( KCal::Journal *journal ) Link Here
644
655
645
         return;
656
         return;
646
  }
657
  }
647
  m_noteUidModify = journal->uid();
658
    m_noteUidModify = journal->uid();
648
    KNote *newNote = new KNote( m_noteGUI, journal, 0, journal->uid().utf8() );
659
    KNote *newNote = new KNote( m_noteGUI, journal, 0, journal->uid().utf8() );
649
    m_noteList.insert( newNote->noteId(), newNote );
660
    m_noteList.insert( newNote->noteId(), newNote );
650
661
Lines 698-703 void KNotesApp::saveNotes( const TQString & uid ) Link Here
698
void KNotesApp::saveNotes()
709
void KNotesApp::saveNotes()
699
{
710
{
700
    KNotesGlobalConfig::writeConfig();
711
    KNotesGlobalConfig::writeConfig();
712
// set the LAST-MODIFIED field before saving
713
// if the note was changed, it was updated
714
// else set the old value
715
    TQDictIterator<KNote> it( m_noteList );
716
    for ( ; *it; ++it )
717
      (*it)->setJournalLastModified((*it)->getLastModified());
701
    m_manager->save();
718
    m_manager->save();
702
}
719
}
703
720
(-)a/../tmp/tdepim/knotes/knotesapp.h (+7 lines)
Lines 81-86 public: Link Here
81
81
82
    TQMap<TQString,TQString> notes() const;
82
    TQMap<TQString,TQString> notes() const;
83
83
84
    /**
85
     * Get the last modified time of a note
86
     * @return the last modified as a TQDateTime 
87
     */
88
    TQDateTime getLastModified( const TQString& noteId ) const;
89
84
    int width( const TQString& noteId ) const;
90
    int width( const TQString& noteId ) const;
85
    int height( const TQString& noteId ) const;
91
    int height( const TQString& noteId ) const;
86
92
Lines 150-155 private: Link Here
150
    KNetwork::TDEServerSocket   *m_listener;
156
    KNetwork::TDEServerSocket   *m_listener;
151
157
152
    TQDict<KNote>    m_noteList;
158
    TQDict<KNote>    m_noteList;
159
153
    KNoteActionList m_noteActions;
160
    KNoteActionList m_noteActions;
154
161
155
    KFind           *m_find;
162
    KFind           *m_find;
(-)a/../tmp/tdepim/knotes/resourcemanager.cpp (+4 lines)
Lines 103-111 bool KNotesResourceManager::addNewNote( KCal::Journal *journal ) Link Here
103
void KNotesResourceManager::registerNote( ResourceNotes *resource,
103
void KNotesResourceManager::registerNote( ResourceNotes *resource,
104
    KCal::Journal *journal )
104
    KCal::Journal *journal )
105
{
105
{
106
    // preserve the lastmodified field
107
    TQDateTime dt = journal->lastModified();
106
    // TODO: only emit the signal if the journal is new?
108
    // TODO: only emit the signal if the journal is new?
107
    m_resourceMap.insert( journal->uid(), resource );
109
    m_resourceMap.insert( journal->uid(), resource );
108
    emit sigRegisteredNote( journal );
110
    emit sigRegisteredNote( journal );
111
    journal->setLastModified(dt);
112
//    kdDebug(5500) << "KNotesResourceManager::registerNote " << journal->uid() << " " << journal->lastModified()  << endl;
109
}
113
}
110
114
111
void KNotesResourceManager::deleteNote( KCal::Journal *journal )
115
void KNotesResourceManager::deleteNote( KCal::Journal *journal )
(-)a/../tmp/tdepim/kontact/plugins/knotes/knotes_part.cpp (-9 / +57 lines)
Lines 96-103 KNotesPart::KNotesPart( TQObject *parent, const char *name ) Link Here
96
  connect( mManager, TQT_SIGNAL( sigDeregisteredNote( KCal::Journal* ) ),
96
  connect( mManager, TQT_SIGNAL( sigDeregisteredNote( KCal::Journal* ) ),
97
           this, TQT_SLOT( killNote( KCal::Journal* ) ) );
97
           this, TQT_SLOT( killNote( KCal::Journal* ) ) );
98
98
99
99
  // read the notes
100
  // read the notes
100
  mManager->load();
101
  mManager->load();
102
103
  TQDictIterator<KNotesIconViewItem> it( mNoteList );
104
  for ( ; it; ++it )
105
	mNotesRevisionList.insert(
106
		static_cast<KNotesIconViewItem *>( it )->journal()->uid(), 
107
		static_cast<KNotesIconViewItem *>( it )->journal()->lastModified());
101
}
108
}
102
109
103
KNotesPart::~KNotesPart()
110
KNotesPart::~KNotesPart()
Lines 190-196 TQString KNotesPart::newNote( const TQString& name, const TQString& text ) Link Here
190
  }
197
  }
191
198
192
  mManager->addNewNote( journal );
199
  mManager->addNewNote( journal );
193
  mManager->save();
200
  mNotesRevisionList.insert(journal->uid(), TQDateTime::currentDateTime());
201
//    mManager->save();
202
  saveAll();
194
203
195
  KNotesIconViewItem *note = mNoteList[ journal->uid() ];
204
  KNotesIconViewItem *note = mNoteList[ journal->uid() ];
196
  mNotesView->ensureItemVisible( note );
205
  mNotesView->ensureItemVisible( note );
Lines 222-232 void KNotesPart::killNote( const TQString& id, bool force ) Link Here
222
         || force )
231
         || force )
223
     )
232
     )
224
  {
233
  {
234
    mNotesRevisionList.remove(id);
225
    mManager->deleteNote( mNoteList[id]->journal() );
235
    mManager->deleteNote( mNoteList[id]->journal() );
226
    mManager->save();
236
//    mManager->save();
237
    saveAll();
227
  }
238
  }
228
}
239
}
229
240
241
void KNotesPart::saveAll()
242
{
243
244
  TQDictIterator<KNotesIconViewItem> it( mNoteList );
245
  for ( ; *it; ++it )
246
    (*it)->journal()->setLastModified(mNotesRevisionList[(*it)->journal()->uid()]) ;
247
//    kdDebug(5500) << "KNotesPart::saveAll() : " << (*it)->journal()->lastModified().toString() << endl;
248
249
 mManager->save();
250
}
251
230
TQString KNotesPart::name( const TQString& id ) const
252
TQString KNotesPart::name( const TQString& id ) const
231
{
253
{
232
  KNotesIconViewItem *note = mNoteList[ id ];
254
  KNotesIconViewItem *note = mNoteList[ id ];
Lines 250-256 void KNotesPart::setName( const TQString& id, const TQString& newName ) Link Here
250
  KNotesIconViewItem *note = mNoteList[ id ];
272
  KNotesIconViewItem *note = mNoteList[ id ];
251
  if ( note ) {
273
  if ( note ) {
252
    note->setText( newName );
274
    note->setText( newName );
253
    mManager->save();
275
    mNotesRevisionList.replace(id, TQDateTime::currentDateTime());
276
//    mManager->save();
277
    saveAll();
254
  }
278
  }
255
}
279
}
256
280
Lines 259-265 void KNotesPart::setText( const TQString& id, const TQString& newText ) Link Here
259
  KNotesIconViewItem *note = mNoteList[ id ];
283
  KNotesIconViewItem *note = mNoteList[ id ];
260
  if ( note ) {
284
  if ( note ) {
261
    note->journal()->setDescription( newText );
285
    note->journal()->setDescription( newText );
262
    mManager->save();
286
    mNotesRevisionList.replace(id, TQDateTime::currentDateTime());
287
//    mManager->save();
288
    saveAll();
263
  }
289
  }
264
}
290
}
265
291
Lines 274-279 TQMap<TQString, TQString> KNotesPart::notes() const Link Here
274
  return notes;
300
  return notes;
275
}
301
}
276
302
303
TQDateTime KNotesPart::getLastModified( const TQString& noteId ) const
304
{
305
306
//  KNotesIconViewItem *note = mNoteList[noteId];
307
//  TQDateTime d = mNotesRevisionList[noteId].value();
308
//   if ( note )
309
//     d = note->journal()->lastModified();
310
//   if (!d.isValid())
311
//     d.setTime_t(0);
312
  return mNotesRevisionList[noteId];
313
314
}
277
315
278
// private stuff
316
// private stuff
279
317
Lines 304-313 void KNotesPart::killSelectedNotes() Link Here
304
    TQPtrListIterator<KNotesIconViewItem> kniviIt( items );
342
    TQPtrListIterator<KNotesIconViewItem> kniviIt( items );
305
    while ( (knivi = *kniviIt) ) {
343
    while ( (knivi = *kniviIt) ) {
306
      ++kniviIt;
344
      ++kniviIt;
345
      mNotesRevisionList.remove(knivi->journal()->uid());
307
      mManager->deleteNote( knivi->journal() );
346
      mManager->deleteNote( knivi->journal() );
308
    }
347
    }
309
348
//    mManager->save();
310
    mManager->save();
349
    saveAll();
311
  }
350
  }
312
}
351
}
313
352
Lines 358-368 void KNotesPart::createNote( KCal::Journal *journal ) Link Here
358
  if ( property.isNull() )
397
  if ( property.isNull() )
359
    journal->setCustomProperty( "KNotes", "RichText", "true" );
398
    journal->setCustomProperty( "KNotes", "RichText", "true" );
360
399
400
  mNotesRevisionList.insert( journal->uid(), TQDateTime::currentDateTime());
361
  mNoteList.insert( journal->uid(), new KNotesIconViewItem( mNotesView, journal ) );
401
  mNoteList.insert( journal->uid(), new KNotesIconViewItem( mNotesView, journal ) );
362
}
402
}
363
403
364
void KNotesPart::killNote( KCal::Journal *journal )
404
void KNotesPart::killNote( KCal::Journal *journal )
365
{
405
{
406
  mNotesRevisionList.remove( journal->uid());
366
  mNoteList.remove( journal->uid() );
407
  mNoteList.remove( journal->uid() );
367
}
408
}
368
409
Lines 380-386 void KNotesPart::editNote( TQIconViewItem *item ) Link Here
380
  if ( mNoteEditDlg->exec() == TQDialog::Accepted ) {
421
  if ( mNoteEditDlg->exec() == TQDialog::Accepted ) {
381
    item->setText( mNoteEditDlg->title() );
422
    item->setText( mNoteEditDlg->title() );
382
    journal->setDescription( mNoteEditDlg->text() );
423
    journal->setDescription( mNoteEditDlg->text() );
383
    mManager->save();
424
    mNotesRevisionList.replace(journal->uid(),TQDateTime::currentDateTime());
425
//    mManager->save();
426
    saveAll();
384
  }
427
  }
385
}
428
}
386
429
Lines 392-399 void KNotesPart::renameNote() Link Here
392
435
393
void KNotesPart::renamedNote( TQIconViewItem* )
436
void KNotesPart::renamedNote( TQIconViewItem* )
394
{
437
{
395
  if ( mOldName != mNotesView->currentItem()->text() )
438
  if ( mOldName != mNotesView->currentItem()->text() ) {
396
    mManager->save();
439
    mNotesRevisionList.replace(
440
    	static_cast<KNotesIconViewItem *>( mNotesView->currentItem() )->journal()->uid(),
441
    	TQDateTime::currentDateTime());
442
//    mManager->save();
443
    saveAll();
444
  }
397
}
445
}
398
446
399
void KNotesPart::slotOnCurrentChanged( TQIconViewItem* )
447
void KNotesPart::slotOnCurrentChanged( TQIconViewItem* )
(-)a/../tmp/tdepim/kontact/plugins/knotes/knotes_part.h (-1 / +5 lines)
Lines 72-77 class KNotesPart : public KParts::ReadOnlyPart, virtual public KNotesIface Link Here
72
72
73
    TQMap<TQString, TQString> notes() const;
73
    TQMap<TQString, TQString> notes() const;
74
74
75
    TQDateTime getLastModified( const TQString& id ) const;
76
    void saveAll();
77
75
  private slots:
78
  private slots:
76
    void createNote( KCal::Journal *journal );
79
    void createNote( KCal::Journal *journal );
77
    void killNote( KCal::Journal *journal );
80
    void killNote( KCal::Journal *journal );
Lines 97-103 class KNotesPart : public KParts::ReadOnlyPart, virtual public KNotesIface Link Here
97
100
98
    KNotesResourceManager *mManager;
101
    KNotesResourceManager *mManager;
99
    TQDict<KNotesIconViewItem> mNoteList;
102
    TQDict<KNotesIconViewItem> mNoteList;
100
  TQString mOldName;
103
    TQMap<TQString, TQDateTime> mNotesRevisionList;;
104
    TQString mOldName;
101
};
105
};
102
106
103
#endif
107
#endif
(-)a/../tmp/tdepim/kontact/plugins/knotes/knotes_plugin.cpp (-2 / +3 lines)
Lines 70-78 const TDEAboutData *KNotesPlugin::aboutData() Link Here
70
    mAboutData = new TDEAboutData( "knotes", I18N_NOOP( "Notes Management" ),
70
    mAboutData = new TDEAboutData( "knotes", I18N_NOOP( "Notes Management" ),
71
                                 "0.5", I18N_NOOP( "Notes Management" ),
71
                                 "0.5", I18N_NOOP( "Notes Management" ),
72
                                  TDEAboutData::License_GPL_V2,
72
                                  TDEAboutData::License_GPL_V2,
73
                                  "(c) 2003-2004 The Kontact developers" );
73
                                  "(c) 2003-2016 The Kontact developers" );
74
    mAboutData->addAuthor( "Michael Brade", "Current Maintainer", "brade@kde.org" );
74
    mAboutData->addAuthor( "Michael Brade", "", "brade@kde.org" );
75
    mAboutData->addAuthor( "Tobias Koenig", "", "tokoe@kde.org" );
75
    mAboutData->addAuthor( "Tobias Koenig", "", "tokoe@kde.org" );
76
    mAboutData->addAuthor( "Emanoil Kotsev", "Bug fixing", "deloptes@yahoo.com" );
76
  }
77
  }
77
78
78
  return mAboutData;
79
  return mAboutData;

Return to bug 2691