Commit 98b6b963 authored by Camilo Higuita's avatar Camilo Higuita

actually make strict get urls with a tag work properly

parent c130e585
...@@ -95,7 +95,6 @@ namespace TAG ...@@ -95,7 +95,6 @@ namespace TAG
{TAG::KEYS::LAST_SYNC, "lastSync"}, {TAG::KEYS::LAST_SYNC, "lastSync"},
{TAG::KEYS::LOT, "lot"}, {TAG::KEYS::LOT, "lot"},
{TAG::KEYS::KEY, "key"}, {TAG::KEYS::KEY, "key"},
{TAG::KEYS::NAME, "name"},
{TAG::KEYS::APP, "app"}, {TAG::KEYS::APP, "app"},
{TAG::KEYS::URI, "uri"}, {TAG::KEYS::URI, "uri"},
{TAG::KEYS::VERSION, "version"} {TAG::KEYS::VERSION, "version"}
...@@ -116,7 +115,6 @@ namespace TAG ...@@ -116,7 +115,6 @@ namespace TAG
{TAG::KEYMAP[KEYS::LAST_SYNC], KEYS::LAST_SYNC}, {TAG::KEYMAP[KEYS::LAST_SYNC], KEYS::LAST_SYNC},
{TAG::KEYMAP[KEYS::LOT], KEYS::LOT}, {TAG::KEYMAP[KEYS::LOT], KEYS::LOT},
{TAG::KEYMAP[KEYS::KEY], KEYS::KEY}, {TAG::KEYMAP[KEYS::KEY], KEYS::KEY},
{TAG::KEYMAP[KEYS::NAME], KEYS::NAME},
{TAG::KEYMAP[KEYS::APP], KEYS::APP}, {TAG::KEYMAP[KEYS::APP], KEYS::APP},
{TAG::KEYMAP[KEYS::URI], KEYS::URI}, {TAG::KEYMAP[KEYS::URI], KEYS::URI},
{TAG::KEYMAP[KEYS::VERSION], KEYS::VERSION} {TAG::KEYMAP[KEYS::VERSION], KEYS::VERSION}
......
...@@ -209,7 +209,7 @@ QVariantList Tagging::getAllTags(const bool &strict) ...@@ -209,7 +209,7 @@ QVariantList Tagging::getAllTags(const bool &strict)
QVariantList Tagging::getUrls(const QString &tag, const bool &strict, std::function<bool(QVariantMap &item)> modifier) QVariantList Tagging::getUrls(const QString &tag, const bool &strict, std::function<bool(QVariantMap &item)> modifier)
{ {
return !strict ? this->get(QString("select distinct turl.*, t.color, t.comment as tagComment from TAGS t inner join TAGS_URLS turl on turl.tag = t.tag where t.tag = '%1'").arg(tag), modifier): return !strict ? this->get(QString("select distinct * from TAGS_URLS where tag = '%1'").arg(tag), modifier):
this->get(QString("select distinct turl.*, t.color, t.comment as tagComment from TAGS t " this->get(QString("select distinct turl.*, t.color, t.comment as tagComment from TAGS t "
"inner join TAGS_USERS tu on t.tag = tu.tag " "inner join TAGS_USERS tu on t.tag = tu.tag "
"inner join APPS_USERS au on au.mac = tu.mac and au.app = t.app " "inner join APPS_USERS au on au.mac = tu.mac and au.app = t.app "
......
...@@ -41,6 +41,8 @@ class MAUIKIT_EXPORT Tagging : public TAGDB ...@@ -41,6 +41,8 @@ class MAUIKIT_EXPORT Tagging : public TAGDB
public: public:
static Tagging *getInstance() static Tagging *getInstance()
{ {
qWarning()<< "GETTIG TAGGING INSTANCE" << QThread::currentThread() << qApp->thread();
if(QThread::currentThread() != qApp->thread()) if(QThread::currentThread() != qApp->thread())
{ {
qWarning()<< "Can not get Tagging instance from a thread different than the mian one " << QThread::currentThread() << qApp->thread(); qWarning()<< "Can not get Tagging instance from a thread different than the mian one " << QThread::currentThread() << qApp->thread();
......
...@@ -107,11 +107,12 @@ QVariantMap TagsList::get(const int &index) const ...@@ -107,11 +107,12 @@ QVariantMap TagsList::get(const int &index) const
return QVariantMap(); return QVariantMap();
const auto folder = this->list.at(index); const auto folder = this->list.at(index);
return std::accumulate(folder.keys().constBegin(), folder.keys().constEnd(), QVariantMap(), [&folder](QVariantMap &res, const TAG::KEYS &key) const auto keys =folder.keys();
return std::accumulate(keys.constBegin(), keys.constEnd(), QVariantMap(), [folder](QVariantMap &res, const TAG::KEYS &key)
{ {
res.insert(TAG::KEYMAP[key], folder[key]); res.insert(TAG::KEYMAP[key], folder[key]);
return res; return res;
}); });
} }
void TagsList::refresh() void TagsList::refresh()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment