Rename Config to Preferences
This commit is contained in:
parent
9fcae6cf9a
commit
0066b9a522
2
Makefile
2
Makefile
|
@ -31,7 +31,6 @@ APP_MIME_SIG = application/x-vnd.Pogger
|
|||
SRCS = \
|
||||
src/App.cpp, \
|
||||
src/AtomFeed.cpp, \
|
||||
src/Config.cpp, \
|
||||
src/Entry.cpp, \
|
||||
src/EntriesView.cpp, \
|
||||
src/Feed.cpp, \
|
||||
|
@ -42,6 +41,7 @@ SRCS = \
|
|||
src/MainWindow.cpp, \
|
||||
src/Mimetypes.cpp, \
|
||||
src/Notifier.cpp, \
|
||||
src/Preferences.cpp, \
|
||||
src/ProtocolListener.cpp, \
|
||||
src/RssFeed.cpp, \
|
||||
src/UpdatesView.cpp, \
|
||||
|
|
10
src/App.cpp
10
src/App.cpp
|
@ -12,7 +12,6 @@
|
|||
#include <getopt.h>
|
||||
|
||||
#include "AtomFeed.h"
|
||||
#include "Config.h"
|
||||
#include "Entry.h"
|
||||
#include "Feed.h"
|
||||
#include "FeedController.h"
|
||||
|
@ -20,6 +19,7 @@
|
|||
#include "MainWindow.h"
|
||||
#include "Mimetypes.h"
|
||||
#include "Notifier.h"
|
||||
#include "Preferences.h"
|
||||
#include "RssFeed.h"
|
||||
#include "Util.h"
|
||||
|
||||
|
@ -31,15 +31,15 @@ main(int argc, char** argv)
|
|||
|
||||
App* app = new App();
|
||||
app->Run();
|
||||
app->cfg->Save();
|
||||
app->fPreferences->Save();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
App::App() : BApplication("application/x-vnd.Pogger")
|
||||
{
|
||||
cfg = new Config;
|
||||
cfg->Load();
|
||||
fPreferences = new Preferences;
|
||||
fPreferences->Load();
|
||||
|
||||
fMainWindow = new MainWindow();
|
||||
fNotifier = new Notifier();
|
||||
|
@ -49,7 +49,7 @@ App::App() : BApplication("application/x-vnd.Pogger")
|
|||
BMessage* updateMessage = new BMessage(kUpdateSubscribed);
|
||||
// MessageReceived(updateMessage);
|
||||
fUpdateRunner = new BMessageRunner(this, updateMessage,
|
||||
cfg->updateInterval);
|
||||
fPreferences->updateInterval);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
#include <SupportDefs.h>
|
||||
#include <Application.h>
|
||||
|
||||
#include "Preferences.h"
|
||||
|
||||
class BMessage;
|
||||
class BMessageRunner;
|
||||
class Config;
|
||||
class FeedController;
|
||||
class MainWindow;
|
||||
class Notifier;
|
||||
|
@ -26,10 +26,10 @@ public:
|
|||
void ArgvReceived(int32 argc, char** argv);
|
||||
|
||||
|
||||
Config* cfg;
|
||||
MainWindow* fMainWindow;
|
||||
BMessageRunner* fUpdateRunner;
|
||||
Preferences* fPreferences;
|
||||
Notifier* fNotifier;
|
||||
BMessageRunner* fUpdateRunner;
|
||||
|
||||
private:
|
||||
FeedController* fFeedController;
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include <tinyxml2.h>
|
||||
|
||||
#include "App.h"
|
||||
#include "Config.h"
|
||||
#include "Entry.h"
|
||||
#include "Util.h"
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#include "Config.h"
|
||||
#include "Util.h"
|
||||
|
||||
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
|
||||
#include <tinyxml2.h>
|
||||
|
||||
#include "Config.h"
|
||||
|
||||
|
||||
class Entry {
|
||||
public:
|
||||
|
|
|
@ -5,11 +5,12 @@
|
|||
|
||||
#include "Feed.h"
|
||||
|
||||
#include <File.h>
|
||||
|
||||
#include <tinyxml2.h>
|
||||
|
||||
#include "App.h"
|
||||
#include "Entry.h"
|
||||
#include "Config.h"
|
||||
#include "Util.h"
|
||||
|
||||
|
||||
|
@ -188,8 +189,6 @@ Feed::xmlCountSiblings (tinyxml2::XMLElement* xsibling, const char* sibling_name
|
|||
bool
|
||||
Feed::AddEntry (Entry* newEntry)
|
||||
{
|
||||
Config* cfg = ((App*)be_app)->cfg;
|
||||
|
||||
entries.AddItem(newEntry);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include "FeedController.h"
|
||||
|
||||
#include <Directory.h>
|
||||
#include <Message.h>
|
||||
#include <Notification.h>
|
||||
|
||||
|
@ -149,7 +150,7 @@ FeedController::_ParseLoop(void* ignored)
|
|||
BList entries;
|
||||
BString feedTitle;
|
||||
BUrl feedUrl = feedBuffer->GetXmlUrl();
|
||||
BDirectory outDir = BDirectory(((App*)be_app)->cfg->outDir);
|
||||
BDirectory outDir = BDirectory(((App*)be_app)->fPreferences->outDir);
|
||||
|
||||
if (feedBuffer->IsAtom()) {
|
||||
AtomFeed* feed = (AtomFeed*)malloc(sizeof(AtomFeed));
|
||||
|
|
|
@ -3,24 +3,24 @@
|
|||
* All rights reserved. Distributed under the terms of the MIT license.
|
||||
*/
|
||||
|
||||
#include "Config.h"
|
||||
#include "Preferences.h"
|
||||
|
||||
#include <String.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
||||
Config::Config() {
|
||||
Preferences::Preferences() {
|
||||
}
|
||||
|
||||
|
||||
Config::Config(Config* cfg) {
|
||||
Preferences::Preferences(Preferences* pref) {
|
||||
}
|
||||
|
||||
|
||||
// !! handle file status
|
||||
void
|
||||
Config::Load()
|
||||
Preferences::Load()
|
||||
{
|
||||
configDir = BString("/boot/home/config/settings/Pogger/");
|
||||
|
||||
|
@ -41,7 +41,7 @@ Config::Load()
|
|||
|
||||
// !! handle file status
|
||||
void
|
||||
Config::Save ()
|
||||
Preferences::Save ()
|
||||
{
|
||||
if (configDir == NULL)
|
||||
configDir = BString("/boot/home/config/settings/Pogger/");
|
|
@ -2,8 +2,8 @@
|
|||
* Copyright 2020, Jaidyn Levesque <jadedctrl@teknik.io>
|
||||
* All rights reserved. Distributed under the terms of the MIT license.
|
||||
*/
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
#ifndef PREFS_H
|
||||
#define PREFS_H
|
||||
|
||||
|
||||
#include <DateTime.h>
|
||||
|
@ -11,10 +11,10 @@
|
|||
#include <StorageKit.h>
|
||||
|
||||
|
||||
class Config {
|
||||
class Preferences {
|
||||
public:
|
||||
Config();
|
||||
Config(Config*);
|
||||
Preferences();
|
||||
Preferences(Preferences*);
|
||||
|
||||
void Load();
|
||||
void Save();
|
||||
|
@ -32,5 +32,5 @@ public:
|
|||
};
|
||||
|
||||
|
||||
#endif
|
||||
#endif // PREFS_H
|
||||
|
|
@ -6,7 +6,6 @@
|
|||
#include "RssFeed.h"
|
||||
|
||||
#include "App.h"
|
||||
#include "Config.h"
|
||||
#include "Entry.h"
|
||||
#include "Util.h"
|
||||
|
||||
|
|
Ŝarĝante…
Reference in New Issue