[10983] Config option for disable progress bar show at server startup.

Make happy nervouse ppl by some secs startup speedup.
This commit is contained in:
VladimirMangos 2011-01-08 03:12:15 +03:00
parent b89e531fee
commit ea930108da
5 changed files with 41 additions and 15 deletions

View file

@ -20,6 +20,8 @@
#include "ProgressBar.h"
bool barGoLink::m_showOutput = true;
char const* const barGoLink::empty = " ";
#ifdef _WIN32
char const* const barGoLink::full = "\x3D";
@ -29,16 +31,23 @@ char const* const barGoLink::full = "*";
barGoLink::~barGoLink()
{
if (!m_showOutput)
return;
printf( "\n" );
fflush(stdout);
}
barGoLink::barGoLink( int row_count )
barGoLink::barGoLink(int row_count)
{
rec_no = 0;
rec_pos = 0;
indic_len = 50;
num_rec = row_count;
if (!m_showOutput)
return;
#ifdef _WIN32
printf( "\x3D" );
#else
@ -53,8 +62,11 @@ barGoLink::barGoLink( int row_count )
fflush(stdout);
}
void barGoLink::step( void )
void barGoLink::step()
{
if (!m_showOutput)
return;
int i, n;
if ( num_rec == 0 ) return;

View file

@ -22,18 +22,22 @@
class MANGOS_DLL_SPEC barGoLink
{
static char const * const empty;
static char const * const full;
int rec_no;
int rec_pos;
int num_rec;
int indic_len;
public:
void step( void );
barGoLink( int );
public: // constructors
barGoLink(int row_count);
~barGoLink();
public: // modifiers
void step( void );
static void SetOutputState(bool on) { m_showOutput = on; }
private:
static bool m_showOutput; // not recommended change with existed active bar
static char const * const empty;
static char const * const full;
int rec_no;
int rec_pos;
int num_rec;
int indic_len;
};
#endif

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10982"
#define REVISION_NR "10983"
#endif // __REVISION_NR_H__