Skip to content

Commit

Permalink
Merge remote-tracking branch 'qgis/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew McAninch committed Aug 26, 2015
2 parents 05b8a98 + 0fb356e commit b404ae2
Show file tree
Hide file tree
Showing 108 changed files with 16,561 additions and 14,350 deletions.
2 changes: 1 addition & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ELSE(TXT2TAGS_EXECUTABLE)
)
ENDIF(TXT2TAGS_EXECUTABLE)

SET(QGIS_DOC_FILES ${QGIS_DOC_FILES} index.html news.html developersmap.html contributors.json favicon.ico style.css AUTHORS CONTRIBUTORS SPONSORS DONORS TRANSLATORS LICENSE)
SET(QGIS_DOC_FILES ${QGIS_DOC_FILES} index.html news.html developersmap.html whatsnew.html contributors.json favicon.ico style.css AUTHORS CONTRIBUTORS SPONSORS DONORS TRANSLATORS LICENSE)

INSTALL(FILES ${QGIS_DOC_FILES} DESTINATION ${QGIS_DATA_DIR}/doc)
INSTALL(FILES ../images/icons/qgis-icon-60x60.png DESTINATION ${QGIS_DATA_DIR}/doc/images)
Expand Down
5 changes: 3 additions & 2 deletions python/core/qgsconditionalstyle.sip
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class QgsConditionalLayerStyles

/**
* @brief Set the conditional styles for the field UI properties.
* @param fieldName name of field
* @param styles
*/
void setFieldStyles( QString fieldName, QList<QgsConditionalStyle> styles );
Expand All @@ -36,11 +37,11 @@ class QgsConditionalLayerStyles

/** Reads field ui properties specific state from Dom node.
*/
virtual bool readXml( const QDomNode& node );
bool readXml( const QDomNode& node );

/** Write field ui properties specific state from Dom node.
*/
virtual bool writeXml( QDomNode & node, QDomDocument & doc ) const;
bool writeXml( QDomNode & node, QDomDocument & doc ) const;
};

/** \class QgsConditionalStyle
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsvectorlayer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ class QgsVectorLayer : QgsMapLayer
/**
* @brief Return the conditional styles that are set for this layer. Style information is
* used to render conditional formatting in the attribute table.
* @return Return a \class QgsConditionalLayerStyles object holding the conditional attribute
* @return Return a QgsConditionalLayerStyles object holding the conditional attribute
* style information. Style information is generic and can be used for anything.
* @note added in QGIS 2.12
*/
Expand Down
15 changes: 6 additions & 9 deletions src/analysis/raster/qgsrastercalculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ int QgsRasterCalculator::processCalculation( QProgressDialog* p )
// if crs transform needed
if ( it->raster->crs() != mOutputCrs )
{
QgsRasterProjector* proj = new QgsRasterProjector();
proj->setCRS( it->raster->crs(), mOutputCrs );
proj->setInput( it->raster->dataProvider()->clone() );
proj->setPrecision( QgsRasterProjector::Exact );
QgsRasterProjector proj;
proj.setCRS( it->raster->crs(), mOutputCrs );
proj.setInput( it->raster->dataProvider() );
proj.setPrecision( QgsRasterProjector::Exact );

block = proj->block( it->bandNumber, mOutputRectangle, mNumOutputColumns, mNumOutputRows );
block = proj.block( it->bandNumber, mOutputRectangle, mNumOutputColumns, mNumOutputRows );
}
else
{
Expand Down Expand Up @@ -155,10 +155,7 @@ int QgsRasterCalculator::processCalculation( QProgressDialog* p )
qWarning( "RasterIO error!" );
}

if ( resultIsNumber )
{
delete[] calcData;
}
delete[] calcData;
}

}
Expand Down
28 changes: 12 additions & 16 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,16 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
int myBlue = settings.value( "/qgis/default_canvas_color_blue", 255 ).toInt();
mMapCanvas->setCanvasColor( QColor( myRed, myGreen, myBlue ) );

centralLayout->addWidget( mMapCanvas, 0, 0, 2, 1 );
mWelcomePage = new QgsWelcomePage;

mCentralContainer = new QStackedWidget;
mCentralContainer->insertWidget( 0, mMapCanvas );
mCentralContainer->insertWidget( 1, mWelcomePage );

qobject_cast<QGridLayout *>( centralWidget->layout() )->addWidget( mCentralContainer, 0, 0, 2, 1 );

mCentralContainer->setCurrentIndex( 1 );


// a bar to warn the user with non-blocking messages
mInfoBar = new QgsMessageBar( centralWidget );
Expand Down Expand Up @@ -1143,14 +1152,12 @@ void QgisApp::readSettings()
data.path = project;
data.title = project;

mRecentProjects.prepend( data );
mRecentProjects.append( data );
}

settings.beginGroup( "/UI/recentProjects" );
QStringList projectKeys = settings.childGroups();



Q_FOREACH ( const QString& key, projectKeys )
{
QgsWelcomePageItemsModel::RecentProjectData data;
Expand All @@ -1159,7 +1166,7 @@ void QgisApp::readSettings()
data.path = settings.value( "path" ).toString();
data.previewImagePath = settings.value( "previewImage" ).toString();
settings.endGroup();
mRecentProjects.prepend( data );
mRecentProjects.append( data );
}
settings.endGroup();

Expand Down Expand Up @@ -3913,19 +3920,8 @@ void QgisApp::fileOpenAfterLaunch()
QString projPath = QString();
if ( projOpen == 0 ) // welcome page
{
mWelcomePage = new QgsWelcomePage;

mCentralContainer = new QStackedWidget;
mCentralContainer->insertWidget( 0, mMapCanvas );
mCentralContainer->insertWidget( 1, mWelcomePage );

connect( mMapCanvas, SIGNAL( layersChanged() ), this, SLOT( showMapCanvas() ) );
connect( this, SIGNAL( newProject() ), this, SLOT( showMapCanvas() ) );

qobject_cast<QGridLayout *>( centralWidget()->layout() )->addWidget( mCentralContainer, 0, 0, 2, 1 );

mCentralContainer->setCurrentIndex( 1 );

return;
}
if ( projOpen == 1 && mRecentProjects.size() > 0 ) // most recent project
Expand Down
7 changes: 6 additions & 1 deletion src/app/qgsabout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,15 @@ void QgsAbout::init()
QTcpSocket socket;
socket.connectToHost( "qgis.org", 80 );
if ( socket.waitForConnected( 1000 ) )
{
setDevelopersMap();
}
else
{
mOptionsListWidget->item( DEVELOPERS_MAP_INDEX )->setHidden( true );

QModelIndex firstItem = mOptionsListWidget->model()->index( 0, 0, QModelIndex() );
mOptionsListWidget->setCurrentIndex( firstItem );
}
developersMapView->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
developersMapView->setContextMenuPolicy( Qt::NoContextMenu );

Expand Down
12 changes: 6 additions & 6 deletions src/app/qgswelcomepage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <QDesktopServices>

QgsWelcomePage::QgsWelcomePage( QWidget* parent )
: QWidget( parent )
: QTabWidget( parent )
{
QVBoxLayout* mainLayout = new QVBoxLayout;
mainLayout->setMargin( 0 );
Expand Down Expand Up @@ -62,7 +62,7 @@ QgsWelcomePage::QgsWelcomePage( QWidget* parent )

recentProjctsContainer->layout()->addWidget( recentProjectsListView );

layout->addWidget( recentProjctsContainer );
addTab( recentProjctsContainer, "Recent Projects" );

QWidget* whatsNewContainer = new QWidget;
whatsNewContainer->setLayout( new QVBoxLayout );
Expand All @@ -73,14 +73,14 @@ QgsWelcomePage::QgsWelcomePage( QWidget* parent )
whatsNewPage->setUrl( QUrl::fromLocalFile( QgsApplication::whatsNewFilePath() ) );
whatsNewPage->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
whatsNewPage->setContextMenuPolicy( Qt::NoContextMenu );
whatsNewPage->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding );
whatsNewPage->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
whatsNewPage->setStyleSheet( "background:transparent" );
whatsNewPage->setAttribute( Qt::WA_TranslucentBackground );

whatsNewContainer->layout()->addWidget( whatsNewPage );
whatsNewContainer->setMaximumWidth( 250 );
whatsNewContainer->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred );
layout->addWidget( whatsNewContainer );
// whatsNewContainer->setMaximumWidth( 250 );
// whatsNewContainer->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred );
addTab( whatsNewContainer, "News" );

connect( whatsNewPage, SIGNAL( linkClicked( QUrl ) ), this, SLOT( whatsNewLinkClicked( QUrl ) ) );

Expand Down
3 changes: 2 additions & 1 deletion src/app/qgswelcomepage.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
#ifndef QGSWELCOMEDIALOG_H
#define QGSWELCOMEDIALOG_H

#include <QTabWidget>
#include <QWidget>
#include <QLabel>

#include "qgswelcomepageitemsmodel.h"

class QgsWelcomePage : public QWidget
class QgsWelcomePage : public QTabWidget
{
Q_OBJECT

Expand Down
3 changes: 2 additions & 1 deletion src/core/pal/feature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ namespace pal
{
mHoles.at( i )->holeOf = this;
}

}


Expand All @@ -119,7 +120,6 @@ namespace pal

qDeleteAll( mHoles );
mHoles.clear();

}

void FeaturePart::extractCoords( const GEOSGeometry* geom )
Expand Down Expand Up @@ -166,6 +166,7 @@ namespace pal
xmax = ymax = -DBL_MAX;

// initialize coordinate arrays
deleteCoords();
x = new double[nbPoints];
y = new double[nbPoints];

Expand Down
2 changes: 0 additions & 2 deletions src/core/pal/labelposition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ namespace pal
probFeat = other.probFeat;
nbOverlap = other.nbOverlap;

memcpy( x, other.x, sizeof( double )*4 );
memcpy( y, other.y, sizeof( double )*4 );
alpha = other.alpha;
w = other.w;
h = other.h;
Expand Down
5 changes: 5 additions & 0 deletions src/core/pal/layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ namespace pal
delete biggest_part; // safe with NULL part
biggest_part = fpart;
}
else
{
delete fpart;
}
continue; // don't add the feature part now, do it later
// TODO: we should probably add also other parts to act just as obstacles
}
Expand Down Expand Up @@ -463,6 +467,7 @@ namespace pal
newFeatureParts->append( newfpart );
newfpart->getBoundingBox( bmin, bmax );
rtree->Insert( bmin, bmax, newfpart );
delete fpart;
}
else
{
Expand Down
1 change: 1 addition & 0 deletions src/core/pal/layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ namespace pal

/** Add newly created feature part into r tree and to the list */
void addFeaturePart( FeaturePart* fpart, const QString &labelText = QString() );

};

} // end namespace pal
Expand Down
2 changes: 2 additions & 0 deletions src/core/pal/pal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ namespace pal

if ( isCancelled() )
{
qDeleteAll( *fFeats );
delete fFeats;
delete prob;
delete obstacles;
Expand Down Expand Up @@ -464,6 +465,7 @@ namespace pal
{
if ( isCancelled() )
{
qDeleteAll( *fFeats );
delete fFeats;
delete prob;
delete obstacles;
Expand Down
8 changes: 2 additions & 6 deletions src/core/pal/pointset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,8 @@ namespace pal
nbPoints = ps.nbPoints;
x = new double[nbPoints];
y = new double[nbPoints];

for ( i = 0; i < nbPoints; i++ )
{
x[i] = ps.x[i];
y[i] = ps.y[i];
}
memcpy( x, ps.x, sizeof( double )* nbPoints );
memcpy( y, ps.y, sizeof( double )* nbPoints );

if ( ps.cHull )
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsconditionalstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ QgsConditionalStyle::QgsConditionalStyle( QString rule )

QgsConditionalStyle::QgsConditionalStyle( const QgsConditionalStyle &other )
: mValid( other.mValid )
, mName( other.mName )
, mRule( other.mRule )
, mFont( other.mFont )
, mBackColor( other.mBackColor )
, mTextColor( other.mTextColor )
, mIcon( other.mIcon )
, mName( other.mName )
{
if ( other.mSymbol.data() )
mSymbol.reset( other.mSymbol->clone() );
Expand Down
5 changes: 3 additions & 2 deletions src/core/qgsconditionalstyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class CORE_EXPORT QgsConditionalLayerStyles

/**
* @brief Set the conditional styles for the field UI properties.
* @param fieldName name of field
* @param styles
*/
void setFieldStyles( QString fieldName, QList<QgsConditionalStyle> styles );
Expand All @@ -48,11 +49,11 @@ class CORE_EXPORT QgsConditionalLayerStyles

/** Reads field ui properties specific state from Dom node.
*/
virtual bool readXml( const QDomNode& node );
bool readXml( const QDomNode& node );

/** Write field ui properties specific state from Dom node.
*/
virtual bool writeXml( QDomNode & node, QDomDocument & doc ) const;
bool writeXml( QDomNode & node, QDomDocument & doc ) const;

private:
QHash<QString, QgsConditionalStyles> mFieldStyles;
Expand Down
12 changes: 5 additions & 7 deletions src/core/qgslabelsearchtree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,15 @@ bool QgsLabelSearchTree::insertLabel( LabelPosition* labelPos, int featureId, co
QgsLabelPosition* newEntry = new QgsLabelPosition( featureId, labelPos->getAlpha(), cornerPoints, QgsRectangle( c_min[0], c_min[1], c_max[0], c_max[1] ),
labelPos->getWidth(), labelPos->getHeight(), layerName, labeltext, labelfont, labelPos->getUpsideDown(), diagram, pinned );
mSpatialIndex.Insert( c_min, c_max, newEntry );
mOwnedPositions << newEntry;
return true;
}

void QgsLabelSearchTree::clear()
{
RTree<QgsLabelPosition*, double, 2, double>::Iterator indexIt;
mSpatialIndex.GetFirst( indexIt );
while ( !mSpatialIndex.IsNull( indexIt ) )
{
delete mSpatialIndex.GetAt( indexIt );
mSpatialIndex.GetNext( indexIt );
}
mSpatialIndex.RemoveAll();

//PAL rtree iterator is buggy and doesn't iterate over all items, so we can't iterate through the tree to delete positions
qDeleteAll( mOwnedPositions );
mOwnedPositions.clear();
}
1 change: 1 addition & 0 deletions src/core/qgslabelsearchtree.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class CORE_EXPORT QgsLabelSearchTree
private:
// set as mutable because RTree template is not const-correct
mutable RTree<QgsLabelPosition*, double, 2, double> mSpatialIndex;
QList< QgsLabelPosition* > mOwnedPositions;
};

#endif // QGSLABELTREE_H
1 change: 1 addition & 0 deletions src/core/qgspallabeling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4227,6 +4227,7 @@ void QgsPalLabeling::drawLabeling( QgsRenderContext& context )
if ( context.renderingStopped() )
{
delete problem;
deleteTemporaryData();
return; // it has been cancelled
}

Expand Down
8 changes: 7 additions & 1 deletion src/core/qgspointlocator.cpp
Original file line number Diff line number Diff line change