[Marble-devel] KDE/kdeedu/marble/src/plugins/render
Anders Lund
anders at alweb.dk
Sun Nov 1 15:27:49 CET 2009
Hi Thibaut,
Thanks a lot!
Now I can open the config dialog, but attempting to load a gpx files
crashes:
Application: Marble skrivebordsglobus (marble), signal: Segmentation fault
[Current thread is 1 (Thread 0x7f79ac285750 (LWP 12930))]
Thread 4 (Thread 0x7f799d065910 (LWP 12931)):
#0 0xffffffffff600177 in ?? ()
#1 0x00007ffffcbff671 in ?? ()
#2 0x00007f79a34efe3f in clock_gettime () from /lib/librt.so.1
#3 0x00007f79a8ffb55d in ?? () from /usr/lib/libQtCore.so.4
#4 0x00007f79a8ffb751 in ?? () from /usr/lib/libQtCore.so.4
#5 0x00007f79a8ffb8f5 in ?? () from /usr/lib/libQtCore.so.4
#6 0x00007f79a8ff9a4d in ?? () from /usr/lib/libQtCore.so.4
#7 0x00007f79a8ff9af5 in ?? () from /usr/lib/libQtCore.so.4
#8 0x00007f79a41a73da in g_main_context_prepare () from
/usr/lib/libglib-2.0.so.0
#9 0x00007f79a41a77b1 in g_main_context_iterate () from
/usr/lib/libglib-2.0.so.0
#10 0x00007f79a41a7ce0 in g_main_context_iteration () from
/usr/lib/libglib-2.0.so.0
#11 0x00007f79a8ff98b6 in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
from /usr/lib/libQtCore.so.4
#12 0x00007f79a8fcfc72 in
QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from
/usr/lib/libQtCore.so.4
#13 0x00007f79a8fd0044 in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from
/usr/lib/libQtCore.so.4
#14 0x00007f79a8ee958b in QThread::exec() () from /usr/lib/libQtCore.so.4
#15 0x00007f799e9468c5 in Marble::GpsdThread::run (this=0x22ebf40) at
/home/anders/src/kde/trunk/kdeedu/marble/src/plugins/positionprovider/gpsd/GpsdThread.cpp:27
#16 0x00007f79a8eec2e5 in ?? () from /usr/lib/libQtCore.so.4
#17 0x00007f79a8c7957a in start_thread () from /lib/libpthread.so.0
#18 0x00007f79a82438ed in clone () from /lib/libc.so.6
#19 0x0000000000000000 in ?? ()
Thread 3 (Thread 0x7f799510f910 (LWP 12932)):
#0 0x00007f79a8c7e9f0 in pthread_getspecific () from /lib/libpthread.so.0
#1 0x00007f79a41cc149 in g_thread_self () from /usr/lib/libglib-2.0.so.0
#2 0x00007f79a41a5e80 in g_main_context_acquire () from
/usr/lib/libglib-2.0.so.0
#3 0x00007f79a41a7732 in g_main_context_iterate () from
/usr/lib/libglib-2.0.so.0
#4 0x00007f79a41a7ce0 in g_main_context_iteration () from
/usr/lib/libglib-2.0.so.0
#5 0x00007f79a8ff98b6 in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
from /usr/lib/libQtCore.so.4
#6 0x00007f79a8fcfc72 in
QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from
/usr/lib/libQtCore.so.4
#7 0x00007f79a8fd0044 in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from
/usr/lib/libQtCore.so.4
#8 0x00007f79a8ee958b in QThread::exec() () from /usr/lib/libQtCore.so.4
#9 0x00007f79a8fb3488 in ?? () from /usr/lib/libQtCore.so.4
#10 0x00007f79a8eec2e5 in ?? () from /usr/lib/libQtCore.so.4
#11 0x00007f79a8c7957a in start_thread () from /lib/libpthread.so.0
#12 0x00007f79a82438ed in clone () from /lib/libc.so.6
#13 0x0000000000000000 in ?? ()
Thread 2 (Thread 0x7f799440d910 (LWP 12938)):
#0 0x00007f79a41a2ce7 in g_main_context_query () from
/usr/lib/libglib-2.0.so.0
#1 0x00007f79a41a7871 in g_main_context_iterate () from
/usr/lib/libglib-2.0.so.0
#2 0x00007f79a41a7ce0 in g_main_context_iteration () from
/usr/lib/libglib-2.0.so.0
#3 0x00007f79a8ff98b6 in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
from /usr/lib/libQtCore.so.4
#4 0x00007f79a8fcfc72 in
QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from
/usr/lib/libQtCore.so.4
#5 0x00007f79a8fd0044 in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from
/usr/lib/libQtCore.so.4
#6 0x00007f79a8ee958b in QThread::exec() () from /usr/lib/libQtCore.so.4
#7 0x00007f79ab942a01 in Marble::FileStorageWatcher::run (this=0x22eb2f0) at
/home/anders/src/kde/trunk/kdeedu/marble/src/lib/FileStorageWatcher.cpp:400
#8 0x00007f79a8eec2e5 in ?? () from /usr/lib/libQtCore.so.4
#9 0x00007f79a8c7957a in start_thread () from /lib/libpthread.so.0
#10 0x00007f79a82438ed in clone () from /lib/libc.so.6
#11 0x0000000000000000 in ?? ()
Thread 1 (Thread 0x7f79ac285750 (LWP 12930)):
[KCrash Handler]
#5 0x00007f79ab8970d3 in QVector<Marble::GeoDataFeature>::constEnd
(this=0x276f13a) at /usr/include/QtCore/qvector.h:233
#6 0x00007f79ab896c00 in Marble::GeoDataContainer::placemarks
(this=0x276f088) at
/home/anders/src/kde/trunk/kdeedu/marble/src/lib/geodata/data/GeoDataContainer.cpp:85
#7 0x00007f79ab92e607 in Marble::PlacemarkManager::addGeoDataDocument
(this=0x231b130, index=<value optimized out>) at
/home/anders/src/kde/trunk/kdeedu/marble/src/lib/PlacemarkManager.cpp:91
#8 0x00007f79ab92e753 in Marble::PlacemarkManager::qt_metacall
(this=0x231b130, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>,
_a=0x7ffffcb3e040)
at
/home/anders/src/kde/trunk/kdeedu/marbuild/src/lib/PlacemarkManager.moc:69
#9 0x00007f79a8fe647c in QMetaObject::activate(QObject*, int, int, void**) ()
from /usr/lib/libQtCore.so.4
#10 0x00007f79ab952ece in Marble::FileManager::fileAdded (this=0x276f13a,
_t1=5) at
/home/anders/src/kde/trunk/kdeedu/marbuild/src/lib/FileManager.moc:89
#11 0x00007f79ab9531b3 in Marble::FileManager::addFile (this=0x22c2880,
item=0x276f070) at
/home/anders/src/kde/trunk/kdeedu/marble/src/lib/FileManager.cpp:139
#12 0x00007f79ab8e6474 in Marble::MarbleModel::openGpxFile (this=0x22e3a20,
filename=<value optimized out>) at
/home/anders/src/kde/trunk/kdeedu/marble/src/lib/MarbleModel.cpp:714
#13 0x000000000041a2ac in Marble::MarblePart::openFile (this=0x226f3c0) at
/home/anders/src/kde/trunk/kdeedu/marble/src/marble_part.cpp:180
#14 0x000000000041a5c7 in Marble::MarblePart::qt_metacall (this=0x226f3c0,
_c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>,
_a=0x7ffffcb3e2f0)
at /home/anders/src/kde/trunk/kdeedu/marbuild/src/marble_part.moc:135
#15 0x00007f79a8fe647c in QMetaObject::activate(QObject*, int, int, void**) ()
from /usr/lib/libQtCore.so.4
#16 0x00007f79a9b597b7 in QAction::triggered(bool) () from
/usr/lib/libQtGui.so.4
#17 0x00007f79a9b5abff in QAction::activate(QAction::ActionEvent) () from
/usr/lib/libQtGui.so.4
#18 0x00007f79a9b5d6b7 in QAction::event(QEvent*) () from
/usr/lib/libQtGui.so.4
#19 0x00007f79aa918d0d in KAction::event(QEvent*) () from
/usr/lib/libkdeui.so.5
#20 0x00007f79a9b5f60c in QApplicationPrivate::notify_helper(QObject*,
QEvent*) () from /usr/lib/libQtGui.so.4
#21 0x00007f79a9b668de in QApplication::notify(QObject*, QEvent*) () from
/usr/lib/libQtGui.so.4
#22 0x00007f79aa9ea5a6 in KApplication::notify(QObject*, QEvent*) () from
/usr/lib/libkdeui.so.5
#23 0x00007f79a8fd133c in QCoreApplication::notifyInternal(QObject*, QEvent*)
() from /usr/lib/libQtCore.so.4
#24 0x00007f79a9b93d56 in ?? () from /usr/lib/libQtGui.so.4
#25 0x00007f79a9b95be7 in ?? () from /usr/lib/libQtGui.so.4
#26 0x00007f79a9b6757e in QApplication::notify(QObject*, QEvent*) () from
/usr/lib/libQtGui.so.4
#27 0x00007f79aa9ea5a6 in KApplication::notify(QObject*, QEvent*) () from
/usr/lib/libkdeui.so.5
#28 0x00007f79a8fd133c in QCoreApplication::notifyInternal(QObject*, QEvent*)
() from /usr/lib/libQtCore.so.4
#29 0x00007f79a9bef05a in ?? () from /usr/lib/libQtGui.so.4
#30 0x00007f79a9bf15a1 in ?? () from /usr/lib/libQtGui.so.4
#31 0x00007f79a9bcaa24 in QApplication::x11ProcessEvent(_XEvent*) () from
/usr/lib/libQtGui.so.4
#32 0x00007f79a9bf2efc in ?? () from /usr/lib/libQtGui.so.4
#33 0x00007f79a41a41fe in g_main_context_dispatch () from
/usr/lib/libglib-2.0.so.0
#34 0x00007f79a41a7bb8 in g_main_context_iterate () from
/usr/lib/libglib-2.0.so.0
#35 0x00007f79a41a7ce0 in g_main_context_iteration () from
/usr/lib/libglib-2.0.so.0
#36 0x00007f79a8ff9863 in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
from /usr/lib/libQtCore.so.4
#37 0x00007f79a9bf26de in ?? () from /usr/lib/libQtGui.so.4
#38 0x00007f79a8fcfc72 in
QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from
/usr/lib/libQtCore.so.4
#39 0x00007f79a8fd0044 in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from
/usr/lib/libQtCore.so.4
#40 0x00007f79a8fd21f9 in QCoreApplication::exec() () from
/usr/lib/libQtCore.so.4
#41 0x0000000000414e30 in main (argc=<value optimized out>, argv=<value
optimized out>) at
/home/anders/src/kde/trunk/kdeedu/marble/src/kdemain.cpp:286
Thibaut Gridel skrev:
> SVN commit 1043428 by tgridel:
>
> Revert "Marble Plugins "wikipedia" and "weather" don't initialize the
> config dialog in constructor anymore."
>
> This reverts commit 1037683 because of crash:
> #5 Marble::WikipediaModel::showThumbnail (this=0x0)
> #6 Marble::WikipediaPlugin::configDialog (this=0xe9aeb0)
> #7 Marble::RenderPlugin::item (this=0xe9aeb0)
>
> CCMAIL: bastianholst at gmx.de
> CCMAIL: marble-devel at kde.org
>
> M +30 -42 weather/WeatherPlugin.cpp
> M +0 -2 weather/WeatherPlugin.h
> M +0 -5 wikipedia/WikipediaModel.cpp
> M +0 -1 wikipedia/WikipediaModel.h
> M +14 -23 wikipedia/WikipediaPlugin.cpp
> M +1 -3 wikipedia/WikipediaPlugin.h
>
>
> --- trunk/KDE/kdeedu/marble/src/plugins/render/weather/WeatherPlugin.cpp
> #1043427:1043428 @@ -45,6 +45,7 @@
> // Plugin is not visible by default
> setVisible( false );
>
> + configDialog();
> readSettings();
> }
>
> @@ -116,16 +117,15 @@
> // Initializing configuration dialog
> m_configDialog = new QDialog();
> ui_configWidget.setupUi( m_configDialog );
> - updateConfigDialog();
> - connect( ui_configWidget.m_buttonBox, SIGNAL( accepted() ),
> - SLOT( writeSettings() ) );
> + connect( ui_configWidget.m_buttonBox, SIGNAL( accepted() ),
> + SLOT( writeSettings() ) );
> connect( ui_configWidget.m_buttonBox, SIGNAL( rejected() ),
> - SLOT( readSettings() ) );
> + SLOT( readSettings() ) );
> QPushButton *applyButton = ui_configWidget.m_buttonBox->button(
> QDialogButtonBox::Apply ); connect( applyButton, SIGNAL( clicked() ),
> - this, SLOT( writeSettings() ) );
> + this, SLOT( writeSettings() ) );
> connect( this, SIGNAL( settingsChanged( QString ) ),
> - this, SLOT( updateItemSettings() ) );
> + this, SLOT( updateItemSettings() ) );
> }
> return m_configDialog;
> }
> @@ -143,6 +143,27 @@
>
> void WeatherPlugin::readSettings()
> {
> + // Information
> + if ( m_settings.value( "showCondition", showConditionDefault
> ).toBool() ) +
> ui_configWidget.m_weatherConditionBox->setCheckState( Qt::Checked ); +
> else
> + ui_configWidget.m_weatherConditionBox->setCheckState(
> Qt::Unchecked ); +
> + if ( m_settings.value( "showTemperature", showTemperatureDefault
> ).toBool() ) + ui_configWidget.m_temperatureBox->setCheckState(
> Qt::Checked ); + else
> + ui_configWidget.m_temperatureBox->setCheckState( Qt::Unchecked );
> +
> + if ( m_settings.value( "showWindDirection", showWindDirectionDefault
> ).toBool() ) + ui_configWidget.m_windDirectionBox->setCheckState(
> Qt::Checked ); + else
> + ui_configWidget.m_windDirectionBox->setCheckState( Qt::Unchecked
> ); +
> + if ( m_settings.value( "showWindSpeed", showWindSpeedDefault
> ).toBool() ) + ui_configWidget.m_windSpeedBox->setCheckState(
> Qt::Checked ); + else
> + ui_configWidget.m_windSpeedBox->setCheckState( Qt::Unchecked );
> +
> // Units
> // The default units depend on the global measure system.
> int temperatureUnit;
> @@ -159,6 +180,7 @@
> }
> m_settings.insert( "temperatureUnit", temperatureUnit );
> }
> + ui_configWidget.m_temperatureComboBox->setCurrentIndex(
> temperatureUnit );
>
> int windSpeedUnit;
> if ( m_settings.contains( "windSpeedUnit" ) ) {
> @@ -173,6 +195,7 @@
> }
> m_settings.insert( "windSpeedUnit", temperatureUnit );
> }
> + ui_configWidget.m_windSpeedComboBox->setCurrentIndex( windSpeedUnit );
>
> int pressureUnit;
> if ( m_settings.contains( "pressureUnit" ) ) {
> @@ -187,10 +210,7 @@
> }
> m_settings.insert( "pressureUnit", pressureUnit );
> }
> -
> - if ( m_configDialog ) {
> - updateConfigDialog();
> - }
> + ui_configWidget.m_pressureComboBox->setCurrentIndex( pressureUnit );
>
> updateItemSettings();
> }
> @@ -223,38 +243,6 @@
> }
> }
>
> -void WeatherPlugin::updateConfigDialog() const
> -{
> - // Information
> - if ( m_settings.value( "showCondition", showConditionDefault
> ).toBool() ) -
> ui_configWidget.m_weatherConditionBox->setCheckState( Qt::Checked ); -
> else
> - ui_configWidget.m_weatherConditionBox->setCheckState(
> Qt::Unchecked ); -
> - if ( m_settings.value( "showTemperature", showTemperatureDefault
> ).toBool() ) - ui_configWidget.m_temperatureBox->setCheckState(
> Qt::Checked ); - else
> - ui_configWidget.m_temperatureBox->setCheckState( Qt::Unchecked );
> -
> - if ( m_settings.value( "showWindDirection", showWindDirectionDefault
> ).toBool() ) - ui_configWidget.m_windDirectionBox->setCheckState(
> Qt::Checked ); - else
> - ui_configWidget.m_windDirectionBox->setCheckState( Qt::Unchecked
> ); -
> - if ( m_settings.value( "showWindSpeed", showWindSpeedDefault
> ).toBool() ) - ui_configWidget.m_windSpeedBox->setCheckState(
> Qt::Checked ); - else
> - ui_configWidget.m_windSpeedBox->setCheckState( Qt::Unchecked );
> -
> - // Units
> - ui_configWidget.m_temperatureComboBox
> - ->setCurrentIndex( m_settings.value( "temperatureUnit"
> ).toInt() ); - ui_configWidget.m_windSpeedComboBox
> - ->setCurrentIndex( m_settings.value( "windSpeedUnit" ).toInt()
> ); - ui_configWidget.m_pressureComboBox
> - ->setCurrentIndex( m_settings.value( "pressureUnit" ).toInt()
> ); -}
> -
> Q_EXPORT_PLUGIN2(WeatherPlugin, Marble::WeatherPlugin)
>
> #include "WeatherPlugin.moc"
> --- trunk/KDE/kdeedu/marble/src/plugins/render/weather/WeatherPlugin.h
> #1043427:1043428 @@ -64,8 +64,6 @@
> void changedSettings();
>
> private:
> - void updateConfigDialog() const;
> -
> bool m_isInitialized;
>
> mutable QIcon m_icon;
> --- trunk/KDE/kdeedu/marble/src/plugins/render/wikipedia/WikipediaModel.cpp
> #1043427:1043428 @@ -52,11 +52,6 @@
> m_showThumbnail = show;
> }
>
> -bool WikipediaModel::showThumbnail() const
> -{
> - return m_showThumbnail;
> -}
> -
> void WikipediaModel::getAdditionalItems( const GeoDataLatLonAltBox& box,
> MarbleDataFacade *facade,
> qint32 number )
> --- trunk/KDE/kdeedu/marble/src/plugins/render/wikipedia/WikipediaModel.h
> #1043427:1043428 @@ -32,7 +32,6 @@
> ~WikipediaModel();
>
> void setShowThumbnail( bool show );
> - bool showThumbnail() const;
>
> protected:
> /**
> ---
> trunk/KDE/kdeedu/marble/src/plugins/render/wikipedia/WikipediaPlugin.cpp
> #1043427:1043428 @@ -39,8 +39,7 @@
> // Plugin is not visible by default
> setVisible( false );
>
> - connect( this, SIGNAL( changedNumberOfItems( quint32 ) ),
> - this, SLOT( checkNumberOfItems( quint32 ) ) );
> + configDialog();
> readSettings();
> }
>
> @@ -114,9 +113,6 @@
> m_configDialog = new QDialog();
> ui_configWidget.setupUi( m_configDialog );
> ui_configWidget.m_itemNumberSpinBox->setRange( 0,
> maximumNumberOfItems ); -
> ui_configWidget.m_itemNumberSpinBox->setValue( numberOfItems() ); -
> WikipediaModel *wikipediaModel = qobject_cast<WikipediaModel*>( model() );
> - updateDialogShowThumbnails( wikipediaModel->showThumbnail() );
> connect( ui_configWidget.m_buttonBox, SIGNAL( accepted() ), SLOT(
> writeSettings() ) ); connect( ui_configWidget.m_buttonBox, SIGNAL(
> rejected() ), @@ -124,6 +120,8 @@
> QPushButton *applyButton = ui_configWidget.m_buttonBox->button(
> QDialogButtonBox::Apply ); connect( applyButton, SIGNAL( clicked() ),
> this, SLOT( writeSettings() ) );
> + connect( this, SIGNAL( changedNumberOfItems( quint32 ) ),
> + this, SLOT( setDialogNumberOfItems( quint32 ) ) );
> connect( this, SIGNAL( settingsChanged( QString ) ),
> this, SLOT( updateItemSettings() ) );
> }
> @@ -143,9 +141,12 @@
>
> void WikipediaPlugin::setShowThumbnails( bool shown )
> {
> - if ( m_configDialog ) {
> - updateDialogShowThumbnails( shown );
> + if ( shown ) {
> + ui_configWidget.m_showThumbnailCheckBox->setCheckState(
> Qt::Checked ); }
> + else {
> + ui_configWidget.m_showThumbnailCheckBox->setCheckState(
> Qt::Unchecked ); + }
>
> WikipediaModel *wikipediaModel = qobject_cast<WikipediaModel*>(
> model() );
>
> @@ -158,6 +159,7 @@
> void WikipediaPlugin::readSettings()
> {
> setNumberOfItems( m_settings.value( "numberOfItems", 15 ).toUInt() );
> + setDialogNumberOfItems( numberOfItems() );
> if ( !m_settings.contains( "showThumbnails" ) ) {
> m_settings.insert( "showThumbnails", true );
> }
> @@ -181,16 +183,15 @@
> emit settingsChanged( nameId() );
> }
>
> -void WikipediaPlugin::checkNumberOfItems( quint32 number )
> +void WikipediaPlugin::setDialogNumberOfItems( quint32 number )
> {
> - if ( number > maximumNumberOfItems ) {
> + if ( number <= maximumNumberOfItems ) {
> + ui_configWidget.m_itemNumberSpinBox->setValue( (int) number );
> + }
> + else {
> // Force a the number of items being lower or equal
> maximumNumberOfItems setNumberOfItems( maximumNumberOfItems );
> }
> -
> - if ( m_configDialog ) {
> - ui_configWidget.m_itemNumberSpinBox->setValue( (int) number );
> - }
> }
>
> void WikipediaPlugin::updateItemSettings()
> @@ -201,16 +202,6 @@
> }
> }
>
> -void WikipediaPlugin::updateDialogShowThumbnails( bool shown ) const
> -{
> - if ( shown ) {
> - ui_configWidget.m_showThumbnailCheckBox->setCheckState(
> Qt::Checked ); - }
> - else {
> - ui_configWidget.m_showThumbnailCheckBox->setCheckState(
> Qt::Unchecked ); - }
> -}
> -
> Q_EXPORT_PLUGIN2(WikipediaPlugin, Marble::WikipediaPlugin)
>
> #include "WikipediaPlugin.moc"
> --- trunk/KDE/kdeedu/marble/src/plugins/render/wikipedia/WikipediaPlugin.h
> #1043427:1043428 @@ -66,13 +66,11 @@
> void readSettings();
> void writeSettings();
>
> - void checkNumberOfItems( quint32 number );
> + void setDialogNumberOfItems( quint32 number );
>
> void updateItemSettings();
>
> private:
> - void updateDialogShowThumbnails( bool shown ) const;
> -
> bool m_isInitialized;
>
> mutable QIcon m_icon;
> _______________________________________________
> Marble-devel mailing list
> Marble-devel at kde.org
> https://mail.kde.org/mailman/listinfo/marble-devel
>
--
www: http://www.alweb.dk
jabber: anderslund at jabber.dk
More information about the Marble-devel
mailing list