Skip to content
Permalink
Browse files

first cleanup fixed file check

  • Loading branch information
mbernasocchi authored and pka committed Jul 5, 2011
1 parent 5be669d commit e1510a84cbc7263af4994a051fe0fbc4244fa854
Showing with 7 additions and 27 deletions.
  1. +6 −24 src/plugins/globe/globe_plugin_dialog.cpp
  2. +1 −3 src/plugins/globe/globe_plugin_dialog.h
@@ -75,15 +75,14 @@
{
if ( "Raster" == type )
{
QFile file;
file.setFileName( uri );
if ( file.exists() )
QFileInfo file( uri );
if ( file.isFile() && file.isReadable() )
{
return true;
}
else
{
error = tr("Invalid Path: ") + file.errorString();
error = tr("Invalid Path: The file is either unreadable or does not exist");
return false;
}
}
@@ -157,16 +156,6 @@
}

//ELEVATION
void QgsGlobePluginDialog::on_showDatasources_clicked()
{
QString txt;
foreach (DataSource source, elevationsDatasources)
{
txt += source.type + ":\t" + source.uri + "\n";
}
showMessageBox( txt );
}

void QgsGlobePluginDialog::on_elevationCombo_currentIndexChanged(QString type)
{
if("Raster" == type)
@@ -231,18 +220,12 @@

void QgsGlobePluginDialog::readElevationDatasourcesFromSettings()
{
elevationsDatasources.clear();
settings.beginGroup("Plugin-Globe");
int size = settings.beginReadArray("ElevationsDatasources");
for (int i = 0; i < size; ++i) {
settings.setArrayIndex(i);
DataSource ds;
ds.type = settings.value("type").toString();
ds.uri = settings.value("uri").toString();
elevationsDatasources.append(ds);

QTableWidgetItem *type = new QTableWidgetItem(ds.type);
QTableWidgetItem *uri = new QTableWidgetItem(ds.uri);
QTableWidgetItem *type = new QTableWidgetItem(settings.value("type").toString());
QTableWidgetItem *uri = new QTableWidgetItem(settings.value("uri").toString());
elevationDatasourcesWidget->setRowCount(1+i);
elevationDatasourcesWidget->setItem(i, 0, type);
elevationDatasourcesWidget->setItem(i, 1, uri);
@@ -254,9 +237,8 @@
void QgsGlobePluginDialog::saveElevationDatasources()
{
elevationsDatasources.clear();
int iRows = elevationDatasourcesWidget->rowCount();

for(int i = 0; i < iRows; ++i)
for(int i = 0; i < elevationDatasourcesWidget->rowCount(); ++i)
{
QTableWidgetItem* type = elevationDatasourcesWidget->item(i, 0);
QTableWidgetItem* uri = elevationDatasourcesWidget->item(i, 1);
@@ -67,12 +67,10 @@ class QgsGlobePluginDialog:public QDialog, private Ui::QgsGlobePluginDialogGuiBa
void on_resetStereoDefaults_clicked();

//ELEVATION
void on_elevationCombo_currentIndexChanged(QString value);
void on_elevationCombo_currentIndexChanged(QString type);
void on_elevationBrowse_clicked();
void on_elevationAdd_clicked();
void on_elevationRemove_clicked();
void on_showDatasources_clicked();

};

struct DataSource {

0 comments on commit e1510a8

Please sign in to comment.
You can’t perform that action at this time.