Commit c130e585 authored by camilo higuita's avatar camilo higuita

add toggle option to fav and unfav urls

parent d991aa08
......@@ -776,5 +776,5 @@ bool FMList::itemIsFav(const QUrl &path)
bool FMList::favItem(const QUrl &path)
{
return FMStatic::fav(path);
return FMStatic::toggleFav(path);
}
......@@ -415,13 +415,18 @@ bool FMStatic::checkFileType(const int& type, const QString& mimeTypeName)
return FMH::SUPPORTED_MIMETYPES[static_cast<FMH::FILTER_TYPE>(type)].contains(mimeTypeName);
}
bool FMStatic::fav(const QUrl& url)
bool FMStatic::toggleFav(const QUrl& url)
{
#ifdef COMPONENT_TAGGING
if(FMStatic::isFav(url))
FMStatic::unFav(url);
return FMStatic::unFav(url);
return Tagging::getInstance()->tagUrl(url.toString(), "fav", "#e91e63");
return FMStatic::fav(url);
}
bool FMStatic::fav(const QUrl& url)
{
#ifdef COMPONENT_TAGGING
return Tagging::getInstance()->tagUrl(url.toString(), "fav", "#e91e63");
#endif
}
......@@ -441,3 +446,5 @@ bool FMStatic::isFav(const QUrl& url, const bool &strict)
......@@ -73,6 +73,7 @@ public slots:
static bool isFav(const QUrl &url, const bool &strict = false);
static bool unFav(const QUrl &url);
static bool fav(const QUrl &url);
static bool toggleFav(const QUrl &url);
};
#endif // FMSTATIC_H
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