Advertisement
Guest User

kmail patch disable akonadi

a guest
Sep 9th, 2010
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 13.08 KB | None | 0 0
  1. diff --git a/kmail/distributionlistdialog.cpp b/kmail/distributionlistdialog.cpp
  2. index f2f937f..3838f6c 100644
  3. --- a/kmail/distributionlistdialog.cpp
  4. +++ b/kmail/distributionlistdialog.cpp
  5. @@ -135,6 +135,7 @@ DistributionListDialog::DistributionListDialog( QWidget *parent )
  6.  
  7.  void DistributionListDialog::setRecipients( const Recipient::List &recipients )
  8.  {
  9. +#ifdef REALLY_WANT_AKONADI
  10.    Recipient::List::ConstIterator it;
  11.    for( it = recipients.constBegin(); it != recipients.constEnd(); ++it ) {
  12.      QStringList emails = KPIMUtils::splitAddressList( (*it).email() );
  13. @@ -179,10 +180,14 @@ void DistributionListDialog::setRecipients( const Recipient::List &recipients )
  14.        }
  15.      }
  16.    }
  17. +#else
  18. +  kWarning() << "FIXME: DistributionListDialog::setRecipients";
  19. +#endif
  20.  }
  21.  
  22.  void DistributionListDialog::slotUser1()
  23.  {
  24. +#ifdef REALLY_WANT_AKONADI
  25.    bool isEmpty = true;
  26.  
  27.    for (int i = 0; i < mRecipientsList->topLevelItemCount(); ++i) {
  28. @@ -258,4 +263,7 @@ void DistributionListDialog::slotUser1()
  29.    new Akonadi::ItemCreateJob( groupItem, targetCollection );
  30.  
  31.    close();
  32. +#else
  33. +  kWarning() << "FIXME: DistributionListDialog::slotUser1";
  34. +#endif
  35.  }
  36. diff --git a/kmail/folderdialogacltab.cpp b/kmail/folderdialogacltab.cpp
  37. index 2383f9c..e503dad 100644
  38. --- a/kmail/folderdialogacltab.cpp
  39. +++ b/kmail/folderdialogacltab.cpp
  40. @@ -277,6 +277,7 @@ void KMail::FolderDialogACLTab::ListViewItem::load( const ACLListEntry& entry )
  41.  void KMail::FolderDialogACLTab::ListViewItem::save( ACLList& aclList,
  42.                                                      IMAPUserIdFormat userIdFormat )
  43.  {
  44. +#ifdef REALLY_WANT_AKONADI
  45.    // expand distribution lists
  46.    Akonadi::ContactGroupSearchJob *job = new Akonadi::ContactGroupSearchJob();
  47.    job->setQuery( Akonadi::ContactGroupSearchJob::Name, userId() );
  48. @@ -303,6 +304,9 @@ void KMail::FolderDialogACLTab::ListViewItem::save( ACLList& aclList,
  49.      }
  50.      aclList.append( entry );
  51.    }
  52. +#else
  53. +  kWarning() << "FIXME: KMail::FolderDialogACLTab::ListViewItem::save";
  54. +#endif
  55.  }
  56.  
  57.  ////
  58. diff --git a/kmail/headerstyle.cpp b/kmail/headerstyle.cpp
  59. index 66567fd..5d9f503 100644
  60. --- a/kmail/headerstyle.cpp
  61. +++ b/kmail/headerstyle.cpp
  62. @@ -487,6 +487,7 @@ namespace KMail {
  63.  
  64.      QString userHTML;
  65.  
  66. +#ifdef REALLY_WANT_AKONADI
  67.      /*Akonadi::ContactSearchJob *job = new Akonadi::ContactSearchJob();
  68.      job->setLimit( 1 );
  69.      job->setQuery( Akonadi::ContactSearchJob::Email, KPIMUtils::firstEmailAddress( message->from() ) );
  70. @@ -527,6 +528,11 @@ namespace KMail {
  71.        }
  72.      }
  73.      else // TODO: find a usable one
  74. +#else
  75. +    QString photoURL;
  76. +    int photoWidth = 60;
  77. +    int photoHeight = 60;
  78. +#endif
  79.      {
  80.        userHTML = "&nbsp;";
  81.      }
  82. diff --git a/kmail/keyresolver.cpp b/kmail/keyresolver.cpp
  83. index 92ec3a1..38580c3 100644
  84. --- a/kmail/keyresolver.cpp
  85. +++ b/kmail/keyresolver.cpp
  86. @@ -1738,6 +1738,7 @@ Kleo::KeyResolver::ContactPreferences Kleo::KeyResolver::lookupContactPreference
  87.    if ( it != d->mContactPreferencesMap.end() )
  88.      return it->second;
  89.  
  90. +#ifdef REALLY_WANT_AKONADI
  91.    Akonadi::ContactSearchJob *job = new Akonadi::ContactSearchJob();
  92.    job->setLimit( 1 );
  93.    job->setQuery( Akonadi::ContactSearchJob::Email, address );
  94. @@ -1758,9 +1759,14 @@ Kleo::KeyResolver::ContactPreferences Kleo::KeyResolver::lookupContactPreference
  95.    }
  96.    // insert into map and grab resulting iterator
  97.    d->mContactPreferencesMap.insert( std::make_pair( address, pref ) );
  98. +#else
  99. +  kWarning() << "FIXME: Kleo::KeyResolver::lookupContactPreferences";
  100. +  ContactPreferences pref;
  101. +#endif
  102.    return pref;
  103.  }
  104.  
  105. +#ifdef REALLY_WANT_AKONADI
  106.  void Kleo::KeyResolver::writeCustomContactProperties( KABC::Addressee &contact, const ContactPreferences& pref ) const
  107.  {
  108.    contact.insertCustom( "KADDRESSBOOK", "CRYPTOENCRYPTPREF", Kleo::encryptionPreferenceToString( pref.encryptionPreference ) );
  109. @@ -1769,9 +1775,11 @@ void Kleo::KeyResolver::writeCustomContactProperties( KABC::Addressee &contact,
  110.    contact.insertCustom( "KADDRESSBOOK", "OPENPGPFP", pref.pgpKeyFingerprints.join( "," ) );
  111.    contact.insertCustom( "KADDRESSBOOK", "SMIMEFP", pref.smimeCertFingerprints.join( "," ) );
  112.  }
  113. +#endif
  114.  
  115.  void Kleo::KeyResolver::saveContactPreference( const QString& email, const ContactPreferences& pref ) const
  116.  {
  117. +#ifdef REALLY_WANT_AKONADI
  118.    d->mContactPreferencesMap.insert( std::make_pair( email, pref ) );
  119.  
  120.    Akonadi::ContactSearchJob *job = new Akonadi::ContactSearchJob();
  121. @@ -1817,6 +1825,9 @@ void Kleo::KeyResolver::saveContactPreference( const QString& email, const Conta
  122.    }
  123.  
  124.    // Assumption: 'pref' comes from d->mContactPreferencesMap already, no need to update that
  125. +#else
  126. +  kWarning() << "FIXME: KeyResolver::saveContactPreference";
  127. +#endif
  128.  }
  129.  
  130.  Kleo::KeyResolver::ContactPreferences::ContactPreferences()
  131. diff --git a/kmail/keyresolver.h b/kmail/keyresolver.h
  132. index 4833a47..4e2635f 100644
  133. --- a/kmail/keyresolver.h
  134. +++ b/kmail/keyresolver.h
  135. @@ -293,7 +293,9 @@ namespace Kleo {
  136.      };
  137.  
  138.      ContactPreferences lookupContactPreferences( const QString& address ) const;
  139. +#ifdef REALLY_WANT_AKONADI
  140.      void writeCustomContactProperties( KABC::Addressee &contact, const ContactPreferences& pref ) const;
  141. +#endif
  142.      void saveContactPreference( const QString& email, const ContactPreferences& pref ) const;
  143.  
  144.    private:
  145. diff --git a/kmail/kmaddrbook.cpp b/kmail/kmaddrbook.cpp
  146. index 2bb2fb8..b787c17 100644
  147. --- a/kmail/kmaddrbook.cpp
  148. +++ b/kmail/kmaddrbook.cpp
  149. @@ -35,6 +35,7 @@
  150.  
  151.  void KabcBridge::addresses(QStringList& result) // includes lists
  152.  {
  153. +#ifdef REALLY_WANT_AKONADI
  154.    KCursorSaver busy(KBusyPtr::busy()); // loading might take a while
  155.  
  156.    Akonadi::ContactSearchJob *job = new Akonadi::ContactSearchJob();
  157. @@ -87,6 +88,10 @@ void KabcBridge::addresses(QStringList& result) // includes lists
  158.    const KABC::ContactGroup::List contactGroups = groupJob->contactGroups();
  159.    foreach ( const KABC::ContactGroup &group, contactGroups )
  160.      result.append( group.name() );
  161. +#else
  162. +  kWarning() << "FIXME: KabcBridge::addresses(result)";
  163. +  return;
  164. +#endif
  165.  
  166.    result.sort();
  167.  }
  168. @@ -95,6 +100,7 @@ QStringList KabcBridge::addresses()
  169.  {
  170.    QStringList entries;
  171.  
  172. +#ifdef REALLY_WANT_AKONADI
  173.    Akonadi::ContactSearchJob *job = new Akonadi::ContactSearchJob();
  174.    if ( !job->exec() )
  175.      return QStringList();
  176. @@ -102,6 +108,9 @@ QStringList KabcBridge::addresses()
  177.    const KABC::Addressee::List contacts = job->contacts();
  178.    foreach ( const KABC::Addressee &contact, contacts )
  179.      entries.append( contact.fullEmail() );
  180. +#else
  181. +  kWarning() << "FIXME: KabcBridge::addresses";
  182. +#endif
  183.  
  184.    return entries;
  185.  }
  186. @@ -114,6 +123,7 @@ QString KabcBridge::expandNickName( const QString& nickName )
  187.  
  188.    const QString lowerNickName = nickName.toLower();
  189.  
  190. +#ifdef REALLY_WANT_AKONADI
  191.    Akonadi::ContactSearchJob *job = new Akonadi::ContactSearchJob();
  192.    job->setQuery( Akonadi::ContactSearchJob::NickName, lowerNickName );
  193.    if ( !job->exec() )
  194. @@ -124,6 +134,9 @@ QString KabcBridge::expandNickName( const QString& nickName )
  195.      if ( contact.nickName().toLower() == lowerNickName )
  196.        return contact.fullEmail();
  197.    }
  198. +#else
  199. +  kWarning() << "FIXME: KabcBridge::expandNickName";
  200. +#endif
  201.  
  202.    return QString();
  203.  }
  204. diff --git a/kmail/kmmainwidget.cpp b/kmail/kmmainwidget.cpp
  205. index 6b4a5f7..4c2bcba 100644
  206. --- a/kmail/kmmainwidget.cpp
  207. +++ b/kmail/kmmainwidget.cpp
  208. @@ -3356,7 +3356,7 @@ void KMMainWidget::slotMsgPopup( KMMessage &msg, const KUrl &aUrl, const QPoint
  209.        menu->addAction( mMsgView->mailToForwardAction() );
  210.  
  211.        menu->addSeparator();
  212. -
  213. +#ifdef REALLY_WANT_AKONADI
  214.        QString email =  KPIMUtils::firstEmailAddress( aUrl.path() );
  215.        Akonadi::ContactSearchJob *job = new Akonadi::ContactSearchJob();
  216.        job->setLimit( 1 );
  217. @@ -3370,6 +3370,9 @@ void KMMainWidget::slotMsgPopup( KMMessage &msg, const KUrl &aUrl, const QPoint
  218.        } else {
  219.          menu->addAction( mMsgView->openAddrBookAction() );
  220.        }
  221. +#else
  222. +      kWarning() << "FIXME: KMMainWidget::slotMsgPopup mailto";
  223. +#endif
  224.        menu->addAction( mMsgView->copyURLAction() );
  225.      } else {
  226.        // popup on a not-mailto URL
  227. diff --git a/kmail/kmreadermainwin.cpp b/kmail/kmreadermainwin.cpp
  228. index d34b776..bec5a7d 100644
  229. --- a/kmail/kmreadermainwin.cpp
  230. +++ b/kmail/kmreadermainwin.cpp
  231. @@ -393,6 +393,7 @@ void KMReaderMainWin::slotMsgPopup( KMMessage &aMsg, const KUrl &aUrl, const QPo
  232.          menu->addAction( mReaderWin->mailToForwardAction() );
  233.          menu->addSeparator();
  234.        }
  235. +#ifdef REALLY_WANT_AKONADI
  236.        QString email =  KPIMUtils::firstEmailAddress( aUrl.path() );
  237.        Akonadi::ContactSearchJob *job = new Akonadi::ContactSearchJob( this );
  238.        job->setLimit( 1 );
  239. @@ -408,6 +409,9 @@ void KMReaderMainWin::slotMsgPopup( KMMessage &aMsg, const KUrl &aUrl, const QPo
  240.        }
  241.        menu->addAction( mReaderWin->copyURLAction() );
  242.        copyAdded = true;
  243. +#else
  244. +      kWarning() << "FIXME: KMReaderMainWin::slotMsgPopup mailto";
  245. +#endif
  246.      } else {
  247.        // popup on a not-mailto URL
  248.        menu->addAction( mReaderWin->urlOpenAction() );
  249. diff --git a/kmail/kmsearchpattern.cpp b/kmail/kmsearchpattern.cpp
  250. index 174be8d..da04786 100644
  251. --- a/kmail/kmsearchpattern.cpp
  252. +++ b/kmail/kmsearchpattern.cpp
  253. @@ -457,6 +457,7 @@ bool KMSearchRuleString::matchesInternal( const QString & msgContents ) const
  254.        return ( QString::compare( msgContents.toLower(), contents().toLower() ) >= 0 );
  255.  
  256.    case FuncIsInAddressbook: {
  257. +#ifdef REALLY_WANT_AKONADI
  258.      const QStringList addressList = KPIMUtils::splitAddressList( msgContents.toLower() );
  259.      for ( QStringList::ConstIterator it = addressList.constBegin(); ( it != addressList.constEnd() ); ++it ) {
  260.        Akonadi::ContactSearchJob *job = new Akonadi::ContactSearchJob();
  261. @@ -467,10 +468,14 @@ bool KMSearchRuleString::matchesInternal( const QString & msgContents ) const
  262.        if ( !job->contacts().isEmpty() )
  263.          return true;
  264.      }
  265. +#else
  266. +    kWarning() << "FIXME: KMSearchRuleString::matchesInternal FuncIsInAddressbook";
  267. +#endif
  268.      return false;
  269.    }
  270.  
  271.    case FuncIsNotInAddressbook: {
  272. +#ifdef REALLY_WANT_AKONADI
  273.      const QStringList addressList = KPIMUtils::splitAddressList( msgContents.toLower() );
  274.      for ( QStringList::ConstIterator it = addressList.constBegin(); ( it != addressList.constEnd() ); ++it ) {
  275.        Akonadi::ContactSearchJob *job = new Akonadi::ContactSearchJob();
  276. @@ -481,10 +486,14 @@ bool KMSearchRuleString::matchesInternal( const QString & msgContents ) const
  277.        if ( job->contacts().isEmpty() )
  278.          return true;
  279.      }
  280. +#else
  281. +    kWarning() << "FIXME: KMSearchRuleString::matchesInternal FuncIsNotInAddressbook";
  282. +#endif
  283.      return false;
  284.    }
  285.  
  286.    case FuncIsInCategory: {
  287. +#ifdef REALLY_WANT_AKONADI
  288.      QString category = contents();
  289.      const QStringList addressList =  KPIMUtils::splitAddressList( msgContents.toLower() );
  290.  
  291. @@ -500,10 +509,14 @@ bool KMSearchRuleString::matchesInternal( const QString & msgContents ) const
  292.            return true;
  293.        }
  294.      }
  295. +#else
  296. +    kWarning() << "FIXME: KMSearchRuleString::matchesInternal FuncIsInCategory";
  297. +#endif
  298.      return false;
  299.    }
  300.  
  301.    case FuncIsNotInCategory: {
  302. +#if REALLY_WANT_AKONADI
  303.      QString category = contents();
  304.      const QStringList addressList =  KPIMUtils::splitAddressList( msgContents.toLower() );
  305.  
  306. @@ -520,6 +533,9 @@ bool KMSearchRuleString::matchesInternal( const QString & msgContents ) const
  307.        }
  308.  
  309.      }
  310. +#else
  311. +    kWarning() << "FIXME: KMSearchRuleString::matchesInternal FuncIsNotInCategory";
  312. +#endif
  313.      return true;
  314.    }
  315.    default:
  316. diff --git a/kmail/main.cpp b/kmail/main.cpp
  317. index 703dac6..5652623 100644
  318. --- a/kmail/main.cpp
  319. +++ b/kmail/main.cpp
  320. @@ -147,12 +147,16 @@ int main(int argc, char *argv[])
  321.    app.setEventLoopReached();
  322.    app.delayedInstanceCreation();
  323.  
  324. +#ifdef REALLY_WANT_AKONADI
  325.    // Start Akonadi
  326.    if ( !Akonadi::Control::start( kmkernel->getKMMainWidget() ) ) {
  327.      //TODO: add message box after string freeze
  328.      kWarning() << "Unable to start Akonadi server, exit application";
  329.      return 1;
  330.    }
  331. +#else
  332. +    kWarning() << "Akonadi disabled";
  333. +#endif
  334.  
  335.    // Go!
  336.    int ret = qApp->exec();
  337. diff --git a/kmail/xfaceconfigurator.cpp b/kmail/xfaceconfigurator.cpp
  338. index 209297e..5f0e562 100644
  339. --- a/kmail/xfaceconfigurator.cpp
  340. +++ b/kmail/xfaceconfigurator.cpp
  341. @@ -34,6 +34,8 @@
  342.  
  343.  #ifdef REALLY_WANT_AKONADI
  344.  #include <akonadi/contact/contactsearchjob.h>
  345. +#else
  346. +#include <kdebug.h>
  347.  #endif
  348.  #include <kabc/addressee.h>
  349.  #include <kcombobox.h>
  350. @@ -246,6 +248,7 @@ namespace KMail {
  351.  
  352.    void XFaceConfigurator::slotSelectFromAddressbook()
  353.    {
  354. +#ifdef REALLY_WANT_AKONADI
  355.      using namespace KPIMIdentities;
  356.  
  357.      IdentityManager manager( true );
  358. @@ -283,6 +286,9 @@ namespace KMail {
  359.        else
  360.          KMessageBox::information( this, i18n("No picture set for your address book entry."), i18n("No Picture") );
  361.      }
  362. +#else
  363. +    kWarning() << "FIXME: XFaceConfigurator::slotSelectFromAddressbook";
  364. +#endif
  365.    }
  366.  
  367.    void XFaceConfigurator::slotUpdateXFace()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement