Save manually-written feed titles
This commit is contained in:
parent
ff7d97aa80
commit
3a423f8a92
|
@ -16,7 +16,7 @@
|
|||
|
||||
AtomFeed::AtomFeed()
|
||||
{
|
||||
fTitle = BString("Untitled Feed");
|
||||
fTitle = BString("");
|
||||
fCachePath = BString("");
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,7 @@ AtomFeed::AtomFeed()
|
|||
AtomFeed::AtomFeed(Feed* feed)
|
||||
: AtomFeed::AtomFeed()
|
||||
{
|
||||
SetTitle(feed->Title());
|
||||
SetXmlUrl(feed->XmlUrl());
|
||||
SetCachePath(feed->CachePath());
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ Feed::Feed(Feed* feed)
|
|||
|
||||
Feed::Feed()
|
||||
:
|
||||
fTitle(BString("Untitled Feed"))
|
||||
fTitle(BString(""))
|
||||
{
|
||||
fLastDate = BDateTime::CurrentDateTime(B_LOCAL_TIME);
|
||||
}
|
||||
|
@ -243,7 +243,7 @@ Feed::SetTitle(const char* titleStr)
|
|||
bool
|
||||
Feed::_SetTitle(tinyxml2::XMLElement* elem)
|
||||
{
|
||||
if (elem != NULL)
|
||||
if (elem != NULL && fTitle.IsEmpty() == true)
|
||||
return SetTitle(elem->GetText());
|
||||
else return false;
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "FeedController.h"
|
||||
#include "FeedListItem.h"
|
||||
#include "FeedsView.h"
|
||||
#include "Util.h"
|
||||
|
||||
|
||||
FeedEditWindow::FeedEditWindow()
|
||||
|
@ -163,7 +164,7 @@ FeedEditWindow::_SaveFeed()
|
|||
|
||||
BString filename;
|
||||
if (title.IsEmpty())
|
||||
filename = BString(urlString);
|
||||
filename = BString(urlToFilename(BUrl(urlString)));
|
||||
else
|
||||
filename = BString(title);
|
||||
subPath.Append(filename);
|
||||
|
|
|
@ -18,6 +18,8 @@ FeedListItem::FeedListItem(Feed* feed)
|
|||
fFeedUrl(feed->XmlUrl()),
|
||||
fFeedPath(feed->CachePath())
|
||||
{
|
||||
if (feed->Title().IsEmpty() == true)
|
||||
SetText("Untitled Feed");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ FeedsView::MessageReceived(BMessage* msg)
|
|||
}
|
||||
case kFeedsEditButton:
|
||||
{
|
||||
if (msg->GetInt32("index", -1) >= 0)
|
||||
_EditSelectedFeed();
|
||||
break;
|
||||
}
|
||||
|
@ -92,8 +93,10 @@ FeedsView::MessageReceived(BMessage* msg)
|
|||
if (msg->FindInt32("total", &total) == B_OK
|
||||
&& msg->FindInt32("current", ¤t) == B_OK)
|
||||
{
|
||||
if (total == current)
|
||||
if (total == current) {
|
||||
fProgressLabel->SetText("");
|
||||
_PopulateFeedList();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
RssFeed::RssFeed()
|
||||
{
|
||||
fTitle = BString("Untitled Feed");
|
||||
fTitle = BString("");
|
||||
fXmlUrl = BString("");
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,7 @@ RssFeed::RssFeed()
|
|||
RssFeed::RssFeed(Feed* feed)
|
||||
: RssFeed::RssFeed()
|
||||
{
|
||||
SetTitle(feed->Title());
|
||||
SetXmlUrl(feed->XmlUrl());
|
||||
SetCachePath(feed->CachePath());
|
||||
}
|
||||
|
|
Ŝarĝante…
Reference in New Issue