• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

knode

  • sources
  • kde-4.12
  • kdepim
  • knode
kngroup.cpp
Go to the documentation of this file.
1 /*
2  KNode, the KDE newsreader
3  Copyright (c) 1999-2006 the KNode authors.
4  See file AUTHORS for details
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  You should have received a copy of the GNU General Public License
11  along with this program; if not, write to the Free Software Foundation,
12  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
13 */
14 
15 
16 #include "kngroup.h"
17 
18 #include "knglobals.h"
19 #include "kncollectionview.h"
20 #include "kncollectionviewitem.h"
21 #include "kngrouppropdlg.h"
22 #include "utilities.h"
23 #include "knmainwidget.h"
24 #include "knscoring.h"
25 #include "knarticlemanager.h"
26 #include "kngroupmanager.h"
27 #include "knnntpaccount.h"
28 #include "headerview.h"
29 #include "settings.h"
30 #include "utils/locale.h"
31 #include "utils/scoped_cursor_override.h"
32 
33 #include <kconfig.h>
34 #include <kdebug.h>
35 #include <klocale.h>
36 #include <KPIMIdentities/Identity>
37 #include <KPIMIdentities/IdentityManager>
38 #include <QTextStream>
39 #include <QByteArray>
40 
41 
42 using namespace KNode::Utilities;
43 #define SORT_DEPTH 5
44 
45 
46 KNGroup::KNGroup( KNCollection::Ptr p )
47  : KNArticleCollection(p), n_ewCount(0), l_astFetchCount(0), r_eadCount(0), i_gnoreCount(0),
48  f_irstNr(0), l_astNr(0), m_axFetch(0), d_ynDataFormat(1), f_irstNew(-1), l_ocked(false),
49  u_seCharset(false), s_tatus(unknown),
50  mIdentityUoid( -1 )
51 {
52  mCleanupConf = new KNode::Cleanup( false );
53 }
54 
55 
56 KNGroup::~KNGroup()
57 {
58  delete mCleanupConf;
59 }
60 
61 
62 QString KNGroup::path()
63 {
64  return p_arent->path();
65 }
66 
67 
68 const QString& KNGroup::name()
69 {
70  static QString ret;
71  if(n_ame.isEmpty()) ret=g_roupname;
72  else ret=n_ame;
73  return ret;
74 }
75 
76 
77 void KNGroup::updateListItem()
78 {
79  if(!l_istItem) return;
80  l_istItem->setTotalCount( c_ount );
81  l_istItem->setUnreadCount( c_ount - r_eadCount - i_gnoreCount );
82 
83  if( knGlobals.top && knGlobals.top->collectionView() ) {
84  l_istItem->updateColumn( knGlobals.top->collectionView()->totalColumnIndex() );
85  l_istItem->updateColumn( knGlobals.top->collectionView()->unreadColumnIndex() );
86  }
87 }
88 
89 
90 bool KNGroup::readInfo(const QString &confPath)
91 {
92  KConfigGroup info( KSharedConfig::openConfig(confPath, KConfig::SimpleConfig), QString() );
93 
94  g_roupname = info.readEntry("groupname");
95  d_escription = info.readEntry("description");
96  n_ame = info.readEntry("name");
97  c_ount = info.readEntry("count",0);
98  r_eadCount = info.readEntry("read",0);
99  if (r_eadCount > c_ount) r_eadCount = c_ount;
100  f_irstNr = info.readEntry("firstMsg",0);
101  l_astNr = info.readEntry("lastMsg",0);
102  d_ynDataFormat = info.readEntry("dynDataFormat",0);
103  u_seCharset = info.readEntry("useCharset", false);
104  d_efaultChSet = info.readEntry("defaultChSet").toLatin1();
105  QString s = info.readEntry("status","unknown");
106  if (s=="readOnly")
107  s_tatus = readOnly;
108  else if (s=="postingAllowed")
109  s_tatus = postingAllowed;
110  else if (s=="moderated")
111  s_tatus = moderated;
112  else
113  s_tatus = unknown;
114  c_rosspostIDBuffer = info.readEntry("crosspostIDBuffer", QStringList() );
115 
116  mIdentityUoid = info.readEntry( "identity", -1 );
117 
118  mCleanupConf->loadConfig( info );
119 
120  return (!g_roupname.isEmpty());
121 }
122 
123 
124 void KNGroup::writeConfig()
125 {
126  QString dir(path());
127 
128  if (!dir.isNull()) {
129  KConfig _info(dir+g_roupname+".grpinfo", KConfig::SimpleConfig);
130  KConfigGroup info( &_info, QString() );
131 
132  info.writeEntry("groupname", g_roupname);
133  info.writeEntry("description", d_escription);
134  info.writeEntry("firstMsg", f_irstNr);
135  info.writeEntry("lastMsg", l_astNr);
136  info.writeEntry("count", c_ount);
137  info.writeEntry("read", r_eadCount);
138  info.writeEntry("dynDataFormat", d_ynDataFormat);
139  info.writeEntry("name", n_ame);
140  info.writeEntry("useCharset", u_seCharset);
141  info.writeEntry("defaultChSet", QString::fromLatin1(d_efaultChSet));
142  switch (s_tatus) {
143  case unknown: info.writeEntry("status","unknown");
144  break;
145  case readOnly: info.writeEntry("status","readOnly");
146  break;
147  case postingAllowed: info.writeEntry("status","postingAllowed");
148  break;
149  case moderated: info.writeEntry("status","moderated");
150  break;
151  }
152  info.writeEntry("crosspostIDBuffer", c_rosspostIDBuffer);
153 
154  info.writeEntry( "identity", mIdentityUoid );
155 
156  mCleanupConf->saveConfig( info );
157  }
158 }
159 
160 
161 KNNntpAccount::Ptr KNGroup::account()
162 {
163  KNCollection::Ptr p = parent();
164  while(p->type()!=KNCollection::CTnntpAccount) p=p->parent();
165 
166  return boost::static_pointer_cast<KNNntpAccount>( p_arent );
167 }
168 
169 const KPIMIdentities::Identity & KNGroup::identity() const
170 {
171  if ( mIdentityUoid < 0 ) {
172  return KPIMIdentities::Identity::null();
173  }
174  return KNGlobals::self()->identityManager()->identityForUoid( mIdentityUoid );
175 }
176 
177 
178 bool KNGroup::loadHdrs()
179 {
180  if(isLoaded()) {
181  kDebug(5003) <<"KNGroup::loadHdrs() : nothing to load";
182  return true;
183  }
184 
185  kDebug(5003) <<"KNGroup::loadHdrs() : loading headers";
186  QByteArray buffer, hdrValue;
187  QFile f;
188  int cnt=0, id, lines, fileFormatVersion, artNumber;
189  unsigned int timeT;
190  KNRemoteArticle::Ptr art;
191 
192  QString dir(path());
193  if (dir.isNull())
194  return false;
195 
196  f.setFileName(dir+g_roupname+".static");
197 
198  if(f.open(QIODevice::ReadOnly)) {
199 
200  while ( !f.atEnd() ) {
201  buffer = f.readLine();
202  if ( buffer.isEmpty() ){
203  if ( f.error() == QFile::NoError ) {
204  kWarning(5003) <<"Found broken line in static-file: Ignored!";
205  continue;
206  } else {
207  kError(5003) <<"Corrupted static file, IO-error!";
208  clear();
209  return false;
210  }
211  }
212 
213  QList<QByteArray> splits = buffer.split( '\t' );
214  if ( splits.size() < 4 ) {
215  kWarning(5003) <<"Found broken line in static-file: Ignored!";
216  continue;
217  }
218  QList<QByteArray>::ConstIterator it = splits.constBegin();
219 
220  art = KNRemoteArticle::Ptr( new KNRemoteArticle( thisGroupPtr() ) );
221 
222  art->messageID()->from7BitString( *it );
223  ++it;
224 
225  art->subject()->from7BitString( *it );
226  ++it;
227 
228  KMime::Types::Mailbox mbox;
229  mbox.setAddress( *it );
230  ++it;
231 
232  if ( (*it) != "0\n" ) // last item has the line ending
233  mbox.setNameFrom7Bit( (*it).trimmed() );
234  art->from()->addAddress( mbox );
235 
236  buffer = f.readLine().trimmed();
237  if ( buffer != "0" )
238  art->references()->from7BitString( buffer );
239 
240  buffer = f.readLine();
241  if ( sscanf( buffer, "%d %d %u %d", &id, &lines, &timeT, &fileFormatVersion) < 4 )
242  fileFormatVersion = 0; // KNode <= 0.4 had no version number
243  art->setId(id);
244  art->lines()->setNumberOfLines(lines);
245  KDateTime dt;
246  dt.setTime_t( timeT );
247  art->date()->setDateTime( dt );
248 
249  if ( fileFormatVersion > 0 ) {
250  buffer = f.readLine();
251  sscanf( buffer, "%d", &artNumber );
252  art->setArticleNumber(artNumber);
253  }
254 
255  // optional headers
256  if ( fileFormatVersion > 1 ) {
257  // first line is the number of addiotion headers
258  buffer = f.readLine().trimmed();
259  // following lines contain one header per line
260  for ( uint i = buffer.toUInt(); i > 0; --i ) {
261  buffer = f.readLine().trimmed();
262  int pos = buffer.indexOf( ':' );
263  QByteArray hdrName = buffer.left( pos );
264  // skip headers we already set above and which we actually never should
265  // find here, but however it still happens... (eg. #101355)
266  if ( hdrName == "Subject" || hdrName == "From" || hdrName == "Date"
267  || hdrName == "Message-ID" || hdrName == "References"
268  || hdrName == "Bytes" || hdrName == "Lines" )
269  continue;
270  hdrValue = buffer.right( buffer.length() - (pos + 2) );
271  if ( hdrValue.length() > 0 )
272  art->setHeader( new KMime::Headers::Generic( hdrName, art.get(), hdrValue ) );
273  }
274  }
275 
276  append( art );
277  cnt++;
278  }
279 
280  setLastID();
281  f.close();
282  }
283  else {
284  clear();
285  return false;
286  }
287 
288 
289  f.setFileName(dir+g_roupname+".dynamic");
290 
291  if (f.open(QIODevice::ReadOnly)) {
292 
293  dynDataVer0 data0;
294  dynDataVer1 data1;
295  int readCnt=0,byteCount,dataSize;
296  if (d_ynDataFormat==0)
297  dataSize = sizeof(data0);
298  else
299  dataSize = sizeof(data1);
300 
301  while(!f.atEnd()) {
302 
303  if (d_ynDataFormat==0)
304  byteCount = f.read((char*)(&data0), dataSize);
305  else
306  byteCount = f.read((char*)(&data1), dataSize);
307  if ((byteCount == -1)||(byteCount!=dataSize)) {
308  if ( f.error() == QFile::NoError ) {
309  kWarning(5003) <<"Found broken entry in dynamic-file: Ignored!";
310  continue;
311  } else {
312  kError(5003) <<"Corrupted dynamic file, IO-error!";
313  clear();
314  return false;
315  }
316  }
317 
318  if (d_ynDataFormat==0)
319  art=byId(data0.id);
320  else
321  art=byId(data1.id);
322 
323  if(art) {
324  if (d_ynDataFormat==0)
325  data0.getData(art);
326  else
327  data1.getData(art);
328 
329  if (art->isRead()) readCnt++;
330  }
331 
332  }
333 
334  f.close();
335 
336  r_eadCount=readCnt;
337 
338  }
339 
340  else {
341  clear();
342  return false;
343  }
344 
345  kDebug(5003) << cnt <<" articles read from file";
346  c_ount=length();
347 
348  // convert old data files into current format:
349  if (d_ynDataFormat!=1) {
350  saveDynamicData(length(), true);
351  d_ynDataFormat=1;
352  }
353 
354  // restore "New" - flags
355  if( f_irstNew > -1 ) {
356  for( int i = f_irstNew; i < length(); ++i ) {
357  at(i)->setNew(true);
358  }
359  }
360 
361  updateThreadInfo();
362  processXPostBuffer(false);
363  return true;
364 }
365 
366 
367 bool KNGroup::unloadHdrs(bool force)
368 {
369  if ( lockedArticles() > 0 ) {
370  return false;
371  }
372 
373  if (!force && isNotUnloadable())
374  return false;
375 
376  KNRemoteArticle::Ptr a;
377  for(int idx=0; idx<length(); idx++) {
378  a=at(idx);
379  if (a->hasContent() && !knGlobals.articleManager()->unloadArticle(a, force))
380  return false;
381  }
382  syncDynamicData();
383  clear();
384 
385  return true;
386 }
387 
388 
389 // Attention: this method is called from the network thread!
390 void KNGroup::insortNewHeaders( const KIO::UDSEntryList &list, KNJobData *job)
391 {
392  KNRemoteArticle::Ptr art, art2;
393  int new_cnt=0, added_cnt=0;
394  int todo = list.count();
395  QTime timer;
396 
397  l_astFetchCount=0;
398 
399  if ( list.isEmpty() )
400  return;
401 
402  timer.start();
403 
404 
405  // recreate msg-ID index
406  syncSearchIndex();
407 
408  // remember index of first new
409  if(f_irstNew == -1)
410  f_irstNew = length(); // index of last + 1
411 
412  // get a list of additional headers provided in the listing
413  if ( mOptionalHeaders.isEmpty() ) {
414  KIO::UDSEntry entry = list.first();
415  const QList<uint> fields = entry.listFields();
416  foreach ( uint field, fields ) {
417  if ( field < KIO::UDSEntry::UDS_EXTRA || field > KIO::UDSEntry::UDS_EXTRA_END )
418  continue;
419  QString value = entry.stringValue( field );
420  kDebug(5003) << value;
421  QString hdrName = value.left( value.indexOf( ':' ) );
422  if ( hdrName == "Subject" || hdrName == "From" || hdrName == "Date"
423  || hdrName == "Message-ID" || hdrName == "References"
424  || hdrName == "Bytes" || hdrName == "Lines" )
425  continue;
426  kDebug(5003) <<"Adding optional header:" << hdrName;
427  mOptionalHeaders.append( hdrName.toLatin1() );
428  }
429  }
430 
431  QString hdrName, hdrValue;
432  for( KIO::UDSEntryList::ConstIterator it = list.begin(); it != list.end(); ++it ) {
433 
434  //new Header-Object
435  art = KNRemoteArticle::Ptr( new KNRemoteArticle( thisGroupPtr() ) );
436  art->setNew(true);
437 
438  const QList<uint> fields = (*it).listFields();
439  foreach ( uint field, fields ) {
440 
441  if ( field == KIO::UDSEntry::UDS_NAME ) {
442  //Article Number
443  art->setArticleNumber( (*it).stringValue( field ).toInt() );
444  } else if ( field >= KIO::UDSEntry::UDS_EXTRA && field <= KIO::UDSEntry::UDS_EXTRA_END ) {
445  QString value = (*it).stringValue( field );
446  int pos = value.indexOf( ':' );
447  if ( pos >= value.length() - 1 )
448  continue; // value is empty
449  hdrName = value.left( pos );
450  hdrValue = value.right( value.length() - ( hdrName.length() + 2 ) );
451 
452  if ( hdrName == "Subject" ) {
453  QByteArray subject;
454  Locale::recodeString( hdrValue.toLatin1(), thisGroupPtr(), subject );
455  art->subject()->from7BitString( subject );
456  if ( art->subject()->isEmpty() )
457  art->subject()->fromUnicodeString( i18n("no subject"), art->defaultCharset() );
458  } else if ( hdrName == "From" ) {
459  QByteArray from;
460  Locale::recodeString( hdrValue.toLatin1(), thisGroupPtr(), from );
461  art->from()->from7BitString( from );
462  if ( art->from()->as7BitString().isEmpty() ) {
463  // If the address incorrect (e.g. "toto <toto AT domain>"), the from is empty !
464  // Used the full header as display name.
465  const QByteArray email = "@invalid";
466  art->from()->addAddress( email, from );
467  }
468  } else if ( hdrName == "Date" ) {
469  art->date()->from7BitString( hdrValue.toLatin1() );
470  } else if ( hdrName == "Message-ID" ) {
471  art->messageID()->from7BitString( hdrValue.simplified().toLatin1() );
472  } else if ( hdrName == "References" ) {
473  if( !hdrValue.isEmpty() )
474  art->references()->from7BitString( hdrValue.toLatin1() );
475  } else if ( hdrName == "Lines" ) {
476  art->lines()->setNumberOfLines( hdrValue.toInt() );
477  } else {
478  // optional extra headers
479  art->setHeader( new KMime::Headers::Generic( hdrName.toLatin1(), art.get(), hdrValue.toLatin1() ) );
480  }
481  }
482  }
483 
484  // check if we have this article already in this group,
485  // if so mark it as new (useful with leafnodes delay-body function)
486  art2=byMessageId(art->messageID()->as7BitString(false));
487  if(art2) { // ok, we already have this article
488  art2->setNew(true);
489  art2->setArticleNumber(art->articleNumber());
490  new_cnt++;
491  } else {
492  append( art );
493  added_cnt++;
494  new_cnt++;
495  }
496 
497  if (timer.elapsed() > 200) { // don't flicker
498  timer.restart();
499  if(job) {
500  job->setProgress((new_cnt*30)/todo);
501  }
502  }
503  }
504 
505  // now we build the threads
506  syncSearchIndex(); // recreate the msgId-index so it contains the appended headers
507  buildThreads(added_cnt, job);
508  updateThreadInfo();
509 
510  // save the new headers
511  saveStaticData(added_cnt);
512  saveDynamicData(added_cnt);
513 
514  // update group-info
515  c_ount=length();
516  n_ewCount+=new_cnt;
517  l_astFetchCount=new_cnt;
518  updateListItem();
519  writeConfig();
520 }
521 
522 
523 int KNGroup::saveStaticData(int cnt,bool ovr)
524 {
525  int idx, savedCnt = 0;
526  KNRemoteArticle::Ptr art;
527 
528  QString dir(path());
529  if (dir.isNull())
530  return 0;
531 
532  QFile f(dir+g_roupname+".static");
533 
534  QIODevice::OpenMode mode;
535  if(ovr) mode=QIODevice::WriteOnly;
536  else mode=QIODevice::WriteOnly | QIODevice::Append;
537 
538  if(f.open(mode)) {
539 
540  QTextStream ts(&f);
541  ts.setCodec( "ISO 8859-1" );
542 
543  for(idx=length()-cnt; idx<length(); ++idx) {
544 
545  art=at(idx);
546 
547  if(art->isExpired()) continue;
548 
549  ts << art->messageID()->as7BitString(false) << '\t';
550  ts << art->subject()->as7BitString(false) << '\t';
551 
552  KMime::Types::Mailbox mbox;
553  if ( !art->from()->isEmpty() )
554  mbox = art->from()->mailboxes().first();
555  ts << mbox.address() << '\t';
556 
557  if ( mbox.hasName() )
558  ts << KMime::encodeRFC2047String( mbox.name(), art->from()->rfc2047Charset() ) << '\n';
559  else
560  ts << "0\n";
561 
562  if(!art->references()->isEmpty())
563  ts << art->references()->as7BitString(false) << "\n";
564  else
565  ts << "0\n";
566 
567  ts << art->id() << ' ';
568  ts << art->lines()->numberOfLines() << ' ';
569  ts << art->date()->dateTime().toTime_t() << ' ';
570  ts << "2\n"; // version number to achieve backward compatibility easily
571 
572  ts << art->articleNumber() << '\n';
573 
574  // optional headers
575  ts << mOptionalHeaders.count() << '\n';
576  Q_FOREACH( const QByteArray &hdrName, mOptionalHeaders ) {
577  KMime::Headers::Base *hdr = art->headerByType( hdrName.data() );
578  if ( hdr )
579  ts << hdrName << ": " << hdr->asUnicodeString() << '\n';
580  else
581  ts << hdrName << ": \n";
582  }
583 
584  savedCnt++;
585  }
586 
587  f.close();
588  }
589 
590  return savedCnt;
591 }
592 
593 
594 void KNGroup::saveDynamicData(int cnt,bool ovr)
595 {
596  dynDataVer1 data;
597  KNRemoteArticle::Ptr art;
598 
599  if(length()>0) {
600  QString dir(path());
601  if (dir.isNull())
602  return;
603 
604  QFile f(dir+g_roupname+".dynamic");
605 
606  QIODevice::OpenMode mode;
607  if(ovr) mode=QIODevice::WriteOnly;
608  else mode=QIODevice::WriteOnly | QIODevice::Append;
609 
610  if(f.open(mode)) {
611 
612  for(int idx=length()-cnt; idx<length(); idx++) {
613  art=at(idx);
614  if(art->isExpired()) continue;
615  data.setData(art);
616  f.write((char*)(&data), sizeof(data));
617  art->setChanged(false);
618  }
619  f.close();
620  }
621  else KNHelper::displayInternalFileError();
622  }
623 }
624 
625 
626 void KNGroup::syncDynamicData()
627 {
628  dynDataVer1 data;
629  int cnt=0, readCnt=0, sOfData;
630  KNRemoteArticle::Ptr art;
631 
632  if(length()>0) {
633 
634  QString dir(path());
635  if (dir.isNull())
636  return;
637 
638  QFile f(dir+g_roupname+".dynamic");
639 
640  if(f.open(QIODevice::ReadWrite)) {
641 
642  sOfData=sizeof(data);
643 
644  for(int i=0; i<length(); ++i) {
645  art=at(i);
646 
647  if(art->hasChanged() && !art->isExpired()) {
648 
649  data.setData(art);
650  f.seek( i * sOfData );
651  f.write((char*) &data, sOfData);
652  cnt++;
653  art->setChanged(false);
654  }
655 
656  if(art->isRead() && !art->isExpired()) readCnt++;
657  }
658 
659  f.close();
660 
661  kDebug(5003) << g_roupname <<" => updated" << cnt <<" entries of dynamic data";
662 
663  r_eadCount=readCnt;
664  }
665  else KNHelper::displayInternalFileError();
666  }
667 }
668 
669 
670 void KNGroup::appendXPostID(const QString &id)
671 {
672  c_rosspostIDBuffer.append(id);
673 }
674 
675 
676 void KNGroup::processXPostBuffer(bool deleteAfterwards)
677 {
678  QStringList remainder;
679  KNRemoteArticle::Ptr xp;
680  KNRemoteArticle::List al;
681 
682  for (QStringList::Iterator it = c_rosspostIDBuffer.begin(); it != c_rosspostIDBuffer.end(); ++it) {
683  if ((xp=byMessageId((*it).toLocal8Bit())))
684  al.append(xp);
685  else
686  remainder.append(*it);
687  }
688  knGlobals.articleManager()->setRead(al, true, false);
689 
690  if (!deleteAfterwards)
691  c_rosspostIDBuffer = remainder;
692  else
693  c_rosspostIDBuffer.clear();
694 }
695 
696 
697 void KNGroup::buildThreads(int cnt, KNJobData *job)
698 {
699  int end=length(),
700  start=end-cnt,
701  foundCnt=0, bySubCnt=0, refCnt=0,
702  resortCnt=0, idx, oldRef; // idRef;
703  KNRemoteArticle::Ptr art, ref;
704  QTime timer;
705 
706  timer.start();
707 
708  // this method is called from the nntp-thread!!!
709 #ifndef NDEBUG
710  kDebug(5003) << "start =" << start << "end =" << end;
711 #endif
712 
713  //resort old hdrs
714  if(start>0)
715  for(idx=0; idx<start; ++idx) {
716  art=at(idx);
717  if(art->threadingLevel()>1) {
718  oldRef=art->idRef();
719  ref=findReference(art);
720  if(ref) {
721  // this method is called from the nntp-thread!!!
722  #ifndef NDEBUG
723  kDebug(5003) << art->id() << ": Old" << oldRef << "New" << art->idRef();
724  #endif
725  resortCnt++;
726  art->setChanged(true);
727  }
728  }
729  }
730 
731 
732  for(idx=start; idx<end; ++idx) {
733 
734  art=at(idx);
735 
736  if(art->idRef()==-1 && !art->references()->isEmpty() ){ //hdr has references
737  refCnt++;
738  if(findReference(art))
739  foundCnt++;
740  }
741  else {
742  if(art->subject()->isReply()) {
743  art->setIdRef(0); //hdr has no references
744  art->setThreadingLevel(0);
745  }
746  else if(art->idRef()==-1)
747  refCnt++;
748  }
749 
750  if (timer.elapsed() > 200) { // don't flicker
751  timer.restart();
752  if(job) {
753  job->setProgress(30+((foundCnt)*70)/cnt);
754  }
755  }
756  }
757 
758 
759  if(foundCnt<refCnt) { // some references could not been found
760 
761  //try to sort by subject
762  KNRemoteArticle::Ptr oldest;
763  KNRemoteArticle::List list;
764 
765  for(idx=start; idx<end; ++idx) {
766 
767  art=at(idx);
768 
769  if(art->idRef()==-1) { //for all not sorted headers
770 
771  list.clear();
772  list.append(art);
773 
774  //find all headers with same subject
775  for(int idx2=0; idx2<length(); idx2++)
776  if(at(idx2)==art) continue;
777  else if(at(idx2)->subject()==art->subject())
778  list.append(at(idx2));
779 
780  if(list.count()==1) {
781  art->setIdRef(0);
782  art->setThreadingLevel(6);
783  bySubCnt++;
784  }
785  else {
786 
787  //find oldest
788  oldest=list.first();
789  for ( KNRemoteArticle::List::Iterator it = list.begin(); it != list.end(); ++it )
790  if ( (*it)->date()->dateTime() < oldest->date()->dateTime() )
791  oldest = (*it);
792 
793  //oldest gets idRef 0
794  if(oldest->idRef()==-1) bySubCnt++;
795  oldest->setIdRef(0);
796  oldest->setThreadingLevel(6);
797 
798  for ( KNRemoteArticle::List::Iterator it = list.begin(); it != list.end(); ++it ) {
799  if ( (*it) == oldest )
800  continue;
801  if ( (*it)->idRef() == -1 || ( (*it)->idRef() != -1 && (*it)->threadingLevel() == 6 ) ) {
802  (*it)->setIdRef(oldest->id());
803  (*it)->setThreadingLevel(6);
804  if ( (*it)->id() >= at(start)->id() )
805  bySubCnt++;
806  }
807  }
808  }
809  }
810 
811  if (timer.elapsed() > 200) { // don't flicker
812  timer.restart();
813  if(job) {
814  job->setProgress(30+((bySubCnt+foundCnt)*70)/cnt);
815  }
816  }
817  }
818  }
819 
820  //all not found items get refID 0
821  for (int idx=start; idx<end; idx++){
822  art=at(idx);
823  if(art->idRef()==-1) {
824  art->setIdRef(0);
825  art->setThreadingLevel(6); //was 0 !!!
826  }
827  }
828 
829  //check for loops in threads
830  int startId;
831  bool isLoop;
832  int iterationCount;
833  for (int idx=start; idx<end; idx++){
834  art=at(idx);
835  startId=art->id();
836  isLoop=false;
837  iterationCount=0;
838  while(art->idRef()!=0 && !isLoop && (iterationCount < end)) {
839  art=byId(art->idRef());
840  isLoop=(art->id()==startId);
841  iterationCount++;
842  }
843 
844  if(isLoop) {
845  // this method is called from the nntp-thread!!!
846  #ifndef NDEBUG
847  kDebug(5003) << "Sorting : loop in" << startId;
848  #endif
849  art=at(idx);
850  art->setIdRef(0);
851  art->setThreadingLevel(0);
852  }
853  }
854 
855  // propagate ignored/watched flags to new headers
856  for(int idx=start; idx<end; idx++) {
857  art=at(idx);
858  int idRef=art->idRef();
859  int tmpIdRef;
860 
861  if(idRef!=0) {
862  while(idRef!=0) {
863  art=byId(idRef);
864  if (art) {
865  tmpIdRef=art->idRef();
866  idRef = (idRef!=tmpIdRef)? tmpIdRef : 0;
867  }
868  }
869  if (art) {
870  if (art->isIgnored()) {
871  at(idx)->setIgnored(true);
872  ++i_gnoreCount;
873  }
874  at(idx)->setWatched(art->isWatched());
875  }
876  }
877  }
878 
879  // this method is called from the nntp-thread!!!
880 #ifndef NDEBUG
881  kDebug(5003) << "Sorting :" << resortCnt << "headers resorted";
882  kDebug(5003) << "Sorting :" << foundCnt << "references of" << refCnt << "found";
883  kDebug(5003) << "Sorting :" << bySubCnt << "references of" << refCnt << "sorted by subject";
884 #endif
885 }
886 
887 
888 KNRemoteArticle::Ptr KNGroup::findReference( KNRemoteArticle::Ptr a )
889 {
890  QByteArray ref_mid;
891  KNRemoteArticle::Ptr ref_art;
892 
893  QList<QByteArray> references = a->references()->identifiers();
894 
895  for ( int ref_nr = 0; ref_nr < references.count() && ref_nr < SORT_DEPTH; ++ref_nr ) {
896  ref_mid = '<' + references.at( references.count() - ref_nr - 1 ) + '>';
897  ref_art = byMessageId(ref_mid);
898  if(ref_art) {
899  a->setThreadingLevel(ref_nr+1);
900  a->setIdRef(ref_art->id());
901  break;
902  }
903  }
904 
905  return ref_art;
906 }
907 
908 
909 void KNGroup::scoreArticles(bool onlynew)
910 {
911  kDebug(5003) <<"KNGroup::scoreArticles()";
912  int len=length(),
913  todo=(onlynew)? lastFetchCount():length();
914 
915  if (todo) {
916  // reset the notify collection
917  delete KNScorableArticle::notifyC;
918  KNScorableArticle::notifyC = 0;
919 
920  kDebug(5003) <<"scoring" << newCount() <<" articles";
921  kDebug(5003) <<"(total" << length() <<" article in group)";
922  ScopedCursorOverride cursor( Qt::WaitCursor );
923  knGlobals.setStatusMsg(i18n(" Scoring..."));
924 
925  int defScore;
926  KScoringManager *sm = knGlobals.scoringManager();
927  sm->initCache(groupname());
928  for(int idx=0; idx<todo; idx++) {
929  KNRemoteArticle::Ptr a = at( len-idx-1 );
930  if ( !a ) {
931  kWarning( 5003 ) <<"found no article at" << len-idx-1;
932  continue;
933  }
934 
935  defScore = 0;
936  if (a->isIgnored())
937  defScore = knGlobals.settings()->ignoredThreshold();
938  else if (a->isWatched())
939  defScore = knGlobals.settings()->watchedThreshold();
940 
941  if (a->score() != defScore) {
942  a->setScore(defScore);
943  a->setChanged(true);
944  }
945 
946  bool read = a->isRead();
947 
948  KNScorableArticle sa(a);
949  sm->applyRules(sa);
950 
951  if ( a->isRead() != read && !read )
952  incReadCount();
953  }
954 
955  knGlobals.setStatusMsg( QString() );
956  cursor.restore();
957 
958  //kDebug(5003) << KNScorableArticle::notifyC->collection();
959  if (KNScorableArticle::notifyC)
960  KNScorableArticle::notifyC->displayCollection(knGlobals.topWidget);
961  }
962 }
963 
964 
965 void KNGroup::reorganize()
966 {
967  kDebug(5003) <<"KNGroup::reorganize()";
968 
969  ScopedCursorOverride cursor( Qt::WaitCursor );
970  knGlobals.setStatusMsg(i18n(" Reorganizing headers..."));
971 
972  for(int idx=0; idx<length(); idx++) {
973  KNRemoteArticle::Ptr a = at( idx );
974  Q_ASSERT( a );
975  a->setId(idx+1); //new ids
976  a->setIdRef(-1);
977  a->setThreadingLevel(0);
978  }
979 
980  buildThreads(length());
981  saveStaticData(length(), true);
982  saveDynamicData(length(), true);
983  knGlobals.top->headerView()->repaint();
984  knGlobals.setStatusMsg( QString() );
985 }
986 
987 
988 void KNGroup::updateThreadInfo()
989 {
990  KNRemoteArticle::Ptr ref;
991  bool brokenThread=false;
992 
993  for(int idx=0; idx<length(); idx++) {
994  at(idx)->setUnreadFollowUps(0);
995  at(idx)->setNewFollowUps(0);
996  }
997 
998  for(int idx=0; idx<length(); idx++) {
999  int idRef=at(idx)->idRef();
1000  int tmpIdRef;
1001  int iterCount=1; // control iteration count to avoid infinite loops
1002  while((idRef!=0) && (iterCount <= length())) {
1003  ref=byId(idRef);
1004  if(!ref) {
1005  brokenThread=true;
1006  break;
1007  }
1008 
1009  if(!at(idx)->isRead()) {
1010  ref->incUnreadFollowUps();
1011  if(at(idx)->isNew()) ref->incNewFollowUps();
1012  }
1013  tmpIdRef=ref->idRef();
1014  idRef= (idRef!=tmpIdRef) ? ref->idRef() : 0;
1015  iterCount++;
1016  }
1017  if(iterCount > length())
1018  brokenThread=true;
1019  if(brokenThread) break;
1020  }
1021 
1022  if(brokenThread) {
1023  kWarning(5003) <<"KNGroup::updateThreadInfo() : Found broken threading information! Restoring ...";
1024  reorganize();
1025  updateThreadInfo();
1026  }
1027 }
1028 
1029 
1030 void KNGroup::showProperties()
1031 {
1032  KNGroupPropDlg *d=new KNGroupPropDlg(this, knGlobals.topWidget);
1033 
1034  if(d->exec()) {
1035  if(d->nickHasChanged()) {
1036  l_istItem->setLabelText( name() );
1037  }
1038  }
1039 
1040  delete d;
1041 }
1042 
1043 
1044 int KNGroup::statThrWithNew()
1045 {
1046  int cnt=0;
1047  for(int i=0; i<length(); ++i)
1048  if( (at(i)->idRef()==0) && (at(i)->hasNewFollowUps()) ) cnt++;
1049  return cnt;
1050 }
1051 
1052 
1053 int KNGroup::statThrWithUnread()
1054 {
1055  int cnt=0;
1056  for(int i=0; i<length(); ++i)
1057  if( (at(i)->idRef()==0) && (at(i)->hasUnreadFollowUps()) ) cnt++;
1058  return cnt;
1059 }
1060 
1061 QString KNGroup::prepareForExecution()
1062 {
1063  if ( KNGlobals::self()->groupManager()->loadHeaders( thisGroupPtr() ) ) {
1064  return QString();
1065  } else {
1066  return i18n("Cannot load saved headers: %1", groupname());
1067  }
1068 }
1069 
1070 //***************************************************************************
1071 
1072 void KNGroup::dynDataVer0::setData( KNRemoteArticle::Ptr a )
1073 {
1074  id=a->id();
1075  idRef=a->idRef();
1076  thrLevel=a->threadingLevel();
1077  read=a->getReadFlag();
1078  score=a->score();
1079 }
1080 
1081 
1082 void KNGroup::dynDataVer0::getData( KNRemoteArticle::Ptr a )
1083 {
1084  a->setId(id);
1085  a->setIdRef(idRef);
1086  a->setRead(read);
1087  a->setThreadingLevel(thrLevel);
1088  a->setScore(score);
1089 }
1090 
1091 
1092 void KNGroup::dynDataVer1::setData( KNRemoteArticle::Ptr a )
1093 {
1094  id=a->id();
1095  idRef=a->idRef();
1096  thrLevel=a->threadingLevel();
1097  read=a->getReadFlag();
1098  score=a->score();
1099  ignoredWatched = 0;
1100  if (a->isWatched())
1101  ignoredWatched = 1;
1102  else if (a->isIgnored())
1103  ignoredWatched = 2;
1104 }
1105 
1106 
1107 void KNGroup::dynDataVer1::getData( KNRemoteArticle::Ptr a )
1108 {
1109  a->setId(id);
1110  a->setIdRef(idRef);
1111  a->setRead(read);
1112  a->setThreadingLevel(thrLevel);
1113  a->setScore(score);
1114  a->setWatched(ignoredWatched==1);
1115  a->setIgnored(ignoredWatched==2);
1116 }
1117 
1118 
1119 KNode::Cleanup * KNGroup::activeCleanupConfig()
1120 {
1121  if (!cleanupConfig()->useDefault())
1122  return cleanupConfig();
1123  return account()->activeCleanupConfig();
1124 }
1125 
1126 KNGroup::Ptr KNGroup::thisGroupPtr()
1127 {
1128  return KNGlobals::self()->groupManager()->group( groupname(), account() );
1129 }
KNArticleCollection::setLastID
void setLastID()
Definition: knarticlecollection.cpp:230
KNNntpAccount
Represents an account on a news server.
Definition: knnntpaccount.h:56
KNGroup::g_roupname
QString g_roupname
Definition: kngroup.h:214
KNGroup::d_ynDataFormat
int d_ynDataFormat
Definition: kngroup.h:202
KNGroup::mOptionalHeaders
QList< QByteArray > mOptionalHeaders
Optional headers provided by the XOVER command.
Definition: kngroup.h:227
KNGlobals::groupManager
KNGroupManager * groupManager()
Returns the group manager.
Definition: knglobals.cpp:117
KNCollection::parent
KNCollection::Ptr parent() const
Returns the parent collection.
Definition: kncollection.h:71
KNGroup::scoreArticles
void scoreArticles(bool onlynew=true)
Definition: kngroup.cpp:909
KNGroup::f_irstNew
int f_irstNew
Definition: kngroup.h:202
KPIM::FolderTreeWidgetItem::updateColumn
void updateColumn(int columnIndex)
Triggers an update for the specified column of this item.
Definition: foldertreewidget.cpp:546
KNGroup::cleanupConfig
KNode::Cleanup * cleanupConfig() const
Returns the cleanup configuration of this group (might be empty).
Definition: kngroup.h:187
KNGroup::buildThreads
void buildThreads(int cnt, KNJobData *parent=0)
Definition: kngroup.cpp:697
KNGroup::mIdentityUoid
int mIdentityUoid
Unique object identifier of the identity of this group.
Definition: kngroup.h:234
KNGroup::processXPostBuffer
void processXPostBuffer(bool deleteAfterwards)
Definition: kngroup.cpp:676
KNGroup::dynDataVer0::idRef
int idRef
Definition: kngroup.h:247
KNGroup::moderated
Definition: kngroup.h:50
utilities.h
KNGroup::path
QString path()
info
Definition: kngroup.cpp:62
KNGroup::name
const QString & name()
Returns the collection name.
Definition: kngroup.cpp:68
KNGroupManager::group
KNGroup::Ptr group(const QString &gName, const KNServerInfo::Ptr s)
Returns a group named gName in the server s, or null if none is found.
Definition: kngroupmanager.cpp:338
KNode::Cleanup::saveConfig
void saveConfig(KConfigGroup &conf)
Definition: knconfig.cpp:252
KNJobData
Abstract base class for all KNode internal jobs.
Definition: knjobdata.h:101
KNCollection::p_arent
KNCollection::Ptr p_arent
A pointer to the parent collection.
Definition: kncollection.h:93
KNGroup::mCleanupConf
KNode::Cleanup * mCleanupConf
Definition: kngroup.h:236
KNArticleCollection::isNotUnloadable
bool isNotUnloadable()
Definition: knarticlecollection.h:98
KNGroup::saveDynamicData
void saveDynamicData(int cnt, bool ovr=false)
Definition: kngroup.cpp:594
KNArticleCollection::syncSearchIndex
void syncSearchIndex()
Definition: knarticlecollection.cpp:240
KNGroup::saveStaticData
int saveStaticData(int cnt, bool ovr=false)
Definition: kngroup.cpp:523
KNArticleCollection::length
int length()
Definition: knarticlecollection.h:95
KNArticleCollection::lockedArticles
unsigned int lockedArticles()
Definition: knarticlecollection.h:102
KNGlobals::self
static KNGlobals * self()
Return the KNGlobals instance.
Definition: knglobals.cpp:72
KNGroup::l_astFetchCount
int l_astFetchCount
Definition: kngroup.h:202
kngroupmanager.h
KNGroup::dynDataVer0::id
int id
Definition: kngroup.h:246
from
QString from() const
KNode::Cleanup
Expirery/cleaup settings (globally or per account/group/folder).
Definition: knconfig.h:132
knarticlemanager.h
kngroup.h
KNGroup::groupname
const QString & groupname()
Definition: kngroup.h:72
KNNntpAccount::Ptr
boost::shared_ptr< KNNntpAccount > Ptr
Shared pointer to a KNNntpAccount.
Definition: knnntpaccount.h:62
KNode::Utilities::ScopedCursorOverride::restore
void restore()
Restore the previous cursor shape.
Definition: scoped_cursor_override.h:59
KNArticleCollection::isLoaded
bool isLoaded()
Definition: knarticlecollection.h:94
KPIM::FolderTreeWidgetItem::setUnreadCount
void setUnreadCount(int unreadCount)
Sets the unread message count to be displayed in the special "Unread" column.
Definition: foldertreewidget.cpp:453
knnntpaccount.h
KNGroup::dynDataVer1::setData
void setData(KNRemoteArticle::Ptr a)
Definition: kngroup.cpp:1092
KNScorableArticle::notifyC
static NotifyCollection * notifyC
Definition: knscoring.h:38
scoped_cursor_override.h
KPIM::KScoringManager
Definition: kscoring.h:315
KNGroup::dynDataVer0::setData
void setData(KNRemoteArticle::Ptr a)
Definition: kngroup.cpp:1072
KNCollection::n_ame
QString n_ame
The name of this collection.
Definition: kncollection.h:97
KNGroup::d_efaultChSet
QByteArray d_efaultChSet
The default charset of this group.
Definition: kngroup.h:213
KNGlobals::identityManager
KPIMIdentities::IdentityManager * identityManager()
Returns the identity manager.
Definition: knglobals.cpp:167
KNGroup::dynDataVer0::read
bool read
Definition: kngroup.h:248
KNGroup::readOnly
Definition: kngroup.h:50
KNGroup::findReference
KNRemoteArticle::Ptr findReference(KNRemoteArticle::Ptr a)
Returns the first message that appears in the References header of a and which exists in this group...
Definition: kngroup.cpp:888
KNGroup::appendXPostID
void appendXPostID(const QString &id)
mark articles with this id as read when we later load the headers / fetch new articles ...
Definition: kngroup.cpp:670
KNHelper::displayInternalFileError
static void displayInternalFileError(QWidget *w=0)
use this for all internal files
Definition: utilities.cpp:344
KNGroup::writeConfig
void writeConfig()
Save the configuration to disk.
Definition: kngroup.cpp:124
KNGroup::postingAllowed
Definition: kngroup.h:50
KNGroup::l_astNr
int l_astNr
Definition: kngroup.h:202
KNGroup::n_ewCount
int n_ewCount
Definition: kngroup.h:202
KNGroup::unknown
Definition: kngroup.h:50
subject
QString subject() const
KNCollection::l_istItem
KNCollectionViewItem * l_istItem
The list view item representing this collection in the folder tree.
Definition: kncollection.h:95
kncollectionview.h
kngrouppropdlg.h
KNGroup::r_eadCount
int r_eadCount
Definition: kngroup.h:202
locale.h
KNGroup::incReadCount
void incReadCount(int i=1)
Definition: kngroup.h:94
knmainwidget.h
kncollectionviewitem.h
KNGroup::updateThreadInfo
void updateThreadInfo()
article handling
Definition: kngroup.cpp:988
KNGroup::f_irstNr
int f_irstNr
Definition: kngroup.h:202
KPIM::NotifyCollection::displayCollection
void displayCollection(QWidget *p=0) const
Definition: kscoring.cpp:414
KNArticleCollection::clear
void clear()
Definition: knarticlecollection.cpp:200
KNGroup::byId
KNRemoteArticle::Ptr byId(int id)
Definition: kngroup.h:122
KNGroup::showProperties
void showProperties()
Shows the group properties dialog.
Definition: kngroup.cpp:1030
KPIM::KScoringManager::applyRules
void applyRules(ScorableArticle &article, const QString &group)
Definition: kscoring.cpp:1121
KNGroupPropDlg
News group properties dialog.
Definition: kngrouppropdlg.h:34
KNGroup::insortNewHeaders
void insortNewHeaders(const KIO::UDSEntryList &list, KNJobData *job=0)
Insert headers of new articles into this group, and then sort.
Definition: kngroup.cpp:390
KPIM::KScoringManager::initCache
void initCache(const QString &group)
Definition: kscoring.cpp:1135
KNGroup::activeCleanupConfig
KNode::Cleanup * activeCleanupConfig()
Returns the active cleanup configuration of this group, ie.
Definition: kngroup.cpp:1119
headerview.h
knglobals.h
KNGroup::c_rosspostIDBuffer
QStringList c_rosspostIDBuffer
Definition: kngroup.h:222
KNGroup::s_tatus
Status s_tatus
Definition: kngroup.h:220
KNGroupPropDlg::nickHasChanged
bool nickHasChanged() const
Definition: kngrouppropdlg.h:40
KNRemoteArticle::Ptr
boost::shared_ptr< KNRemoteArticle > Ptr
Shared pointer to a KNRemoteArticle. To be used instead of raw KNRemoteArticle*.
Definition: knarticle.h:107
KNCollection::Ptr
boost::shared_ptr< KNCollection > Ptr
Shared pointer to a KNCollection.
Definition: kncollection.h:40
settings.h
KNGroup::reorganize
void reorganize()
Definition: kngroup.cpp:965
KNArticleCollection::append
void append(KNArticle::Ptr a)
Appends an article to this collection.
Definition: knarticlecollection.cpp:186
KNGroup::prepareForExecution
QString prepareForExecution()
Definition: kngroup.cpp:1061
KNGroup::lastFetchCount
int lastFetchCount() const
Definition: kngroup.h:89
KNGroup::dynDataVer0::score
short score
Definition: kngroup.h:249
KNGroup::u_seCharset
bool u_seCharset
Definition: kngroup.h:217
KNGroup::dynDataVer0
Definition: kngroup.h:238
KNJobData::setProgress
void setProgress(unsigned int progress)
Set the progress value of the progress item if available.
Definition: knjobdata.h:168
KNGroup::dynDataVer1::id
int id
Definition: kngroup.h:259
KPIM::FolderTreeWidgetItem::setLabelText
void setLabelText(const QString &label)
Sets the textual data for the "Label" column of the parent FolderTreeWidget.
Definition: foldertreewidget.cpp:439
KNGroup::i_gnoreCount
int i_gnoreCount
Definition: kngroup.h:202
KNGroup::statThrWithUnread
int statThrWithUnread()
Definition: kngroup.cpp:1053
KNGroup::dynDataVer1::getData
void getData(KNRemoteArticle::Ptr a)
Definition: kngroup.cpp:1107
KNGroup::newCount
int newCount() const
count + numbers
Definition: kngroup.h:82
KNScorableArticle
Article interface for the scoring system.
Definition: knscoring.h:24
KNGroup::dynDataVer1::read
bool read
Definition: kngroup.h:261
KNRemoteArticle
KNRemoteArticle represents an article, whos body has to be retrieved from a remote host or from the l...
Definition: knarticle.h:103
KNGroup::thisGroupPtr
KNGroup::Ptr thisGroupPtr()
Returns a shared pointer pointing to this group.
Definition: kngroup.cpp:1126
KNArticleCollection
Abstract base class for article collections, ie.
Definition: knarticlecollection.h:76
knscoring.h
KNode::Utilities::ScopedCursorOverride
This object change the application cursor to a given type and then restore the previous cursor when i...
Definition: scoped_cursor_override.h:36
KNGroup::at
KNRemoteArticle::Ptr at(int i)
Definition: kngroup.h:120
KNCollection::c_ount
int c_ount
Definition: kncollection.h:98
SORT_DEPTH
#define SORT_DEPTH
Definition: kngroup.cpp:43
KNGroup::~KNGroup
~KNGroup()
Definition: kngroup.cpp:56
KNGroup::dynDataVer0::thrLevel
short thrLevel
Definition: kngroup.h:249
KNode::Cleanup::loadConfig
void loadConfig(const KConfigGroup &conf)
Definition: knconfig.cpp:229
KNGroup::syncDynamicData
void syncDynamicData()
Definition: kngroup.cpp:626
KPIM::FolderTreeWidgetItem::setTotalCount
void setTotalCount(int totalCount)
Sets the total message count to be displayed in the special "Total" column.
Definition: foldertreewidget.cpp:476
knGlobals
#define knGlobals
Keep compatibility with the old way.
Definition: knglobals.h:28
KNCollection::CTnntpAccount
Definition: kncollection.h:33
KNGroup::account
KNNntpAccount::Ptr account()
Returns the account this group belongs to.
Definition: kngroup.cpp:161
KNGroup::readInfo
bool readInfo(const QString &confPath)
Load the properties/settings of this collection.
Definition: kngroup.cpp:90
KNGroup::identity
virtual const KPIMIdentities::Identity & identity() const
Returns the identity configured for this group.
Definition: kngroup.cpp:169
KNGroup::KNGroup
KNGroup(KNCollection::Ptr p=KNCollection::Ptr())
Definition: kngroup.cpp:46
KNGroup::loadHdrs
bool loadHdrs()
Load the stored headers from disk.
Definition: kngroup.cpp:178
KNGroup::statThrWithNew
int statThrWithNew()
Definition: kngroup.cpp:1044
KNGroup::dynDataVer0::getData
void getData(KNRemoteArticle::Ptr a)
Definition: kngroup.cpp:1082
KNGroup::dynDataVer1
Definition: kngroup.h:252
KNGroup::byMessageId
KNRemoteArticle::Ptr byMessageId(const QByteArray &mId)
Definition: kngroup.h:124
QList< QByteArray >
KNGroup::Ptr
boost::shared_ptr< KNGroup > Ptr
Shared pointer to a KNGroup.
Definition: kngroup.h:47
KNGroup::d_escription
QString d_escription
Definition: kngroup.h:214
KNGroup::unloadHdrs
bool unloadHdrs(bool force=true)
Definition: kngroup.cpp:367
KNGroup::updateListItem
void updateListItem()
list-item handling
Definition: kngroup.cpp:77
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:36 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

knode

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

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal