Skip to content

Commit 4ed9c53

Browse files
committed
Use cache from settings
1 parent 0cbd8a3 commit 4ed9c53

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/plugins/globe/globe_plugin.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,7 @@ void GlobePlugin::layersChanged()
619619
for(int i = 0; i < table->rowCount(); ++i)
620620
{
621621
QString type = table->item(i, 0)->text();
622+
bool cache = table->item(i, 1)->checkState();
622623
QString uri = table->item(i, 2)->text();
623624
MapLayer* layer = 0;
624625

@@ -647,8 +648,7 @@ void GlobePlugin::layersChanged()
647648
}
648649
map->addMapLayer( layer );
649650

650-
bool cache = table->item(i, 1)->checkState();
651-
layer->setCache( 0 ); //TODO: from dialog
651+
if ( !cache || type == "Worldwind" ) layer->setCache( 0 ); //no tms cache for worldwind (use worldwind_cache)
652652
}
653653

654654
//remove QGIS layer

src/plugins/globe/globe_plugin_dialog.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void QgsGlobePluginDialog::on_elevationAdd_clicked()
202202
QTableWidgetItem *type = new QTableWidgetItem(elevationCombo->currentText());
203203
QTableWidgetItem *uri = new QTableWidgetItem(elevationPath->text());
204204
QTableWidgetItem* cache = new QTableWidgetItem();
205-
cache->setCheckState(Qt::Unchecked);
205+
cache->setCheckState( (elevationCombo->currentText() == "Worldwind") ? Qt::Checked : Qt::Unchecked ); //worldwind_cache will be active
206206
elevationDatasourcesWidget->setRowCount(1+i);
207207
elevationDatasourcesWidget->setItem(i, 0, type);
208208
elevationDatasourcesWidget->setItem(i, 1, cache);
@@ -285,7 +285,7 @@ void QgsGlobePluginDialog::readElevationDatasources()
285285
elevationDatasourcesWidget->setRowCount(1+i);
286286
elevationDatasourcesWidget->setItem(i, 0, type);
287287
QTableWidgetItem* chkBoxItem = new QTableWidgetItem();
288-
(cache) ? chkBoxItem->setCheckState(Qt::Checked) : chkBoxItem->setCheckState(Qt::Unchecked);
288+
chkBoxItem->setCheckState( cache ? Qt::Checked : Qt::Unchecked );
289289
elevationDatasourcesWidget->setItem(i, 1, chkBoxItem);
290290
elevationDatasourcesWidget->setItem(i, 2, uri);
291291
}

0 commit comments

Comments
 (0)