aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mappletrunner/mappletrunner.cpp2
-rw-r--r--src/extensions/applicationextension/mextensionhandle.cpp21
-rw-r--r--src/extensions/applicationextension/mextensionhandle.h6
-rw-r--r--src/extensions/applicationextension/mextensionhandle_p.h3
-rw-r--r--src/extensions/applicationextension/mextensionrunner.cpp2
-rw-r--r--src/extensions/applicationextension/mextensionrunner.h2
-rw-r--r--tests/stubs/mextensionhandle_stub.h12
-rw-r--r--tests/ut_mapplethandle/ut_mapplethandle.h3
-rw-r--r--tests/ut_mextensionhandle/ut_mextensionhandle.cpp10
-rw-r--r--tests/ut_mextensionhandle/ut_mextensionhandle.h3
10 files changed, 40 insertions, 24 deletions
diff --git a/mappletrunner/mappletrunner.cpp b/mappletrunner/mappletrunner.cpp
index 44140cde..ad420278 100644
--- a/mappletrunner/mappletrunner.cpp
+++ b/mappletrunner/mappletrunner.cpp
@@ -155,7 +155,7 @@ void MAppletRunner::setAppletProperties()
connect(widget, SIGNAL(setAppletText(QString)), this, SLOT(appletTextChanged(QString)));
}
- connect(this, SIGNAL(visibilityChanged(bool)), widget, SIGNAL(visibilityChanged(bool)));
+ connect(this, SIGNAL(visibilityChanged()), widget, SIGNAL(visibleChanged()));
connect(view, SIGNAL(orientationChanged(M::Orientation)), widget, SIGNAL(orientationChanged(M::Orientation)));
}
diff --git a/src/extensions/applicationextension/mextensionhandle.cpp b/src/extensions/applicationextension/mextensionhandle.cpp
index 69140db0..1d1fe690 100644
--- a/src/extensions/applicationextension/mextensionhandle.cpp
+++ b/src/extensions/applicationextension/mextensionhandle.cpp
@@ -71,7 +71,6 @@ MExtensionHandlePrivate::MExtensionHandlePrivate() :
aliveResponseTimeout(3000),
runnerConnectionTimeout(20000),
applicationVisible(true),
- widgetVisible(true),
remoteActions(),
q_ptr(NULL)
{
@@ -88,7 +87,8 @@ MExtensionHandlePrivate::~MExtensionHandlePrivate()
void MExtensionHandlePrivate::visibilityChanged()
{
- communicator.sendMessage(MAppletVisibilityMessage(applicationVisible && widgetVisible));
+ Q_Q(MExtensionHandle);
+ communicator.sendMessage(MAppletVisibilityMessage(q->isVisible() && applicationVisible));
}
void MExtensionHandlePrivate::operationComplete(const QString &operation, const QString &pkg, const QString &error)
@@ -127,7 +127,7 @@ MExtensionHandle::MExtensionHandle(QGraphicsItem *parent) :
SIGNAL(orientationChanged(M::Orientation)),
this, SLOT(orientationEvent(M::Orientation)));
- connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(visibilityEvent(bool)));
+ connect(this, SIGNAL(visibleChanged()), this, SLOT(visibilityChanged()));
// Configure the timers
connect(&d->aliveTimer, SIGNAL(timeout()), this, SLOT(sendAliveMessageRequest()));
@@ -148,7 +148,7 @@ MExtensionHandle::MExtensionHandle(MExtensionHandlePrivate *dd, MExtensionHandle
SIGNAL(orientationChanged(M::Orientation)),
this, SLOT(orientationEvent(M::Orientation)));
- connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(visibilityEvent(bool)));
+ connect(this, SIGNAL(visibleChanged()), this, SLOT(visibilityChanged()));
// Configure the timers
connect(&d->aliveTimer, SIGNAL(timeout()), this, SLOT(sendAliveMessageRequest()));
@@ -281,6 +281,9 @@ void MExtensionHandle::connectionEstablished()
d->aliveTimer.start(5000);
sendAliveMessageRequest();
+ // Send the visibility changed message to the runner
+ d->visibilityChanged();
+
if (d->oldGeometry.isValid()) {
// Restore the old geometry
setGeometry(d->oldGeometry);
@@ -437,14 +440,18 @@ void MExtensionHandle::sendAliveMessageRequest()
d->communicationTimer.start(d->aliveResponseTimeout);
}
-void MExtensionHandle::visibilityEvent(bool visible)
+void MExtensionHandle::visibilityChanged()
{
Q_D(MExtensionHandle);
-
- d->widgetVisible = visible;
d->visibilityChanged();
}
+//TODO: Remove this redundant signal in next API/ABI break window.
+void MExtensionHandle::visibilityEvent(bool visible)
+{
+ Q_UNUSED(visible);
+}
+
void MExtensionHandle::enterDisplayEvent()
{
Q_D(MExtensionHandle);
diff --git a/src/extensions/applicationextension/mextensionhandle.h b/src/extensions/applicationextension/mextensionhandle.h
index cdea2f01..f39bb1b8 100644
--- a/src/extensions/applicationextension/mextensionhandle.h
+++ b/src/extensions/applicationextension/mextensionhandle.h
@@ -201,10 +201,16 @@ protected slots:
/*!
* \brief A slot for notifying that the visibility of the extension has changed due to hide()/show()
+ * TODO: Remove this redundant signal in next API/ABI break window.
*/
void visibilityEvent(bool visible);
/*!
+ * \brief A slot for notifying that the visibility of the extension has changed due to hide()/show()
+ */
+ void visibilityChanged();
+
+ /*!
* \brief A slot for notifying that the orientation has changed
*/
void orientationEvent(M::Orientation);
diff --git a/src/extensions/applicationextension/mextensionhandle_p.h b/src/extensions/applicationextension/mextensionhandle_p.h
index 94a2d8a1..c1e3cba4 100644
--- a/src/extensions/applicationextension/mextensionhandle_p.h
+++ b/src/extensions/applicationextension/mextensionhandle_p.h
@@ -88,9 +88,6 @@ public:
//! Application level visibility
bool applicationVisible;
- //! Widget level visibility
- bool widgetVisible;
-
//! A list of remote actions
QList<MAction *> remoteActions;
diff --git a/src/extensions/applicationextension/mextensionrunner.cpp b/src/extensions/applicationextension/mextensionrunner.cpp
index 8bdf9a5f..2be416fc 100644
--- a/src/extensions/applicationextension/mextensionrunner.cpp
+++ b/src/extensions/applicationextension/mextensionrunner.cpp
@@ -223,7 +223,7 @@ void MExtensionRunner::messageReceived(const MAppletMessage &message)
// Visible area rectangle is irrelevant when sending
// on or off display events.
QRectF dummyRectangle;
- emit visibilityChanged(m->isVisible());
+ emit visibilityChanged();
visible = m->isVisible();
if (visible) {
MOnDisplayChangeEvent event(MOnDisplayChangeEvent::FullyOnDisplay, dummyRectangle);
diff --git a/src/extensions/applicationextension/mextensionrunner.h b/src/extensions/applicationextension/mextensionrunner.h
index 6bdb2375..e8f22fba 100644
--- a/src/extensions/applicationextension/mextensionrunner.h
+++ b/src/extensions/applicationextension/mextensionrunner.h
@@ -84,7 +84,7 @@ Q_SIGNALS:
/*!
* \brief A signal that is emitted when item is shown/hidden
*/
- void visibilityChanged(bool visibility);
+ void visibilityChanged();
protected slots:
/*!
diff --git a/tests/stubs/mextensionhandle_stub.h b/tests/stubs/mextensionhandle_stub.h
index 7851a189..0dd01da1 100644
--- a/tests/stubs/mextensionhandle_stub.h
+++ b/tests/stubs/mextensionhandle_stub.h
@@ -54,6 +54,7 @@ class MExtensionHandleStub : public StubBase {
virtual void communicationTimerTimeout();
virtual void sendAliveMessageRequest();
virtual void visibilityEvent(bool visible);
+ virtual void visibilityChanged();
virtual void orientationEvent(const M::Orientation &);
virtual void processStdErrorReady();
virtual void processStdOutputReady();
@@ -62,7 +63,7 @@ class MExtensionHandleStub : public StubBase {
virtual void remoteActionTriggered();
virtual void setBrokenState();
virtual void displayContextMenu(QList<QString> actions);
-};
+};
// 2. IMPLEMENT STUB
void MExtensionHandleStub::MExtensionHandleConstructor(QGraphicsItem *parent) {
@@ -79,7 +80,6 @@ void MExtensionHandleStub::init(const QString &runnerBinary, const QString &meta
params.append( new Parameter<const QStringList & >(extraArguments));
stubMethodEntered("init",params);
}
-
void MExtensionHandleStub::initPlaceHolder(const QString &packageName, const QString &installationError) {
QList<ParameterBase*> params;
params.append( new Parameter<const QString & >(packageName));
@@ -201,6 +201,10 @@ void MExtensionHandleStub::visibilityEvent(bool visible) {
stubMethodEntered("visibilityEvent",params);
}
+void MExtensionHandleStub::visibilityChanged() {
+ stubMethodEntered("visibilityChanged");
+}
+
void MExtensionHandleStub::orientationEvent(const M::Orientation &orientation) {
QList<ParameterBase*> params;
params.append( new Parameter<const M::Orientation & >(orientation));
@@ -354,6 +358,10 @@ void MExtensionHandle::visibilityEvent(bool visible) {
gMExtensionHandleStub->visibilityEvent(visible);
}
+void MExtensionHandle::visibilityChanged() {
+ gMExtensionHandleStub->visibilityChanged();
+}
+
void MExtensionHandle::orientationEvent(M::Orientation orientation) {
gMExtensionHandleStub->orientationEvent(orientation);
}
diff --git a/tests/ut_mapplethandle/ut_mapplethandle.h b/tests/ut_mapplethandle/ut_mapplethandle.h
index ca8f61c5..fb0e9c8c 100644
--- a/tests/ut_mapplethandle/ut_mapplethandle.h
+++ b/tests/ut_mapplethandle/ut_mapplethandle.h
@@ -65,8 +65,7 @@ private slots:
signals:
void messageReceived(const MAppletMessage &message);
void connectionFromRunnerEstablished();
- void widgetVisibilityChanged(bool visible);
- void applicationVisibilityChanged(bool visible);
+ void visibilityChanged();
void operationComplete(const QString &operation, const QString &pkg, const QString &error);
void operationProgress(const QString &operation, const QString &pkg, int);
};
diff --git a/tests/ut_mextensionhandle/ut_mextensionhandle.cpp b/tests/ut_mextensionhandle/ut_mextensionhandle.cpp
index 3001191a..6bb4bce6 100644
--- a/tests/ut_mextensionhandle/ut_mextensionhandle.cpp
+++ b/tests/ut_mextensionhandle/ut_mextensionhandle.cpp
@@ -262,8 +262,7 @@ void Ut_MExtensionHandle::init()
handle = new MTestExtensionHandle();
handle->setViewType("default");
connect(this, SIGNAL(connectionFromRunnerEstablished()), handle, SLOT(connectionEstablished()));
- connect(this, SIGNAL(widgetVisibilityChanged(bool)), handle, SLOT(visibilityEvent(bool)));
- connect(this, SIGNAL(applicationVisibilityChanged(bool)), handle, SLOT(applicationVisibilityChanged(bool)));
+ connect(this, SIGNAL(visibilityChanged()), handle, SLOT(visibilityChanged()));
connect(this, SIGNAL(operationComplete(QString, QString, QString)), handle, SLOT(operationComplete(QString, QString, QString)));
connect(this, SIGNAL(operationProgress(QString, QString, int)), handle, SLOT(operationProgress(QString, QString, int)));
@@ -521,12 +520,13 @@ void Ut_MExtensionHandle::testThatAppletBreaksIfConnectionIsNotEstablished()
void Ut_MExtensionHandle::testVisibility()
{
- // Visibility should be true only if both the widget and the application are visible
- emit widgetVisibilityChanged(false);
+ handle->setVisible(false);
+ emit visibilityChanged();
QVERIFY(!visibility);
handle->exitDisplayEvent();
QVERIFY(!visibility);
- emit widgetVisibilityChanged(true);
+ handle->setVisible(true);
+ emit visibilityChanged();
QVERIFY(!visibility);
handle->enterDisplayEvent();
QVERIFY(visibility);
diff --git a/tests/ut_mextensionhandle/ut_mextensionhandle.h b/tests/ut_mextensionhandle/ut_mextensionhandle.h
index 5da363ee..53f8bd7c 100644
--- a/tests/ut_mextensionhandle/ut_mextensionhandle.h
+++ b/tests/ut_mextensionhandle/ut_mextensionhandle.h
@@ -111,8 +111,7 @@ private slots:
signals:
void messageReceived(const MAppletMessage &message);
void connectionFromRunnerEstablished();
- void widgetVisibilityChanged(bool visible);
- void applicationVisibilityChanged(bool visible);
+ void visibilityChanged();
void operationComplete(const QString &operation, const QString &pkg, const QString &error);
void operationProgress(const QString &operation, const QString &pkg, int);
};