Skip to content
Permalink
Browse files

make saving of relative pathes of file data sources optional

git-svn-id: http://svn.osgeo.org/qgis/trunk@10874 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Jun 1, 2009
1 parent 34a2c01 commit f2df6475634147792a50a5ffe06305ac90b8eca0
Showing with 143 additions and 140 deletions.
  1. +5 −4 src/app/qgsprojectproperties.cpp
  2. +2 −1 src/core/qgsmaplayer.cpp
  3. +136 −135 src/ui/qgsprojectpropertiesbase.ui
@@ -80,6 +80,8 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas* mapCanvas, QWidget *pa
radManual->setChecked( true );
}

cbxAbsolutePath->setChecked( QgsProject::instance()->readBoolEntry( "Paths", "/Absolute", true ) );

int dp = QgsProject::instance()->readNumEntry( "PositionPrecision", "/DecimalPlaces" );
spinBoxDP->setValue( dp );

@@ -274,14 +276,13 @@ void QgsProjectProperties::apply()
// number of decimal places for the manual option
// Note. Qt 3.2.3 and greater have a function selectedId() that
// can be used instead of the two part technique here
if ( radAutomatic->isChecked() )
QgsProject::instance()->writeEntry( "PositionPrecision", "/Automatic", true );
else
QgsProject::instance()->writeEntry( "PositionPrecision", "/Automatic", false );
QgsProject::instance()->writeEntry( "PositionPrecision", "/Automatic", radAutomatic->isChecked() );
QgsProject::instance()->writeEntry( "PositionPrecision", "/DecimalPlaces", spinBoxDP->value() );
// Announce that we may have a new display precision setting
emit displayPrecisionChanged();

QgsProject::instance()->writeEntry( "Paths", "/Absolute", cbxAbsolutePath->isChecked() );

//set the colour for selections
QColor myColour = pbnSelectionColour->color();
QgsProject::instance()->writeEntry( "Gui", "/SelectionColorRedPart", myColour.red() );
@@ -282,7 +282,8 @@ bool QgsMapLayer::writeXML( QDomNode & layer_node, QDomDocument & document )
QString src = source();
QFileInfo srcInfo( src );

if ( srcInfo.exists() )
bool absolutePath = QgsProject::instance()->readBoolEntry( "Paths", "/Absolute", true );
if ( !absolutePath && srcInfo.exists() )
{
QFileInfo pfi( QgsProject::instance()->fileName() );
QgsDebugMsg( "project path: " + pfi.canonicalPath() );

0 comments on commit f2df647

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