From ff7d97aa80704f5ea6b41b70b15ea9be33793734 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann Date: Sun, 21 Mar 2021 13:45:06 -0500 Subject: [PATCH] Add default subscription --- src/FeedController.cpp | 6 ++++++ src/FeedEditWindow.cpp | 7 +++++++ src/Preferences.cpp | 2 -- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/FeedController.cpp b/src/FeedController.cpp index 86dd0f6..abe05c9 100644 --- a/src/FeedController.cpp +++ b/src/FeedController.cpp @@ -97,6 +97,12 @@ FeedController::SubscribedFeeds() BDirectory subDir(subPath.Path()); if (subDir.InitCheck() == B_ENTRY_NOT_FOUND) { subDir.CreateDirectory(subPath.Path(), &subDir); + + subPath.Append("Haiku Project"); + Feed defaultSub(BUrl("https://www.haiku-os.org/blog/index.xml"), + BEntry(subPath.Path())); + defaultSub.SetTitle("Haiku Project"); + defaultSub.Filetize(); } BEntry feedEntry; diff --git a/src/FeedEditWindow.cpp b/src/FeedEditWindow.cpp index 3c151c2..ada6614 100644 --- a/src/FeedEditWindow.cpp +++ b/src/FeedEditWindow.cpp @@ -132,6 +132,13 @@ FeedEditWindow::_SaveFeed() BDirectory subDir(subPath.Path()); if (subDir.InitCheck() == B_ENTRY_NOT_FOUND) { subDir.CreateDirectory(subPath.Path(), &subDir); + + BPath defaultSubPath(subPath); + defaultSubPath.Append("Haiku Project"); + Feed defaultSub(BUrl("https://www.haiku-os.org/blog/index.xml"), + BEntry(defaultSubPath.Path())); + defaultSub.SetTitle("Haiku Project"); + defaultSub.Filetize(); } BString title(fFeedNameText->Text()); diff --git a/src/Preferences.cpp b/src/Preferences.cpp index 69385d7..11e475c 100644 --- a/src/Preferences.cpp +++ b/src/Preferences.cpp @@ -18,7 +18,6 @@ Preferences::Preferences(Preferences* pref) { } -// !! handle file status void Preferences::Load() { @@ -57,7 +56,6 @@ Preferences::Load() } -// !! handle file status void Preferences::Save() {