refs #642, fixed setup loading, in same step refs #636 clear cache

* changed signals in setup reader
* explicit mode is default
* detailed information what is loaded
* new log pattern
* allow to add message list to log component
* allow to clear cache by cmd line arg
* consolidated cmd names
This commit is contained in:
Klaus Basan
2016-04-14 02:27:23 +02:00
parent bd9de9308c
commit d0daad7d34
17 changed files with 372 additions and 159 deletions

View File

@@ -90,10 +90,10 @@ namespace BlackCore
void deleteAllCookies();
//! Setup already syncronized
bool isSetupSyncronized() const;
bool isSetupAvailable() const;
//! Reload setup and version
BlackMisc::CStatusMessage requestReloadOfSetupAndVersion();
BlackMisc::CStatusMessageList requestReloadOfSetupAndVersion();
//! Web data services available?
bool hasWebDataServices() const;
@@ -114,7 +114,7 @@ namespace BlackCore
const char *swiftVersionChar();
//! Running in dev.environment?
bool isRunningInDeveloperEnvironment() const;
bool isRunningInDeveloperEnvironment() const { return this->m_devEnv; }
//! Signal startup automatically or individually
void signalStartupAutomatically(bool signal = false);
@@ -137,6 +137,9 @@ namespace BlackCore
//! Process all events for some time
static void processEventsFor(int milliseconds);
//! Clear the caches
static QStringList clearCaches();
// ----------------------- parsing ----------------------------------------
//! \name parsing of command line options
@@ -259,11 +262,11 @@ namespace BlackCore
const BlackMisc::CSlot<void(QNetworkReply *)> &callback);
signals:
//! Setup syncronized
void setupSyncronized(bool success);
//! Setup available (cache, web load, ..)
void setupAvailable(bool success);
//! Update info syncronized
void updateInfoSynchronized(bool success);
//! Update info available (cache, web load)
void updateInfoAvailable(bool success);
//! Startup has been completed
void startUpCompleted(bool success);
@@ -276,7 +279,7 @@ namespace BlackCore
protected slots:
//! Setup read/syncronized
void ps_setupSyncronized(bool success);
void ps_setupAvailable(bool available);
//! Startup completed
virtual void ps_startupCompleted();
@@ -297,6 +300,9 @@ namespace BlackCore
//! Can be used to start special services
virtual bool startHookIn() { return true; }
//! Flag set or explicitly set to true
bool isSetOrTrue(const QCommandLineOption &option) const;
//! Severe issue during startup, most likely it does not make sense to continue
//! \note call this here if the parsing stage is over and reaction to a runtime issue
//! is needed
@@ -317,17 +323,17 @@ namespace BlackCore
static void registerMetadata();
// cmd parsing
QCommandLineParser m_parser; //!< cmd parser
QCommandLineOption m_cmdHelp {"help"}; //!< help option
QCommandLineOption m_cmdVersion {"version"}; //!< version option
QCommandLineOption m_cmdDBusAddress {"empty"}; //!< DBus address
QCommandLineOption m_cmdDevelopment {"dev"}; //!< Dev flag
QCommandLineOption m_cmdSharedDir {"shared"}; //!< Dev flag
bool m_parsed = false; //!< Parsing accomplished?
bool m_started = false; //!< started with success?
bool m_startUpCompleted = false; //!< startup phase completed? Can mean startup failed
bool m_startSetupReader = false; //!< start the setup reader
QCommandLineParser m_parser; //!< cmd parser
QCommandLineOption m_cmdHelp {"help"}; //!< help option
QCommandLineOption m_cmdVersion {"version"}; //!< version option
QCommandLineOption m_cmdDBusAddress {"empty"}; //!< DBus address
QCommandLineOption m_cmdDevelopment {"dev"}; //!< Dev. flag
QCommandLineOption m_cmdSharedDir {"shared"}; //!< Shared directory
QCommandLineOption m_cmdClearCache {"clearcache"}; //!< Clear cache
bool m_parsed = false; //!< Parsing accomplished?
bool m_started = false; //!< started with success?
bool m_startUpCompleted = false; //!< startup phase completed? Can mean startup failed
bool m_startSetupReader = false; //!< start the setup reader
private:
//! init logging system
@@ -336,6 +342,9 @@ namespace BlackCore
//! Init parser
void initParser();
//! Dev.environment
bool initIsRunningInDeveloperEnvironment() const;
//! Async. start when setup is loaded
bool asyncWebAndContextStart();
@@ -354,6 +363,7 @@ namespace BlackCore
bool m_useContexts = false; //!< use contexts
bool m_useWebData = false; //!< use web data
bool m_signalStartup = true; //!< signal startup automatically
bool m_devEnv = false; //!< dev. environment
};
} // namespace