summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2010-05-03 17:47:18 +0200
committerPatrick Ohly <patrick.ohly@intel.com>2010-05-04 09:39:20 +0200
commit29e0b8eac1004504906ff55ce4e49ab8bc662335 (patch)
tree65ec96a447382eac36abd32659e4d10c4e327661
parent006bcf2603ad00f6b86ab0a69e2f533802eb3eb9 (diff)
templates: use single-file format (MBC #1208)
This patch switches reading of templates on disk from the previous, one file per .ini file format to the single-file format produced by the syncevo-phone-config utility. This makes creating templates much easier, also when using just an editor instead of the tool. The existing Cmdline tests cover this code pretty well, as demonstrated by the number of fixes that were necessary in the previous patches when running the tests. Therefore it should be safe to use this in SyncEvolution 1.0.
-rw-r--r--src/Makefile-gen.am15
-rw-r--r--src/syncevo/SyncConfig.cpp79
-rw-r--r--src/syncevo/SyncConfig.h6
-rw-r--r--src/templates/clients/SyncEvolution.ini26
-rw-r--r--src/templates/clients/SyncEvolution/config.ini4
-rw-r--r--src/templates/clients/SyncEvolution/sources/addressbook/config.ini2
-rw-r--r--src/templates/clients/SyncEvolution/sources/calendar/config.ini2
-rw-r--r--src/templates/clients/SyncEvolution/sources/memo/config.ini2
-rw-r--r--src/templates/clients/SyncEvolution/sources/todo/config.ini2
-rw-r--r--src/templates/clients/SyncEvolution/template.ini2
-rw-r--r--src/templates/clients/phone/nokia/S40/7210c.ini23
-rw-r--r--src/templates/clients/phone/nokia/S40/7210c/config.ini2
-rw-r--r--src/templates/clients/phone/nokia/S40/7210c/sources/addressbook/config.ini2
-rw-r--r--src/templates/clients/phone/nokia/S40/7210c/sources/calendar+todo/config.ini4
-rw-r--r--src/templates/clients/phone/nokia/S40/7210c/sources/calendar/config.ini1
-rw-r--r--src/templates/clients/phone/nokia/S40/7210c/sources/memo/config.ini2
-rw-r--r--src/templates/clients/phone/nokia/S40/7210c/sources/todo/config.ini1
-rw-r--r--src/templates/clients/phone/nokia/S40/7210c/template.ini3
-rw-r--r--src/templates/clients/phone/nokia/S60/N85.ini25
-rw-r--r--src/templates/clients/phone/nokia/S60/N85/config.ini3
-rw-r--r--src/templates/clients/phone/nokia/S60/N85/sources/addressbook/config.ini2
-rw-r--r--src/templates/clients/phone/nokia/S60/N85/sources/calendar+todo/config.ini4
-rw-r--r--src/templates/clients/phone/nokia/S60/N85/sources/calendar/config.ini1
-rw-r--r--src/templates/clients/phone/nokia/S60/N85/sources/memo/config.ini2
-rw-r--r--src/templates/clients/phone/nokia/S60/N85/sources/todo/config.ini1
-rw-r--r--src/templates/clients/phone/nokia/S60/N85/template.ini4
-rw-r--r--src/templates/clients/phone/nokia/maemo/n900.ini23
-rw-r--r--src/templates/clients/phone/nokia/maemo/n900/config.ini3
-rw-r--r--src/templates/clients/phone/nokia/maemo/n900/sources/addressbook/config.ini2
-rw-r--r--src/templates/clients/phone/nokia/maemo/n900/sources/calendar+todo/config.ini4
-rw-r--r--src/templates/clients/phone/nokia/maemo/n900/sources/calendar/config.ini1
-rw-r--r--src/templates/clients/phone/nokia/maemo/n900/sources/memo/config.ini2
-rw-r--r--src/templates/clients/phone/nokia/maemo/n900/sources/todo/config.ini1
-rw-r--r--src/templates/clients/phone/nokia/maemo/n900/template.ini2
-rw-r--r--src/templates/servers/Funambol.ini28
-rw-r--r--src/templates/servers/Funambol/config.ini7
-rw-r--r--src/templates/servers/Funambol/sources/addressbook/config.ini2
-rw-r--r--src/templates/servers/Funambol/sources/calendar/config.ini3
-rw-r--r--src/templates/servers/Funambol/sources/memo/config.ini1
-rw-r--r--src/templates/servers/Funambol/sources/todo/config.ini3
-rw-r--r--src/templates/servers/Funambol/template.ini2
-rw-r--r--src/templates/servers/ScheduleWorld.ini22
-rw-r--r--src/templates/servers/ScheduleWorld/config.ini5
-rw-r--r--src/templates/servers/ScheduleWorld/sources/addressbook/config.ini2
-rw-r--r--src/templates/servers/ScheduleWorld/sources/calendar/config.ini1
-rw-r--r--src/templates/servers/ScheduleWorld/sources/memo/config.ini1
-rw-r--r--src/templates/servers/ScheduleWorld/sources/todo/config.ini1
-rw-r--r--src/templates/servers/ScheduleWorld/template.ini2
48 files changed, 204 insertions, 134 deletions
diff --git a/src/Makefile-gen.am b/src/Makefile-gen.am
index 701e1595..9a419e91 100644
--- a/src/Makefile-gen.am
+++ b/src/Makefile-gen.am
@@ -212,19 +212,8 @@ nodist_client_test_SOURCES = ../test/test.cpp
CLIENT_LIB_TEST_FILES = \
testcases/lcs/file1.txt \
testcases/lcs/file2.txt \
- testcases/templates/clients/SyncEvolution/sources/addressbook/config.ini \
- testcases/templates/clients/SyncEvolution/sources/memo/config.ini \
- testcases/templates/clients/SyncEvolution/sources/todo/config.ini \
- testcases/templates/clients/SyncEvolution/sources/calendar/config.ini \
- testcases/templates/clients/SyncEvolution/template.ini \
- testcases/templates/clients/SyncEvolution/config.ini \
- testcases/templates/clients/phone/nokia/S40/7210c/sources/addressbook/config.ini \
- testcases/templates/clients/phone/nokia/S40/7210c/sources/memo/config.ini \
- testcases/templates/clients/phone/nokia/S40/7210c/sources/todo/config.ini \
- testcases/templates/clients/phone/nokia/S40/7210c/sources/calendar/config.ini \
- testcases/templates/clients/phone/nokia/S40/7210c/sources/calendar+todo/config.ini \
- testcases/templates/clients/phone/nokia/S40/7210c/template.ini \
- testcases/templates/clients/phone/nokia/S40/7210c/config.ini \
+ testcases/templates/clients/SyncEvolution.ini \
+ testcases/templates/clients/phone/nokia/S40/7210c.ini \
testcases/vcard21.vcf \
testcases/vcard30.vcf \
testcases/ical20.ics \
diff --git a/src/syncevo/SyncConfig.cpp b/src/syncevo/SyncConfig.cpp
index cdf27769..cdfe24a9 100644
--- a/src/syncevo/SyncConfig.cpp
+++ b/src/syncevo/SyncConfig.cpp
@@ -28,6 +28,7 @@
#include <syncevo/VolatileConfigNode.h>
#include <syncevo/DevNullConfigNode.h>
#include <syncevo/MultiplexConfigNode.h>
+#include <syncevo/SingleFileConfigTree.h>
#include <syncevo/lcs.h>
#include <test.h>
#include <synthesis/timeutil.h>
@@ -416,22 +417,22 @@ SyncConfig::TemplateList SyncConfig::matchPeerTemplates(const DeviceList &peers,
// layout, the match is entirely based on the metadata template.ini
string templateDir(SyncEvolutionTemplateDir());
std::queue <std::string, std::list<std::string> > directories;
- if (isDir(templateDir)) {
- directories.push (templateDir);
- }
+
+ directories.push (templateDir);
while (!directories.empty()) {
string sDir = directories.front();
directories.pop();
- if (!TemplateConfig::isTemplateConfig(sDir)) {
+ if (isDir(sDir)) {
+ // check all sub directories
ReadDir dir(sDir);
- //not a template folder, check all sub directories
BOOST_FOREACH(const string &entry, dir) {
- if (isDir(sDir + "/" + entry)) {
- directories.push (sDir + "/" + entry);
- }
+ directories.push(sDir + "/" + entry);
}
} else {
TemplateConfig templateConf (sDir);
+ if (!templateConf.isTemplateConfig()) {
+ continue;
+ }
BOOST_FOREACH (const DeviceList::value_type &entry, peers){
int rank = templateConf.metaMatch (entry.m_fingerprint, entry.m_matchMode);
if (fuzzyMatch){
@@ -485,8 +486,10 @@ boost::shared_ptr<SyncConfig> SyncConfig::createPeerTemplate(const string &serve
// before starting another fuzzy match process, first try to load the
// template directly taking the parameter as the path
- if (isDir (server) && TemplateConfig::isTemplateConfig(server)) {
+ bool fromDisk = false;
+ if (TemplateConfig::isTemplateConfig(server)) {
templateConfig = server;
+ fromDisk = true;
} else {
SyncConfig::DeviceList devices;
devices.push_back (DeviceDescription("", server, MATCH_ALL));
@@ -498,11 +501,12 @@ boost::shared_ptr<SyncConfig> SyncConfig::createPeerTemplate(const string &serve
if (templateConfig.empty()) {
// not found, avoid reading current directory by using one which doesn't exist
templateConfig = "/dev/null";
+ } else {
+ fromDisk = true;
}
}
- boost::shared_ptr<FileConfigTree> tree(new FileConfigTree(templateConfig, "", false));
- tree->setReadOnly(true);
+ boost::shared_ptr<ConfigTree> tree(new SingleFileConfigTree(templateConfig));
boost::shared_ptr<SyncConfig> config(new SyncConfig(server, tree));
boost::shared_ptr<PersistentSyncSourceConfig> source;
@@ -559,13 +563,23 @@ boost::shared_ptr<SyncConfig> SyncConfig::createPeerTemplate(const string &serve
source->setSync("two-way");
}
- if (isDir(templateConfig)) {
- // directory exists, check for icon?
+ if (fromDisk) {
+ // check for icon
if (config->getIconURI().empty()) {
- ReadDir dir(templateConfig);
+ string dirname, filename;
+ splitPath(templateConfig, dirname, filename);
+ ReadDir dir(getDirname(dirname));
+
+ // remove last suffix, regardless what it is
+ size_t pos = filename.rfind('.');
+ if (pos != filename.npos) {
+ filename.resize(pos);
+ }
+ filename += "-icon";
+
BOOST_FOREACH(const string &entry, dir) {
- if (boost::istarts_with(entry, "icon")) {
- config->setIconURI("file://" + templateConfig + "/" + entry);
+ if (boost::istarts_with(entry, filename)) {
+ config->setIconURI("file://" + dirname + "/" + entry);
break;
}
}
@@ -573,8 +587,7 @@ boost::shared_ptr<SyncConfig> SyncConfig::createPeerTemplate(const string &serve
// leave the source configs alone and return the config as it is:
// in order to have sources configured as part of the template,
- // the template directory must have directories for all
- // sources under "sources"
+ // the template must have entries for all sources under "sources"
return config;
}
@@ -2220,24 +2233,34 @@ bool SyncConfig::TemplateDescription::compare_op (boost::shared_ptr<SyncConfig::
return (left->m_templateId < right->m_templateId);
}
-TemplateConfig::TemplateConfig (const string &path)
- : m_metaNode (new FileConfigNode (path, "template.ini", true)),
- m_id(""),
- m_path(path)
+TemplateConfig::TemplateConfig(const string &path) :
+ m_template(new SingleFileConfigTree(path))
{
- m_metaNode->readProperties(m_metaProps);
+ boost::shared_ptr<ConfigNode> metaNode = m_template->open("template.ini");
+ metaNode->readProperties(m_metaProps);
}
-bool TemplateConfig::isTemplateConfig (const string &dir)
+bool TemplateConfig::isTemplateConfig (const string &path)
{
- return !ReadDir(dir).find ("template.ini", false).empty();
+ SingleFileConfigTree templ(path);
+ boost::shared_ptr<ConfigNode> metaNode = templ.open("template.ini");
+ if (!metaNode->exists()) {
+ return false;
+ }
+ ConfigProps props;
+ metaNode->readProperties(props);
+ return !props.empty();
}
-int TemplateConfig::serverModeMatch (SyncConfig::MatchMode mode)
+bool TemplateConfig::isTemplateConfig() const
{
+ return !m_metaProps.empty();
+}
- FileConfigNode configNode (m_path, "config.ini", true);
- std::string peerIsClient = configNode.readProperty ("peerIsClient");
+int TemplateConfig::serverModeMatch (SyncConfig::MatchMode mode)
+{
+ boost::shared_ptr<ConfigNode> configNode = m_template->open("config.ini");
+ std::string peerIsClient = configNode->readProperty ("peerIsClient");
//not a match if serverMode does not match
if ((peerIsClient.empty() || peerIsClient == "0") && mode == SyncConfig::MATCH_FOR_SERVER_MODE) {
diff --git a/src/syncevo/SyncConfig.h b/src/syncevo/SyncConfig.h
index ea4a4ad0..1fefaccf 100644
--- a/src/syncevo/SyncConfig.h
+++ b/src/syncevo/SyncConfig.h
@@ -1680,16 +1680,17 @@ class SyncSourceConfig {
string m_cachedPassword;
};
+class SingleFileConfigTree;
+
/**
* Representing a configuration template node used for fuzzy matching.
*/
class TemplateConfig
{
- boost::shared_ptr<FileConfigNode> m_metaNode;
+ boost::shared_ptr<SingleFileConfigTree> m_template;
ConfigProps m_metaProps;
string m_id;
string m_templateName;
- string m_path;
public:
TemplateConfig (const string &path);
enum {
@@ -1701,6 +1702,7 @@ public:
BEST_MATCH=5
};
static bool isTemplateConfig (const string &path);
+ bool isTemplateConfig() const;
virtual int metaMatch (const string &fingerprint, SyncConfig::MatchMode mode);
virtual int serverModeMatch (SyncConfig::MatchMode mode);
virtual int fingerprintMatch (const string &fingerprint);
diff --git a/src/templates/clients/SyncEvolution.ini b/src/templates/clients/SyncEvolution.ini
new file mode 100644
index 00000000..58a6d0d4
--- /dev/null
+++ b/src/templates/clients/SyncEvolution.ini
@@ -0,0 +1,26 @@
+=== template.ini ===
+fingerprint = SyncEvolution Client
+description = SyncEvolution server side template
+
+=== config.ini ===
+username = test
+password = test
+PeerIsClient = 1
+ConsumerReady = 1
+
+=== sources/addressbook/config.ini ===
+sync = two-way
+uri = addressbook
+
+=== sources/calendar/config.ini ===
+sync = two-way
+uri = calendar
+
+=== sources/todo/config.ini ===
+sync = two-way
+uri = todo
+
+=== sources/memo/config.ini ===
+sync = two-way
+uri = memo
+
diff --git a/src/templates/clients/SyncEvolution/config.ini b/src/templates/clients/SyncEvolution/config.ini
deleted file mode 100644
index 8bf276d9..00000000
--- a/src/templates/clients/SyncEvolution/config.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-username = test
-password = test
-PeerIsClient = 1
-ConsumerReady = 1
diff --git a/src/templates/clients/SyncEvolution/sources/addressbook/config.ini b/src/templates/clients/SyncEvolution/sources/addressbook/config.ini
deleted file mode 100644
index edafb58e..00000000
--- a/src/templates/clients/SyncEvolution/sources/addressbook/config.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-sync = two-way
-uri = addressbook
diff --git a/src/templates/clients/SyncEvolution/sources/calendar/config.ini b/src/templates/clients/SyncEvolution/sources/calendar/config.ini
deleted file mode 100644
index aa6c8541..00000000
--- a/src/templates/clients/SyncEvolution/sources/calendar/config.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-sync = two-way
-uri = calendar
diff --git a/src/templates/clients/SyncEvolution/sources/memo/config.ini b/src/templates/clients/SyncEvolution/sources/memo/config.ini
deleted file mode 100644
index 48618618..00000000
--- a/src/templates/clients/SyncEvolution/sources/memo/config.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-sync = two-way
-uri = memo
diff --git a/src/templates/clients/SyncEvolution/sources/todo/config.ini b/src/templates/clients/SyncEvolution/sources/todo/config.ini
deleted file mode 100644
index 63e719e7..00000000
--- a/src/templates/clients/SyncEvolution/sources/todo/config.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-sync = two-way
-uri = todo
diff --git a/src/templates/clients/SyncEvolution/template.ini b/src/templates/clients/SyncEvolution/template.ini
deleted file mode 100644
index 75a446c4..00000000
--- a/src/templates/clients/SyncEvolution/template.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-fingerprint = SyncEvolution Client
-description = SyncEvolution server side template
diff --git a/src/templates/clients/phone/nokia/S40/7210c.ini b/src/templates/clients/phone/nokia/S40/7210c.ini
new file mode 100644
index 00000000..c919444f
--- /dev/null
+++ b/src/templates/clients/phone/nokia/S40/7210c.ini
@@ -0,0 +1,23 @@
+=== template.ini ===
+fingerprint = Nokia 7210c,Nokia
+description = Template for Nokia S40 series Phone
+templateName = Nokia S40
+
+=== config.ini ===
+PeerIsClient = 1
+ConsumerReady = 1
+
+=== sources/addressbook/config.ini ===
+sync = two-way
+uri = Contacts
+
+=== sources/calendar/config.ini ===
+sync = none
+
+=== sources/todo/config.ini ===
+sync = none
+
+=== sources/memo/config.ini ===
+sync = two-way
+uri = memo
+
diff --git a/src/templates/clients/phone/nokia/S40/7210c/config.ini b/src/templates/clients/phone/nokia/S40/7210c/config.ini
deleted file mode 100644
index 5f637c6b..00000000
--- a/src/templates/clients/phone/nokia/S40/7210c/config.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-PeerIsClient = 1
-ConsumerReady = 1
diff --git a/src/templates/clients/phone/nokia/S40/7210c/sources/addressbook/config.ini b/src/templates/clients/phone/nokia/S40/7210c/sources/addressbook/config.ini
deleted file mode 100644
index e9850ecf..00000000
--- a/src/templates/clients/phone/nokia/S40/7210c/sources/addressbook/config.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-sync = two-way
-uri = Contacts
diff --git a/src/templates/clients/phone/nokia/S40/7210c/sources/calendar+todo/config.ini b/src/templates/clients/phone/nokia/S40/7210c/sources/calendar+todo/config.ini
deleted file mode 100644
index 90d1dd7d..00000000
--- a/src/templates/clients/phone/nokia/S40/7210c/sources/calendar+todo/config.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-sync = two-way
-type = virtual:text/x-calendar:1.0
-evolutionsource = calendar,todo
-uri = Calendar
diff --git a/src/templates/clients/phone/nokia/S40/7210c/sources/calendar/config.ini b/src/templates/clients/phone/nokia/S40/7210c/sources/calendar/config.ini
deleted file mode 100644
index 84e080b4..00000000
--- a/src/templates/clients/phone/nokia/S40/7210c/sources/calendar/config.ini
+++ /dev/null
@@ -1 +0,0 @@
-sync = none
diff --git a/src/templates/clients/phone/nokia/S40/7210c/sources/memo/config.ini b/src/templates/clients/phone/nokia/S40/7210c/sources/memo/config.ini
deleted file mode 100644
index 48618618..00000000
--- a/src/templates/clients/phone/nokia/S40/7210c/sources/memo/config.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-sync = two-way
-uri = memo
diff --git a/src/templates/clients/phone/nokia/S40/7210c/sources/todo/config.ini b/src/templates/clients/phone/nokia/S40/7210c/sources/todo/config.ini
deleted file mode 100644
index 84e080b4..00000000
--- a/src/templates/clients/phone/nokia/S40/7210c/sources/todo/config.ini
+++ /dev/null
@@ -1 +0,0 @@
-sync = none
diff --git a/src/templates/clients/phone/nokia/S40/7210c/template.ini b/src/templates/clients/phone/nokia/S40/7210c/template.ini
deleted file mode 100644
index 9f057000..00000000
--- a/src/templates/clients/phone/nokia/S40/7210c/template.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-fingerprint = Nokia 7210c,Nokia
-description = Template for Nokia S40 series Phone
-templateName = Nokia S40
diff --git a/src/templates/clients/phone/nokia/S60/N85.ini b/src/templates/clients/phone/nokia/S60/N85.ini
new file mode 100644
index 00000000..036736bb
--- /dev/null
+++ b/src/templates/clients/phone/nokia/S60/N85.ini
@@ -0,0 +1,25 @@
+=== template.ini ===
+fingerprint = Nokia N85,Nokia
+description = Template for Nokia S60 series Phone
+templateName = Nokia S60
+
+
+=== config.ini ===
+peerIsClient = 1
+remoteIdentifier = PC Suite
+ConsumerReady = 1
+
+=== sources/addressbook/config.ini ===
+sync = two-way
+uri = Contacts
+
+=== sources/calendar/config.ini ===
+sync = none
+
+=== sources/todo/config.ini ===
+sync = none
+
+=== sources/memo/config.ini ===
+sync = two-way
+uri = Notes
+
diff --git a/src/templates/clients/phone/nokia/S60/N85/config.ini b/src/templates/clients/phone/nokia/S60/N85/config.ini
deleted file mode 100644
index 2325c098..00000000
--- a/src/templates/clients/phone/nokia/S60/N85/config.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-peerIsClient = 1
-remoteIdentifier = PC Suite
-ConsumerReady = 1
diff --git a/src/templates/clients/phone/nokia/S60/N85/sources/addressbook/config.ini b/src/templates/clients/phone/nokia/S60/N85/sources/addressbook/config.ini
deleted file mode 100644
index e9850ecf..00000000
--- a/src/templates/clients/phone/nokia/S60/N85/sources/addressbook/config.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-sync = two-way
-uri = Contacts
diff --git a/src/templates/clients/phone/nokia/S60/N85/sources/calendar+todo/config.ini b/src/templates/clients/phone/nokia/S60/N85/sources/calendar+todo/config.ini
deleted file mode 100644
index e31f19cb..00000000
--- a/src/templates/clients/phone/nokia/S60/N85/sources/calendar+todo/config.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-sync = two-way
-type = virtual:text/calendar
-evolutionsource = calendar,todo
-uri = Calendar
diff --git a/src/templates/clients/phone/nokia/S60/N85/sources/calendar/config.ini b/src/templates/clients/phone/nokia/S60/N85/sources/calendar/config.ini
deleted file mode 100644
index 84e080b4..00000000
--- a/src/templates/clients/phone/nokia/S60/N85/sources/calendar/config.ini
+++ /dev/null
@@ -1 +0,0 @@
-sync = none
diff --git a/src/templates/clients/phone/nokia/S60/N85/sources/memo/config.ini b/src/templates/clients/phone/nokia/S60/N85/sources/memo/config.ini
deleted file mode 100644
index 2e2ba78d..00000000
--- a/src/templates/clients/phone/nokia/S60/N85/sources/memo/config.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-sync = two-way
-uri = Notes
diff --git a/src/templates/clients/phone/nokia/S60/N85/sources/todo/config.ini b/src/templates/clients/phone/nokia/S60/N85/sources/todo/config.ini
deleted file mode 100644
index 84e080b4..00000000
--- a/src/templates/clients/phone/nokia/S60/N85/sources/todo/config.ini
+++ /dev/null
@@ -1 +0,0 @@
-sync = none
diff --git a/src/templates/clients/phone/nokia/S60/N85/template.ini b/src/templates/clients/phone/nokia/S60/N85/template.ini
deleted file mode 100644
index ea0d646e..00000000
--- a/src/templates/clients/phone/nokia/S60/N85/template.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-fingerprint = Nokia N85,Nokia
-description = Template for Nokia S60 series Phone
-templateName = Nokia S60
-
diff --git a/src/templates/clients/phone/nokia/maemo/n900.ini b/src/templates/clients/phone/nokia/maemo/n900.ini
new file mode 100644
index 00000000..d781950c
--- /dev/null
+++ b/src/templates/clients/phone/nokia/maemo/n900.ini
@@ -0,0 +1,23 @@
+=== template.ini ===
+fingerprint = Nokia N900
+description = Template for Nokia N900
+
+=== config.ini ===
+PeerIsClient = 1
+ConsumerReady = 1
+remoteIdentifier = PC Suite
+
+=== sources/addressbook/config.ini ===
+sync = two-way
+uri = Contacts
+
+=== sources/calendar/config.ini ===
+sync = none
+
+=== sources/todo/config.ini ===
+sync = none
+
+=== sources/memo/config.ini ===
+sync = two-way
+uri = Notes
+
diff --git a/src/templates/clients/phone/nokia/maemo/n900/config.ini b/src/templates/clients/phone/nokia/maemo/n900/config.ini
deleted file mode 100644
index 58ca3438..00000000
--- a/src/templates/clients/phone/nokia/maemo/n900/config.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-PeerIsClient = 1
-ConsumerReady = 1
-remoteIdentifier = PC Suite
diff --git a/src/templates/clients/phone/nokia/maemo/n900/sources/addressbook/config.ini b/src/templates/clients/phone/nokia/maemo/n900/sources/addressbook/config.ini
deleted file mode 100644
index e9850ecf..00000000
--- a/src/templates/clients/phone/nokia/maemo/n900/sources/addressbook/config.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-sync = two-way
-uri = Contacts
diff --git a/src/templates/clients/phone/nokia/maemo/n900/sources/calendar+todo/config.ini b/src/templates/clients/phone/nokia/maemo/n900/sources/calendar+todo/config.ini
deleted file mode 100644
index e31f19cb..00000000
--- a/src/templates/clients/phone/nokia/maemo/n900/sources/calendar+todo/config.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-sync = two-way
-type = virtual:text/calendar
-evolutionsource = calendar,todo
-uri = Calendar
diff --git a/src/templates/clients/phone/nokia/maemo/n900/sources/calendar/config.ini b/src/templates/clients/phone/nokia/maemo/n900/sources/calendar/config.ini
deleted file mode 100644
index 84e080b4..00000000
--- a/src/templates/clients/phone/nokia/maemo/n900/sources/calendar/config.ini
+++ /dev/null
@@ -1 +0,0 @@
-sync = none
diff --git a/src/templates/clients/phone/nokia/maemo/n900/sources/memo/config.ini b/src/templates/clients/phone/nokia/maemo/n900/sources/memo/config.ini
deleted file mode 100644
index 2e2ba78d..00000000
--- a/src/templates/clients/phone/nokia/maemo/n900/sources/memo/config.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-sync = two-way
-uri = Notes
diff --git a/src/templates/clients/phone/nokia/maemo/n900/sources/todo/config.ini b/src/templates/clients/phone/nokia/maemo/n900/sources/todo/config.ini
deleted file mode 100644
index 84e080b4..00000000
--- a/src/templates/clients/phone/nokia/maemo/n900/sources/todo/config.ini
+++ /dev/null
@@ -1 +0,0 @@
-sync = none
diff --git a/src/templates/clients/phone/nokia/maemo/n900/template.ini b/src/templates/clients/phone/nokia/maemo/n900/template.ini
deleted file mode 100644
index 83652763..00000000
--- a/src/templates/clients/phone/nokia/maemo/n900/template.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-fingerprint = Nokia N900
-description = Template for Nokia N900
diff --git a/src/templates/servers/Funambol.ini b/src/templates/servers/Funambol.ini
new file mode 100644
index 00000000..b3d6a4fc
--- /dev/null
+++ b/src/templates/servers/Funambol.ini
@@ -0,0 +1,28 @@
+=== template.ini ===
+fingerprint = Funambol
+description = http://my.funambol.com
+
+=== config.ini ===
+syncURL = http://my.funambol.com/sync
+WebURL = http://my.funambol.com
+enableWBXML = FALSE
+ConsumerReady = TRUE
+RetryInterval = 0
+
+=== sources/addressbook/config.ini ===
+type = addressbook
+uri = card
+
+=== sources/calendar/config.ini ===
+uri = event
+sync = two-way
+type = calendar:text/calendar!
+
+=== sources/todo/config.ini ===
+uri = task
+sync = two-way
+type = todo:text/calendar!
+
+=== sources/memo/config.ini ===
+uri = note
+
diff --git a/src/templates/servers/Funambol/config.ini b/src/templates/servers/Funambol/config.ini
deleted file mode 100644
index b2e699c4..00000000
--- a/src/templates/servers/Funambol/config.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-# *not* a complete config, do not copy manually into ~/.config
-
-syncURL = http://my.funambol.com/sync
-WebURL = http://my.funambol.com
-enableWBXML = FALSE
-ConsumerReady = TRUE
-RetryInterval = 0
diff --git a/src/templates/servers/Funambol/sources/addressbook/config.ini b/src/templates/servers/Funambol/sources/addressbook/config.ini
deleted file mode 100644
index f4842470..00000000
--- a/src/templates/servers/Funambol/sources/addressbook/config.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-type = addressbook
-uri = card
diff --git a/src/templates/servers/Funambol/sources/calendar/config.ini b/src/templates/servers/Funambol/sources/calendar/config.ini
deleted file mode 100644
index 5030e2c0..00000000
--- a/src/templates/servers/Funambol/sources/calendar/config.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-uri = event
-sync = two-way
-type = calendar:text/calendar!
diff --git a/src/templates/servers/Funambol/sources/memo/config.ini b/src/templates/servers/Funambol/sources/memo/config.ini
deleted file mode 100644
index 756f0fef..00000000
--- a/src/templates/servers/Funambol/sources/memo/config.ini
+++ /dev/null
@@ -1 +0,0 @@
-uri = note
diff --git a/src/templates/servers/Funambol/sources/todo/config.ini b/src/templates/servers/Funambol/sources/todo/config.ini
deleted file mode 100644
index d9089636..00000000
--- a/src/templates/servers/Funambol/sources/todo/config.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-uri = task
-sync = two-way
-type = todo:text/calendar!
diff --git a/src/templates/servers/Funambol/template.ini b/src/templates/servers/Funambol/template.ini
deleted file mode 100644
index ef872458..00000000
--- a/src/templates/servers/Funambol/template.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-fingerprint = Funambol
-description = http://my.funambol.com
diff --git a/src/templates/servers/ScheduleWorld.ini b/src/templates/servers/ScheduleWorld.ini
new file mode 100644
index 00000000..50ccfc91
--- /dev/null
+++ b/src/templates/servers/ScheduleWorld.ini
@@ -0,0 +1,22 @@
+=== template.ini ===
+fingerprint = ScheduleWorld, default
+description = http://www.scheduleworld.org
+
+=== config.ini ===
+syncURL = http://sync.scheduleworld.com/funambol/ds
+WebURL = http://www.scheduleworld.com
+ConsumerReady = TRUE
+
+=== sources/addressbook/config.ini ===
+type = addressbook:text/vcard
+uri = card3
+
+=== sources/calendar/config.ini ===
+uri = cal2
+
+=== sources/todo/config.ini ===
+uri = task2
+
+=== sources/memo/config.ini ===
+uri = note
+
diff --git a/src/templates/servers/ScheduleWorld/config.ini b/src/templates/servers/ScheduleWorld/config.ini
deleted file mode 100644
index 202c6e3e..00000000
--- a/src/templates/servers/ScheduleWorld/config.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-# *not* a complete config, do not copy manually into ~/.config
-
-syncURL = http://sync.scheduleworld.com/funambol/ds
-WebURL = http://www.scheduleworld.com
-ConsumerReady = TRUE
diff --git a/src/templates/servers/ScheduleWorld/sources/addressbook/config.ini b/src/templates/servers/ScheduleWorld/sources/addressbook/config.ini
deleted file mode 100644
index 256d6859..00000000
--- a/src/templates/servers/ScheduleWorld/sources/addressbook/config.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-type = addressbook:text/vcard
-uri = card3
diff --git a/src/templates/servers/ScheduleWorld/sources/calendar/config.ini b/src/templates/servers/ScheduleWorld/sources/calendar/config.ini
deleted file mode 100644
index 63def8b0..00000000
--- a/src/templates/servers/ScheduleWorld/sources/calendar/config.ini
+++ /dev/null
@@ -1 +0,0 @@
-uri = cal2
diff --git a/src/templates/servers/ScheduleWorld/sources/memo/config.ini b/src/templates/servers/ScheduleWorld/sources/memo/config.ini
deleted file mode 100644
index 756f0fef..00000000
--- a/src/templates/servers/ScheduleWorld/sources/memo/config.ini
+++ /dev/null
@@ -1 +0,0 @@
-uri = note
diff --git a/src/templates/servers/ScheduleWorld/sources/todo/config.ini b/src/templates/servers/ScheduleWorld/sources/todo/config.ini
deleted file mode 100644
index 7f2d8f96..00000000
--- a/src/templates/servers/ScheduleWorld/sources/todo/config.ini
+++ /dev/null
@@ -1 +0,0 @@
-uri = task2
diff --git a/src/templates/servers/ScheduleWorld/template.ini b/src/templates/servers/ScheduleWorld/template.ini
deleted file mode 100644
index 855ce8ed..00000000
--- a/src/templates/servers/ScheduleWorld/template.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-fingerprint = ScheduleWorld, default
-description = http://www.scheduleworld.org