[Marble-commits] KDE/kdeedu/marble/src
Wes Hardaker
wjhns25 at hardakers.net
Tue Jun 22 22:59:00 CEST 2010
SVN commit 1141469 by hardaker:
make render plugins report a renderType() to determine which menu they should go in rather than determining this via a class type
M +1 -2 QtMainWindow.cpp
M +5 -0 lib/AbstractDataPlugin.cpp
M +8 -0 lib/AbstractDataPlugin.h
M +5 -0 lib/RenderPlugin.cpp
M +13 -0 lib/RenderPlugin.h
M +1 -2 marble_part.cpp
--- trunk/KDE/kdeedu/marble/src/QtMainWindow.cpp #1141468:1141469
@@ -341,9 +341,8 @@
QList<RenderPlugin *>::const_iterator const end = renderPluginList.constEnd();
for (; i != end; ++i ) {
// FIXME: This will go into the layer manager when AbstractDataPlugin is an interface
- AbstractDataPlugin *dataPlugin = qobject_cast<AbstractDataPlugin *>(*i);
- if( dataPlugin ) {
+ if( i->renderType() == Online ) {
m_onlineServicesMenu->addAction( (*i)->action() );
}
}
--- trunk/KDE/kdeedu/marble/src/lib/AbstractDataPlugin.cpp #1141468:1141469
@@ -159,6 +159,11 @@
}
}
+RenderPlugin::RenderType AbstractDataPlugin::renderType() const
+{
+ return Online;
+}
+
void AbstractDataPlugin::requestRepaint()
{
emit repaintNeeded( QRegion() );
--- trunk/KDE/kdeedu/marble/src/lib/AbstractDataPlugin.h #1141468:1141469
@@ -115,6 +115,14 @@
*/
QList<AbstractDataPluginItem *> whichItemAt( const QPoint& curpos );
+ /**
+ * Function for returning the type of plugin this is for.
+ * This affects where in the menu tree the action() is placed.
+ *
+ * @return: The type of render plugin this is.
+ */
+ virtual RenderType renderType() const;
+
private Q_SLOTS:
void requestRepaint();
--- trunk/KDE/kdeedu/marble/src/lib/RenderPlugin.cpp #1141468:1141469
@@ -179,6 +179,11 @@
Q_UNUSED( settings );
}
+RenderPlugin::RenderType RenderPlugin::renderType() const
+{
+ return Unknown;
+}
+
bool RenderPlugin::eventFilter( QObject *, QEvent * )
{
return false;
--- trunk/KDE/kdeedu/marble/src/lib/RenderPlugin.h #1141468:1141469
@@ -53,6 +53,11 @@
BackendTypes // a QStringList
};
+ enum RenderType {
+ Unknown,
+ Online
+ };
+
RenderPlugin();
virtual ~RenderPlugin();
@@ -109,6 +114,14 @@
*/
virtual void setSettings( QHash<QString,QVariant> settings );
+ /**
+ * Function for returning the type of plugin this is for.
+ * This affects where in the menu tree the action() is placed.
+ *
+ * @return: The type of render plugin this is.
+ */
+ virtual RenderType renderType() const;
+
public Q_SLOTS:
void setEnabled( bool enabled );
void setVisible( bool visible );
--- trunk/KDE/kdeedu/marble/src/marble_part.cpp #1141468:1141469
@@ -780,9 +780,8 @@
QList<RenderPlugin *>::const_iterator const end = renderPluginList.constEnd();
for (; i != end; ++i ) {
// FIXME: This will go into the layer manager when AbstractDataPlugin is an interface
- AbstractDataPlugin *dataPlugin = qobject_cast<AbstractDataPlugin *>(*i);
- if( dataPlugin ) {
+ if( (*i)->renderType() == RenderPlugin::Online ) {
actionList.append( (*i)->action() );
}
}
More information about the Marble-commits
mailing list