Fix crash on adding/removing feeds
This commit is contained in:
parent
1d8433f598
commit
38584415b2
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -141,7 +141,7 @@ SourceManager::EditFeed(Feed* updated)
|
|||
void
|
||||
SourceManager::RemoveFeed(Feed* mortonta)
|
||||
{
|
||||
return GetSource(mortonta)->EditFeed(mortonta);
|
||||
return GetSource(mortonta)->RemoveFeed(mortonta);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -44,6 +44,13 @@ RssAtom::Name()
|
|||
}
|
||||
|
||||
|
||||
const char*
|
||||
RssAtom::Config()
|
||||
{
|
||||
return fConfigPath.String();
|
||||
}
|
||||
|
||||
|
||||
BObjectList<Feed>
|
||||
RssAtom::Feeds()
|
||||
{
|
||||
|
|
|
@ -20,6 +20,7 @@ public:
|
|||
|
||||
const char* Type();
|
||||
const char* Name();
|
||||
const char* Config();
|
||||
|
||||
BObjectList<Feed> 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;
|
||||
};
|
||||
|
||||
|
||||
|
|
Ŝarĝante…
Reference in New Issue