Go to the documentation of this file.
8 #include <QCoreApplication>
12 #include <mythconfig.h>
21 #include <libmythbase/mythversion.h>
47 add(
"--refresh-all",
"refresh-all",
false,
48 "Refresh ALL configured and installed tree grabbers",
"");
49 add(
"--refresh-rss",
"refresh-rss",
false,
50 "Refresh RSS feeds only",
"");
51 add(
"--refresh-tree",
"refresh-tree",
false,
52 "Refresh trees only",
"");
57 int main(
int argc,
char *argv[])
78 QCoreApplication a(argc, argv);
79 QCoreApplication::setApplicationName(
"mythfillnetvision");
90 if (!context.Init(
false))
92 LOG(VB_GENERAL, LOG_ERR,
"Failed to init MythContext, exiting.");
100 if (refreshall && (refreshrss || refreshtree))
102 LOG(VB_GENERAL, LOG_ERR,
"--refresh-all must not be accompanied by "
103 "--refresh-rss or --refresh-tree");
107 if (refreshrss && refreshtree)
109 LOG(VB_GENERAL, LOG_ERR,
"--refresh-rss and --refresh-tree are "
110 "mutually exclusive options");
114 if (!refreshall && !refreshrss && !refreshtree)
125 if (refreshall || refreshtree)
138 if ((refreshall || refreshrss) && !
findAllDBRSS().empty())
152 LOG(VB_GENERAL, LOG_INFO,
"MythFillNetvision run complete.");
void LoadArguments(void) override
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
Parent class for defining application command line parsers.
MythCommFlagCommandLineParser cmdline
Startup context for MythTV.
void addVersion(void)
Canned argument definition for –version.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
void addLogging(const QString &defaultVerbosity="general", LogLevel_t defaultLogLevel=LOG_INFO)
Canned argument definition for all logging options, including –verbose, –logpath, –quiet,...
virtual bool Parse(int argc, const char *const *argv)
Loop through argv and populate arguments with values.
CommandLineArg * add(const QString &arg, const QString &name, bool def, QString help, QString longhelp)
MythFillNVCommandLineParser()
@ GENERIC_EXIT_INVALID_CMDLINE
Command line parse error.
@ GENERIC_EXIT_OK
Exited with no error.
static void PrintVersion(void)
Print application version information.
GrabberDownloadThread * gdt
void PrintHelp(void) const
Print command line option help.
RSSSite::rssList findAllDBRSS()
int main(int argc, char *argv[])
void addHelp(void)
Canned argument definition for –help.
bool toBool(const QString &key) const
Returns stored QVariant as a boolean.
int ConfigureLogging(const QString &mask="general", bool progress=false)
Read in logging options and initialize the logging interface.
virtual void LoadArguments(void)
static void load(const QString &module_name)
Load a QTranslator for the user's preferred language.
@ GENERIC_EXIT_NO_MYTHCONTEXT
No MythContext available.