diff --git a/src/FeedEditWindow.cpp b/src/FeedEditWindow.cpp index cde19eb..91a1669 100644 --- a/src/FeedEditWindow.cpp +++ b/src/FeedEditWindow.cpp @@ -146,8 +146,11 @@ FeedEditWindow::_SaveFeed() fFeed->SetTitle(title.String()); fFeed->SetUrl(BUrl(urlString)); - if (BString(fFeed->Identifier()).IsEmpty() == true) + if (BString(fFeed->Identifier()).IsEmpty() == true) { + Source* source = SourceManager::GetSourceOfType("RssAtom"); + fFeed->SetSource(source->Config()); SourceManager::AddFeed(fFeed); + } else SourceManager::EditFeed(fFeed); diff --git a/src/Source.h b/src/Source.h index aeea3f1..ed9537d 100644 --- a/src/Source.h +++ b/src/Source.h @@ -43,6 +43,7 @@ public: virtual const char* Type() { return "Source"; }; virtual const char* Name() { return "Generic"; }; + virtual const char* Config() { return NULL; }; BString fConfigPath; }; diff --git a/src/SourceManager.cpp b/src/SourceManager.cpp index 367df40..d0a4b03 100644 --- a/src/SourceManager.cpp +++ b/src/SourceManager.cpp @@ -141,7 +141,7 @@ SourceManager::EditFeed(Feed* updated) void SourceManager::RemoveFeed(Feed* mortonta) { - return GetSource(mortonta)->EditFeed(mortonta); + return GetSource(mortonta)->RemoveFeed(mortonta); } diff --git a/src/sources/RssAtom.cpp b/src/sources/RssAtom.cpp index f8b4a23..10bc3ef 100644 --- a/src/sources/RssAtom.cpp +++ b/src/sources/RssAtom.cpp @@ -44,6 +44,13 @@ RssAtom::Name() } +const char* +RssAtom::Config() +{ + return fConfigPath.String(); +} + + BObjectList RssAtom::Feeds() { diff --git a/src/sources/RssAtom.h b/src/sources/RssAtom.h index db47440..d855124 100644 --- a/src/sources/RssAtom.h +++ b/src/sources/RssAtom.h @@ -20,6 +20,7 @@ public: const char* Type(); const char* Name(); + const char* Config(); BObjectList Feeds(); @@ -34,6 +35,8 @@ public: bool IsUpdated(Feed* feed); + BString fConfigPath; + private: bool _IsAtom(Feed* feed); bool _IsRss(Feed* feed); @@ -71,7 +74,6 @@ private: BPath _SubscriptionPath(); BString fTitle; - BString fConfigPath; };