on xenial help sign in
Fixed preview construction that resulted in duplicated actions for generic preview.
5d7c85ePawel Stolowski
plugins/Unity/preview.cpp+7−2
@@ -131,13 +131,13 @@ Preview* Preview::newFromUnityPreview(unity::dash::Preview::Ptr unityPreview)
131 preview = new GenericPreview();
131 preview = new GenericPreview();
132 }
132 }
133
133
134− preview->Preview::setUnityPreview(unityPreview);
134+ preview->setUnityPreviewBase(unityPreview);
135 preview->setUnityPreview(unityPreview);
135 preview->setUnityPreview(unityPreview);
136
136
137 return preview;
137 return preview;
138}
138}
139
139
140−void Preview::setUnityPreview(unity::dash::Preview::Ptr unityPreview)
140+void Preview::setUnityPreviewBase(unity::dash::Preview::Ptr unityPreview)
141{
141{
142 m_unityPreview = unityPreview;
142 m_unityPreview = unityPreview;
143
143
@@ -163,6 +163,11 @@ void Preview::setUnityPreview(unity::dash::Preview::Ptr unityPreview)
163 Q_EMIT imageSourceUriChanged();
163 Q_EMIT imageSourceUriChanged();
164}
164}
165
165
166+void Preview::setUnityPreview(unity::dash::Preview::Ptr /* unityPreview */)
167+{
168+ // default implementation does nothing
169+}
170+
166void Preview::execute(const QString& actionId, const QHash<QString, QVariant>& hints)
171void Preview::execute(const QString& actionId, const QHash<QString, QVariant>& hints)
167{
172{
168 if (m_unityPreview) {
173 if (m_unityPreview) {
plugins/Unity/preview.h+2
@@ -76,6 +76,8 @@ protected:
76 unity::dash::Preview::Ptr m_unityPreview;
76 unity::dash::Preview::Ptr m_unityPreview;
77
77
78private:
78private:
79+ void setUnityPreviewBase(unity::dash::Preview::Ptr unityPreview);
80+
79 QList<QObject *> m_actions;
81 QList<QObject *> m_actions;
80 QList<QObject *> m_infoHints;
82 QList<QObject *> m_infoHints;
81};
83};