Skip to content

Commit

Permalink
make saving of relative pathes of file data sources optional
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10874 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jun 1, 2009
1 parent 211fd89 commit 780b5fa
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 140 deletions.
9 changes: 5 additions & 4 deletions src/app/qgsprojectproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down Expand Up @@ -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() );
Expand Down
3 changes: 2 additions & 1 deletion src/core/qgsmaplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
Expand Down
Loading

0 comments on commit 780b5fa

Please sign in to comment.