Commit 51b122c0 authored by camilo higuita's avatar camilo higuita
Browse files

stuck here

parent 408c6135
......@@ -90,19 +90,19 @@ dirLister(new KCoreDirLister(this))
for(const auto &kfile : dirLister->items())
{
qDebug() << kfile.url() << kfile.name() << kfile.isDir();
content << FMH::MODEL{ {FMH::MODEL_KEY::LABEL, kfile.name()},
{FMH::MODEL_KEY::NAME, kfile.name()},
{FMH::MODEL_KEY::DATE, kfile.time(KFileItem::FileTimes::CreationTime).toString(Qt::TextDate)},
{FMH::MODEL_KEY::MODIFIED, kfile.time(KFileItem::FileTimes::ModificationTime).toString(Qt::TextDate)},
{FMH::MODEL_KEY::PATH, kfile.url().toString()},
{FMH::MODEL_KEY::THUMBNAIL, kfile.localPath()},
{FMH::MODEL_KEY::MIME, kfile.mimetype()},
{FMH::MODEL_KEY::GROUP, kfile.group()},
{FMH::MODEL_KEY::ICON, kfile.iconName()},
{FMH::MODEL_KEY::SIZE, QString::number(kfile.size())},
{FMH::MODEL_KEY::THUMBNAIL, kfile.mostLocalUrl().toString()},
{FMH::MODEL_KEY::OWNER, kfile.user()},
{FMH::MODEL_KEY::COUNT, kfile.isLocalFile() && kfile.isDir() ? QString::number(QDir(kfile.localPath()).count() - 2) : "0"}
content << FMH::MODEL{ {KEYS::LABEL, kfile.name()},
{KEYS::NAME, kfile.name()},
{KEYS::DATE, kfile.time(KFileItem::FileTimes::CreationTime).toString(Qt::TextDate)},
{KEYS::MODIFIED, kfile.time(KFileItem::FileTimes::ModificationTime).toString(Qt::TextDate)},
{KEYS::PATH, kfile.url().toString()},
{KEYS::THUMBNAIL, kfile.localPath()},
{KEYS::MIME, kfile.mimetype()},
{KEYS::GROUP, kfile.group()},
{KEYS::ICON, kfile.iconName()},
{KEYS::SIZE, QString::number(kfile.size())},
{KEYS::THUMBNAIL, kfile.mostLocalUrl().toString()},
{KEYS::OWNER, kfile.user()},
{KEYS::COUNT, kfile.isLocalFile() && kfile.isDir() ? QString::number(QDir(kfile.localPath()).count() - 2) : "0"}
};
}
......@@ -149,7 +149,7 @@ dirLister(new KCoreDirLister(this))
switch(signalType)
{
case Syncing::SIGNAL_TYPE::OPEN:
this->openUrl(item[FMH::MODEL_KEY::PATH]);
this->openUrl(item[KEYS::PATH]);
break;
case Syncing::SIGNAL_TYPE::DOWNLOAD:
......@@ -160,7 +160,7 @@ dirLister(new KCoreDirLister(this))
{
QVariantMap data;
for(auto key : item.keys())
data.insert(FMH::MODEL_NAME[key], item[key]);
data.insert(KEYS::_N[key], item[key]);
this->copy(QVariantList {data}, this->sync->getCopyTo());
break;
......@@ -196,7 +196,7 @@ QVariantMap FM::toMap(const FMH::MODEL& model)
{
QVariantMap map;
for(const auto &key : model.keys())
map.insert(FMH::MODEL_NAME[key], model[key]);
map.insert(KEYS::_N[key], model[key]);
return map;
}
......@@ -205,7 +205,7 @@ FMH::MODEL FM::toModel(const QVariantMap& map)
{
FMH::MODEL model;
for(const auto &key : map.keys())
model.insert(FMH::MODEL_NAME_KEY[key], map[key].toString());
model.insert(KEYS::_K[key], map[key].toString());
return model;
}
......@@ -218,7 +218,7 @@ FMH::MODEL_LIST FM::packItems(const QStringList &items, const QString &type)
if(FMH::fileExists(path))
{
auto model = FMH::getFileInfoModel(path);
model.insert(FMH::MODEL_KEY::TYPE, type);
model.insert(KEYS::TYPE, type);
data << model;
}
......@@ -236,9 +236,9 @@ QVariantList FM::get(const QString &queryTxt)
while(query.next())
{
QVariantMap data;
for(auto key : FMH::MODEL_NAME.keys())
if(query.record().indexOf(FMH::MODEL_NAME[key]) > -1)
data[FMH::MODEL_NAME[key]] = query.value(FMH::MODEL_NAME[key]).toString();
for(const auto nameKey : KEYS::_NAMES())
if(query.record().indexOf(nameKey) > -1)
data[nameKey] = query.value(nameKey).toString();
mapList<< data;
......@@ -344,10 +344,10 @@ FMH::MODEL_LIST FM::getAppsPath()
{
FMH::MODEL
{
{FMH::MODEL_KEY::ICON, "system-run"},
{FMH::MODEL_KEY::LABEL, FMH::PATHTYPE_LABEL[FMH::PATHTYPE_KEY::APPS_PATH]},
{FMH::MODEL_KEY::PATH, FMH::PATHTYPE_URI[FMH::PATHTYPE_KEY::APPS_PATH]},
{FMH::MODEL_KEY::TYPE, FMH::PATHTYPE_LABEL[FMH::PATHTYPE_KEY::PLACES_PATH]}
{KEYS::ICON, "system-run"},
{KEYS::LABEL, FMH::PATHTYPE_LABEL[FMH::PATHTYPE_KEY::APPS_PATH]},
{KEYS::PATH, FMH::PATHTYPE_URI[FMH::PATHTYPE_KEY::APPS_PATH]},
{KEYS::TYPE, FMH::PATHTYPE_LABEL[FMH::PATHTYPE_KEY::PLACES_PATH]}
}
};
}
......@@ -401,11 +401,11 @@ FMH::MODEL_LIST FM::search(const QString& query, const QUrl &path, const bool &h
// for(const auto &i : model.groupIndexes(KFilePlacesModel::GroupType::RemoteType))
// {
// drives << FMH::MODEL{
// {FMH::MODEL_KEY::NAME, model.text(i)},
// {FMH::MODEL_KEY::LABEL, model.text(i)},
// {FMH::MODEL_KEY::PATH, model.url(i).toString()},
// {FMH::MODEL_KEY::ICON, model.icon(i).name()},
// {FMH::MODEL_KEY::TYPE, FMH::PATHTYPE_NAME[FMH::PATHTYPE_KEY::DRIVES_PATH]},
// {KEYS::NAME, model.text(i)},
// {KEYS::LABEL, model.text(i)},
// {KEYS::PATH, model.url(i).toString()},
// {KEYS::ICON, model.icon(i).name()},
// {KEYS::TYPE, FMH::PATHTYPE_NAME[FMH::PATHTYPE_KEY::DRIVES_PATH]},
// };
// }
//
......@@ -418,10 +418,10 @@ FMH::MODEL_LIST FM::search(const QString& query, const QUrl &path, const bool &h
// // {
// // QVariantMap drive =
// // {
// // {FMH::MODEL_NAME[FMH::MODEL_KEY::ICON], "drive-harddisk"},
// // {FMH::MODEL_NAME[FMH::MODEL_KEY::LABEL], device.displayName()},
// // {FMH::MODEL_NAME[FMH::MODEL_KEY::PATH], device.rootPath()},
// // {FMH::MODEL_NAME[FMH::MODEL_KEY::TYPE], FMH::PATHTYPE_NAME[FMH::PATHTYPE_KEY::DRIVES]}
// // {KEYS::_N[KEYS::ICON], "drive-harddisk"},
// // {KEYS::_N[KEYS::LABEL], device.displayName()},
// // {KEYS::_N[KEYS::PATH], device.rootPath()},
// // {KEYS::_N[KEYS::TYPE], FMH::PATHTYPE_NAME[FMH::PATHTYPE_KEY::DRIVES]}
// // };
// //
// // drives << drive;
......@@ -458,10 +458,10 @@ FMH::MODEL_LIST FM::getTags(const int &limit)
const auto label = tag.toMap().value(TAG::KEYMAP[TAG::KEYS::TAG]).toString();
data << FMH::MODEL
{
{FMH::MODEL_KEY::PATH, FMH::PATHTYPE_URI[FMH::PATHTYPE_KEY::TAGS_PATH]+label},
{FMH::MODEL_KEY::ICON, "tag"},
{FMH::MODEL_KEY::LABEL, label},
{FMH::MODEL_KEY::TYPE, FMH::PATHTYPE_LABEL[FMH::PATHTYPE_KEY::TAGS_PATH]}
{KEYS::PATH, FMH::PATHTYPE_URI[FMH::PATHTYPE_KEY::TAGS_PATH]+label},
{KEYS::ICON, "tag"},
{KEYS::LABEL, label},
{KEYS::TYPE, FMH::PATHTYPE_LABEL[FMH::PATHTYPE_KEY::TAGS_PATH]}
};
}
}
......@@ -487,9 +487,9 @@ bool FM::getCloudServerContent(const QString &path, const QStringList &filters,
auto map = data.first().toMap();
user = map[FMH::MODEL_NAME[FMH::MODEL_KEY::USER]].toString();
auto server = map[FMH::MODEL_NAME[FMH::MODEL_KEY::SERVER]].toString();
auto password = map[FMH::MODEL_NAME[FMH::MODEL_KEY::PASSWORD]].toString();
user = map[KEYS::_N[KEYS::USER]].toString();
auto server = map[KEYS::_N[KEYS::SERVER]].toString();
auto password = map[KEYS::_N[KEYS::PASSWORD]].toString();
this->sync->setCredentials(server, user, password);
this->sync->listContent(path, filters, depth);
......@@ -504,13 +504,13 @@ FMH::MODEL_LIST FM::getCloudAccounts()
{
auto map = account.toMap();
res << FMH::MODEL {
{FMH::MODEL_KEY::PATH, FMH::PATHTYPE_URI[FMH::PATHTYPE_KEY::CLOUD_PATH]+map[FMH::MODEL_NAME[FMH::MODEL_KEY::USER]].toString()},
{FMH::MODEL_KEY::ICON, "folder-cloud"},
{FMH::MODEL_KEY::LABEL, map[FMH::MODEL_NAME[FMH::MODEL_KEY::USER]].toString()},
{FMH::MODEL_KEY::USER, map[FMH::MODEL_NAME[FMH::MODEL_KEY::USER]].toString()},
{FMH::MODEL_KEY::SERVER, map[FMH::MODEL_NAME[FMH::MODEL_KEY::SERVER]].toString()},
{FMH::MODEL_KEY::PASSWORD, map[FMH::MODEL_NAME[FMH::MODEL_KEY::PASSWORD]].toString()},
{FMH::MODEL_KEY::TYPE, FMH::PATHTYPE_LABEL[FMH::PATHTYPE_KEY::CLOUD_PATH]}};
{KEYS::PATH, FMH::PATHTYPE_URI[FMH::PATHTYPE_KEY::CLOUD_PATH]+map[KEYS::_N[KEYS::USER]].toString()},
{KEYS::ICON, "folder-cloud"},
{KEYS::LABEL, map[KEYS::_N[KEYS::USER]].toString()},
{KEYS::USER, map[KEYS::_N[KEYS::USER]].toString()},
{KEYS::SERVER, map[KEYS::_N[KEYS::SERVER]].toString()},
{KEYS::PASSWORD, map[KEYS::_N[KEYS::PASSWORD]].toString()},
{KEYS::TYPE, FMH::PATHTYPE_LABEL[FMH::PATHTYPE_KEY::CLOUD_PATH]}};
}
return res;
}
......@@ -526,7 +526,7 @@ void FM::openCloudItem(const QVariantMap &item)
qDebug()<< item;
FMH::MODEL data;
for(const auto &key : item.keys())
data.insert(FMH::MODEL_NAME_KEY[key], item[key].toString());
data.insert(KEYS::_K[key], item[key].toString());
this->sync->resolveFile(data, Syncing::SIGNAL_TYPE::OPEN);
}
......@@ -536,7 +536,7 @@ void FM::getCloudItem(const QVariantMap &item)
qDebug()<< item;
FMH::MODEL data;
for(const auto &key : item.keys())
data.insert(FMH::MODEL_NAME_KEY[key], item[key].toString());
data.insert(KEYS::_K[key], item[key].toString());
this->sync->resolveFile(data, Syncing::SIGNAL_TYPE::DOWNLOAD);
}
......@@ -555,9 +555,9 @@ QVariantList FM::getCloudAccountsList()
bool FM::addCloudAccount(const QString &server, const QString &user, const QString &password)
{
const QVariantMap account = {
{FMH::MODEL_NAME[FMH::MODEL_KEY::SERVER], server},
{FMH::MODEL_NAME[FMH::MODEL_KEY::USER], user},
{FMH::MODEL_NAME[FMH::MODEL_KEY::PASSWORD], password}
{KEYS::_N[KEYS::SERVER], server},
{KEYS::_N[KEYS::USER], user},
{KEYS::_N[KEYS::PASSWORD], password}
};
if(this->insert(FMH::TABLEMAP[FMH::TABLE::CLOUDS], account))
......@@ -572,8 +572,8 @@ bool FM::addCloudAccount(const QString &server, const QString &user, const QStri
bool FM::removeCloudAccount(const QString &server, const QString &user)
{
FMH::DB account = {
{FMH::MODEL_KEY::SERVER, server},
{FMH::MODEL_KEY::USER, user},
{KEYS::SERVER, server},
{KEYS::USER, user},
};
if(this->remove(FMH::TABLEMAP[FMH::TABLE::CLOUDS], account))
......@@ -707,7 +707,7 @@ bool FM::cut(const QVariantList &data, const QString &where)
for(const auto &item : items)
{
const auto path = item[FMH::MODEL_KEY::PATH];
const auto path = item[KEYS::PATH];
if(this->isCloud(path))
{
......@@ -720,7 +720,7 @@ bool FM::cut(const QVariantList &data, const QString &where)
QFile file(QUrl(path).toLocalFile());
file.rename(where+"/"+QFileInfo(QUrl(path).toLocalFile()).fileName());
#else
auto job = KIO::move(QUrl(path), QUrl(where+"/"+FMH::getFileInfoModel(path)[FMH::MODEL_KEY::LABEL]));
auto job = KIO::move(QUrl(path), QUrl(where+"/"+FMH::getFileInfoModel(path)[KEYS::LABEL]));
job->start();
#endif
}
......@@ -739,7 +739,7 @@ bool FM::copy(const QVariantList &data, const QString &where)
QStringList cloudPaths;
for(const auto &item : items)
{
const auto path = item[FMH::MODEL_KEY::PATH];
const auto path = item[KEYS::PATH];
if(this->isDir(path))
{
return FM::copyPath(path, where+"/"+QFileInfo(path).fileName(), false);
......@@ -754,7 +754,7 @@ bool FM::copy(const QVariantList &data, const QString &where)
if(this->isCloud(where))
cloudPaths << path;
else
FM::copyPath(path, where+"/"+FMH::getFileInfoModel(path)[FMH::MODEL_KEY::LABEL], false);
FM::copyPath(path, where+"/"+FMH::getFileInfoModel(path)[KEYS::LABEL], false);
}
}
......
......@@ -173,7 +173,7 @@ bool FMDB::update(const QString &tableName, const FMH::DB &updateData, const QVa
QStringList set;
for (auto key : updateData.keys())
set.append(FMH::MODEL_NAME[key]+" = '"+updateData[key]+"'");
set.append(KEYS::_N[key]+" = '"+updateData[key]+"'");
QStringList condition;
for (auto key : where.keys())
......@@ -209,7 +209,7 @@ bool FMDB::remove(const QString &tableName, const FMH::DB &removeData)
auto i = 0;
for (auto key : removeData.keys())
{
strValues.append(QString("%1 = \"%2\"").arg(FMH::MODEL_NAME[key], removeData[key]));
strValues.append(QString("%1 = \"%2\"").arg(KEYS::_N[key], removeData[key]));
i++;
if(removeData.keys().size() > 1 && i<removeData.keys().size())
......
......@@ -44,8 +44,6 @@
#include <KFileItem>
#include <KFilePlacesModel>
#endif
/**
*base key implementation model
*/
......@@ -72,6 +70,11 @@ namespace PRIV
return (value == other.value
&& n == other.n);
}
inline operator uint()const
{
return value;
}
};
typedef struct
......@@ -96,13 +99,15 @@ namespace PRIV
if(values.contains(__val.n))
{
values[__val.n] = {static_cast<unsigned int>(static_cast<unsigned int>(values[__val.n].value)), __val.n, __val.label};
values[__val.n].n = __val.n;
values[__val.n].label = __val.label;
}
else {
else {
values[__val.n] = {static_cast<unsigned int>(values.size()), __val.n, __val.label};
}
return (values[__val.n]);
// return std::forward<__KEY<uint>>(__k);
}
__KEY<uint>& operator[] (const QString &n)
......@@ -129,25 +134,6 @@ namespace KEYS
return PRIV::KEYDB << value;
}
inline static const QString& (_N)(const KEY & k)
{
return k.n;
}
inline static const KEY& _K (const KEYRING::key_type &n)
{
return PRIV::KEYDB[n];
}
inline static const KEY& _K (const decltype(KEY::value) &value)
{
const auto res = std::find_if(PRIV::KEYDB.values.constBegin(), PRIV::KEYDB.values.constEnd(), [&value](const KEY &key) -> bool
{
return key.value == value;
});
return res.value();
}
inline static const KEYRING& _VALUES()
{
......@@ -177,6 +163,47 @@ namespace KEYS
return uint (KEYS::_VALUES().count());
}
static struct
{
inline const decltype(KEY::n)& operator()(const KEY & k)
{
return k.n;
}
inline const decltype(KEY::n)& operator[](const KEY & k)
{
return this->operator()(k);
}
} _N;
static struct
{
inline const KEY& operator()(const KEYRING::key_type &n)
{
return PRIV::KEYDB[n];
}
inline const KEY& operator()(const decltype(KEY::value) &value)
{
const auto res = std::find_if(PRIV::KEYDB.values.constBegin(), PRIV::KEYDB.values.constEnd(), [&value](const KEY &key) -> bool
{
return key.value == value;
});
return res.value();
}
inline const KEY& operator[](const KEYRING::key_type &n)
{
return this->operator()(n);
}
inline const KEY& operator[](const decltype(KEY::value) &value)
{
return this->operator()(value);
}
} _K;
static const auto &ICON= _SET("icon");
static const auto &LABEL = _SET("label");
static const auto &PATH = _SET("path");
......@@ -286,6 +313,7 @@ inline uint qHash(const KEYS::KEY &key)
return qHash(key.n) ^ key.value;
}
namespace FMH
{
......@@ -328,207 +356,8 @@ namespace FMH
{FILTER_TYPE::NONE, QStringList()}
};
static const QHash<FMH::MODEL_KEY, QString> MODEL_NAME =
{
{MODEL_KEY::ICON, "icon"},
{MODEL_KEY::LABEL, "label"},
{MODEL_KEY::PATH, "path"},
{MODEL_KEY::URL, "url"},
{MODEL_KEY::TYPE, "type"},
{MODEL_KEY::GROUP, "group"},
{MODEL_KEY::OWNER, "owner"},
{MODEL_KEY::SUFFIX, "suffix"},
{MODEL_KEY::NAME, "name"},
{MODEL_KEY::DATE, "date"},
{MODEL_KEY::MODIFIED, "modified"},
{MODEL_KEY::MIME, "mime"},
{MODEL_KEY::SIZE, "size"},
{MODEL_KEY::TAG, "tag"},
{MODEL_KEY::PERMISSIONS, "permissions"},
{MODEL_KEY::THUMBNAIL, "thumbnail"},
{MODEL_KEY::THUMBNAIL_1, "thumbnail_1"},
{MODEL_KEY::THUMBNAIL_2, "thumbnail_2"},
{MODEL_KEY::THUMBNAIL_3, "thumbnail_3"},
{MODEL_KEY::ICONSIZE, "iconsize"},
{MODEL_KEY::HIDDEN, "hidden"},
{MODEL_KEY::DETAILVIEW, "detailview"},
{MODEL_KEY::SHOWTERMINAL, "showterminal"},
{MODEL_KEY::SHOWTHUMBNAIL, "showthumbnail"},
{MODEL_KEY::COUNT, "count"},
{MODEL_KEY::SORTBY, "sortby"},
{MODEL_KEY::USER, "user"},
{MODEL_KEY::PASSWORD, "password"},
{MODEL_KEY::SERVER, "server"},
{MODEL_KEY::FOLDERSFIRST, "foldersfirst"},
{MODEL_KEY::VIEWTYPE, "viewtype"},
{MODEL_KEY::ADDDATE, "adddate"},
{MODEL_KEY::FAV, "fav"},
{MODEL_KEY::FAVORITE, "favorite"},
{MODEL_KEY::COLOR, "color"},
{MODEL_KEY::RATE, "rate"},
{MODEL_KEY::FORMAT, "format"},
{MODEL_KEY::PLACE, "place"},
{MODEL_KEY::LOCATION, "location"},
{MODEL_KEY::ALBUM, "album"},
{MODEL_KEY::DURATION, "duration"},
{MODEL_KEY::RELEASEDATE, "releasedate"},
{MODEL_KEY::ARTIST, "artist"},
{MODEL_KEY::LYRICS, "lyrics"},
{MODEL_KEY::TRACK, "track"},
{MODEL_KEY::GENRE, "genre"},
{MODEL_KEY::WIKI, "wiki"},
{MODEL_KEY::CONTEXT, "context"},
{MODEL_KEY::SOURCETYPE, "sourcetype"},
{MODEL_KEY::ARTWORK, "artwork"},
{MODEL_KEY::NOTE, "note"},
{MODEL_KEY::MOOD, "mood"},
{MODEL_KEY::COMMENT, "comment"},
{MODEL_KEY::PLAYLIST, "playlist"},
{MODEL_KEY::SOURCE, "source"},
{MODEL_KEY::TITLE, "title"},
{MODEL_KEY::ID, "id"},
{MODEL_KEY::LICENSE, "license"},
{MODEL_KEY::DESCRIPTION, "description"},
{MODEL_KEY::BOOKMARK, "bookmark"},
{MODEL_KEY::ACCOUNT, "account"},
{MODEL_KEY::ACCOUNTTYPE, "accounttype"},
{MODEL_KEY::VERSION, "version"},
{MODEL_KEY::DOMAIN, "domain"},
{MODEL_KEY::CATEGORY, "category"},
{MODEL_KEY::CONTENT, "content"},
{MODEL_KEY::PIN, "pin"},
{MODEL_KEY::IMG, "img"},
{MODEL_KEY::PREVIEW, "preview"},
{MODEL_KEY::LINK, "link"},
{MODEL_KEY::STAMP, "stamp"},
/** ccdav keys **/
{MODEL_KEY::N, "n"},
{MODEL_KEY::IM, "im"},
{MODEL_KEY::PHOTO, "photo"},
{MODEL_KEY::GENDER, "gender"},
{MODEL_KEY::ADR, "adr"},
{MODEL_KEY::ADR_2, "adr2"},
{MODEL_KEY::ADR_3, "adr3"},
{MODEL_KEY::EMAIL, "email"},
{MODEL_KEY::EMAIL_2, "email2"},
{MODEL_KEY::EMAIL_3, "email3"},
{MODEL_KEY::LANG, "lang"},
{MODEL_KEY::NICKNAME, "nickname"},
{MODEL_KEY::ORG, "org"},
{MODEL_KEY::PROFILE, "profile"},
{MODEL_KEY::TZ, "tz"},
{MODEL_KEY::TEL, "tel"},
{MODEL_KEY::TEL_2, "tel2"},
{MODEL_KEY::TEL_3, "tel3"},
{MODEL_KEY::CITY, "city"},
{MODEL_KEY::STATE, "state"},
{MODEL_KEY::COUNTRY, "country"}
};
static const QHash<QString, FMH::MODEL_KEY> MODEL_NAME_KEY =
{
{MODEL_NAME[MODEL_KEY::ICON], MODEL_KEY::ICON},
{MODEL_NAME[MODEL_KEY::LABEL], MODEL_KEY::LABEL},
{MODEL_NAME[MODEL_KEY::PATH], MODEL_KEY::PATH},
{MODEL_NAME[MODEL_KEY::URL], MODEL_KEY::URL},
{MODEL_NAME[MODEL_KEY::TYPE], MODEL_KEY::TYPE},
{MODEL_NAME[MODEL_KEY::GROUP], MODEL_KEY::GROUP},
{MODEL_NAME[MODEL_KEY::OWNER], MODEL_KEY::OWNER},
{MODEL_NAME[MODEL_KEY::SUFFIX], MODEL_KEY::SUFFIX},
{MODEL_NAME[MODEL_KEY::NAME], MODEL_KEY::NAME},
{MODEL_NAME[MODEL_KEY::DATE], MODEL_KEY::DATE},
{MODEL_NAME[MODEL_KEY::MODIFIED], MODEL_KEY::MODIFIED},
{MODEL_NAME[MODEL_KEY::MIME], MODEL_KEY::MIME},
{MODEL_NAME[MODEL_KEY::SIZE], MODEL_KEY::SIZE,},
{MODEL_NAME[MODEL_KEY::TAG], MODEL_KEY::TAG},
{MODEL_NAME[MODEL_KEY::PERMISSIONS], MODEL_KEY::PERMISSIONS},
{MODEL_NAME[MODEL_KEY::THUMBNAIL], MODEL_KEY::THUMBNAIL},
{MODEL_NAME[MODEL_KEY::THUMBNAIL_1], MODEL_KEY::THUMBNAIL_1},
{MODEL_NAME[MODEL_KEY::THUMBNAIL_2], MODEL_KEY::THUMBNAIL_2},
{MODEL_NAME[MODEL_KEY::THUMBNAIL_3], MODEL_KEY::THUMBNAIL_3},
{MODEL_NAME[MODEL_KEY::ICONSIZE], MODEL_KEY::ICONSIZE},
{MODEL_NAME[MODEL_KEY::HIDDEN], MODEL_KEY::HIDDEN},
{MODEL_NAME[MODEL_KEY::DETAILVIEW], MODEL_KEY::DETAILVIEW},
{MODEL_NAME[MODEL_KEY::SHOWTERMINAL], MODEL_KEY::SHOWTERMINAL},
{MODEL_NAME[MODEL_KEY::SHOWTHUMBNAIL], MODEL_KEY::SHOWTHUMBNAIL},
{MODEL_NAME[MODEL_KEY::COUNT], MODEL_KEY::COUNT},
{MODEL_NAME[MODEL_KEY::SORTBY], MODEL_KEY::SORTBY},
{MODEL_NAME[MODEL_KEY::USER], MODEL_KEY::USER},
{MODEL_NAME[MODEL_KEY::PASSWORD], MODEL_KEY::PASSWORD},
{MODEL_NAME[MODEL_KEY::SERVER], MODEL_KEY::SERVER},
{MODEL_NAME[MODEL_KEY::VIEWTYPE], MODEL_KEY::VIEWTYPE},
{MODEL_NAME[MODEL_KEY::ADDDATE], MODEL_KEY::ADDDATE},
{MODEL_NAME[MODEL_KEY::FAV], MODEL_KEY::FAV},
{MODEL_NAME[MODEL_KEY::FAVORITE], MODEL_KEY::FAVORITE},
{MODEL_NAME[MODEL_KEY::COLOR], MODEL_KEY::COLOR},
{MODEL_NAME[MODEL_KEY::RATE], MODEL_KEY::RATE},
{MODEL_NAME[MODEL_KEY::FORMAT], MODEL_KEY::FORMAT},
{MODEL_NAME[MODEL_KEY::PLACE], MODEL_KEY::PLACE},
{MODEL_NAME[MODEL_KEY::LOCATION], MODEL_KEY::LOCATION},
{MODEL_NAME[MODEL_KEY::ALBUM], MODEL_KEY::ALBUM},
{MODEL_NAME[MODEL_KEY::ARTIST], MODEL_KEY::ARTIST},
{MODEL_NAME[MODEL_KEY::DURATION], MODEL_KEY::DURATION},
{MODEL_NAME[MODEL_KEY::TRACK], MODEL_KEY::TRACK},
{MODEL_NAME[MODEL_KEY::GENRE], MODEL_KEY::GENRE},
{MODEL_NAME[MODEL_KEY::LYRICS], MODEL_KEY::LYRICS},
{MODEL_NAME[MODEL_KEY::RELEASEDATE], MODEL_KEY::RELEASEDATE},
{MODEL_NAME[MODEL_KEY::FORMAT], MODEL_KEY::FORMAT},
{MODEL_NAME[MODEL_KEY::WIKI], MODEL_KEY::WIKI},
{MODEL_NAME[MODEL_KEY::SOURCETYPE], MODEL_KEY::SOURCETYPE},
{MODEL_NAME[MODEL_KEY::ARTWORK], MODEL_KEY::ARTWORK},
{MODEL_NAME[MODEL_KEY::NOTE], MODEL_KEY::NOTE},
{MODEL_NAME[MODEL_KEY::MOOD], MODEL_KEY::MOOD},
{MODEL_NAME[MODEL_KEY::COMMENT], MODEL_KEY::COMMENT},
{MODEL_NAME[MODEL_KEY::CONTEXT], MODEL_KEY::CONTEXT},
{MODEL_NAME[MODEL_KEY::SOURCE], MODEL_KEY::SOURCE},
{MODEL_NAME[MODEL_KEY::TITLE], MODEL_KEY::TITLE},
{MODEL_NAME[MODEL_KEY::ID], MODEL_KEY::ID},
{MODEL_NAME[MODEL_KEY::LICENSE], MODEL_KEY::LICENSE},
{MODEL_NAME[MODEL_KEY::DESCRIPTION], MODEL_KEY::DESCRIPTION},
{MODEL_NAME[MODEL_KEY::BOOKMARK], MODEL_KEY::BOOKMARK},
{MODEL_NAME[MODEL_KEY::ACCOUNT], MODEL_KEY::ACCOUNT},
{MODEL_NAME[MODEL_KEY::ACCOUNTTYPE], MODEL_KEY::ACCOUNTTYPE},
{MODEL_NAME[MODEL_KEY::VERSION], MODEL_KEY::VERSION},
{MODEL_NAME[MODEL_KEY::DOMAIN], MODEL_KEY::DOMAIN},
{MODEL_NAME[MODEL_KEY::CATEGORY], MODEL_KEY::CATEGORY},
{MODEL_NAME[MODEL_KEY::CONTENT], MODEL_KEY::CONTENT},
{MODEL_NAME[MODEL_KEY::PIN], MODEL_KEY::PIN},
{MODEL_NAME[MODEL_KEY::IMG], MODEL_KEY::IMG},
{MODEL_NAME[MODEL_KEY::PREVIEW], MODEL_KEY::PREVIEW},
{MODEL_NAME[MODEL_KEY::LINK], MODEL_KEY::LINK},
{MODEL_NAME[MODEL_KEY::STAMP], MODEL_KEY::STAMP},
/** ccdav keys **/
{MODEL_NAME[MODEL_KEY::N], MODEL_KEY::N},
{MODEL_NAME[MODEL_KEY::IM], MODEL_KEY::IM},
{MODEL_NAME[MODEL_KEY::PHOTO], MODEL_KEY::PHOTO},
{MODEL_NAME[MODEL_KEY::GENDER], MODEL_KEY::GENDER},
{MODEL_NAME[MODEL_KEY::ADR], MODEL_KEY::ADR},
{MODEL_NAME[MODEL_KEY::ADR_2], MODEL_KEY::ADR_2},
{MODEL_NAME[MODEL_KEY::ADR_3], MODEL_KEY::ADR_3},
{MODEL_NAME[MODEL_KEY::EMAIL], MODEL_KEY::EMAIL},
{MODEL_NAME[MODEL_KEY::EMAIL_2], MODEL_KEY::EMAIL_2},
{MODEL_NAME[MODEL_KEY::EMAIL_3], MODEL_KEY::EMAIL_3},
{MODEL_NAME[MODEL_KEY::LANG], MODEL_KEY::LANG},
{MODEL_NAME[MODEL_KEY::NICKNAME], MODEL_KEY::NICKNAME},
{MODEL_NAME[MODEL_KEY::ORG], MODEL_KEY::ORG},
{MODEL_NAME[MODEL_KEY::PROFILE], MODEL_KEY::PROFILE},
{MODEL_NAME[MODEL_KEY::TZ], MODEL_KEY::TZ},
{MODEL_NAME[MODEL_KEY::TEL], MODEL_KEY::TEL},
{MODEL_NAME[MODEL_KEY::TEL_2], MODEL_KEY::TEL_2},
{MODEL_NAME[MODEL_KEY::TEL_3], MODEL_KEY::TEL_3},
{MODEL_NAME[MODEL_KEY::CITY], MODEL_KEY::CITY},
{MODEL_NAME[MODEL_KEY::STATE], MODEL_KEY::STATE},
{MODEL_NAME[MODEL_KEY::COUNTRY], MODEL_KEY::COUNTRY}