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