• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libkonq
 

libkonq

  • libkonq
konq_historymgr.cpp
1 /* This file is part of the KDE project
2  Copyright (C) 2000,2001 Carsten Pfeiffer <pfeiffer@kde.org>
3 
4  This program is free software; you can redistribute it and/or
5  modify it under the terms of the GNU General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; see the file COPYING. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #include "konq_historymgr.h"
21 
22 #include <dcopclient.h>
23 
24 #include <tdeapplication.h>
25 #include <kdebug.h>
26 #include <ksavefile.h>
27 #include <ksimpleconfig.h>
28 #include <tdestandarddirs.h>
29 
30 #include <zlib.h>
31 
32 #include "konqbookmarkmanager.h"
33 
34 const TQ_UINT32 KonqHistoryManager::s_historyVersion = 3;
35 
36 KonqHistoryManager::KonqHistoryManager( TQObject *parent, const char *name )
37  : KParts::HistoryProvider( parent, name ),
38  KonqHistoryComm( "KonqHistoryManager" )
39 {
40  m_updateTimer = new TQTimer( this );
41 
42  // defaults
43  TDEConfig *config = TDEGlobal::config();
44  TDEConfigGroupSaver cs( config, "HistorySettings" );
45  m_maxCount = config->readNumEntry( "Maximum of History entries", 500 );
46  m_maxCount = TQMAX( 1, m_maxCount );
47  m_maxAgeDays = config->readNumEntry( "Maximum age of History entries", 90);
48 
49  m_history.setAutoDelete( true );
50  m_filename = locateLocal( "data",
51  TQString::fromLatin1("konqueror/konq_history" ));
52 
53  if ( !tdeApp->dcopClient()->isAttached() )
54  tdeApp->dcopClient()->attach();
55 
56 
57  // take care of the completion object
58  m_pCompletion = new TDECompletion;
59  m_pCompletion->setOrder( TDECompletion::Weighted );
60 
61  // and load the history
62  loadHistory();
63 
64  connect( m_updateTimer, TQ_SIGNAL( timeout() ), TQ_SLOT( slotEmitUpdated() ));
65 }
66 
67 
68 KonqHistoryManager::~KonqHistoryManager()
69 {
70  delete m_pCompletion;
71  clearPending();
72 }
73 
74 bool KonqHistoryManager::isSenderOfBroadcast()
75 {
76  DCOPClient *dc = callingDcopClient();
77  return !dc || (dc->senderId() == dc->appId());
78 }
79 
80 // loads the entire history
81 bool KonqHistoryManager::loadHistory()
82 {
83  clearPending();
84  m_history.clear();
85  m_pCompletion->clear();
86 
87  TQFile file( m_filename );
88  if ( !file.open( IO_ReadOnly ) ) {
89  if ( file.exists() )
90  kdWarning() << "Can't open " << file.name() << endl;
91 
92  // try to load the old completion history
93  bool ret = loadFallback();
94  emit loadingFinished();
95  return ret;
96  }
97 
98  TQDataStream fileStream( &file );
99  TQByteArray data; // only used for version == 2
100  // we construct the stream object now but fill in the data later.
101  // thanks to QBA's explicit sharing this works :)
102  TQDataStream crcStream( data, IO_ReadOnly );
103 
104  if ( !fileStream.atEnd() ) {
105  TQ_UINT32 version;
106  fileStream >> version;
107 
108  TQDataStream *stream = &fileStream;
109 
110  bool crcChecked = false;
111  bool crcOk = false;
112 
113  if ( version == 2 || version == 3) {
114  TQ_UINT32 crc;
115  crcChecked = true;
116  fileStream >> crc >> data;
117  crcOk = crc32( 0, reinterpret_cast<unsigned char *>( data.data() ), data.size() ) == crc;
118  stream = &crcStream; // pick up the right stream
119  }
120 
121  if ( version == 3 )
122  {
123  //Use KURL marshalling for V3 format.
124  KonqHistoryEntry::marshalURLAsStrings = false;
125  }
126 
127  if ( version != 0 && version < 3 ) //Versions 1,2 (but not 0) are also valid
128  {
129  //Turn on backwards compatibility mode..
130  KonqHistoryEntry::marshalURLAsStrings = true;
131  // it doesn't make sense to save to save maxAge and maxCount in the
132  // binary file, this would make backups impossible (they would clear
133  // themselves on startup, because all entries expire).
134  // [But V1 and V2 formats did it, so we do a dummy read]
135  TQ_UINT32 dummy;
136  *stream >> dummy;
137  *stream >> dummy;
138 
139  //OK.
140  version = 3;
141  }
142 
143  if ( s_historyVersion != version || ( crcChecked && !crcOk ) ) {
144  kdWarning() << "The history version doesn't match, aborting loading" << endl;
145  file.close();
146  emit loadingFinished();
147  return false;
148  }
149 
150 
151  while ( !stream->atEnd() ) {
152  KonqHistoryEntry *entry = new KonqHistoryEntry;
153  TQ_CHECK_PTR( entry );
154  *stream >> *entry;
155  // kdDebug(1203) << "## loaded entry: " << entry->url << ", Title: " << entry->title << endl;
156  m_history.append( entry );
157  TQString urlString2 = entry->url.prettyURL();
158 
159  addToCompletion( urlString2, entry->typedURL, entry->numberOfTimesVisited );
160 
161  // and fill our baseclass.
162  TQString urlString = entry->url.url();
163  KParts::HistoryProvider::insert( urlString );
164  // DF: also insert the "pretty" version if different
165  // This helps getting 'visited' links on websites which don't use fully-escaped urls.
166 
167  if ( urlString != urlString2 )
168  KParts::HistoryProvider::insert( urlString2 );
169  }
170 
171  kdDebug(1203) << "## loaded: " << m_history.count() << " entries." << endl;
172 
173  m_history.sort();
174  adjustSize();
175  }
176 
177 
178  //This is important - we need to switch to a consistent marshalling format for
179  //communicating between different konqueror instances. Since during an upgrade
180  //some "old" copies may still running, we use the old format for the DCOP transfers.
181  //This doesn't make that much difference performance-wise for single entries anyway.
182  KonqHistoryEntry::marshalURLAsStrings = true;
183 
184 
185  // Theoretically, we should emit update() here, but as we only ever
186  // load items on startup up to now, this doesn't make much sense. Same
187  // thing for the above loadFallback().
188  // emit KParts::HistoryProvider::update( some list );
189 
190 
191 
192  file.close();
193  emit loadingFinished();
194 
195  return true;
196 }
197 
198 
199 // saves the entire history
200 bool KonqHistoryManager::saveHistory()
201 {
202  KSaveFile file( m_filename );
203  if ( file.status() != 0 ) {
204  kdWarning() << "Can't open " << file.name() << endl;
205  return false;
206  }
207 
208  TQDataStream *fileStream = file.dataStream();
209  *fileStream << s_historyVersion;
210 
211  TQByteArray data;
212  TQDataStream stream( data, IO_WriteOnly );
213 
214  //We use KURL for marshalling URLs in entries in the V3
215  //file format
216  KonqHistoryEntry::marshalURLAsStrings = false;
217  TQPtrListIterator<KonqHistoryEntry> it( m_history );
218  KonqHistoryEntry *entry;
219  while ( (entry = it.current()) ) {
220  stream << *entry;
221  ++it;
222  }
223 
224  //For DCOP, transfer strings instead - wire compat.
225  KonqHistoryEntry::marshalURLAsStrings = true;
226 
227  TQ_UINT32 crc = crc32( 0, reinterpret_cast<unsigned char *>( data.data() ), data.size() );
228  *fileStream << crc << data;
229 
230  file.close();
231 
232  return true;
233 }
234 
235 
236 void KonqHistoryManager::adjustSize()
237 {
238  KonqHistoryEntry *entry = m_history.getFirst();
239 
240  while ( m_history.count() > m_maxCount || isExpired( entry ) ) {
241  removeFromCompletion( entry->url.prettyURL(), entry->typedURL );
242 
243  TQString urlString = entry->url.url();
244  KParts::HistoryProvider::remove( urlString );
245 
246  addToUpdateList( urlString );
247 
248  emit entryRemoved( m_history.getFirst() );
249  m_history.removeFirst(); // deletes the entry
250 
251  entry = m_history.getFirst();
252  }
253 }
254 
255 
256 void KonqHistoryManager::addPending( const KURL& url, const TQString& typedURL,
257  const TQString& title )
258 {
259  addToHistory( true, url, typedURL, title );
260 }
261 
262 void KonqHistoryManager::confirmPending( const KURL& url,
263  const TQString& typedURL,
264  const TQString& title )
265 {
266  addToHistory( false, url, typedURL, title );
267 }
268 
269 
270 void KonqHistoryManager::addToHistory( bool pending, const KURL& _url,
271  const TQString& typedURL,
272  const TQString& title )
273 {
274  kdDebug(1203) << "## addToHistory: " << _url.prettyURL() << " Typed URL: " << typedURL << ", Title: " << title << endl;
275 
276  if ( filterOut( _url ) ) // we only want remote URLs
277  return;
278 
279  // http URLs without a path will get redirected immediately to url + '/'
280  if ( _url.path().isEmpty() && _url.protocol().startsWith("http") )
281  return;
282 
283  KURL url( _url );
284  bool hasPass = url.hasPass();
285  url.setPass( TQString::null ); // No password in the history, especially not in the completion!
286  url.setHost( url.host().lower() ); // All host parts lower case
287  KonqHistoryEntry entry;
288  TQString u = url.prettyURL();
289  entry.url = url;
290  if ( (u != typedURL) && !hasPass )
291  entry.typedURL = typedURL;
292 
293  // we only keep the title if we are confirming an entry. Otherwise,
294  // we might get bogus titles from the previous url (actually it's just
295  // konqueror's window caption).
296  if ( !pending && u != title )
297  entry.title = title;
298  entry.firstVisited = TQDateTime::currentDateTime();
299  entry.lastVisited = entry.firstVisited;
300 
301  // always remove from pending if available, otherwise the else branch leaks
302  // if the map already contains an entry for this key.
303  TQMapIterator<TQString,KonqHistoryEntry*> it = m_pending.find( u );
304  if ( it != m_pending.end() ) {
305  delete it.data();
306  m_pending.remove( it );
307  }
308 
309  if ( !pending ) {
310  if ( it != m_pending.end() ) {
311  // we make a pending entry official, so we just have to update
312  // and not increment the counter. No need to care about
313  // firstVisited, as this is not taken into account on update.
314  entry.numberOfTimesVisited = 0;
315  }
316  }
317 
318  else {
319  // We add a copy of the current history entry of the url to the
320  // pending list, so that we can restore it if the user canceled.
321  // If there is no entry for the url yet, we just store the url.
322  KonqHistoryEntry *oldEntry = findEntry( url );
323  m_pending.insert( u, oldEntry ?
324  new KonqHistoryEntry( *oldEntry ) : 0L );
325  }
326 
327  // notify all konqueror instances about the entry
328  emitAddToHistory( entry );
329 }
330 
331 // interface of KParts::HistoryManager
332 // Usually, we only record the history for non-local URLs (i.e. filterOut()
333 // returns false). But when using the HistoryProvider interface, we record
334 // exactly those filtered-out urls.
335 // Moreover, we don't get any pending/confirming entries, just one insert()
336 void KonqHistoryManager::insert( const TQString& url )
337 {
338  KURL u ( url );
339  if ( !filterOut( u ) || u.protocol() == "about" ) { // remote URL
340  return;
341  }
342  // Local URL -> add to history
343  KonqHistoryEntry entry;
344  entry.url = u;
345  entry.firstVisited = TQDateTime::currentDateTime();
346  entry.lastVisited = entry.firstVisited;
347  emitAddToHistory( entry );
348 }
349 
350 void KonqHistoryManager::emitAddToHistory( const KonqHistoryEntry& entry )
351 {
352  TQByteArray data;
353  TQDataStream stream( data, IO_WriteOnly );
354  stream << entry << objId();
355  // Protection against very long urls (like data:)
356  if ( data.size() > 4096 )
357  return;
358  tdeApp->dcopClient()->send( "konqueror*", "KonqHistoryManager",
359  "notifyHistoryEntry(KonqHistoryEntry, TQCString)",
360  data );
361 }
362 
363 
364 void KonqHistoryManager::removePending( const KURL& url )
365 {
366  // kdDebug(1203) << "## Removing pending... " << url.prettyURL() << endl;
367 
368  if ( url.isLocalFile() )
369  return;
370 
371  TQMapIterator<TQString,KonqHistoryEntry*> it = m_pending.find( url.prettyURL() );
372  if ( it != m_pending.end() ) {
373  KonqHistoryEntry *oldEntry = it.data(); // the old entry, may be 0L
374  emitRemoveFromHistory( url ); // remove the current pending entry
375 
376  if ( oldEntry ) // we had an entry before, now use that instead
377  emitAddToHistory( *oldEntry );
378 
379  delete oldEntry;
380  m_pending.remove( it );
381  }
382 }
383 
384 // clears the pending list and makes sure the entries get deleted.
385 void KonqHistoryManager::clearPending()
386 {
387  TQMapIterator<TQString,KonqHistoryEntry*> it = m_pending.begin();
388  while ( it != m_pending.end() ) {
389  delete it.data();
390  ++it;
391  }
392  m_pending.clear();
393 }
394 
395 void KonqHistoryManager::emitRemoveFromHistory( const KURL& url )
396 {
397  TQByteArray data;
398  TQDataStream stream( data, IO_WriteOnly );
399  stream << url << objId();
400  tdeApp->dcopClient()->send( "konqueror*", "KonqHistoryManager",
401  "notifyRemove(KURL, TQCString)", data );
402 }
403 
404 void KonqHistoryManager::emitRemoveFromHistory( const KURL::List& urls )
405 {
406  TQByteArray data;
407  TQDataStream stream( data, IO_WriteOnly );
408  stream << urls << objId();
409  tdeApp->dcopClient()->send( "konqueror*", "KonqHistoryManager",
410  "notifyRemove(KURL::List, TQCString)", data );
411 }
412 
413 void KonqHistoryManager::emitClear()
414 {
415  TQByteArray data;
416  TQDataStream stream( data, IO_WriteOnly );
417  stream << objId();
418  tdeApp->dcopClient()->send( "konqueror*", "KonqHistoryManager",
419  "notifyClear(TQCString)", data );
420 }
421 
422 void KonqHistoryManager::emitSetMaxCount( TQ_UINT32 count )
423 {
424  TQByteArray data;
425  TQDataStream stream( data, IO_WriteOnly );
426  stream << count << objId();
427  tdeApp->dcopClient()->send( "konqueror*", "KonqHistoryManager",
428  "notifyMaxCount(TQ_UINT32, TQCString)", data );
429 }
430 
431 void KonqHistoryManager::emitSetMaxAge( TQ_UINT32 days )
432 {
433  TQByteArray data;
434  TQDataStream stream( data, IO_WriteOnly );
435  stream << days << objId();
436  tdeApp->dcopClient()->send( "konqueror*", "KonqHistoryManager",
437  "notifyMaxAge(TQ_UINT32, TQCString)", data );
438 }
439 
441 // DCOP called methods
442 
443 void KonqHistoryManager::notifyHistoryEntry( KonqHistoryEntry e,
444  TQCString )
445 {
446  //kdDebug(1203) << "Got new entry from Broadcast: " << e.url.prettyURL() << endl;
447 
448  KonqHistoryEntry *entry = findEntry( e.url );
449  TQString urlString = e.url.url();
450 
451  if ( !entry ) { // create a new history entry
452  entry = new KonqHistoryEntry;
453  entry->url = e.url;
454  entry->firstVisited = e.firstVisited;
455  entry->numberOfTimesVisited = 0; // will get set to 1 below
456  m_history.append( entry );
457  KParts::HistoryProvider::insert( urlString );
458  }
459 
460  if ( !e.typedURL.isEmpty() )
461  entry->typedURL = e.typedURL;
462  if ( !e.title.isEmpty() )
463  entry->title = e.title;
464  entry->numberOfTimesVisited += e.numberOfTimesVisited;
465  entry->lastVisited = e.lastVisited;
466 
467  addToCompletion( entry->url.prettyURL(), entry->typedURL );
468 
469  // bool pending = (e.numberOfTimesVisited != 0);
470 
471  adjustSize();
472 
473  // note, no need to do the updateBookmarkMetadata for every
474  // history object, only need to for the broadcast sender as
475  // the history object itself keeps the data consistant.
476  bool updated = KonqBookmarkManager::self()->updateAccessMetadata( urlString );
477 
478  if ( isSenderOfBroadcast() ) {
479  // we are the sender of the broadcast, so we save
480  saveHistory();
481  // note, bk save does not notify, and we don't want to!
482  if (updated)
483  KonqBookmarkManager::self()->save();
484  }
485 
486  addToUpdateList( urlString );
487  emit entryAdded( entry );
488 }
489 
490 void KonqHistoryManager::notifyMaxCount( TQ_UINT32 count, TQCString )
491 {
492  m_maxCount = count;
493  clearPending();
494  adjustSize();
495 
496  TDEConfig *config = TDEGlobal::config();
497  TDEConfigGroupSaver cs( config, "HistorySettings" );
498  config->writeEntry( "Maximum of History entries", m_maxCount );
499 
500  if ( isSenderOfBroadcast() ) {
501  saveHistory();
502  config->sync();
503  }
504 }
505 
506 void KonqHistoryManager::notifyMaxAge( TQ_UINT32 days, TQCString )
507 {
508  m_maxAgeDays = days;
509  clearPending();
510  adjustSize();
511 
512  TDEConfig *config = TDEGlobal::config();
513  TDEConfigGroupSaver cs( config, "HistorySettings" );
514  config->writeEntry( "Maximum age of History entries", m_maxAgeDays );
515 
516  if ( isSenderOfBroadcast() ) {
517  saveHistory();
518  config->sync();
519  }
520 }
521 
522 void KonqHistoryManager::notifyClear( TQCString )
523 {
524  clearPending();
525  m_history.clear();
526  m_pCompletion->clear();
527 
528  if ( isSenderOfBroadcast() )
529  saveHistory();
530 
531  KParts::HistoryProvider::clear(); // also emits the cleared() signal
532 }
533 
534 void KonqHistoryManager::notifyRemove( KURL url, TQCString )
535 {
536  kdDebug(1203) << "#### Broadcast: remove entry:: " << url.prettyURL() << endl;
537 
538 
539  KonqHistoryEntry *entry = m_history.findEntry( url );
540 
541  if ( entry ) { // entry is now the current item
542  removeFromCompletion( entry->url.prettyURL(), entry->typedURL );
543 
544  TQString urlString = entry->url.url();
545  KParts::HistoryProvider::remove( urlString );
546 
547  addToUpdateList( urlString );
548 
549  m_history.take(); // does not delete
550  emit entryRemoved( entry );
551  delete entry;
552 
553  if ( isSenderOfBroadcast() )
554  saveHistory();
555  }
556 }
557 
558 void KonqHistoryManager::notifyRemove( KURL::List urls, TQCString )
559 {
560  kdDebug(1203) << "#### Broadcast: removing list!" << endl;
561 
562  bool doSave = false;
563  KURL::List::Iterator it = urls.begin();
564  while ( it != urls.end() ) {
565  KonqHistoryEntry *entry = m_history.findEntry( *it );
566 
567  if ( entry ) { // entry is now the current item
568  removeFromCompletion( entry->url.prettyURL(), entry->typedURL );
569 
570  TQString urlString = entry->url.url();
571  KParts::HistoryProvider::remove( urlString );
572 
573  addToUpdateList( urlString );
574 
575  m_history.take(); // does not delete
576  emit entryRemoved( entry );
577  delete entry;
578  doSave = true;
579  }
580 
581  ++it;
582  }
583 
584  if (doSave && isSenderOfBroadcast())
585  saveHistory();
586 }
587 
588 
589 // compatibility fallback, try to load the old completion history
590 bool KonqHistoryManager::loadFallback()
591 {
592  TQString file = locateLocal( "config", TQString::fromLatin1("konq_history"));
593  if ( file.isEmpty() )
594  return false;
595 
596  KonqHistoryEntry *entry;
597  KSimpleConfig config( file );
598  config.setGroup("History");
599  TQStringList items = config.readListEntry( "CompletionItems" );
600  TQStringList::Iterator it = items.begin();
601 
602  while ( it != items.end() ) {
603  entry = createFallbackEntry( *it );
604  if ( entry ) {
605  m_history.append( entry );
606  addToCompletion( entry->url.prettyURL(), TQString::null, entry->numberOfTimesVisited );
607 
608  KParts::HistoryProvider::insert( entry->url.url() );
609  }
610  ++it;
611  }
612 
613  m_history.sort();
614  adjustSize();
615  saveHistory();
616 
617  return true;
618 }
619 
620 // tries to create a small KonqHistoryEntry out of a string, where the string
621 // looks like "http://www.bla.com/bla.html:23"
622 // the attached :23 is the weighting from TDECompletion
623 KonqHistoryEntry * KonqHistoryManager::createFallbackEntry(const TQString& item) const
624 {
625  // code taken from TDECompletion::addItem(), adjusted to use weight = 1
626  uint len = item.length();
627  uint weight = 1;
628 
629  // find out the weighting of this item (appended to the string as ":num")
630  int index = item.findRev(':');
631  if ( index > 0 ) {
632  bool ok;
633  weight = item.mid( index + 1 ).toUInt( &ok );
634  if ( !ok )
635  weight = 1;
636 
637  len = index; // only insert until the ':'
638  }
639 
640 
641  KonqHistoryEntry *entry = 0L;
642  KURL u( item.left( len ));
643  if ( u.isValid() ) {
644  entry = new KonqHistoryEntry;
645  // that's the only entries we know about...
646  entry->url = u;
647  entry->numberOfTimesVisited = weight;
648  // to make it not expire immediately...
649  entry->lastVisited = TQDateTime::currentDateTime();
650  }
651 
652  return entry;
653 }
654 
655 KonqHistoryEntry * KonqHistoryManager::findEntry( const KURL& url )
656 {
657  // small optimization (dict lookup) for items _not_ in our history
658  if ( !KParts::HistoryProvider::contains( url.url() ) )
659  return 0L;
660 
661  return m_history.findEntry( url );
662 }
663 
664 bool KonqHistoryManager::filterOut( const KURL& url )
665 {
666  return ( url.isLocalFile() || url.host().isEmpty() );
667 }
668 
669 void KonqHistoryManager::slotEmitUpdated()
670 {
671  emit KParts::HistoryProvider::updated( m_updateURLs );
672  m_updateURLs.clear();
673 }
674 
675 TQStringList KonqHistoryManager::allURLs() const
676 {
677  TQStringList list;
678  KonqHistoryIterator it ( m_history );
679  for ( ; it.current(); ++it )
680  list.append( it.current()->url.url() );
681 
682  return list;
683 }
684 
685 void KonqHistoryManager::addToCompletion( const TQString& url, const TQString& typedURL,
686  int numberOfTimesVisited )
687 {
688  m_pCompletion->addItem( url, numberOfTimesVisited );
689  // typed urls have a higher priority
690  m_pCompletion->addItem( typedURL, numberOfTimesVisited +10 );
691 }
692 
693 void KonqHistoryManager::removeFromCompletion( const TQString& url, const TQString& typedURL )
694 {
695  m_pCompletion->removeItem( url );
696  m_pCompletion->removeItem( typedURL );
697 }
698 
700 
701 
702 KonqHistoryEntry * KonqHistoryList::findEntry( const KURL& url )
703 {
704  // we search backwards, probably faster to find an entry
705  KonqHistoryEntry *entry = last();
706  while ( entry ) {
707  if ( entry->url == url )
708  return entry;
709 
710  entry = prev();
711  }
712 
713  return 0L;
714 }
715 
716 // sort by lastVisited date (oldest go first)
717 int KonqHistoryList::compareItems( TQPtrCollection::Item item1,
718  TQPtrCollection::Item item2 )
719 {
720  KonqHistoryEntry *entry1 = static_cast<KonqHistoryEntry *>( item1 );
721  KonqHistoryEntry *entry2 = static_cast<KonqHistoryEntry *>( item2 );
722 
723  if ( entry1->lastVisited > entry2->lastVisited )
724  return 1;
725  else if ( entry1->lastVisited < entry2->lastVisited )
726  return -1;
727  else
728  return 0;
729 }
730 
731 using namespace KParts; // for IRIX
732 
733 #include "konq_historymgr.moc"
KonqHistoryManager::notifyRemove
virtual void notifyRemove(KURL url, TQCString saveId)
Notifes about a url that has to be removed from the history.
Definition: konq_historymgr.cpp:534
KonqHistoryManager::emitSetMaxAge
void emitSetMaxAge(TQ_UINT32 days)
Sets a new maximum age of history entries and removes all entries that are older than days...
Definition: konq_historymgr.cpp:431
KonqHistoryManager::notifyHistoryEntry
virtual void notifyHistoryEntry(KonqHistoryEntry e, TQCString saveId)
Every konqueror instance broadcasts new history entries to the other konqueror instances.
Definition: konq_historymgr.cpp:443
KonqHistoryManager::notifyMaxCount
virtual void notifyMaxCount(TQ_UINT32 count, TQCString saveId)
Called when the configuration of the maximum count changed.
Definition: konq_historymgr.cpp:490
KonqHistoryManager::filterOut
virtual bool filterOut(const KURL &url)
Definition: konq_historymgr.cpp:664
KonqHistoryManager::loadHistory
bool loadHistory()
Loads the history and fills the completion object.
Definition: konq_historymgr.cpp:81
KonqHistoryManager::removePending
void removePending(const KURL &url)
Removes a pending url from the history, e.g.
Definition: konq_historymgr.cpp:364
KonqHistoryManager::confirmPending
void confirmPending(const KURL &url, const TQString &typedURL=TQString::null, const TQString &title=TQString::null)
Confirms and updates the entry for url.
Definition: konq_historymgr.cpp:262
KonqHistoryManager::notifyClear
virtual void notifyClear(TQCString saveId)
Clears the history completely.
Definition: konq_historymgr.cpp:522
KonqHistoryManager::addPending
void addPending(const KURL &url, const TQString &typedURL=TQString::null, const TQString &title=TQString::null)
Adds a pending entry to the history.
Definition: konq_historymgr.cpp:256
KonqHistoryManager::emitRemoveFromHistory
void emitRemoveFromHistory(const KURL &url)
Removes the history entry for url, if existant.
Definition: konq_historymgr.cpp:395
KonqHistoryManager::addToHistory
void addToHistory(bool pending, const KURL &url, const TQString &typedURL=TQString::null, const TQString &title=TQString::null)
Does the work for addPending() and confirmPending().
Definition: konq_historymgr.cpp:270
KonqHistoryManager::adjustSize
void adjustSize()
Resizes the history list to contain less or equal than m_maxCount entries.
Definition: konq_historymgr.cpp:236
KonqHistoryComm
DCOP Methods for KonqHistoryManager.
Definition: konq_historycomm.h:59
KonqHistoryManager::emitAddToHistory
void emitAddToHistory(const KonqHistoryEntry &entry)
Notifes all running instances about a new HistoryEntry via DCOP.
Definition: konq_historymgr.cpp:350
KonqHistoryManager::allURLs
virtual TQStringList allURLs() const
Definition: konq_historymgr.cpp:675
KonqHistoryManager::saveHistory
bool saveHistory()
Saves the entire history.
Definition: konq_historymgr.cpp:200
KParts
Definition: konq_dirpart.h:32
KonqHistoryManager::insert
virtual void insert(const TQString &)
Reimplemented in such a way that all URLs that would be filtered out normally (see filterOut()) will ...
Definition: konq_historymgr.cpp:336
KonqHistoryManager::emitSetMaxCount
void emitSetMaxCount(TQ_UINT32 count)
Sets a new maximum size of history and truncates the current history if necessary.
Definition: konq_historymgr.cpp:422
KonqHistoryManager::emitClear
void emitClear()
Clears the history and tells all other Konqueror instances via DCOP to do the same.
Definition: konq_historymgr.cpp:413
KonqHistoryManager::notifyMaxAge
virtual void notifyMaxAge(TQ_UINT32 days, TQCString saveId)
Called when the configuration of the maximum age of history-entries changed.
Definition: konq_historymgr.cpp:506

libkonq

Skip menu "libkonq"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libkonq

Skip menu "libkonq"
  • kate
  • libkonq
  • twin
  •   lib
Generated for libkonq by doxygen 1.8.13
This website is maintained by Timothy Pearson.