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->SetTitle(title.String());
|
||||||
fFeed->SetUrl(BUrl(urlString));
|
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);
|
SourceManager::AddFeed(fFeed);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
SourceManager::EditFeed(fFeed);
|
SourceManager::EditFeed(fFeed);
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ public:
|
||||||
|
|
||||||
virtual const char* Type() { return "Source"; };
|
virtual const char* Type() { return "Source"; };
|
||||||
virtual const char* Name() { return "Generic"; };
|
virtual const char* Name() { return "Generic"; };
|
||||||
|
virtual const char* Config() { return NULL; };
|
||||||
|
|
||||||
BString fConfigPath;
|
BString fConfigPath;
|
||||||
};
|
};
|
||||||
|
|
|
@ -141,7 +141,7 @@ SourceManager::EditFeed(Feed* updated)
|
||||||
void
|
void
|
||||||
SourceManager::RemoveFeed(Feed* mortonta)
|
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>
|
BObjectList<Feed>
|
||||||
RssAtom::Feeds()
|
RssAtom::Feeds()
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,6 +20,7 @@ public:
|
||||||
|
|
||||||
const char* Type();
|
const char* Type();
|
||||||
const char* Name();
|
const char* Name();
|
||||||
|
const char* Config();
|
||||||
|
|
||||||
BObjectList<Feed> Feeds();
|
BObjectList<Feed> Feeds();
|
||||||
|
|
||||||
|
@ -34,6 +35,8 @@ public:
|
||||||
|
|
||||||
bool IsUpdated(Feed* feed);
|
bool IsUpdated(Feed* feed);
|
||||||
|
|
||||||
|
BString fConfigPath;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool _IsAtom(Feed* feed);
|
bool _IsAtom(Feed* feed);
|
||||||
bool _IsRss(Feed* feed);
|
bool _IsRss(Feed* feed);
|
||||||
|
@ -71,7 +74,6 @@ private:
|
||||||
BPath _SubscriptionPath();
|
BPath _SubscriptionPath();
|
||||||
|
|
||||||
BString fTitle;
|
BString fTitle;
|
||||||
BString fConfigPath;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Ŝarĝante…
Reference in New Issue