Commit ce24f009 authored by Torsten Rahn's avatar Torsten Rahn

- Fixing Order and Selection in MarbleControlBox

- Fixing uninitialized Canvas on first start.
- Fixing MarbleStarsPlugin when viewport yheight is bigger than width.


svn path=/branches/KDE/4.1/kdeedu/marble/; revision=836907
parent 5f604e6c
......@@ -162,12 +162,9 @@ MarbleControlBox::~MarbleControlBox()
void MarbleControlBox::setMapThemeModel( QStandardItemModel *mapThemeModel ) {
d->m_mapThemeModel = mapThemeModel;
d->uiWidget.marbleThemeSelectView->setModel( d->m_mapThemeModel );
/*
d->m_mapSortProxy->setSourceModel( d->m_mapThemeModel );
d->m_mapSortProxy->sort( 0 );
d->uiWidget.marbleThemeSelectView->setModel( d->m_mapSortProxy );
*/
connect( d->m_mapThemeModel, SIGNAL( rowsInserted ( QModelIndex, int, int) ),
this, SLOT( updateMapThemeView() ) );
updateMapThemeView();
......@@ -498,17 +495,17 @@ void MarbleControlBox::search()
void MarbleControlBox::selectTheme( const QString &theme )
{
qDebug() << "Entered selectTheme";
if ( !d->m_mapThemeModel )
if ( !d->m_mapSortProxy )
return;
for ( int row = 0; row < d->m_mapThemeModel->rowCount(); ++row ) {
QModelIndex itIndexName = d->m_mapThemeModel->index( row, 1, QModelIndex() );
QModelIndex itIndex = d->m_mapThemeModel->index( row, 0, QModelIndex() );
qDebug() << "Select Theme: " << theme << " Stored: " << d->m_mapThemeModel->data( itIndexName ).toString();
for ( int row = 0; row < d->m_mapSortProxy->rowCount(); ++row ) {
QModelIndex itIndexName = d->m_mapSortProxy->index( row, 1, QModelIndex() );
QModelIndex itIndex = d->m_mapSortProxy->index( row, 0, QModelIndex() );
qDebug() << "Select Theme: " << theme << " Stored: " << d->m_mapSortProxy->data( itIndexName ).toString();
// If we have found the theme in the theme model,
// and it is not the one that we already have,
// then
// set the new one in the ui.
if ( theme == d->m_mapThemeModel->data( itIndexName ).toString()
if ( theme == d->m_mapSortProxy->data( itIndexName ).toString()
&& itIndexName != d->uiWidget.marbleThemeSelectView->currentIndex() ) {
// Mark the correct picture for the selected map theme and
// also make sure it's shown.
......
......@@ -234,12 +234,11 @@ void ViewParams::setCanvasImage( QImage * const image )
{
delete d->m_canvasImage;
d->m_canvasImage = image;
/*
// Repaint the background if necessary
if ( !currentProjection()->mapCoversViewport( viewport() ) ) {
d->m_canvasImage->fill( Qt::transparent );
}
*/
}
QImage * ViewParams::coastImage() const
......
......@@ -151,7 +151,7 @@ bool MarbleStarsPlugin::render( GeoPainter *painter, ViewportParams *viewport,
continue;
}
double skyRadius = viewport->width();
double skyRadius = 0.6 * sqrt( viewport->width() * viewport->width() + viewport->height() * viewport->height() );
double earthRadius = viewport->radius();
double earthCenteredX = qpos.v[Q_X] * skyRadius;
double earthCenteredY = qpos.v[Q_Y] * skyRadius;
......
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