rbutil: Remove ProgressLogger interface class.
Since we're using signals to connect to the Logger we don't need an interface class, and the only thing still used was the log level enum. Put those values in a dedicated header instead. Change-Id: Ic3aee14ba13b81e283b477d11b1c15a5c26ffeab
This commit is contained in:
parent
01e245417e
commit
35bc4590ae
15 changed files with 16 additions and 51 deletions
|
@ -195,7 +195,7 @@ add_library(rbbase
|
|||
${CMAKE_CURRENT_LIST_DIR}/base/httpget.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/base/mspackutil.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/base/mspackutil.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/base/progressloggerinterface.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/base/progressloglevels.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/base/playerbuildinfo.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/base/playerbuildinfo.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/base/rbsettings.cpp
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#define BOOTLOADERINSTALLBASE_H
|
||||
|
||||
#include <QtCore>
|
||||
#include "progressloggerinterface.h"
|
||||
#include "progressloglevels.h"
|
||||
#include "httpget.h"
|
||||
|
||||
//! baseclass for all Bootloader installs
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#define BOOTLOADERINSTALLFILE_H
|
||||
|
||||
#include <QtCore>
|
||||
#include "progressloggerinterface.h"
|
||||
#include "bootloaderinstallbase.h"
|
||||
|
||||
//! install a bootloader by putting a single file on the player.
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#define BOOTLOADERINSTALLMI4_H
|
||||
|
||||
#include <QtCore>
|
||||
#include "progressloggerinterface.h"
|
||||
#include "bootloaderinstallbase.h"
|
||||
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include <QtCore>
|
||||
#include "Logger.h"
|
||||
#include "mspackutil.h"
|
||||
#include "progressloggerinterface.h"
|
||||
#include "progressloglevels.h"
|
||||
|
||||
MsPackUtil::MsPackUtil(QObject* parent)
|
||||
:ArchiveUtil(parent)
|
||||
|
|
|
@ -18,43 +18,12 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef PROGRESSLOGGERINTERFACE_H
|
||||
#define PROGRESSLOGGERINTERFACE_H
|
||||
|
||||
#include <QtCore>
|
||||
#ifndef PROGRESSLOGLEVELS_H
|
||||
#define PROGRESSLOGLEVELS_H
|
||||
|
||||
enum {
|
||||
LOGNOICON, LOGOK, LOGINFO, LOGWARNING, LOGERROR
|
||||
};
|
||||
|
||||
|
||||
|
||||
class ProgressloggerInterface : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ProgressloggerInterface(QObject* parent) : QObject(parent) {}
|
||||
|
||||
virtual void setProgressValue(int value)=0;
|
||||
virtual void setProgressMax(int max)=0;
|
||||
virtual int getProgressMax()=0;
|
||||
|
||||
signals:
|
||||
void aborted();
|
||||
|
||||
|
||||
public slots:
|
||||
virtual void addItem(const QString &text, int flag)=0; //! add a string to the list, with icon
|
||||
|
||||
virtual void close()=0;
|
||||
virtual void show()=0;
|
||||
virtual void setRunning()=0;
|
||||
virtual void setFinished()=0;
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
#define TALKFILE_H
|
||||
|
||||
#include <QtCore>
|
||||
#include "progressloggerinterface.h"
|
||||
#include "progressloglevels.h"
|
||||
|
||||
#include "talkgenerator.h"
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#define TALKGENERATOR_H
|
||||
|
||||
#include <QtCore>
|
||||
#include "progressloggerinterface.h"
|
||||
#include "progressloglevels.h"
|
||||
|
||||
#include "encoderbase.h"
|
||||
#include "ttsbase.h"
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include <QtCore>
|
||||
|
||||
#include "progressloggerinterface.h"
|
||||
#include "progressloglevels.h"
|
||||
|
||||
|
||||
class Uninstaller : public QObject
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#define VOICEFILE_H
|
||||
|
||||
#include <QtCore>
|
||||
#include "progressloggerinterface.h"
|
||||
#include "progressloglevels.h"
|
||||
|
||||
#include "httpget.h"
|
||||
#include "voicefont.h"
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include <QtCore>
|
||||
|
||||
#include "progressloggerinterface.h"
|
||||
#include "progressloglevels.h"
|
||||
#include "httpget.h"
|
||||
#include "Logger.h"
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include <QtCore>
|
||||
#include <QDebug>
|
||||
#include "ziputil.h"
|
||||
#include "progressloggerinterface.h"
|
||||
#include "progressloglevels.h"
|
||||
#include "Logger.h"
|
||||
|
||||
#include "quazip/quazip.h"
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "sysinfo.h"
|
||||
#include "systrace.h"
|
||||
|
||||
ProgressLoggerGui::ProgressLoggerGui(QWidget* parent): ProgressloggerInterface(parent)
|
||||
ProgressLoggerGui::ProgressLoggerGui(QWidget* parent): QObject(parent)
|
||||
{
|
||||
downloadProgress = new QDialog(parent);
|
||||
downloadProgress->setModal(true);
|
||||
|
@ -103,7 +103,7 @@ void ProgressLoggerGui::setRunning()
|
|||
disconnect(dp.buttonAbort, &QAbstractButton::clicked, downloadProgress, &QWidget::close);
|
||||
// emit aborted() once button is pressed but not closed().
|
||||
disconnect(dp.buttonAbort, &QAbstractButton::clicked, this, &ProgressLoggerGui::closed);
|
||||
connect(dp.buttonAbort, SIGNAL(clicked()), this, SIGNAL(aborted()));
|
||||
connect(dp.buttonAbort, &QAbstractButton::clicked, this, &ProgressLoggerGui::aborted);
|
||||
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ void ProgressLoggerGui::setFinished()
|
|||
// close the window on button press.
|
||||
connect(dp.buttonAbort, &QAbstractButton::clicked, downloadProgress, &QWidget::close);
|
||||
// emit closed() once button is pressed but not aborted().
|
||||
disconnect(dp.buttonAbort, SIGNAL(clicked()), this, SIGNAL(aborted()));
|
||||
disconnect(dp.buttonAbort, &QAbstractButton::clicked, this, &ProgressLoggerGui::aborted);
|
||||
connect(dp.buttonAbort, &QAbstractButton::clicked, this, &ProgressLoggerGui::closed);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,10 +22,10 @@
|
|||
|
||||
#include <QWidget>
|
||||
|
||||
#include "progressloggerinterface.h"
|
||||
#include "progressloglevels.h"
|
||||
#include "ui_progressloggerfrm.h"
|
||||
|
||||
class ProgressLoggerGui :public ProgressloggerInterface
|
||||
class ProgressLoggerGui :public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -42,8 +42,6 @@
|
|||
#include "backupdialog.h"
|
||||
#include "changelog.h"
|
||||
|
||||
#include "progressloggerinterface.h"
|
||||
|
||||
#include "bootloaderinstallbase.h"
|
||||
#include "bootloaderinstallhelper.h"
|
||||
|
||||
|
|
Loading…
Reference in a new issue