diff --git a/src/Entry.cpp b/src/Entry.cpp index 51ea1ba..ac8866a 100644 --- a/src/Entry.cpp +++ b/src/Entry.cpp @@ -31,8 +31,13 @@ bool Entry::Filetize(BDirectory outDir) { BFile file(title.String(), B_READ_WRITE); + BEntry outDirEntry; time_t tt_date = date.Time_t(); + outDir.GetEntry(&outDirEntry); + if (outDir.InitCheck() == B_ENTRY_NOT_FOUND) { + outDir.CreateDirectory(BPath(&outDirEntry).Path(), &outDir); + } outDir.CreateFile(title.String(), &file); BString betype = BString("text/x-feed-entry"); diff --git a/src/FeedController.cpp b/src/FeedController.cpp index 639feac..977c3ec 100644 --- a/src/FeedController.cpp +++ b/src/FeedController.cpp @@ -94,8 +94,11 @@ FeedController::SubscribedFeeds() find_directory(B_USER_SETTINGS_DIRECTORY, &subPath); subPath.Append("Pogger"); subPath.Append("Subscriptions"); - BDirectory subDir(subPath.Path()); + if (subDir.InitCheck() == B_ENTRY_NOT_FOUND) { + subDir.CreateDirectory(subPath.Path(), &subDir); + } + BEntry feedEntry; BPath feedPath; BStringList feeds; diff --git a/src/FeedEditWindow.cpp b/src/FeedEditWindow.cpp index 165bd46..6f33aa7 100644 --- a/src/FeedEditWindow.cpp +++ b/src/FeedEditWindow.cpp @@ -129,6 +129,10 @@ FeedEditWindow::_SaveFeed() find_directory(B_USER_SETTINGS_DIRECTORY, &subPath); subPath.Append("Pogger"); subPath.Append("Subscriptions"); + BDirectory subDir(subPath.Path()); + if (subDir.InitCheck() == B_ENTRY_NOT_FOUND) { + subDir.CreateDirectory(subPath.Path(), &subDir); + } BString title(fFeedNameText->Text()); const char* urlString = fFeedUrlText->Text(); diff --git a/src/Preferences.cpp b/src/Preferences.cpp index 51e31e3..69385d7 100644 --- a/src/Preferences.cpp +++ b/src/Preferences.cpp @@ -25,6 +25,10 @@ Preferences::Load() BPath cfgPath; find_directory(B_USER_SETTINGS_DIRECTORY, &cfgPath); cfgPath.Append("Pogger"); + if (BDirectory(cfgPath.Path()).InitCheck() == B_ENTRY_NOT_FOUND) { + BDirectory(cfgPath.Path()).CreateDirectory(cfgPath.Path(), NULL); + } + BString filename = BString(cfgPath.Path()).Append("/Settings"); BFile file = BFile(filename.String(), B_READ_ONLY);