Commit eefaf0c4 authored by hjk's avatar hjk
Browse files

ProgressManager: Hide some internally used function from .h interface.



The indirection of the "virtual + implementation inheritance" pattern is
kind of subset of the "static" pattern, no need to have both.

Change-Id: I4e2c2742dae94819ee05c7925c02b954a8c6294b
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent f84e5eed
...@@ -264,6 +264,8 @@ using namespace Core::Internal; ...@@ -264,6 +264,8 @@ using namespace Core::Internal;
Sent when all tasks of a \a type have finished. Sent when all tasks of a \a type have finished.
*/ */
static ProgressManagerPrivate *m_instance = 0;
ProgressManagerPrivate::ProgressManagerPrivate() ProgressManagerPrivate::ProgressManagerPrivate()
: m_applicationTask(0), : m_applicationTask(0),
m_currentStatusDetailsWidget(0), m_currentStatusDetailsWidget(0),
...@@ -271,6 +273,7 @@ ProgressManagerPrivate::ProgressManagerPrivate() ...@@ -271,6 +273,7 @@ ProgressManagerPrivate::ProgressManagerPrivate()
m_progressViewPinned(false), m_progressViewPinned(false),
m_hovered(false) m_hovered(false)
{ {
m_instance = this;
m_progressView = new ProgressView; m_progressView = new ProgressView;
// withDelay, so the statusBarWidget has the chance to get the enter event // withDelay, so the statusBarWidget has the chance to get the enter event
connect(m_progressView, SIGNAL(hoveredChanged(bool)), this, SLOT(updateVisibilityWithDelay())); connect(m_progressView, SIGNAL(hoveredChanged(bool)), this, SLOT(updateVisibilityWithDelay()));
...@@ -284,6 +287,7 @@ ProgressManagerPrivate::~ProgressManagerPrivate() ...@@ -284,6 +287,7 @@ ProgressManagerPrivate::~ProgressManagerPrivate()
ExtensionSystem::PluginManager::removeObject(m_statusBarWidgetContainer); ExtensionSystem::PluginManager::removeObject(m_statusBarWidgetContainer);
delete m_statusBarWidgetContainer; delete m_statusBarWidgetContainer;
cleanup(); cleanup();
m_instance = 0;
} }
void ProgressManagerPrivate::readSettings() void ProgressManagerPrivate::readSettings()
...@@ -717,16 +721,12 @@ void ToggleButton::paintEvent(QPaintEvent *event) ...@@ -717,16 +721,12 @@ void ToggleButton::paintEvent(QPaintEvent *event)
} }
static ProgressManager *m_instance = 0;
ProgressManager::ProgressManager() ProgressManager::ProgressManager()
{ {
m_instance = this;
} }
ProgressManager::~ProgressManager() ProgressManager::~ProgressManager()
{ {
m_instance = 0;
} }
QObject *ProgressManager::instance() QObject *ProgressManager::instance()
......
...@@ -66,12 +66,6 @@ signals: ...@@ -66,12 +66,6 @@ signals:
void taskStarted(Core::Id type); void taskStarted(Core::Id type);
void allTasksFinished(Core::Id type); void allTasksFinished(Core::Id type);
protected:
virtual void doCancelTasks(Core::Id type) = 0;
virtual FutureProgress *doAddTask(const QFuture<void> &future, const QString &title,
Core::Id type, ProgressFlags flags = 0) = 0;
virtual void doSetApplicationLabel(const QString &text) = 0;
private: private:
ProgressManager(); ProgressManager();
~ProgressManager(); ~ProgressManager();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment