Hello community,

here is the log from the commit of package kdepimlibs4 for openSUSE:Factory 
checked in at 2013-12-11 14:32:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kdepimlibs4 (Old)
 and      /work/SRC/openSUSE:Factory/.kdepimlibs4.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kdepimlibs4"

Changes:
--------
--- /work/SRC/openSUSE:Factory/kdepimlibs4/kdepimlibs4.changes  2013-12-02 
12:31:03.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.kdepimlibs4.new/kdepimlibs4.changes     
2013-12-11 14:32:35.000000000 +0100
@@ -1,0 +2,16 @@
+Fri Nov 29 07:00:24 UTC 2013 - tittiatc...@gmail.com
+
+- Update to 4.11.97
+   * KDE 4.12 RC 1 release
+   * See http://www.kde.org/announcements/announce-4.12-rc.php
+
+-------------------------------------------------------------------
+Sat Nov 23 22:15:00 UTC 2013 - tittiatc...@gmail.com
+
+- Update to 4.11.95
+   * KDE 4.12 Beta 3 release
+   * See http://www.kde.org/announcements/announce-4.12-beta3.php
+- Dropped patch Fixed-refcounting-in-ETM-and-Monitor.patch (included
+  upstream)
+
+-------------------------------------------------------------------

Old:
----
  Fixed-refcounting-in-ETM-and-Monitor.patch
  kdepimlibs-4.11.90.tar.xz

New:
----
  kdepimlibs-4.11.97.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kdepimlibs4.spec ++++++
--- /var/tmp/diff_new_pack.Src4AS/_old  2013-12-11 14:32:36.000000000 +0100
+++ /var/tmp/diff_new_pack.Src4AS/_new  2013-12-11 14:32:36.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           kdepimlibs4
-Version:        4.11.90
+Version:        4.11.97
 Release:        0
 Summary:        KDE PIM Libraries
 License:        LGPL-2.1+
@@ -27,8 +27,6 @@
 Patch1:         disable-pth-build.diff
 # ldapkio-kolab3.diff: Add LDAP config for Kolab 3
 Patch2:         ldapkio-kolab3.diff
-# PATCH-FIX-UPSTREAM Fixed-refcounting-in-ETM-and-Monitor.patch -- kde#312460
-Patch100:       Fixed-refcounting-in-ETM-and-Monitor.patch
 BuildRequires:  boost-devel
 BuildRequires:  cyrus-sasl-devel
 BuildRequires:  fdupes
@@ -63,7 +61,6 @@
 %setup -q -n kdepimlibs-%{version}
 %patch1
 %patch2
-%patch100 -p1
 
 %build
   %cmake_kde4 -d build

++++++ kdepimlibs-4.11.90.tar.xz -> kdepimlibs-4.11.97.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/CMakeLists.txt 
new/kdepimlibs-4.11.97/CMakeLists.txt
--- old/kdepimlibs-4.11.90/CMakeLists.txt       2013-11-13 14:11:53.000000000 
+0100
+++ new/kdepimlibs-4.11.97/CMakeLists.txt       2013-11-26 00:43:25.000000000 
+0100
@@ -7,7 +7,7 @@
 ############### The kdepimlibs version (used e.g. in KdepimLibsConfig.cmake) 
###############
 set(KDEPIMLIBS_VERSION_MAJOR 4)
 set(KDEPIMLIBS_VERSION_MINOR 11)
-set(KDEPIMLIBS_VERSION_PATCH 90)
+set(KDEPIMLIBS_VERSION_PATCH 97)
 set(KDEPIMLIBS_VERSION 
${KDEPIMLIBS_VERSION_MAJOR}.${KDEPIMLIBS_VERSION_MINOR}.${KDEPIMLIBS_VERSION_PATCH})
 
 
@@ -20,7 +20,7 @@
 
 set (QT_MIN_VERSION "4.8.0")
 # kdepim depends on the latest released version of kdelibs, ie. 4.x kdepim 
depends on 4.x-1 kdelibs
-find_package(KDE4 4.11 REQUIRED)
+find_package(KDE4 4.11.3 REQUIRED)
 include(KDE4Defaults)
 include(MacroLibrary)
 include(KDEPlatformProfile)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/Mainpage.dox 
new/kdepimlibs-4.11.97/akonadi/Mainpage.dox
--- old/kdepimlibs-4.11.90/akonadi/Mainpage.dox 2013-11-13 14:11:53.000000000 
+0100
+++ new/kdepimlibs-4.11.97/akonadi/Mainpage.dox 2013-11-26 00:43:25.000000000 
+0100
@@ -712,7 +712,7 @@
 
 In Qt Model-View, the application data is stored in a model, and there may be 
one or more views attached to it displaying its contents. The model doesn’t 
have any knowledge of the views, and so it can’t know whether any particular 
Collection is selected, and purge its Iitems.
 
-To solve this, we use the KSelectionProxyModel, which already has a lot of 
code for managing the selection a user makes in a view. A subclass, 
Akonadi::SelectionProxyModel implements a reference counting system which 
increments the refcount of a Collection when it is selected, and decrements it 
when deselected. If the reference count of a Collection goes down to zero, it 
is put in a queue to be purged. It is not purged immediately, but queued 
because if the user is clicking around several Collection in a short time, we 
don’t want to purge the Collections each click or we’d lose the benefit of the 
caching. Like other <a 
href="http://doc.trolltech.com/4.5/qobject.html#receivers";>similar optimisation 
techniques</a>, this violates the object-oriented principle of modularity, but 
it is worth it for the benefit it brings. The effect can be seen in the 
akonadiconsole tool by not filtering out the items from the tree.
+To solve this, we use the KSelectionProxyModel, which already has a lot of 
code for managing the selection a user makes in a view. A subclass, 
Akonadi::SelectionProxyModel implements a reference counting system which 
increments the refcount of a Collection when it is selected, and decrements it 
when deselected. If the reference count of a Collection goes down to zero, it 
is put in a queue to be purged. It is not purged immediately, but queued 
because if the user is clicking around several Collection in a short time, we 
don’t want to purge the Collections each click or we’d lose the benefit of the 
caching. Like other <a 
href="http://qt-project.org/doc/qt-4.7/qobject.html#id-aa43c933-c869-42eb-af14-ff17b8304c96";>similar
 optimisation techniques</a>, this violates the object-oriented principle of 
modularity, but it is worth it for the benefit it brings. The effect can be 
seen in the akonadiconsole tool by not filtering out the items from the tree.
 
 In the screenshots below I removed the filtering out of Items in the tree so 
that the fetching/purging can be seen. In real applications, the Items in the 
tree on the left would not be visible.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/agentbase.cpp 
new/kdepimlibs-4.11.97/akonadi/agentbase.cpp
--- old/kdepimlibs-4.11.90/akonadi/agentbase.cpp        2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/agentbase.cpp        2013-11-26 
00:43:25.000000000 +0100
@@ -52,6 +52,9 @@
 
 #include <signal.h>
 #include <stdlib.h>
+#if defined __GLIBC__
+# include <malloc.h> // for dumping memory information
+#endif
 
 //#define EXPERIMENTAL_INPROCESS_AGENTS 1
 
@@ -361,6 +364,8 @@
     kFatal() << "Unable to register service" << serviceId << "at dbus:" << 
DBusConnectionPool::threadConnection().lastError().message();
   }
   q->setOnlineInternal( mDesiredOnlineState );
+
+  DBusConnectionPool::threadConnection().registerObject( QLatin1String( 
"/Debug" ), this, QDBusConnection::ExportScriptableSlots );
 }
 
 void AgentBasePrivate::setProgramName()
@@ -642,6 +647,46 @@
   }
 }
 
+QString AgentBasePrivate::dumpNotificationListToString() const
+{
+  return mChangeRecorder->dumpNotificationListToString();
+}
+
+void AgentBasePrivate::dumpMemoryInfo() const
+{
+  // Send it to stdout, so we can debug user problems.
+  // since you have to explicitely call this
+  // it won't flood users with release builds.
+  QTextStream stream( stdout );
+  stream << dumpMemoryInfoToString();
+}
+
+QString AgentBasePrivate::dumpMemoryInfoToString() const
+{
+  // man mallinfo for more info
+  QString str;
+#if defined __GLIBC__
+  struct mallinfo mi;
+  mi = mallinfo();
+  QTextStream stream( &str );
+  stream
+    << "Total non-mmapped bytes (arena):      " << mi.arena     << '\n'
+    << "# of free chunks (ordblks):           " << mi.ordblks   << '\n'
+    << "# of free fastbin blocks (smblks>:    " << mi.smblks    << '\n'
+    << "# of mapped regions (hblks):          " << mi.hblks     << '\n'
+    << "Bytes in mapped regions (hblkhd):     " << mi.hblkhd    << '\n'
+    << "Max. total allocated space (usmblks): " << mi.usmblks   << '\n'
+    << "Free bytes held in fastbins (fsmblks):" << mi.fsmblks   << '\n'
+    << "Total allocated space (uordblks):     " << mi.uordblks  << '\n'
+    << "Total free space (fordblks):          " << mi.fordblks  << '\n'
+    << "Topmost releasable block (keepcost):  " << mi.keepcost  << '\n';
+#else
+  str = QLatin1String( "mallinfo() not supported" );
+#endif
+  return str;
+}
+
+
 AgentBase::AgentBase( const QString & id )
   : d_ptr( new AgentBasePrivate( this ) )
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/agentbase_p.h 
new/kdepimlibs-4.11.97/akonadi/agentbase_p.h
--- old/kdepimlibs-4.11.90/akonadi/agentbase_p.h        2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/agentbase_p.h        2013-11-26 
00:43:25.000000000 +0100
@@ -38,6 +38,8 @@
 class AgentBasePrivate : public QObject
 {
   Q_OBJECT
+  Q_CLASSINFO( "D-Bus Interface", "org.kde.dfaure" )
+
   public:
     explicit AgentBasePrivate( AgentBase *parent );
     virtual ~AgentBasePrivate();
@@ -107,6 +109,11 @@
     AgentBase::Observer *mObserver;
 
   public Q_SLOTS:
+    // Dump the contents of the current ChangeReplay
+    Q_SCRIPTABLE QString dumpNotificationListToString() const;
+    Q_SCRIPTABLE void dumpMemoryInfo() const;
+    Q_SCRIPTABLE QString dumpMemoryInfoToString() const;
+
     virtual void itemAdded( const Akonadi::Item &item, const 
Akonadi::Collection &collection );
     virtual void itemChanged( const Akonadi::Item &item, const 
QSet<QByteArray> &partIdentifiers );
     virtual void itemMoved( const Akonadi::Item &, const Akonadi::Collection 
&source, const Akonadi::Collection &destination );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/calendar/CMakeLists.txt 
new/kdepimlibs-4.11.97/akonadi/calendar/CMakeLists.txt
--- old/kdepimlibs-4.11.90/akonadi/calendar/CMakeLists.txt      2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/calendar/CMakeLists.txt      2013-11-26 
00:43:25.000000000 +0100
@@ -14,6 +14,7 @@
 add_subdirectory( tests )
 
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -UQT_NO_CAST_FROM_ASCII 
-UQT_NO_CAST_TO_ASCII ${KDE4_ENABLE_EXCEPTIONS}")
+remove_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII)
 
 set(akonadicalendar_LIB_SRC
   blockalarmsattribute.cpp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/calendar/calendarbase.cpp 
new/kdepimlibs-4.11.97/akonadi/calendar/calendarbase.cpp
--- old/kdepimlibs-4.11.90/akonadi/calendar/calendarbase.cpp    2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/calendar/calendarbase.cpp    2013-11-26 
00:43:25.000000000 +0100
@@ -297,7 +297,13 @@
 
   // Get the real pointer
   oldIncidence = q->MemoryCalendar::incidence( oldIncidence->uid() );
-  Q_ASSERT( oldIncidence );
+
+  if ( !oldIncidence ) {
+    // How can this happen ?
+    kWarning() << "Couldn't find old incidence";
+    Q_ASSERT( false );
+    return;
+  }
 
   if ( newIncidence->instanceIdentifier() == 
oldIncidence->instanceIdentifier() ) {
     kWarning() << "New uid=" << newIncidence->uid() << "; old uid=" << 
oldIncidence->uid()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/collectiondialog.h 
new/kdepimlibs-4.11.97/akonadi/collectiondialog.h
--- old/kdepimlibs-4.11.90/akonadi/collectiondialog.h   2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/collectiondialog.h   2013-11-26 
00:43:25.000000000 +0100
@@ -202,6 +202,7 @@
     Q_PRIVATE_SLOT( d, void slotSelectionChanged() )
     Q_PRIVATE_SLOT( d, void slotAddChildCollection() )
     Q_PRIVATE_SLOT( d, void slotCollectionCreationResult(KJob* job) )
+    Q_PRIVATE_SLOT( d, void slotFilterFixedString( const QString & ) )
     //@endcond
 };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kdepimlibs-4.11.90/akonadi/collectiondialog_desktop.cpp 
new/kdepimlibs-4.11.97/akonadi/collectiondialog_desktop.cpp
--- old/kdepimlibs-4.11.90/akonadi/collectiondialog_desktop.cpp 2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/collectiondialog_desktop.cpp 2013-11-26 
00:43:25.000000000 +0100
@@ -94,15 +94,15 @@
       mRightsFilterModel = new EntityRightsFilterModel( mParent );
       mRightsFilterModel->setSourceModel( mMimeTypeFilterModel );
 
-      KRecursiveFilterProxyModel* filterCollection = new 
KRecursiveFilterProxyModel( mParent );
-      filterCollection->setDynamicSortFilter( true );
-      filterCollection->setSourceModel( mRightsFilterModel );
-      filterCollection->setFilterCaseSensitivity( Qt::CaseInsensitive );
-      mView->setModel( filterCollection );
+      mFilterCollection = new KRecursiveFilterProxyModel( mParent );
+      mFilterCollection->setDynamicSortFilter( true );
+      mFilterCollection->setSourceModel( mRightsFilterModel );
+      mFilterCollection->setFilterCaseSensitivity( Qt::CaseInsensitive );
+      mView->setModel( mFilterCollection );
 
       changeCollectionDialogOptions( options );
       mParent->connect( filterCollectionLineEdit, SIGNAL(textChanged(QString)),
-                        filterCollection, SLOT(setFilterFixedString(QString)) 
);
+                        mParent, SLOT(slotFilterFixedString(QString)) );
 
       mParent->connect( mView->selectionModel(), 
SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
                         mParent, SLOT(slotSelectionChanged()) );
@@ -110,7 +110,7 @@
       mParent->connect( mView, SIGNAL(doubleClicked(QModelIndex)),
                         mParent, SLOT(accept()) );
 
-      mSelectionHandler = new AsyncSelectionHandler( filterCollection, mParent 
);
+      mSelectionHandler = new AsyncSelectionHandler( mFilterCollection, 
mParent );
       mParent->connect( mSelectionHandler, 
SIGNAL(collectionAvailable(QModelIndex)),
                         mParent, SLOT(slotCollectionAvailable(QModelIndex)) );
     }
@@ -124,6 +124,12 @@
       mView->expandAll();
       mView->setCurrentIndex( index );
     }
+    void slotFilterFixedString( const QString &filter)
+    {
+      mFilterCollection->setFilterFixedString(filter); 
+      if (mKeepTreeExpanded)
+         mView->expandAll();
+    }
 
     CollectionDialog *mParent;
 
@@ -135,6 +141,7 @@
     QLabel *mTextLabel;
     bool mAllowToCreateNewChildCollection;
     bool mKeepTreeExpanded;
+    KRecursiveFilterProxyModel *mFilterCollection;
 
     void slotSelectionChanged();
     void slotAddChildCollection();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kdepimlibs-4.11.90/akonadi/collectiondialog_mobile.cpp 
new/kdepimlibs-4.11.97/akonadi/collectiondialog_mobile.cpp
--- old/kdepimlibs-4.11.90/akonadi/collectiondialog_mobile.cpp  2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/collectiondialog_mobile.cpp  2013-11-26 
00:43:25.000000000 +0100
@@ -132,6 +132,10 @@
   mSelectionModel->setCurrentIndex( index, QItemSelectionModel::ClearAndSelect 
);
 }
 
+void CollectionDialog::Private::slotFilterFixedString( const QString &filter)
+{
+}
+
 void CollectionDialog::Private::slotSelectionChanged()
 {
   mOkButtonEnabled = mSelectionModel->hasSelection();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/collectionmodel.cpp 
new/kdepimlibs-4.11.97/akonadi/collectionmodel.cpp
--- old/kdepimlibs-4.11.90/akonadi/collectionmodel.cpp  2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/collectionmodel.cpp  2013-11-26 
00:43:25.000000000 +0100
@@ -220,7 +220,6 @@
   Q_D( const CollectionModel );
 
   // Pass modeltest.
-  // http://labs.trolltech.com/forums/topic/79
   if ( !index.isValid() ) {
     return 0;
   }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kdepimlibs-4.11.90/akonadi/contact/emailaddressselectionwidget.cpp 
new/kdepimlibs-4.11.97/akonadi/contact/emailaddressselectionwidget.cpp
--- old/kdepimlibs-4.11.90/akonadi/contact/emailaddressselectionwidget.cpp      
2013-11-13 14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/contact/emailaddressselectionwidget.cpp      
2013-11-26 00:43:25.000000000 +0100
@@ -58,6 +58,7 @@
     SearchLineEdit( QWidget *receiver, QWidget *parent = 0 )
       : KLineEdit( parent ), mReceiver( receiver )
     {
+        setClearButtonShown( true );
     }
 
   protected:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/entitycache_p.h 
new/kdepimlibs-4.11.97/akonadi/entitycache_p.h
--- old/kdepimlibs-4.11.90/akonadi/entitycache_p.h      2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/entitycache_p.h      2013-11-26 
00:43:25.000000000 +0100
@@ -441,7 +441,7 @@
       // make sure we find this node again if something went wrong here,
       // most likely the object got deleted from the server in the meantime
       if ( !result.isValid() ) {
-        node->entity = Item( id );
+        node->entity = T( id );
         node->invalid = true;
       } else {
         node->entity = result;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/entitytreemodel.cpp 
new/kdepimlibs-4.11.97/akonadi/entitytreemodel.cpp
--- old/kdepimlibs-4.11.90/akonadi/entitytreemodel.cpp  2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/entitytreemodel.cpp  2013-11-26 
00:43:25.000000000 +0100
@@ -358,7 +358,6 @@
 {
   Q_D( const EntityTreeModel );
   // Pass modeltest.
-  // http://labs.trolltech.com/forums/topic/79
   if ( !index.isValid() ) {
     return 0;
   }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/entitytreemodel_p.cpp 
new/kdepimlibs-4.11.97/akonadi/entitytreemodel_p.cpp
--- old/kdepimlibs-4.11.90/akonadi/entitytreemodel_p.cpp        2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/entitytreemodel_p.cpp        2013-11-26 
00:43:25.000000000 +0100
@@ -1569,20 +1569,9 @@
 bool EntityTreeModelPrivate::shouldPurge( Collection::Id id )
 {
   // reference counted collections should never be purged
-  // they first have to be deref'ed until they reach 0
-  if ( m_monitor->d_ptr->refCountMap.contains( id ) ) {
-    return false;
-  }
-
-  // if the collection is buffered, keep it
-  if ( m_monitor->d_ptr->m_buffer.isBuffered( id ) ) {
-    return false;
-  }
-
-  static const int MAXITEMS = 10000;
-
-  // if we do not exceed the maximum items limit, keep it
-  if ( m_items.size() < MAXITEMS ) {
+  // they first have to be deref'ed until they reach 0.
+  // if the collection is buffered, keep it.
+  if ( m_monitor->d_ptr->isMonitored( id ) ) {
     return false;
   }
 
@@ -1902,6 +1891,11 @@
       return false;
     }
 
+    // If the collection is no longer monitored by the monitor we have to 
refetch
+    if ( !m_monitor->d_ptr->isMonitored( colId ) ) {
+      return true;
+    }
+
     // Collections which contain no items at all can't contain more
     if ( m_collectionsWithoutItems.contains( colId ) ) {
       return false;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/itemfetchjob.cpp 
new/kdepimlibs-4.11.97/akonadi/itemfetchjob.cpp
--- old/kdepimlibs-4.11.90/akonadi/itemfetchjob.cpp     2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/itemfetchjob.cpp     2013-11-26 
00:43:25.000000000 +0100
@@ -230,6 +230,13 @@
   return d->mResultItems;
 }
 
+void ItemFetchJob::clearItems()
+{
+  Q_D( ItemFetchJob );
+
+  d->mResultItems.clear();
+}
+
 void ItemFetchJob::setFetchScope( ItemFetchScope &fetchScope )
 {
   Q_D( ItemFetchJob );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/itemfetchjob.h 
new/kdepimlibs-4.11.97/akonadi/itemfetchjob.h
--- old/kdepimlibs-4.11.90/akonadi/itemfetchjob.h       2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/itemfetchjob.h       2013-11-26 
00:43:25.000000000 +0100
@@ -130,7 +130,7 @@
     virtual ~ItemFetchJob();
 
     /**
-     * Returns the fetched item.
+     * Returns the fetched items.
      *
      * @note The items are invalid before the result( KJob* )
      *       signal has been emitted or if an error occurred.
@@ -138,6 +138,12 @@
     Item::List items() const;
 
     /**
+     * Save memory by clearing the fetched items.
+     * @since 4.12
+     */
+    void clearItems();
+
+    /**
      * Sets the item fetch scope.
      *
      * The ItemFetchScope controls how much of an item's data is fetched
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/itemsearchjob.cpp 
new/kdepimlibs-4.11.97/akonadi/itemsearchjob.cpp
--- old/kdepimlibs-4.11.90/akonadi/itemsearchjob.cpp    2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/itemsearchjob.cpp    2013-11-26 
00:43:25.000000000 +0100
@@ -25,6 +25,7 @@
 #include "protocolhelper_p.h"
 
 #include <QtCore/QTimer>
+#include <QThreadStorage>
 
 using namespace Akonadi;
 
@@ -57,8 +58,26 @@
     QTimer* mEmitTimer;
 };
 
+QThreadStorage<Session *> instances;
+
+static Session *defaultSearchSession()
+{
+  if ( !instances.hasLocalData() ) {
+    const QByteArray sessionName = Session::defaultSession()->sessionId() + 
"-SearchSession";
+    instances.setLocalData( new Session( sessionName ) );
+  }
+  return instances.localData();
+}
+
+static QObject *sessionForJob( QObject *parent )
+{
+  if ( qobject_cast<Job *>(parent) || qobject_cast<Session *>(parent) )
+    return parent;
+  return defaultSearchSession();
+}
+
 ItemSearchJob::ItemSearchJob( const QString & query, QObject * parent )
-  : Job( new ItemSearchJobPrivate( this, query ), parent )
+  : Job( new ItemSearchJobPrivate( this, query ), sessionForJob( parent ) )
 {
   Q_D( ItemSearchJob );
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/job.cpp 
new/kdepimlibs-4.11.97/akonadi/job.cpp
--- old/kdepimlibs-4.11.90/akonadi/job.cpp      2013-11-13 14:11:53.000000000 
+0100
+++ new/kdepimlibs-4.11.97/akonadi/job.cpp      2013-11-26 00:43:25.000000000 
+0100
@@ -129,6 +129,7 @@
       // We do these dbus calls manually, so as to avoid having to install (or 
copy) the console's
       // xml interface document. Since this is purely a debugging aid, that 
seems preferable to
       // publishing something not intended for public consumption.
+      // WARNING: for any signature change here, apply it to 
resourcescheduler.cpp too
       QList<QVariant> argumentList;
       argumentList << QLatin1String( mSession->sessionId() )
                    << QString::number(reinterpret_cast<quintptr>( q ), 16)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/monitor_p.cpp 
new/kdepimlibs-4.11.97/akonadi/monitor_p.cpp
--- old/kdepimlibs-4.11.90/akonadi/monitor_p.cpp        2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/monitor_p.cpp        2013-11-26 
00:43:25.000000000 +0100
@@ -169,15 +169,16 @@
     || ( op == NotificationMessageV2::Link )
     || ( op == NotificationMessageV2::Unlink ) )
   {
-    if ( refCountMap.contains( parentCollectionId ) || m_buffer.isBuffered( 
parentCollectionId ) )
+    if ( isMonitored( parentCollectionId ) ) {
       return false;
+    }
   }
 
   if ( op == NotificationMessageV2::Move )
   {
-    if ( !refCountMap.contains( parentCollectionId ) && !m_buffer.isBuffered( 
parentCollectionId ) )
-      if ( !refCountMap.contains( msg.parentDestCollection() ) && 
!m_buffer.isBuffered( msg.parentDestCollection() ) )
-        return true;
+    if ( !isMonitored( parentCollectionId ) && !isMonitored( 
msg.parentDestCollection() ) ) {
+      return true;
+    }
     // We can't ignore the move. It must be transformed later into a removal 
or insertion.
     return false;
   }
@@ -489,8 +490,8 @@
   bool destWatched = false;
 
   if ( useRefCounting && msg.type() == NotificationMessageV2::Items ) {
-    sourceWatched = refCountMap.contains( msg.parentCollection() ) || 
m_buffer.isBuffered( msg.parentCollection() );
-    destWatched = refCountMap.contains( msg.parentDestCollection() ) || 
m_buffer.isBuffered( msg.parentDestCollection() );
+    sourceWatched = isMonitored( msg.parentCollection() );
+    destWatched = isMonitored( msg.parentDestCollection() );
   } else {
     if ( !resources.isEmpty() ) {
       sourceWatched = resources.contains( msg.resource() );
@@ -906,8 +907,9 @@
   if ( --refCountMap[ id ] == 0 )
   {
     refCountMap.remove( id );
+    return m_buffer.buffer( id );
   }
-  return m_buffer.buffer( id );
+  return -1;
 }
 
 void MonitorPrivate::PurgeBuffer::purge( Collection::Id id )
@@ -932,6 +934,19 @@
   return bumpedId;
 }
 
+int MonitorPrivate::PurgeBuffer::buffersize()
+{
+  return MAXBUFFERSIZE;
+}
+
+bool MonitorPrivate::isMonitored( Entity::Id colId ) const
+{
+  if ( !useRefCounting ) {
+    return true;
+  }
+  return refCountMap.contains( colId ) || m_buffer.isBuffered( colId );
+}
+
 void MonitorPrivate::notifyCollectionStatisticsWatchers(Entity::Id collection, 
const QByteArray& resource) {
   if ( collection > 0 && (monitorAll || isCollectionMonitored( collection ) || 
resources.contains( resource ) ) ) {
     recentlyChangedCollections.insert( collection );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/monitor_p.h 
new/kdepimlibs-4.11.97/akonadi/monitor_p.h
--- old/kdepimlibs-4.11.90/akonadi/monitor_p.h  2013-11-13 14:11:53.000000000 
+0100
+++ new/kdepimlibs-4.11.97/akonadi/monitor_p.h  2013-11-26 00:43:25.000000000 
+0100
@@ -170,7 +170,7 @@
 
       Check whether a Collection is buffered using the isBuffered method.
     */
-    class PurgeBuffer
+    class AKONADI_TESTS_EXPORT PurgeBuffer
     {
       // Buffer the most recent 10 unreferenced Collections
       static const int MAXBUFFERSIZE = 10;
@@ -196,6 +196,8 @@
         return m_buffer.contains( id );
       }
 
+      static int buffersize();
+
     private:
       QQueue<Collection::Id> m_buffer;
     } m_buffer;
@@ -205,6 +207,17 @@
     void ref( Collection::Id id );
     Collection::Id deref( Collection::Id id );
 
+    /**
+     * Returns true if the collection is monitored by monitor.
+     *
+     * A collection is always monitored if useRefCounting is false.
+     * If ref counting is used, the collection is only monitored,
+     * if the collection is either in refCountMap or m_buffer.
+     * If ref counting is used and the collection is not in refCountMap or 
m_buffer,
+     * no updates for the contained items are emitted, because they are lazily 
ignored.
+     */
+    bool isMonitored( Collection::Id colId ) const;
+
   private:
     // collections that need a statistics update
     QSet<Collection::Id> recentlyChangedCollections;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/notes/CMakeLists.txt 
new/kdepimlibs-4.11.97/akonadi/notes/CMakeLists.txt
--- old/kdepimlibs-4.11.90/akonadi/notes/CMakeLists.txt 2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/notes/CMakeLists.txt 2013-11-26 
00:43:25.000000000 +0100
@@ -5,6 +5,7 @@
 )
 
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -UQT_NO_CAST_FROM_ASCII 
-UQT_NO_CAST_TO_ASCII ${KDE4_ENABLE_EXCEPTIONS}")
+remove_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII)
 
 set(akonadinotes_LIB_SRC
   noteutils.cpp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/qtest_akonadi.h 
new/kdepimlibs-4.11.97/akonadi/qtest_akonadi.h
--- old/kdepimlibs-4.11.90/akonadi/qtest_akonadi.h      2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/qtest_akonadi.h      2013-11-26 
00:43:25.000000000 +0100
@@ -62,8 +62,9 @@
  * Checks that the test is running in the proper test environment
  */
 void checkTestIsIsolated() {
-  QVERIFY2( !qgetenv( "TESTRUNNER_DB_ENVIRONMENT" ).isEmpty(),
-            "This test must be run using ctest, in order to use the testrunner 
environment. Aborting, to avoid messing up your real akonadi" );
+  Q_ASSERT_X( !qgetenv( "TESTRUNNER_DB_ENVIRONMENT" ).isEmpty(),
+              "AkonadiTest::checkTestIsIsolated",
+              "This test must be run using ctest, in order to use the 
testrunner environment. Aborting, to avoid messing up your real akonadi" );
 }
 
 /**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/resourcebase.cpp 
new/kdepimlibs-4.11.97/akonadi/resourcebase.cpp
--- old/kdepimlibs-4.11.90/akonadi/resourcebase.cpp     2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/resourcebase.cpp     2013-11-26 
00:43:25.000000000 +0100
@@ -60,10 +60,6 @@
 #include <QApplication>
 #include <QtDBus/QtDBus>
 
-#if defined __GLIBC__
-# include <malloc.h> // for dumping memory information
-#endif
-
 using namespace Akonadi;
 
 class Akonadi::ResourceBasePrivate : public AgentBasePrivate
@@ -182,12 +178,6 @@
     }
 
   public Q_SLOTS:
-    // Dump the contents of the current ChangeReplay
-    Q_SCRIPTABLE QString dumpNotificationListToString() const
-    {
-      return mChangeRecorder->dumpNotificationListToString();
-    }
-
     // Dump the state of the scheduler
     Q_SCRIPTABLE QString dumpToString() const
     {
@@ -207,38 +197,6 @@
       scheduler->clear();
     }
 
-    Q_SCRIPTABLE void dumpMemoryInfo() const
-    {
-      // Send it to stdout, so we can debug user problems.
-      // since you have to explicitely call this
-      // it won't flood users with release builds.
-      QTextStream stream( stdout );
-      stream << dumpMemoryInfoToString();
-    }
-
-    Q_SCRIPTABLE QString dumpMemoryInfoToString() const
-    {
-      // man mallinfo for more info
-      QString str;
-#if defined __GLIBC__
-      struct mallinfo mi;
-      mi = mallinfo();
-      QTextStream stream( &str );
-      stream << "Total non-mmapped bytes (arena):      " << mi.arena     << 
'\n'
-             << "# of free chunks (ordblks):           " << mi.ordblks   << 
'\n'
-             << "# of free fastbin blocks (smblks>:    " << mi.smblks    << 
'\n'
-             << "# of mapped regions (hblks):          " << mi.hblks     << 
'\n'
-             << "Bytes in mapped regions (hblkhd):     " << mi.hblkhd    << 
'\n'
-             << "Max. total allocated space (usmblks): " << mi.usmblks   << 
'\n'
-             << "Free bytes held in fastbins (fsmblks):" << mi.fsmblks   << 
'\n'
-             << "Total allocated space (uordblks):     " << mi.uordblks  << 
'\n'
-             << "Total free space (fordblks):          " << mi.fordblks  << 
'\n'
-             << "Topmost releasable block (keepcost):  " << mi.keepcost  << 
'\n';
-#else
-      str = QLatin1String( "mallinfo() not supported" );
-#endif
-      return str;
-    }
 
   protected Q_SLOTS:
     // reimplementations from AgentbBasePrivate, containing sanity checks that 
only apply to resources
@@ -481,8 +439,6 @@
   if ( !d->mChangeRecorder->isEmpty() )
     d->scheduler->scheduleChangeReplay();
 
-  DBusConnectionPool::threadConnection().registerObject( QLatin1String( 
"/Debug" ), d, QDBusConnection::ExportScriptableSlots );
-
   new ResourceSelectJob( identifier() );
 
   connect( d->mChangeRecorder->session(), SIGNAL(reconnected()), 
SLOT(slotSessionReconnected()) );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/resourcescheduler.cpp 
new/kdepimlibs-4.11.97/akonadi/resourcescheduler.cpp
--- old/kdepimlibs-4.11.90/akonadi/resourcescheduler.cpp        2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/resourcescheduler.cpp        2013-11-26 
00:43:25.000000000 +0100
@@ -77,7 +77,7 @@
   if ( queue.contains( t ) || mCurrentTask == t )
     return;
   queue << t;
-  signalTaskToTracker( t, "SyncCollection" );
+  signalTaskToTracker( t, "SyncCollection", QString::number( col.id() ) );
   scheduleNext();
 }
 
@@ -91,7 +91,7 @@
   if ( queue.contains( t ) || mCurrentTask == t )
     return;
   queue << t;
-  signalTaskToTracker( t, "SyncCollectionAttributes" );
+  signalTaskToTracker( t, "SyncCollectionAttributes", QString::number( 
collection.id() ) );
   scheduleNext();
 }
 
@@ -119,7 +119,7 @@
 
   t.dbusMsgs << msg;
   queue << t;
-  signalTaskToTracker( t, "FetchItem" );
+  signalTaskToTracker( t, "FetchItem", QString::number( item.id() ) );
   scheduleNext();
 }
 
@@ -144,7 +144,7 @@
   if ( queue.contains( t ) || mCurrentTask == t )
     return;
   queue << t;
-  signalTaskToTracker( t, "InvalideCacheForCollection" );
+  signalTaskToTracker( t, "InvalideCacheForCollection", QString::number( 
collection.id() ) );
   scheduleNext();
 }
 
@@ -173,7 +173,7 @@
     return;
 
   queue << t;
-  signalTaskToTracker( t, "RecursiveMoveReplay" );
+  signalTaskToTracker( t, "RecursiveMoveReplay", QString::number( 
t.collection.id() ) );
   scheduleNext();
 }
 
@@ -401,7 +401,7 @@
   }
 }
 
-void ResourceScheduler::signalTaskToTracker( const Task &task, const 
QByteArray &taskType )
+void ResourceScheduler::signalTaskToTracker( const Task &task, const 
QByteArray &taskType, const QString &debugString )
 {
   // if there's a job tracer running, tell it about the new job
   if ( !s_resourcetracker && 
DBusConnectionPool::threadConnection().interface()->isServiceRegistered(QLatin1String(
 "org.kde.akonadiconsole" ) ) ) {
@@ -413,10 +413,12 @@
 
   if ( s_resourcetracker ) {
     QList<QVariant> argumentList;
-    argumentList << static_cast<AgentBase*>(  parent() )->identifier()
-                 << QString::number( task.serial )
-                 << QString()
-                 << QString::fromLatin1( taskType );
+    argumentList << static_cast<AgentBase*>( parent() )->identifier()  // 
"session" (in our case resource)
+                 << QString::number( task.serial )                     // "job"
+                 << QString()                                          // 
"parent job"
+                 << QString::fromLatin1( taskType )                    // "job 
type"
+                 << debugString                                        // "job 
debugging string"
+                 ;
     s_resourcetracker->asyncCallWithArgumentList(QLatin1String( "jobCreated" 
), argumentList);
   }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/resourcescheduler_p.h 
new/kdepimlibs-4.11.97/akonadi/resourcescheduler_p.h
--- old/kdepimlibs-4.11.90/akonadi/resourcescheduler_p.h        2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/resourcescheduler_p.h        2013-11-26 
00:43:25.000000000 +0100
@@ -236,7 +236,7 @@
     void executeNext();
 
   private:
-    void signalTaskToTracker( const Task &task, const QByteArray &taskType );
+    void signalTaskToTracker( const Task &task, const QByteArray &taskType, 
const QString &debugString = QString() );
 
     // We have a number of task queues, by order of priority.
     // * ChangeReplay must be first:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/akonadi/tests/CMakeLists.txt 
new/kdepimlibs-4.11.97/akonadi/tests/CMakeLists.txt
--- old/kdepimlibs-4.11.90/akonadi/tests/CMakeLists.txt 2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/tests/CMakeLists.txt 2013-11-26 
00:43:25.000000000 +0100
@@ -138,3 +138,4 @@
 add_akonadi_isolated_test(collectioncreator.cpp)
 add_akonadi_isolated_test(itembenchmark.cpp)
 add_akonadi_isolated_test(gidtest.cpp)
+add_akonadi_isolated_test(lazypopulationtest.cpp)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kdepimlibs-4.11.90/akonadi/tests/lazypopulationtest.cpp 
new/kdepimlibs-4.11.97/akonadi/tests/lazypopulationtest.cpp
--- old/kdepimlibs-4.11.90/akonadi/tests/lazypopulationtest.cpp 1970-01-01 
01:00:00.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/tests/lazypopulationtest.cpp 2013-11-26 
00:43:25.000000000 +0100
@@ -0,0 +1,188 @@
+/*
+    Copyright (c) 2013 Christian Mollekopf <mollek...@kolabsys.com>
+
+    This library is free software; you can redistribute it and/or modify it
+    under the terms of the GNU Library General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or (at your
+    option) any later version.
+
+    This library is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
+    License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to the
+    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+    02110-1301, USA.
+*/
+
+#include <QObject>
+
+#include "test_utils.h"
+
+#include <KStandardDirs>
+#include <akonadi/entitytreemodel.h>
+#include <akonadi/control.h>
+#include <akonadi/entitytreemodel_p.h>
+#include <akonadi/monitor_p.h>
+#include <akonadi/changerecorder_p.h>
+#include <akonadi/qtest_akonadi.h>
+#include <akonadi/collectioncreatejob.h>
+#include <akonadi/itemcreatejob.h>
+
+using namespace Akonadi;
+
+/**
+ * This is a test for the LazyPopulation of the ETM and the associated 
refcounting in the Monitor.
+ */
+class LazyPopulationTest : public QObject
+{
+  Q_OBJECT
+
+private slots:
+  void initTestCase();
+
+  /**
+   * Test a complete scenario that checks:
+   * * loading on referencing
+   * * buffering after referencing
+   * * purging after the collection leaves the buffer
+   * * not-fetching when a collection is not buffered and not referenced
+   * * reloading after a collection becomes referenced again
+   */
+  void testItemAdded();
+};
+
+void LazyPopulationTest::initTestCase()
+{
+  AkonadiTest::checkTestIsIsolated();
+  Akonadi::Control::start();
+  AkonadiTest::setAllResourcesOffline();
+}
+
+
+QModelIndex getIndex(const QString &string, EntityTreeModel *model)
+{
+  QModelIndexList list = model->match( model->index( 0, 0 ), Qt::DisplayRole, 
string, 1, Qt::MatchRecursive );
+  if ( list.isEmpty() ) {
+    return QModelIndex();
+  }
+  return list.first();
+}
+
+/**
+ * Since we have no sensible way to figure out if the model is fully populated,
+ * we use the brute force approach.
+ */
+bool waitForPopulation(const QModelIndex &idx, EntityTreeModel *model, int 
count)
+{
+  for (int i = 0; i < 500; i++) {
+    if (model->rowCount(idx) >= count) {
+      return true;
+    }
+    QTest::qWait(10);
+  }
+  return false;
+}
+
+void LazyPopulationTest::testItemAdded()
+{
+  Collection res3 = Collection( collectionIdFromPath( "res3" ) );
+
+  const QString mainCollectionName("main");
+  Collection monitorCol;
+  {
+    monitorCol.setParentCollection(res3);
+    monitorCol.setName(mainCollectionName);
+    CollectionCreateJob *create = new CollectionCreateJob(monitorCol, this);
+    AKVERIFYEXEC(create);
+    monitorCol = create->collection();
+  }
+
+  //Number of buffered collections in the monitor
+  const int bufferSize = MonitorPrivate::PurgeBuffer::buffersize();
+  for (int i = 0; i < bufferSize; i++) {
+    Collection col;
+    col.setParentCollection(res3);
+    col.setName(QString("col%1").arg(i));
+    CollectionCreateJob *create = new CollectionCreateJob(col, this);
+    AKVERIFYEXEC(create);
+  }
+
+  Item item1;
+  {
+    item1.setMimeType( "application/octet-stream" );
+    ItemCreateJob *append = new ItemCreateJob(item1, monitorCol, this);
+    AKVERIFYEXEC(append);
+    item1 = append->item();
+  }
+
+  ChangeRecorder *changeRecorder = new ChangeRecorder(this);
+  changeRecorder->setCollectionMonitored(Collection::root());
+  EntityTreeModel *model = new EntityTreeModel( changeRecorder, this );
+  model->setItemPopulationStrategy(Akonadi::EntityTreeModel::LazyPopulation);
+
+  const int numberOfRootCollections = 4;
+  //Wait for initial listing to complete
+  QVERIFY(waitForPopulation(QModelIndex(), model, numberOfRootCollections));
+
+  const QModelIndex res3Index = getIndex("res3", model);
+  QVERIFY(waitForPopulation(res3Index, model, bufferSize + 1));
+
+  QModelIndex monitorIndex = getIndex(mainCollectionName, model);
+  QVERIFY(monitorIndex.isValid());
+
+  //---Check that the item is present after the collection was referenced
+  model->setData(monitorIndex, QVariant(), EntityTreeModel::CollectionRefRole);
+  model->fetchMore(monitorIndex);
+  //Wait for collection to be fetched
+  QVERIFY(waitForPopulation(monitorIndex, model, 1));
+
+  //The item should now be present
+  QCOMPARE(model->index(0, 0, 
monitorIndex).data(Akonadi::EntityTreeModel::ItemIdRole).value<Akonadi::Item::Id>(),
 item1.id());
+
+  //---ensure item1 is still available after no longer being referenced due to 
buffering
+  model->setData(monitorIndex, QVariant(), 
EntityTreeModel::CollectionDerefRole);
+  QCOMPARE(model->index(0, 0, 
monitorIndex).data(Akonadi::EntityTreeModel::ItemIdRole).value<Akonadi::Item::Id>(),
 item1.id());
+
+  //---ensure item1 gets purged after the collection is no longer buffered
+  //Get the monitorCol out of the buffer
+  for (int i = 0; i < bufferSize-1; i++) {
+    QModelIndex idx = getIndex(QString("col%1").arg(i), model);
+    QVERIFY(idx.isValid());
+    model->setData(idx, QVariant(), EntityTreeModel::CollectionRefRole);
+    model->setData(idx, QVariant(), EntityTreeModel::CollectionDerefRole);
+  }
+  //The collection is still in the buffer...
+  QCOMPARE(model->rowCount(monitorIndex), 1);
+  {
+    QModelIndex idx = getIndex(QString("col%1").arg(bufferSize-1), model);
+    QVERIFY(idx.isValid());
+    model->setData(idx, QVariant(), EntityTreeModel::CollectionRefRole);
+    model->setData(idx, QVariant(), EntityTreeModel::CollectionDerefRole);
+  }
+  //...and now purged
+  QCOMPARE(model->rowCount(monitorIndex), 0);
+
+  //---ensure item2 added to unbuffered and unreferenced collection is not 
added to the model
+  Item item2;
+  {
+    item2.setMimeType( "application/octet-stream" );
+    ItemCreateJob *append = new ItemCreateJob(item2, monitorCol, this);
+    AKVERIFYEXEC(append);
+    item2 = append->item();
+  }
+  QCOMPARE(model->rowCount(monitorIndex), 0);
+
+  //---ensure all items are loaded after re-referencing the collection
+  model->setData(monitorIndex, QVariant(), EntityTreeModel::CollectionRefRole);
+  model->fetchMore(monitorIndex);
+  //Wait for collection to be fetched
+  QVERIFY(waitForPopulation(monitorIndex, model, 2));
+  QCOMPARE(model->rowCount(monitorIndex), 2);
+}
+
+#include "lazypopulationtest.moc"
+
+QTEST_AKONADIMAIN(LazyPopulationTest, NoGUI)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kdepimlibs-4.11.90/akonadi/tests/testresource/knutresource.desktop 
new/kdepimlibs-4.11.97/akonadi/tests/testresource/knutresource.desktop
--- old/kdepimlibs-4.11.90/akonadi/tests/testresource/knutresource.desktop      
2013-11-13 14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/akonadi/tests/testresource/knutresource.desktop      
2013-11-26 00:43:25.000000000 +0100
@@ -11,6 +11,7 @@
 Name[hu]=Knut
 Name[ia]=Knut
 Name[kk]=Knut
+Name[nb]=Knut
 Name[nl]=Knut
 Name[nn]=Knut
 Name[pt]=Knut
@@ -37,6 +38,7 @@
 Comment[hu]=Egy ügynök hibakeresési céllal
 Comment[ia]=Un agente con propositos de debugging
 Comment[kk]=Жөндеу агенті
+Comment[nb]=En agent for feilsøking
 Comment[nl]=Een agent voor debugging-doeleinden
 Comment[nn]=Ein agent til feilsøking
 Comment[pt]=Um agente para fins de depuração
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/kabc/addressee.h 
new/kdepimlibs-4.11.97/kabc/addressee.h
--- old/kdepimlibs-4.11.90/kabc/addressee.h     2013-11-13 14:11:53.000000000 
+0100
+++ new/kdepimlibs-4.11.97/kabc/addressee.h     2013-11-26 00:43:25.000000000 
+0100
@@ -980,7 +980,7 @@
     class Private;
     QSharedDataPointer<Private> d;
 };
-#ifdef MAKE_KABC_LIB
+#ifdef kabc_EXPORTS
 KDE_DUMMY_QHASH_FUNCTION( Addressee )
 #endif
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kdepimlibs-4.11.90/kabc/plugins/file/kabc_file_core_export.h 
new/kdepimlibs-4.11.97/kabc/plugins/file/kabc_file_core_export.h
--- old/kdepimlibs-4.11.90/kabc/plugins/file/kabc_file_core_export.h    
2013-11-13 14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/kabc/plugins/file/kabc_file_core_export.h    
1970-01-01 01:00:00.000000000 +0100
@@ -1,39 +0,0 @@
-/*
-  This file is part of the kabc library.
-  Copyright (c) 2006-2007 Allen Winter <win...@kde.org>
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Library General Public
-  License as published by the Free Software Foundation; either
-  version 2 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Library General Public License for more details.
-
-  You should have received a copy of the GNU Library General Public License
-  along with this library; see the file COPYING.LIB.  If not, write to
-  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-  Boston, MA 02110-1301, USA.
-*/
-
-#ifndef KABC_FILE_CORE_EXPORT_H
-#define KABC_FILE_CORE_EXPORT_H
-
-#include <kdemacros.h>
-
-#ifndef KABC_FILE_CORE_EXPORT
-# if defined(KDEPIM_STATIC_LIBS)
-   /* No export/import for static libraries */
-#  define KABC_FILE_CORE_EXPORT
-# elif defined(MAKE_KABC_FILE_CORE_LIB)
-   /* We are building this library */
-#  define KABC_FILE_CORE_EXPORT KDE_EXPORT
-# else
-   /* We are using this library */
-#  define KABC_FILE_CORE_EXPORT KDE_IMPORT
-# endif
-#endif
-
-#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/kabc/tests/CMakeLists.txt 
new/kdepimlibs-4.11.97/kabc/tests/CMakeLists.txt
--- old/kdepimlibs-4.11.90/kabc/tests/CMakeLists.txt    2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/kabc/tests/CMakeLists.txt    2013-11-26 
00:43:25.000000000 +0100
@@ -1,5 +1,5 @@
 set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
-include_directories( ${CMAKE_SOURCE_DIR}/kabc )
+include_directories( ${CMAKE_SOURCE_DIR}/kabc 
${CMAKE_BINARY_DIR}/kabc/plugins/file)
 
 ########### next target ###############
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kdepimlibs-4.11.90/kholidays/holidays/plan2/holiday_ar_es 
new/kdepimlibs-4.11.97/kholidays/holidays/plan2/holiday_ar_es
--- old/kdepimlibs-4.11.90/kholidays/holidays/plan2/holiday_ar_es       
2013-11-13 14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/kholidays/holidays/plan2/holiday_ar_es       
2013-11-26 00:43:25.000000000 +0100
@@ -5,9 +5,9 @@
 ::
 :: Author:   Daniel Vega <d...@dc.uba.ar>
 ::
-:: Updated:  18-JAN-2013
+:: Updated:  14-NOV-2013
 ::
-:: Source:   Decretos 1584/2010 , 1585/2010 , 67/2010 y 521/2011
+:: Source:   Decretos 1584/2010 , 1585/2010 , 67/2010 , 521/2011 y 1768/2013
 ::           
http://www.boletinoficial.gov.ar/DisplayPdf.aspx?f=20101103&s=01&pd=1&pa=3
 ::           http://www.lanacion.com.ar/anexos/informe/08/53008.pdf
 ::           http://www.adecra.org.ar/nuevaweb/gestion/rrhh/CENSO2010.pdf
@@ -35,21 +35,34 @@
 "Inmaculada Concepción de María"  weekend on december 8
 "Navidad"                         weekend on december 25
 
+:: Special designated holdays
+
 "Censo Nacional"                  weekend on 27.10.2010
 
+"Bicentenario de la Bandera"      weekend on 27.02.2012
+"Bicentenario Batalla de Tucumán" weekend on 24.09.2012
+
+"Bicentenario Asamblea Año XIII"  weekend on 31.01.2013
+"Bicentenario Batalla de Salta"   weekend on 20.02.2013
+
 "Feriado Turístico"               weekend on 25.03.2011
 "Feriado Turístico"               weekend on 09.12.2011
 
-"Bicentenario de la Bandera"      weekend on 27.02.2012
 "Feriado Turístico"               weekend on 30.04.2012
-"Bicentenario Batalla de Tucumán" weekend on 24.09.2012
 "Feriado Turístico"               weekend on 24.12.2012
 
-"Bicentenario Asamblea Año XIII"  weekend on 31.01.2013
-"Bicentenario Batalla de Salta"   weekend on 20.02.2013
 "Feriado Turístico"               weekend on 01.04.2013
 "Feriado Turístico"               weekend on 21.06.2013
 
+"Feriado Turístico"               weekend on 02.05.2014
+"Feriado Turístico"               weekend on 26.12.2014
+
+"Feriado Turístico"               weekend on 23.03.2015
+"Feriado Turístico"               weekend on 07.12.2015
+
+"Feriado Turístico"               weekend on 08.07.2016
+"Feriado Turístico"               weekend on 09.12.2016
+
 
 :: Religious
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/kimap/fetchjob.h 
new/kdepimlibs-4.11.97/kimap/fetchjob.h
--- old/kdepimlibs-4.11.90/kimap/fetchjob.h     2013-11-13 14:11:53.000000000 
+0100
+++ new/kdepimlibs-4.11.97/kimap/fetchjob.h     2013-11-26 00:43:25.000000000 
+0100
@@ -68,7 +68,7 @@
      * what is fetched that the IMAP FETCH command normally
      * does, but the common cases are catered for.
      */
-    class FetchScope
+    class KIMAP_EXPORT FetchScope
     {
     public:
       FetchScope();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/kimap/sessionthread.cpp 
new/kdepimlibs-4.11.97/kimap/sessionthread.cpp
--- old/kdepimlibs-4.11.90/kimap/sessionthread.cpp      2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/kimap/sessionthread.cpp      2013-11-26 
00:43:25.000000000 +0100
@@ -274,6 +274,7 @@
 // Called in secondary thread
 void SessionThread::sslConnected()
 {
+  doSslFallback = false;
   Q_ASSERT( QThread::currentThread() == thread() );
   if ( !m_socket )
     return;
@@ -290,7 +291,6 @@
      KSslErrorUiData errorData( m_socket );
      emit sslError( errorData );
   } else {
-    doSslFallback = false;
     kDebug() << "TLS negotiation done.";
     m_encryptedMode = true;
     emit encryptionNegotiationResult( true, m_socket->negotiatedSslVersion() );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kdepimlibs-4.11.90/kimap/tests/testimapidle.cpp 
new/kdepimlibs-4.11.97/kimap/tests/testimapidle.cpp
--- old/kdepimlibs-4.11.90/kimap/tests/testimapidle.cpp 2013-11-13 
14:11:53.000000000 +0100
+++ new/kdepimlibs-4.11.97/kimap/tests/testimapidle.cpp 2013-11-26 
00:43:25.000000000 +0100
@@ -23,7 +23,7 @@
 #include <klocale.h>
 #include <klocalizedstring.h>
 #include <kdebug.h>
-#include <qtcpsocket.h>
+#include <ktcpsocket.h>
 #include <QCoreApplication>
 #include <qsignalspy.h>
 

--
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to