diff --git a/resources/text/CHANGELOG b/resources/text/CHANGELOG index 1a07e344b..263b49fd6 100755 --- a/resources/text/CHANGELOG +++ b/resources/text/CHANGELOG @@ -14,6 +14,7 @@ Added: Fixed: +▪ Fixed some problems when adding feeds from external web browser like Firefox. (bug #135) ▪ Fixed problem where custom HTTP timeout setting was ignored for TT-RSS account. (GitHub bug #9) ▪ Fixed problems with master update mutex locking. (bug #153) ▪ Fixed some problems: "Add category to selected account" was enabled when it shouldn't be. diff --git a/src/definitions/definitions.h.in b/src/definitions/definitions.h.in index 76c73cfc8..2ac1aa7d8 100755 --- a/src/definitions/definitions.h.in +++ b/src/definitions/definitions.h.in @@ -46,6 +46,7 @@ #define ENCLOSURES_OUTER_SEPARATOR '#' #define ECNLOSURES_INNER_SEPARATOR '&' +#define URI_SCHEME_FEED_SHORT "feed:" #define URI_SCHEME_FEED "feed://" #define URI_SCHEME_HTTP "http://" #define RELEASES_LIST "https://bitbucket.org/skunkos/rssguard/raw/master/resources/text/UPDATES?at=master" diff --git a/src/miscellaneous/application.cpp b/src/miscellaneous/application.cpp index ff5e850a6..fca4b4e49 100755 --- a/src/miscellaneous/application.cpp +++ b/src/miscellaneous/application.cpp @@ -171,7 +171,7 @@ void Application::processExecutionMessage(const QString &message) { else if (msg == APP_QUIT_INSTANCE) { quit(); } - else if (msg.startsWith(QL1S(URI_SCHEME_FEED))) { + else if (msg.startsWith(QL1S(URI_SCHEME_FEED_SHORT))) { // Application was running, and someone wants to add new feed. StandardServiceRoot *root = qApp->mainForm()->tabWidget()->feedMessageViewer()->feedsView()->sourceModel()->standardServiceRoot(); diff --git a/src/services/standard/standardserviceroot.cpp b/src/services/standard/standardserviceroot.cpp index 43bb91212..beca633fa 100755 --- a/src/services/standard/standardserviceroot.cpp +++ b/src/services/standard/standardserviceroot.cpp @@ -315,9 +315,25 @@ void StandardServiceRoot::checkArgumentsForFeedAdding() { } } +QString StandardServiceRoot::processFeedUrl(const QString &feed_url) { + if (feed_url.startsWith(QL1S(URI_SCHEME_FEED_SHORT))) { + QString without_feed_prefix = feed_url.mid(5); + + if (without_feed_prefix.startsWith(QL1S("https:")) || without_feed_prefix.startsWith(QL1S("http:"))) { + return without_feed_prefix; + } + else { + return feed_url; + } + } + else { + return feed_url; + } +} + void StandardServiceRoot::checkArgumentForFeedAdding(const QString &argument) { - if (argument.startsWith(QL1S("feed:"))) { - addNewFeed(argument); + if (argument.startsWith(QL1S(URI_SCHEME_FEED_SHORT))) { + addNewFeed(processFeedUrl(argument)); } } diff --git a/src/services/standard/standardserviceroot.h b/src/services/standard/standardserviceroot.h index 81687da99..57f18ae50 100755 --- a/src/services/standard/standardserviceroot.h +++ b/src/services/standard/standardserviceroot.h @@ -88,6 +88,7 @@ class StandardServiceRoot : public ServiceRoot { void exportFeeds(); private: + QString processFeedUrl(const QString &feed_url); void checkArgumentsForFeedAdding(); RecycleBin *m_recycleBin;