Skip to content
Permalink
Browse files

Merge remote-tracking branch 'qgis/master' into grass

  • Loading branch information
Andrew McAninch
Andrew McAninch committed Aug 26, 2015
2 parents 05b8a98 + 0fb356e commit 6809835426ee7a4a20b102b944442d9f7bd87657
Showing with 16,561 additions and 14,350 deletions.
  1. +1 −1 doc/CMakeLists.txt
  2. +3 −2 python/core/qgsconditionalstyle.sip
  3. +1 −1 python/core/qgsvectorlayer.sip
  4. +6 −9 src/analysis/raster/qgsrastercalculator.cpp
  5. +12 −16 src/app/qgisapp.cpp
  6. +6 −1 src/app/qgsabout.cpp
  7. +6 −6 src/app/qgswelcomepage.cpp
  8. +2 −1 src/app/qgswelcomepage.h
  9. +2 −1 src/core/pal/feature.cpp
  10. +0 −2 src/core/pal/labelposition.cpp
  11. +5 −0 src/core/pal/layer.cpp
  12. +1 −0 src/core/pal/layer.h
  13. +2 −0 src/core/pal/pal.cpp
  14. +2 −6 src/core/pal/pointset.cpp
  15. +1 −1 src/core/qgsconditionalstyle.cpp
  16. +3 −2 src/core/qgsconditionalstyle.h
  17. +5 −7 src/core/qgslabelsearchtree.cpp
  18. +1 −0 src/core/qgslabelsearchtree.h
  19. +1 −0 src/core/qgspallabeling.cpp
  20. +7 −1 src/core/qgspointlocator.cpp
  21. +1 −1 src/core/qgsvectorlayer.h
  22. +5 −0 src/core/raster/qgscontrastenhancement.cpp
  23. +7 −4 src/core/raster/qgsrasterlayer.cpp
  24. +1 −0 src/core/raster/qgsrasterrenderer.cpp
  25. +1 −1 src/gui/attributetable/qgsattributetablemodel.h
  26. +1 −0 src/gui/qgsdatadefinedbutton.cpp
  27. +3 −0 src/gui/qgsexpressionbuilderwidget.cpp
  28. +1 −0 src/gui/symbology-ng/qgsrendererv2propertiesdialog.cpp
  29. +35 −5 src/plugins/grass/CMakeLists.txt
  30. +1 −0 src/plugins/grass/qgsgrassmodule.cpp
  31. +4 −3 src/plugins/grass/qgsgrassmoduleoptions.cpp
  32. +16 −2 src/plugins/grass/qgsgrassshell.cpp
  33. +7 −5 src/plugins/grass/qgsgrasstools.cpp
  34. +260 −242 src/plugins/grass/qtermwidget/BlockArray.cpp
  35. +88 −85 src/plugins/grass/qtermwidget/BlockArray.h
  36. +166 −152 src/plugins/grass/qtermwidget/Character.h
  37. +205 −208 src/plugins/grass/qtermwidget/CharacterColor.h
  38. +788 −0 src/plugins/grass/qtermwidget/ColorScheme.cpp
  39. +359 −0 src/plugins/grass/qtermwidget/ColorScheme.h
  40. +41 −69 src/plugins/grass/qtermwidget/ColorTables.h
  41. +0 −16 src/plugins/grass/qtermwidget/DefaultTranslatorText.h
  42. +206 −293 src/plugins/grass/qtermwidget/Emulation.cpp
  43. +411 −405 src/plugins/grass/qtermwidget/Emulation.h
  44. +0 −88 src/plugins/grass/qtermwidget/ExtendedDefaultTranslator.h
  45. +298 −304 src/plugins/grass/qtermwidget/Filter.cpp
  46. +339 −326 src/plugins/grass/qtermwidget/Filter.h
  47. +502 −216 src/plugins/grass/qtermwidget/History.cpp
  48. +377 −228 src/plugins/grass/qtermwidget/History.h
  49. +157 −0 src/plugins/grass/qtermwidget/HistorySearch.cpp
  50. +70 −0 src/plugins/grass/qtermwidget/HistorySearch.h
  51. +639 −646 src/plugins/grass/qtermwidget/KeyboardTranslator.cpp
  52. +483 −548 src/plugins/grass/qtermwidget/KeyboardTranslator.h
  53. +17 −18 src/plugins/grass/qtermwidget/LineFont.h
  54. +185 −168 src/plugins/grass/qtermwidget/Pty.cpp
  55. +185 −215 src/plugins/grass/qtermwidget/Pty.h
  56. +850 −1,068 src/plugins/grass/qtermwidget/Screen.cpp
  57. +626 −613 src/plugins/grass/qtermwidget/Screen.h
  58. +128 −131 src/plugins/grass/qtermwidget/ScreenWindow.cpp
  59. +225 −222 src/plugins/grass/qtermwidget/ScreenWindow.h
  60. +118 −0 src/plugins/grass/qtermwidget/SearchBar.cpp
  61. +60 −0 src/plugins/grass/qtermwidget/SearchBar.h
  62. +85 −0 src/plugins/grass/qtermwidget/SearchBar.ui
  63. +632 −580 src/plugins/grass/qtermwidget/Session.cpp
  64. +546 −528 src/plugins/grass/qtermwidget/Session.h
  65. +88 −93 src/plugins/grass/qtermwidget/ShellCommand.cpp
  66. +62 −64 src/plugins/grass/qtermwidget/ShellCommand.h
  67. +153 −129 src/plugins/grass/qtermwidget/TerminalCharacterDecoder.cpp
  68. +116 −105 src/plugins/grass/qtermwidget/TerminalCharacterDecoder.h
  69. +1,836 −1,474 src/plugins/grass/qtermwidget/TerminalDisplay.cpp
  70. +753 −645 src/plugins/grass/qtermwidget/TerminalDisplay.h
  71. +791 −827 src/plugins/grass/qtermwidget/Vt102Emulation.cpp
  72. +141 −142 src/plugins/grass/qtermwidget/Vt102Emulation.h
  73. +42 −0 src/plugins/grass/qtermwidget/color-schemes/BlackOnWhite.schema
  74. +0 −128 src/plugins/grass/qtermwidget/default.keytab
  75. +0 −1,123 src/plugins/grass/qtermwidget/k3process.cpp
  76. +0 −893 src/plugins/grass/qtermwidget/k3process.h
  77. +0 −343 src/plugins/grass/qtermwidget/k3processcontroller.cpp
  78. +0 −137 src/plugins/grass/qtermwidget/k3processcontroller.h
  79. +94 −58 src/plugins/grass/qtermwidget/kb-layouts/default.keytab
  80. +7 −2 src/plugins/grass/qtermwidget/kb-layouts/linux.keytab
  81. +7 −2 src/plugins/grass/qtermwidget/kb-layouts/vt420pc.keytab
  82. +158 −153 src/plugins/grass/qtermwidget/konsole_wcwidth.cpp
  83. +8 −7 src/plugins/grass/qtermwidget/konsole_wcwidth.h
  84. +412 −0 src/plugins/grass/qtermwidget/kprocess.cpp
  85. +372 −0 src/plugins/grass/qtermwidget/kprocess.h
  86. +357 −312 src/plugins/grass/qtermwidget/kpty.cpp
  87. +15 −15 src/plugins/grass/qtermwidget/kpty.h
  88. +15 −10 src/plugins/grass/qtermwidget/kpty_p.h
  89. +422 −0 src/plugins/grass/qtermwidget/kptydevice.cpp
  90. +361 −0 src/plugins/grass/qtermwidget/kptydevice.h
  91. +129 −0 src/plugins/grass/qtermwidget/kptyprocess.cpp
  92. +178 −0 src/plugins/grass/qtermwidget/kptyprocess.h
  93. +499 −146 src/plugins/grass/qtermwidget/qtermwidget.cpp
  94. +175 −59 src/plugins/grass/qtermwidget/qtermwidget.h
  95. +85 −0 src/plugins/grass/qtermwidget/tools.cpp
  96. +10 −0 src/plugins/grass/qtermwidget/tools.h
  97. +27 −11 src/providers/grass/qgsgrass.cpp
  98. +3 −0 src/providers/grass/qgsgrass.h
  99. +11 −14 src/ui/qgsexpressionbuilder.ui
  100. +4 −1 tests/src/analysis/testqgsrastercalculator.cpp
  101. +4 −0 tests/src/analysis/testqgszonalstatistics.cpp
  102. +0 −1 tests/src/core/testqgsexpressioncontext.cpp
  103. +0 −2 tests/src/core/testqgsmaprotation.cpp
  104. +16 −1 tests/src/core/testqgsogcutils.cpp
  105. +10 −6 tests/src/core/testqgsrasterlayer.cpp
  106. +1 −0 tests/src/core/testqgsrastersublayer.cpp
  107. +1 −0 tests/src/core/testqgsstylev2.cpp
  108. +2 −0 tests/src/providers/testqgsgdalprovider.cpp
@@ -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)
@@ -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 );
@@ -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
@@ -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
*/
@@ -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
{
@@ -155,10 +155,7 @@ int QgsRasterCalculator::processCalculation( QProgressDialog* p )
qWarning( "RasterIO error!" );
}

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

}
@@ -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 );
@@ -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;
@@ -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();

@@ -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
@@ -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 );

@@ -26,7 +26,7 @@
#include <QDesktopServices>

QgsWelcomePage::QgsWelcomePage( QWidget* parent )
: QWidget( parent )
: QTabWidget( parent )
{
QVBoxLayout* mainLayout = new QVBoxLayout;
mainLayout->setMargin( 0 );
@@ -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 );
@@ -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 ) ) );

@@ -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

@@ -110,6 +110,7 @@ namespace pal
{
mHoles.at( i )->holeOf = this;
}

}


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

qDeleteAll( mHoles );
mHoles.clear();

}

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

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

@@ -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;
@@ -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
}
@@ -463,6 +467,7 @@ namespace pal
newFeatureParts->append( newfpart );
newfpart->getBoundingBox( bmin, bmax );
rtree->Insert( bmin, bmax, newfpart );
delete fpart;
}
else
{
@@ -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
@@ -386,6 +386,7 @@ namespace pal

if ( isCancelled() )
{
qDeleteAll( *fFeats );
delete fFeats;
delete prob;
delete obstacles;
@@ -464,6 +465,7 @@ namespace pal
{
if ( isCancelled() )
{
qDeleteAll( *fFeats );
delete fFeats;
delete prob;
delete obstacles;
@@ -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 )
{
@@ -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() );
@@ -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 );
@@ -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;
@@ -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();
}
@@ -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
@@ -4227,6 +4227,7 @@ void QgsPalLabeling::drawLabeling( QgsRenderContext& context )
if ( context.renderingStopped() )
{
delete problem;
deleteTemporaryData();
return; // it has been cancelled
}

@@ -670,6 +670,9 @@ bool QgsPointLocator::rebuildIndex( int maxFeaturesToIndex )

SpatialIndex::Region r( rect2region( f.constGeometry()->boundingBox() ) );
dataList << new RTree::Data( 0, 0, r, f.id() );

if ( mGeoms.contains( f.id() ) )
delete mGeoms.take( f.id() );
mGeoms[f.id()] = new QgsGeometry( *f.constGeometry() );
++indexedCount;

@@ -748,6 +751,9 @@ void QgsPointLocator::onFeatureAdded( QgsFeatureId fid )
{
SpatialIndex::Region r( rect2region( bbox ) );
mRTree->insertData( 0, 0, r, f.id() );

if ( mGeoms.contains( f.id() ) )
delete mGeoms.take( f.id() );
mGeoms[fid] = new QgsGeometry( *f.constGeometry() );
}
}
@@ -761,7 +767,7 @@ void QgsPointLocator::onFeatureDeleted( QgsFeatureId fid )
if ( mGeoms.contains( fid ) )
{
mRTree->deleteData( rect2region( mGeoms[fid]->boundingBox() ), fid );
mGeoms.remove( fid );
delete mGeoms.take( fid );
}
}

0 comments on commit 6809835

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