Skip to content
Permalink
Browse files

Merge branch 'master' of github.com:qgis/Quantum-GIS

  • Loading branch information
pka committed Jul 13, 2011
2 parents 36fb5a7 + e0f4d06 commit 587ecf4316dbff5b6bbae72a585081bfe6435f43
@@ -189,12 +189,12 @@ void QgsComposerItemWidget::on_mPositionButton_clicked()
}
}

void QgsComposerItemWidget::on_mItemIdLineEdit_textChanged(const QString &text)
void QgsComposerItemWidget::on_mItemIdLineEdit_textChanged( const QString &text )
{
if ( mItem )
{
mItem->beginCommand( tr( "Item id changed" ), QgsComposerMergeCommand::ComposerLabelSetId );
mItem->setId( text );
mItem->endCommand();
}
if ( mItem )
{
mItem->beginCommand( tr( "Item id changed" ), QgsComposerMergeCommand::ComposerLabelSetId );
mItem->setId( text );
mItem->endCommand();
}
}
@@ -713,7 +713,7 @@ QgsLegendGroup* QgsLegend::addEmbeddedGroup( const QString& groupName, const QSt
removeItem( cItem );
}

if( cItem )
if ( cItem )
{
group->insertChild( group->childCount(), cItem );
}
@@ -309,7 +309,7 @@ void QgsLegendLayer::rasterLayerSymbology( QgsRasterLayer* layer )
SymbologyList itemList;
QList< QPair< QString, QColor > > rasterItemList = layer->legendSymbologyItems();
QList< QPair< QString, QColor > >::const_iterator itemIt = rasterItemList.constBegin();
for(; itemIt != rasterItemList.constEnd(); ++itemIt )
for ( ; itemIt != rasterItemList.constEnd(); ++itemIt )
{
QPixmap itemPixmap( treeWidget()->iconSize() );
itemPixmap.fill( itemIt->second );
@@ -10,7 +10,7 @@
QgsEmbedLayerDialog::QgsEmbedLayerDialog( QWidget * parent, Qt::WindowFlags f ): QDialog( parent, f )
{
setupUi( this );
QObject::connect( mButtonBox, SIGNAL(rejected() ), this, SLOT(reject() ) );
QObject::connect( mButtonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
}

QgsEmbedLayerDialog::~QgsEmbedLayerDialog()
@@ -23,11 +23,11 @@ QList< QPair < QString, QString > > QgsEmbedLayerDialog::embeddedGroups() const

QList<QTreeWidgetItem*> items = mTreeWidget->selectedItems();
QList<QTreeWidgetItem*>::iterator itemIt = items.begin();
for(; itemIt != items.end(); ++itemIt )
for ( ; itemIt != items.end(); ++itemIt )
{
if( (*itemIt)->data(0, Qt::UserRole).toString() == "group" )
if (( *itemIt )->data( 0, Qt::UserRole ).toString() == "group" )
{
result.push_back( qMakePair( (*itemIt)->text( 0 ), mProjectPath ) );
result.push_back( qMakePair(( *itemIt )->text( 0 ), mProjectPath ) );
}
}

@@ -40,11 +40,11 @@ QList< QPair < QString, QString > > QgsEmbedLayerDialog::embeddedLayers() const

QList<QTreeWidgetItem*> items = mTreeWidget->selectedItems();
QList<QTreeWidgetItem*>::iterator itemIt = items.begin();
for(; itemIt != items.end(); ++itemIt )
for ( ; itemIt != items.end(); ++itemIt )
{
if( (*itemIt)->data(0, Qt::UserRole).toString() == "layer" )
if (( *itemIt )->data( 0, Qt::UserRole ).toString() == "layer" )
{
result.push_back( qMakePair( (*itemIt)->data(0, Qt::UserRole + 1).toString(), mProjectPath ) );
result.push_back( qMakePair(( *itemIt )->data( 0, Qt::UserRole + 1 ).toString(), mProjectPath ) );
}
}
return result;
@@ -56,8 +56,8 @@ void QgsEmbedLayerDialog::on_mBrowseFileToolButton_clicked()
mProjectFileLineEdit->blockSignals( true );

QSettings s;
QString projectFile = QFileDialog::getOpenFileName( 0, tr("Select project file"), s.value("/qgis/last_embedded_project_path").toString() ,tr("QGIS project files (*.qgs)") );
if( !projectFile.isEmpty() )
QString projectFile = QFileDialog::getOpenFileName( 0, tr( "Select project file" ), s.value( "/qgis/last_embedded_project_path" ).toString() , tr( "QGIS project files (*.qgs)" ) );
if ( !projectFile.isEmpty() )
{
mProjectFileLineEdit->setText( projectFile );
}
@@ -73,55 +73,55 @@ void QgsEmbedLayerDialog::on_mProjectFileLineEdit_editingFinished()
void QgsEmbedLayerDialog::changeProjectFile()
{
QFile projectFile( mProjectFileLineEdit->text() );
if( !projectFile.exists() )
if ( !projectFile.exists() )
{
return;
}

if( mProjectPath == mProjectFileLineEdit->text() )
if ( mProjectPath == mProjectFileLineEdit->text() )
{
//already up to date
return;
}

//check we are not embedding from/to the same project
if( mProjectFileLineEdit->text() == QgsProject::instance()->fileName() )
if ( mProjectFileLineEdit->text() == QgsProject::instance()->fileName() )
{
QMessageBox::critical( 0, tr("Recursive embeding not possible"), tr("It is not possible to embed layers / groups from the current project") );
QMessageBox::critical( 0, tr( "Recursive embeding not possible" ), tr( "It is not possible to embed layers / groups from the current project" ) );
return;
}

mTreeWidget->clear();

//parse project file and fill tree
if( !projectFile.open( QIODevice::ReadOnly ) )
if ( !projectFile.open( QIODevice::ReadOnly ) )
{
return;
}

QDomDocument projectDom;
if( !projectDom.setContent( &projectFile ) )
if ( !projectDom.setContent( &projectFile ) )
{
return;
}

QDomElement legendElem = projectDom.documentElement().firstChildElement("legend");
if( legendElem.isNull() )
QDomElement legendElem = projectDom.documentElement().firstChildElement( "legend" );
if ( legendElem.isNull() )
{
return;
}

QDomNodeList legendChildren = legendElem.childNodes();
QDomElement currentChildElem;

for( int i = 0; i < legendChildren.size(); ++i )
for ( int i = 0; i < legendChildren.size(); ++i )
{
currentChildElem = legendChildren.at( i ).toElement();
if( currentChildElem.tagName() == "legendlayer" )
if ( currentChildElem.tagName() == "legendlayer" )
{
addLegendLayerToTreeWidget( currentChildElem );
}
else if( currentChildElem.tagName() == "legendgroup" )
else if ( currentChildElem.tagName() == "legendgroup" )
{
addLegendGroupToTreeWidget( currentChildElem );
}
@@ -135,32 +135,32 @@ void QgsEmbedLayerDialog::addLegendGroupToTreeWidget( const QDomElement& groupEl
QDomNodeList groupChildren = groupElem.childNodes();
QDomElement currentChildElem;

if(groupElem.attribute("embedded") == "1" )
if ( groupElem.attribute( "embedded" ) == "1" )
{
return;
}

QTreeWidgetItem* groupItem = 0;
if( !parent )
if ( !parent )
{
groupItem = new QTreeWidgetItem( mTreeWidget );
}
else
{
groupItem = new QTreeWidgetItem( parent );
}
groupItem->setIcon( 0, QgisApp::getThemeIcon("mActionFolder.png") );
groupItem->setText( 0, groupElem.attribute("name") );
groupItem->setIcon( 0, QgisApp::getThemeIcon( "mActionFolder.png" ) );
groupItem->setText( 0, groupElem.attribute( "name" ) );
groupItem->setData( 0, Qt::UserRole, "group" );

for( int i = 0; i < groupChildren.size(); ++i )
for ( int i = 0; i < groupChildren.size(); ++i )
{
currentChildElem = groupChildren.at( i ).toElement();
if( currentChildElem.tagName() == "legendlayer" )
if ( currentChildElem.tagName() == "legendlayer" )
{
addLegendLayerToTreeWidget( currentChildElem, groupItem );
}
else if( currentChildElem.tagName() == "legendgroup" )
else if ( currentChildElem.tagName() == "legendgroup" )
{
addLegendGroupToTreeWidget( currentChildElem, groupItem );
}
@@ -169,31 +169,31 @@ void QgsEmbedLayerDialog::addLegendGroupToTreeWidget( const QDomElement& groupEl

void QgsEmbedLayerDialog::addLegendLayerToTreeWidget( const QDomElement& layerElem, QTreeWidgetItem* parent )
{
if(layerElem.attribute("embedded") == "1" )
if ( layerElem.attribute( "embedded" ) == "1" )
{
return;
}

QTreeWidgetItem* item = 0;
if( parent )
if ( parent )
{
item = new QTreeWidgetItem( parent );
}
else
{
item = new QTreeWidgetItem( mTreeWidget );
}
item->setText( 0, layerElem.attribute("name") );
item->setText( 0, layerElem.attribute( "name" ) );
item->setData( 0, Qt::UserRole, "layer" );
item->setData( 0, Qt::UserRole + 1, layerElem.firstChildElement("filegroup").firstChildElement("legendlayerfile").attribute("layerid") );
item->setData( 0, Qt::UserRole + 1, layerElem.firstChildElement( "filegroup" ).firstChildElement( "legendlayerfile" ).attribute( "layerid" ) );
}

void QgsEmbedLayerDialog::on_mTreeWidget_itemSelectionChanged()
{
mTreeWidget->blockSignals( true );
QList<QTreeWidgetItem*> items = mTreeWidget->selectedItems();
QList<QTreeWidgetItem*>::iterator itemIt = items.begin();
for(; itemIt != items.end(); ++itemIt )
for ( ; itemIt != items.end(); ++itemIt )
{
//deselect children recursively
unselectChildren( *itemIt );
@@ -203,13 +203,13 @@ void QgsEmbedLayerDialog::on_mTreeWidget_itemSelectionChanged()

void QgsEmbedLayerDialog::unselectChildren( QTreeWidgetItem* item )
{
if( !item )
if ( !item )
{
return;
}

QTreeWidgetItem* currentChild = 0;
for( int i = 0; i < item->childCount(); ++i )
for ( int i = 0; i < item->childCount(); ++i )
{
currentChild = item->child( i );
currentChild->setSelected( false );
@@ -221,9 +221,9 @@ void QgsEmbedLayerDialog::on_mButtonBox_accepted()
{
QSettings s;
QFileInfo fi( mProjectPath );
if( fi.exists() )
if ( fi.exists() )
{
s.setValue("/qgis/last_embedded_project_path", fi.absolutePath() );
s.setValue( "/qgis/last_embedded_project_path", fi.absolutePath() );
}
accept();
}
@@ -8,7 +8,7 @@ class QDomElement;

class QgsEmbedLayerDialog: public QDialog, private Ui::QgsEmbedLayerDialogBase
{
Q_OBJECT
Q_OBJECT
public:
QgsEmbedLayerDialog( QWidget * parent = 0, Qt::WindowFlags f = 0 );
~QgsEmbedLayerDialog();
@@ -330,7 +330,7 @@ class CORE_EXPORT QgsComposerItem: public QObject, public QGraphicsRectItem
void rotationChanged( double newRotation );
/**Used e.g. by the item widgets to update the gui elements*/
void itemChanged();
private:
private:
// Label id (unique within the same composition)
QString mId;
};
@@ -125,7 +125,7 @@ class CORE_EXPORT QgsComposerRasterSymbolItem: public QgsComposerLegendItem
QString layerID() const { return mLayerID; }
ItemType itemType() const { return RasterSymbolItem; }

void setColor( const QColor& c ){ mColor = c; }
void setColor( const QColor& c ) { mColor = c; }
QColor color() const { return mColor; }

private:
@@ -238,10 +238,10 @@ int QgsLegendModel::addRasterLayerItems( QStandardItem* layerItem, QgsMapLayer*

QList< QPair< QString, QColor > > rasterItemList = rasterLayer->legendSymbologyItems();
QList< QPair< QString, QColor > >::const_iterator itemIt = rasterItemList.constBegin();
for(; itemIt != rasterItemList.constEnd(); ++itemIt )
for ( ; itemIt != rasterItemList.constEnd(); ++itemIt )
{
QgsComposerRasterSymbolItem* currentSymbolItem = new QgsComposerRasterSymbolItem( itemIt->first );
if( mHasTopLevelWindow )
if ( mHasTopLevelWindow )
{
QPixmap itemPixmap( 20, 20 );
itemPixmap.fill( itemIt->second );
@@ -283,8 +283,8 @@ class CORE_EXPORT QgsProject : public QObject
@return the layer or 0 in case of error
@note: added in version 1.8*/
//static QgsMapLayer* createEmbeddedLayer( const QString& layerId, const QString& projectFilePath );
bool createEmbeddedLayer( const QString& layerId, const QString& projectFilePath, QList<QDomNode>& brokenNodes,
QList< QPair< QgsVectorLayer*, QDomElement > >& vectorLayerList, bool saveFlag = true );
bool createEmbeddedLayer( const QString& layerId, const QString& projectFilePath, QList<QDomNode>& brokenNodes,
QList< QPair< QgsVectorLayer*, QDomElement > >& vectorLayerList, bool saveFlag = true );

protected:

@@ -78,25 +78,25 @@ namespace SpatialIndex
extern ISpatialIndex* returnRTree( IStorageManager& in0, Tools::PropertySet& in1 );
#endif//_MSC_VER
extern ISpatialIndex* createNewRTree(
IStorageManager& sm,
double fillFactor,
unsigned long indexCapacity,
unsigned long leafCapacity,
unsigned long dimension,
RTreeVariant rv,
long& indexIdentifier
);
IStorageManager& sm,
double fillFactor,
unsigned long indexCapacity,
unsigned long leafCapacity,
unsigned long dimension,
RTreeVariant rv,
long& indexIdentifier
);
extern ISpatialIndex* createAndBulkLoadNewRTree(
BulkLoadMethod m,
IDataStream& stream,
IStorageManager& sm,
double fillFactor,
unsigned long indexCapacity,
unsigned long leafCapacity,
unsigned long dimension,
RTreeVariant rv,
long& indexIdentifier
);
BulkLoadMethod m,
IDataStream& stream,
IStorageManager& sm,
double fillFactor,
unsigned long indexCapacity,
unsigned long leafCapacity,
unsigned long dimension,
RTreeVariant rv,
long& indexIdentifier
);
extern ISpatialIndex* loadRTree( IStorageManager& in, long indexIdentifier );
}
}
@@ -57,15 +57,15 @@ namespace SpatialIndex
//
// Interfaces
//
interface IEntry : public Tools::IObject
interface IEntry : public Tools::IObject
{
public:
virtual long getIdentifier() const = 0;
virtual void getShape( IShape** out ) const = 0;
virtual ~IEntry() {}
}; // IEntry

interface INode : public IEntry, public Tools::ISerializable
interface INode : public IEntry, public Tools::ISerializable
{
public:
virtual unsigned long getChildrenCount() const = 0;
@@ -77,14 +77,14 @@ interface INode : public IEntry, public Tools::ISerializable
virtual ~INode() {}
}; // INode

interface IData : public IEntry
interface IData : public IEntry
{
public:
virtual void getData( unsigned long& len, byte** data ) const = 0;
virtual ~IData() {}
}; // IData

interface IDataStream : public Tools::IObjectStream
interface IDataStream : public Tools::IObjectStream
{
public:
virtual IData* getNext() = 0;
@@ -168,7 +168,7 @@ interface IDataStream : public Tools::IObjectStream
NewPage = -0x1
};

interface IBuffer : public IStorageManager
interface IBuffer : public IStorageManager
{
public:
virtual unsigned long getHits() = 0;

0 comments on commit 587ecf4

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