Skip to content

Commit

Permalink
automatic indentation update (r10009-r10065)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@10066 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jan 31, 2009
1 parent 0f0f381 commit ddd7c8b
Show file tree
Hide file tree
Showing 15 changed files with 104 additions and 102 deletions.
57 changes: 29 additions & 28 deletions src/app/qgisapp.cpp
Expand Up @@ -801,7 +801,7 @@ void QgisApp::createActions()
mActionLayerSelectionSaveAs->setStatusTip( tr( "Save the selection as a shapefile" ) ); mActionLayerSelectionSaveAs->setStatusTip( tr( "Save the selection as a shapefile" ) );
connect( mActionLayerSelectionSaveAs, SIGNAL( triggered() ), this, SLOT( saveSelectionAsShapefile() ) ); connect( mActionLayerSelectionSaveAs, SIGNAL( triggered() ), this, SLOT( saveSelectionAsShapefile() ) );
mActionLayerSelectionSaveAs->setEnabled( false ); mActionLayerSelectionSaveAs->setEnabled( false );

mActionRemoveLayer = new QAction( getThemeIcon( "mActionRemoveLayer.png" ), tr( "Remove Layer" ), this ); mActionRemoveLayer = new QAction( getThemeIcon( "mActionRemoveLayer.png" ), tr( "Remove Layer" ), this );
mActionRemoveLayer->setShortcut( tr( "Ctrl+D", "Remove a Layer" ) ); mActionRemoveLayer->setShortcut( tr( "Ctrl+D", "Remove a Layer" ) );
mActionRemoveLayer->setStatusTip( tr( "Remove a Layer" ) ); mActionRemoveLayer->setStatusTip( tr( "Remove a Layer" ) );
Expand Down Expand Up @@ -2173,15 +2173,16 @@ bool QgisApp::addVectorLayers( QStringList const & theLayerQStringList, const QS


// If the newly created layer has more than 1 layer of data available, we show the // If the newly created layer has more than 1 layer of data available, we show the
// sublayers selection dialog so the user can select the sublayers to actually load. // sublayers selection dialog so the user can select the sublayers to actually load.
if ( sublayers.count() > 1) if ( sublayers.count() > 1 )
{ {
askUserForSublayers(layer); askUserForSublayers( layer );


// The first layer loaded is not usefull in that case. The user can select it in // The first layer loaded is not usefull in that case. The user can select it in
// the list if he wants to load it. // the list if he wants to load it.
delete layer; delete layer;


}else // there is 1 layer of data available }
else // there is 1 layer of data available
{ {
// Register this layer with the layers registry // Register this layer with the layers registry
QgsMapLayerRegistry::instance()->addMapLayer( layer ); QgsMapLayerRegistry::instance()->addMapLayer( layer );
Expand Down Expand Up @@ -2219,57 +2220,57 @@ bool QgisApp::addVectorLayers( QStringList const & theLayerQStringList, const QS
} // QgisApp::addVectorLayer() } // QgisApp::addVectorLayer()


// This method is the method that does the real job. If the layer given in // This method is the method that does the real job. If the layer given in
// parameter is NULL, then the method tries to act on the activeLayer. // parameter is NULL, then the method tries to act on the activeLayer.
void QgisApp::askUserForSublayers(QgsVectorLayer *layer) void QgisApp::askUserForSublayers( QgsVectorLayer *layer )
{ {
if (layer == NULL) if ( layer == NULL )
{ {
if (activeLayer() == NULL || activeLayer()->type() != QgsMapLayer::VectorLayer) if ( activeLayer() == NULL || activeLayer()->type() != QgsMapLayer::VectorLayer )
return; return;

layer = (QgsVectorLayer*) activeLayer(); layer = ( QgsVectorLayer* ) activeLayer();
if (layer->dataProvider()->name() != "ogr") if ( layer->dataProvider()->name() != "ogr" )
return; return;
} }

QStringList sublayers = layer->dataProvider()->subLayers(); QStringList sublayers = layer->dataProvider()->subLayers();


// We initialize a selection dialog and display it. // We initialize a selection dialog and display it.
QgsOGRSublayersDialog chooseSublayersDialog( this ); QgsOGRSublayersDialog chooseSublayersDialog( this );
chooseSublayersDialog.populateLayerTable( sublayers ); chooseSublayersDialog.populateLayerTable( sublayers );

if (chooseSublayersDialog.exec()) if ( chooseSublayersDialog.exec() )
{ {
QString uri = layer->source(); QString uri = layer->source();
if ( uri.contains('&', Qt::CaseSensitive) ) if ( uri.contains( '&', Qt::CaseSensitive ) )
{ {
// If we get here, there are some options added to the filename. // If we get here, there are some options added to the filename.
// A valid uri is of the form: filename&option1=value1&option2=value2,... // A valid uri is of the form: filename&option1=value1&option2=value2,...
// We want only the filename here, so we get the first part of the split. // We want only the filename here, so we get the first part of the split.
QStringList theURIParts = uri.split("&"); QStringList theURIParts = uri.split( "&" );
uri = theURIParts.at( 0 ); uri = theURIParts.at( 0 );
} }

// the user has done his choice // the user has done his choice
loadOGRSublayers(uri, chooseSublayersDialog.getSelection()); loadOGRSublayers( uri, chooseSublayersDialog.getSelection() );
} }
} }


// This method will load with OGR the layers in parameter. // This method will load with OGR the layers in parameter.
// This method has been conceived to use the new URI // This method has been conceived to use the new URI
// format of the ogrprovider so as to give precisions about which // format of the ogrprovider so as to give precisions about which
// sublayer to load into QGIS. It is normally triggered by the // sublayer to load into QGIS. It is normally triggered by the
// sublayer selection dialog. // sublayer selection dialog.
void QgisApp::loadOGRSublayers( QString uri, QStringList list) void QgisApp::loadOGRSublayers( QString uri, QStringList list )
{ {
// The uri must contain the actual uri of the vectorLayer from which we are // The uri must contain the actual uri of the vectorLayer from which we are
// going to load the sublayers. // going to load the sublayers.
QString fileName = QFileInfo(uri).baseName(); QString fileName = QFileInfo( uri ).baseName();
for (int i = 0; i < list.size(); i++) for ( int i = 0; i < list.size(); i++ )
{ {
QString composedURI=uri+"&layername="+list.at(i); QString composedURI = uri + "&layername=" + list.at( i );
QgsVectorLayer *layer=addVectorLayer(composedURI,fileName+":"+list.at(i),"ogr"); QgsVectorLayer *layer = addVectorLayer( composedURI, fileName + ":" + list.at( i ), "ogr" );
} }
} }


/** This helper checks to see whether the file name appears to be a valid vector file name */ /** This helper checks to see whether the file name appears to be a valid vector file name */
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.h
Expand Up @@ -600,7 +600,7 @@ class QgisApp : public QMainWindow
/** This method will open a dialog so the user can select the sublayers /** This method will open a dialog so the user can select the sublayers
* to load * to load
*/ */
void askUserForSublayers(QgsVectorLayer *layer); void askUserForSublayers( QgsVectorLayer *layer );
/** Add a raster layer to the map (passed in as a ptr). /** Add a raster layer to the map (passed in as a ptr).
* It won't force a refresh. * It won't force a refresh.
*/ */
Expand Down
29 changes: 15 additions & 14 deletions src/app/qgsogrsublayersdialog.cpp
Expand Up @@ -23,8 +23,8 @@ QgsOGRSublayersDialog::QgsOGRSublayersDialog( QWidget* parent, Qt::WFlags fl )
: QDialog( parent, fl ) : QDialog( parent, fl )
{ {
setupUi( this ); setupUi( this );
QStringList labels=QStringList() << "Layer ID" << "Layer name" << "Nb of features" << "Geometry type"; QStringList labels = QStringList() << "Layer ID" << "Layer name" << "Nb of features" << "Geometry type";
layersTable->setHeaderLabels(labels); layersTable->setHeaderLabels( labels );
} }


QgsOGRSublayersDialog::~QgsOGRSublayersDialog() QgsOGRSublayersDialog::~QgsOGRSublayersDialog()
Expand All @@ -33,22 +33,23 @@ QgsOGRSublayersDialog::~QgsOGRSublayersDialog()


QStringList QgsOGRSublayersDialog::getSelection() QStringList QgsOGRSublayersDialog::getSelection()
{ {
QStringList list=QStringList(); QStringList list = QStringList();
for (int i = 0; i < layersTable-> selectedItems().size(); i++) for ( int i = 0; i < layersTable-> selectedItems().size(); i++ )
{ {
QString theItem =layersTable-> selectedItems().at(i)->text(1); QString theItem = layersTable-> selectedItems().at( i )->text( 1 );
list.append(theItem); list.append( theItem );
} }
return list; return list;
} }


void QgsOGRSublayersDialog::populateLayerTable (QStringList theList) void QgsOGRSublayersDialog::populateLayerTable( QStringList theList )
{ {
for (int i =0; i< theList.size(); i++){ for ( int i = 0; i < theList.size(); i++ )
QString ligne = theList.at(i); {
QStringList elements = ligne.split(":"); QString ligne = theList.at( i );
QStringList item=QStringList(); QStringList elements = ligne.split( ":" );
item << elements.at(0) << elements.at(1) << elements.at(2) << elements.at(3); QStringList item = QStringList();
layersTable -> addTopLevelItem(new QTreeWidgetItem(item)); item << elements.at( 0 ) << elements.at( 1 ) << elements.at( 2 ) << elements.at( 3 );
} layersTable -> addTopLevelItem( new QTreeWidgetItem( item ) );
}
} }
4 changes: 2 additions & 2 deletions src/app/qgsogrsublayersdialog.h
Expand Up @@ -28,8 +28,8 @@ class QgsOGRSublayersDialog : public QDialog, private Ui::QgsOGRSublayersDialogB
public: public:
QgsOGRSublayersDialog( QWidget* parent = 0, Qt::WFlags fl = 0 ); QgsOGRSublayersDialog( QWidget* parent = 0, Qt::WFlags fl = 0 );
~QgsOGRSublayersDialog(); ~QgsOGRSublayersDialog();
void populateLayerTable(QStringList theList); void populateLayerTable( QStringList theList );
QStringList getSelection(); QStringList getSelection();


}; };


Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsserversourceselect.cpp
Expand Up @@ -77,7 +77,7 @@ QgsServerSourceSelect::QgsServerSourceSelect( QWidget * parent, Qt::WFlags fl )
int i = 1; int i = 1;
while ( iter != m_PotentialFormats.end() ) while ( iter != m_PotentialFormats.end() )
{ {
QRadioButton* btn = new QRadioButton(iter.value().first); QRadioButton* btn = new QRadioButton( iter.value().first );
m_imageFormatGroup->addButton( btn, iter.value().second ); m_imageFormatGroup->addButton( btn, iter.value().second );
m_imageFormatLayout->addWidget( btn ); m_imageFormatLayout->addWidget( btn );
if ( i == 1 ) if ( i == 1 )
Expand Down Expand Up @@ -584,7 +584,7 @@ QString QgsServerSourceSelect::selectedImageEncoding()
QString imageEncoding = m_PotentialFormats.key( qMakePair( label, id ) ); QString imageEncoding = m_PotentialFormats.key( qMakePair( label, id ) );


//substitute blanks with %20 (e.g. in "image/png; mode=24bit") //substitute blanks with %20 (e.g. in "image/png; mode=24bit")
imageEncoding.replace(QRegExp(" "), "%20"); imageEncoding.replace( QRegExp( " " ), "%20" );
return imageEncoding; return imageEncoding;
} }


Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposermap.cpp
Expand Up @@ -372,7 +372,7 @@ void QgsComposerMap::setSceneRect( const QRectF& rectangle )
mExtent = QgsRectangle( mExtent.xMinimum(), mExtent.yMinimum(), mExtent.xMaximum(), mExtent.yMinimum() + newHeight ); mExtent = QgsRectangle( mExtent.xMinimum(), mExtent.yMinimum(), mExtent.xMaximum(), mExtent.yMinimum() + newHeight );
mCacheUpdated = false; mCacheUpdated = false;
emit extentChanged(); emit extentChanged();
if(mPreviewMode != Rectangle) if ( mPreviewMode != Rectangle )
{ {
cache(); cache();
} }
Expand Down
16 changes: 8 additions & 8 deletions src/core/qgsgeometry.cpp
Expand Up @@ -5453,29 +5453,29 @@ QList<QgsGeometry*> QgsGeometry::asGeometryCollection()
if ( mGeos == NULL ) if ( mGeos == NULL )
return QList<QgsGeometry*>(); return QList<QgsGeometry*>();
} }

int type = GEOSGeomTypeId( mGeos ); int type = GEOSGeomTypeId( mGeos );
QgsDebugMsg("geom type: "+QString::number(type)); QgsDebugMsg( "geom type: " + QString::number( type ) );

QList<QgsGeometry*> geomCollection; QList<QgsGeometry*> geomCollection;

if ( type != GEOS_MULTIPOINT && if ( type != GEOS_MULTIPOINT &&
type != GEOS_MULTILINESTRING && type != GEOS_MULTILINESTRING &&
type != GEOS_MULTIPOLYGON && type != GEOS_MULTIPOLYGON &&
type != GEOS_GEOMETRYCOLLECTION ) type != GEOS_GEOMETRYCOLLECTION )
{ {
// we have a single-part geometry - put there a copy of this one // we have a single-part geometry - put there a copy of this one
geomCollection.append( new QgsGeometry(*this) ); geomCollection.append( new QgsGeometry( *this ) );
return geomCollection; return geomCollection;
} }

int count = GEOSGetNumGeometries( mGeos ); int count = GEOSGetNumGeometries( mGeos );
QgsDebugMsg("geom count: "+QString::number(count)); QgsDebugMsg( "geom count: " + QString::number( count ) );


for ( int i = 0; i < count; ++i ) for ( int i = 0; i < count; ++i )
{ {
const GEOSGeometry * geometry = GEOSGetGeometryN( mGeos, i ); const GEOSGeometry * geometry = GEOSGetGeometryN( mGeos, i );
geomCollection.append( fromGeosGeom( GEOSGeom_clone(geometry) ) ); geomCollection.append( fromGeosGeom( GEOSGeom_clone( geometry ) ) );
} }


return geomCollection; return geomCollection;
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.cpp
Expand Up @@ -2324,7 +2324,7 @@ bool QgsVectorLayer::readSymbology( const QDomNode& node, QString& errorMessage


if ( !renderer ) if ( !renderer )
{ {
errorMessage = tr("Unknown renderer"); errorMessage = tr( "Unknown renderer" );
return false; return false;
} }


Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsdetaileditemdelegate.cpp
Expand Up @@ -122,11 +122,11 @@ void QgsDetailedItemDelegate::paintManually( QPainter * thepPainter,
if ( theOption.state & QStyle::State_Selected ) if ( theOption.state & QStyle::State_Selected )
{ {
drawHighlight( theOption, thepPainter, height( theOption, theData ) ); drawHighlight( theOption, thepPainter, height( theOption, theData ) );
thepPainter->setPen(theOption.palette.highlightedText().color()); thepPainter->setPen( theOption.palette.highlightedText().color() );
} }
else else
{ {
thepPainter->setPen(theOption.palette.text().color()); thepPainter->setPen( theOption.palette.text().color() );
} }




Expand Down
8 changes: 4 additions & 4 deletions src/gui/qgsmapcanvas.cpp
Expand Up @@ -431,14 +431,14 @@ void QgsMapCanvas::saveAsImage( QString theFileName, QPixmap * theQPixmap, QStri
myHeader += QString::number( myRect.xMinimum() ) + "\r\n"; myHeader += QString::number( myRect.xMinimum() ) + "\r\n";
//Origin Y (top left corner) //Origin Y (top left corner)
myHeader += QString::number( myRect.yMaximum() ) + "\r\n"; myHeader += QString::number( myRect.yMaximum() ) + "\r\n";
QFileInfo myInfo = QFileInfo(theFileName); QFileInfo myInfo = QFileInfo( theFileName );
QString myWorldFileName = myInfo.absolutePath() + QDir::separator() + myInfo.baseName() + "." + theFormat + "w"; QString myWorldFileName = myInfo.absolutePath() + QDir::separator() + myInfo.baseName() + "." + theFormat + "w";
QFile myWorldFile(myWorldFileName); QFile myWorldFile( myWorldFileName );
if (!myWorldFile.open(QIODevice::WriteOnly | QIODevice::Text)) if ( !myWorldFile.open( QIODevice::WriteOnly | QIODevice::Text ) )
{ {
return; return;
} }
QTextStream myStream(&myWorldFile); QTextStream myStream( &myWorldFile );
myStream << myHeader; myStream << myHeader;
} // saveAsImage } // saveAsImage


Expand Down

0 comments on commit ddd7c8b

Please sign in to comment.