Skip to content

Commit f2df647

Browse files
author
jef
committed
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
1 parent 34a2c01 commit f2df647

File tree

3 files changed

+143
-140
lines changed

3 files changed

+143
-140
lines changed

src/app/qgsprojectproperties.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas* mapCanvas, QWidget *pa
8080
radManual->setChecked( true );
8181
}
8282

83+
cbxAbsolutePath->setChecked( QgsProject::instance()->readBoolEntry( "Paths", "/Absolute", true ) );
84+
8385
int dp = QgsProject::instance()->readNumEntry( "PositionPrecision", "/DecimalPlaces" );
8486
spinBoxDP->setValue( dp );
8587

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

284+
QgsProject::instance()->writeEntry( "Paths", "/Absolute", cbxAbsolutePath->isChecked() );
285+
285286
//set the colour for selections
286287
QColor myColour = pbnSelectionColour->color();
287288
QgsProject::instance()->writeEntry( "Gui", "/SelectionColorRedPart", myColour.red() );

src/core/qgsmaplayer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ bool QgsMapLayer::writeXML( QDomNode & layer_node, QDomDocument & document )
282282
QString src = source();
283283
QFileInfo srcInfo( src );
284284

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

0 commit comments

Comments
 (0)