зеркало из https://github.com/nextcloud/desktop.git
Simplified LogBrowser
This commit is contained in:
Родитель
60f966e9c2
Коммит
8384fe477a
|
@ -37,8 +37,7 @@ Logger* Logger::_instance=0;
|
|||
|
||||
Logger::Logger( QObject* parent)
|
||||
: QObject(parent),
|
||||
_showTime(true),
|
||||
_doLogging(false)
|
||||
_showTime(true)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -59,8 +58,6 @@ void Logger::destroy()
|
|||
|
||||
void Logger::log(Log log)
|
||||
{
|
||||
if( ! _doLogging ) return;
|
||||
|
||||
QString msg;
|
||||
if( _showTime ) {
|
||||
msg = log.timeStamp.toString("MM-dd hh:mm:ss:zzz") + " ";
|
||||
|
@ -97,11 +94,6 @@ void Logger::mirallLog( const QString& message )
|
|||
Logger::instance()->log( log_ );
|
||||
}
|
||||
|
||||
void Logger::setEnabled( bool state )
|
||||
{
|
||||
_doLogging = state;
|
||||
}
|
||||
|
||||
// ==============================================================================
|
||||
|
||||
LogWidget::LogWidget(QWidget *parent)
|
||||
|
@ -186,18 +178,6 @@ LogBrowser::~LogBrowser()
|
|||
}
|
||||
}
|
||||
|
||||
void LogBrowser::show()
|
||||
{
|
||||
QDialog::show();
|
||||
Logger::instance()->setEnabled(true);
|
||||
}
|
||||
|
||||
void LogBrowser::close()
|
||||
{
|
||||
Logger::instance()->setEnabled(false);
|
||||
QDialog::close();
|
||||
}
|
||||
|
||||
void LogBrowser::slotNewLog( const QString& msg )
|
||||
{
|
||||
if( _logWidget->isVisible() ) {
|
||||
|
|
|
@ -53,8 +53,6 @@ public:
|
|||
static Logger* instance();
|
||||
static void destroy();
|
||||
|
||||
void setEnabled( bool );
|
||||
|
||||
signals:
|
||||
void newLog(const QString&);
|
||||
|
||||
|
@ -89,8 +87,6 @@ public:
|
|||
signals:
|
||||
|
||||
public slots:
|
||||
void show();
|
||||
void close();
|
||||
|
||||
protected slots:
|
||||
void slotNewLog( const QString &msg );
|
||||
|
|
Загрузка…
Ссылка в новой задаче