Index: akonadi/libakonadi/collectionpropertiesdialog.h
===================================================================
--- akonadi/libakonadi/collectionpropertiesdialog.h	(wersja 762193)
+++ akonadi/libakonadi/collectionpropertiesdialog.h	(kopia robocza)
@@ -53,15 +53,9 @@
     /**
       Register additional pages for the collection properties dialog.
     */
-    template <typename T> static void registerPage()
-    {
-      registerPage( new CollectionPropertiesPageFactory<T> );
-    }
+    static void registerPage( CollectionPropertiesPageFactory *factory );
 
   private:
-    static void registerPage( AbstractCollectionPropertiesPageFactory *factory );
-
-  private:
     class Private;
     Private* const d;
     Q_PRIVATE_SLOT( d, void save() )
Index: akonadi/libakonadi/collectionpropertiespage.h
===================================================================
--- akonadi/libakonadi/collectionpropertiespage.h	(wersja 762193)
+++ akonadi/libakonadi/collectionpropertiespage.h	(kopia robocza)
@@ -84,12 +84,12 @@
 /**
   Factory class for collection property dialog pages.
   You probably want to use Akonadi::CollectionPropertiesPageFactory instead.
-  @see Akonadi::CollectionPropertiesPageFactory
+  @see AKONADI_COLLECTION_PROPERTIES_PAGE_FACTORY
 */
-class AKONADI_EXPORT AbstractCollectionPropertiesPageFactory
+class AKONADI_EXPORT CollectionPropertiesPageFactory
 {
   public:
-    virtual ~AbstractCollectionPropertiesPageFactory();
+    virtual ~CollectionPropertiesPageFactory();
 
     /**
       Returns the actual page widget.
@@ -98,23 +98,18 @@
     virtual CollectionPropertiesPage* createWidget( QWidget *parent = 0 ) const = 0;
 };
 
-
 /**
-  Factory class for collection property dialog pages.
-  @see Akonadi::CollectionPropertiesDialog, Akonadi::CollectionPropertiesPage
-*/
-template <typename T> class AKONADI_EXPORT CollectionPropertiesPageFactory
-  : public AbstractCollectionPropertiesPageFactory
-{
-  public:
-    /**
-      Returns the actual page widget.
-      @param parent The parent widget.
-    */
-    inline CollectionPropertiesPage* createWidget( QWidget *parent = 0 ) const
-    {
-      return new T( parent );
-    }
+  \relates CollectionPropertiesPageFactory
+  This macro exports the factory named @param factoryName for @param className class.
+*/ 
+#define AKONADI_COLLECTION_PROPERTIES_PAGE_FACTORY(factoryName, className) \
+class factoryName: public CollectionPropertiesPageFactory \
+{ \
+  public: \
+    inline CollectionPropertiesPage* createWidget( QWidget *parent = 0 ) const \
+    { \
+      return new className( parent ); \
+    } \
 };
 
 }
Index: akonadi/libakonadi/collectionpropertiesdialog.cpp
===================================================================
--- akonadi/libakonadi/collectionpropertiesdialog.cpp	(wersja 762193)
+++ akonadi/libakonadi/collectionpropertiesdialog.cpp	(kopia robocza)
@@ -29,6 +29,8 @@
 
 using namespace Akonadi;
 
+AKONADI_COLLECTION_PROPERTIES_PAGE_FACTORY(CollectionGeneralPropertiesPageFactory, CollectionGeneralPropertiesPage)
+
 // FIXME: we leak d->pages!
 
 class CollectionPropertiesDialog::Private
@@ -42,7 +44,7 @@
 
     static void registerBuiltinPages()
     {
-      pages.append( new CollectionPropertiesPageFactory<CollectionGeneralPropertiesPage>() );
+      pages.append( new CollectionGeneralPropertiesPageFactory() );
     }
 
     void save()
@@ -72,12 +74,12 @@
     }
 
     Collection collection;
-    static QList<AbstractCollectionPropertiesPageFactory*> pages;
+    static QList<CollectionPropertiesPageFactory*> pages;
     QTabWidget* tabWidget;
     CollectionPropertiesDialog *q;
 };
 
-QList<AbstractCollectionPropertiesPageFactory*> CollectionPropertiesDialog::Private::pages;
+QList<CollectionPropertiesPageFactory*> CollectionPropertiesDialog::Private::pages;
 
 CollectionPropertiesDialog::CollectionPropertiesDialog(const Collection & collection, QWidget * parent) :
     KDialog( parent ),
@@ -90,7 +92,7 @@
   d->tabWidget = new QTabWidget( mainWidget() );
   layout->addWidget( d->tabWidget );
 
-  foreach ( AbstractCollectionPropertiesPageFactory *factory, d->pages ) {
+  foreach ( CollectionPropertiesPageFactory *factory, d->pages ) {
     CollectionPropertiesPage *page = factory->createWidget( d->tabWidget );
     if ( page->canHandle( d->collection ) ) {
       d->tabWidget->addTab( page, page->pageTitle() );
@@ -109,7 +111,7 @@
   delete d;
 }
 
-void CollectionPropertiesDialog::registerPage(AbstractCollectionPropertiesPageFactory * factory)
+void CollectionPropertiesDialog::registerPage(CollectionPropertiesPageFactory * factory)
 {
   if ( Private::pages.isEmpty() )
     Private::registerBuiltinPages();
Index: akonadi/libakonadi/collectionpropertiespage.cpp
===================================================================
--- akonadi/libakonadi/collectionpropertiespage.cpp	(wersja 762193)
+++ akonadi/libakonadi/collectionpropertiespage.cpp	(kopia robocza)
@@ -53,7 +53,7 @@
   d->title = title;
 }
 
-AbstractCollectionPropertiesPageFactory::~AbstractCollectionPropertiesPageFactory()
+CollectionPropertiesPageFactory::~CollectionPropertiesPageFactory()
 {
 }
 
Index: akonadi/clients/akonadiconsole/browserwidget.cpp
===================================================================
--- akonadi/clients/akonadiconsole/browserwidget.cpp	(wersja 762193)
+++ akonadi/clients/akonadiconsole/browserwidget.cpp	(kopia robocza)
@@ -46,6 +46,9 @@
 
 using namespace Akonadi;
 
+AKONADI_COLLECTION_PROPERTIES_PAGE_FACTORY(CollectionAttributePageFactory, CollectionAttributePage)
+AKONADI_COLLECTION_PROPERTIES_PAGE_FACTORY(CollectionInternalsPageFactory, CollectionInternalsPage)
+
 BrowserWidget::BrowserWidget(QWidget * parent) :
     QWidget( parent ),
     mItemModel( 0 ),
@@ -86,8 +89,8 @@
   connect( contentUi.saveButton, SIGNAL(clicked()), SLOT(save()) );
   splitter2->addWidget( contentViewParent );
 
-  CollectionPropertiesDialog::registerPage<CollectionAttributePage>();
-  CollectionPropertiesDialog::registerPage<CollectionInternalsPage>();
+  CollectionPropertiesDialog::registerPage( new CollectionAttributePageFactory() );
+  CollectionPropertiesDialog::registerPage( new CollectionInternalsPageFactory() );
 }
 
 void BrowserWidget::collectionActivated(const QModelIndex & index)
