Use cache from settings

This commit is contained in:
Pirmin Kalberer 2010-12-09 22:52:42 +01:00
parent 0cbd8a3e69
commit 4ed9c53060
2 changed files with 4 additions and 4 deletions

View File

@ -619,6 +619,7 @@ void GlobePlugin::layersChanged()
for(int i = 0; i < table->rowCount(); ++i)
{
QString type = table->item(i, 0)->text();
bool cache = table->item(i, 1)->checkState();
QString uri = table->item(i, 2)->text();
MapLayer* layer = 0;
@ -647,8 +648,7 @@ void GlobePlugin::layersChanged()
}
map->addMapLayer( layer );
bool cache = table->item(i, 1)->checkState();
layer->setCache( 0 ); //TODO: from dialog
if ( !cache || type == "Worldwind" ) layer->setCache( 0 ); //no tms cache for worldwind (use worldwind_cache)
}
//remove QGIS layer

View File

@ -202,7 +202,7 @@ void QgsGlobePluginDialog::on_elevationAdd_clicked()
QTableWidgetItem *type = new QTableWidgetItem(elevationCombo->currentText());
QTableWidgetItem *uri = new QTableWidgetItem(elevationPath->text());
QTableWidgetItem* cache = new QTableWidgetItem();
cache->setCheckState(Qt::Unchecked);
cache->setCheckState( (elevationCombo->currentText() == "Worldwind") ? Qt::Checked : Qt::Unchecked ); //worldwind_cache will be active
elevationDatasourcesWidget->setRowCount(1+i);
elevationDatasourcesWidget->setItem(i, 0, type);
elevationDatasourcesWidget->setItem(i, 1, cache);
@ -285,7 +285,7 @@ void QgsGlobePluginDialog::readElevationDatasources()
elevationDatasourcesWidget->setRowCount(1+i);
elevationDatasourcesWidget->setItem(i, 0, type);
QTableWidgetItem* chkBoxItem = new QTableWidgetItem();
(cache) ? chkBoxItem->setCheckState(Qt::Checked) : chkBoxItem->setCheckState(Qt::Unchecked);
chkBoxItem->setCheckState( cache ? Qt::Checked : Qt::Unchecked );
elevationDatasourcesWidget->setItem(i, 1, chkBoxItem);
elevationDatasourcesWidget->setItem(i, 2, uri);
}