Skip to content

Commit 4200046

Browse files
committedSep 9, 2013
Merge remote-tracking branch 'upstream/master'
2 parents 3216390 + c705034 commit 4200046

37 files changed

+644
-493
lines changed
 

‎images/images.qrc

Lines changed: 451 additions & 440 deletions
Large diffs are not rendered by default.

‎images/splash/splash.png

-3.21 KB
Loading

‎images/splash/splash.xcf.bz2

3.98 KB
Binary file not shown.

‎images/sponsors/aas_300wide.png

6.42 KB
Loading

‎images/sponsors/bronze.png

5.16 KB
Loading

‎images/sponsors/buttons.xcf

45.6 KB
Binary file not shown.

‎images/sponsors/gaia.png

8.23 KB
Loading

‎images/sponsors/geosynergy.png

13.8 KB
Loading

‎images/sponsors/gold.png

6.07 KB
Loading

‎images/sponsors/ibw.png

10.2 KB
Loading

‎images/sponsors/platinum.png

5.36 KB
Loading

‎images/sponsors/silver.png

4.22 KB
Loading

‎images/sponsors/vorarlberg.png

7.13 KB
Loading

‎python/console/console_editor.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ def setLexers(self):
240240
chekBoxAPI = self.settings.value("pythonConsole/preloadAPI", True, type=bool)
241241
chekBoxPreparedAPI = self.settings.value("pythonConsole/usePreparedAPIFile", False, type=bool)
242242
if chekBoxAPI:
243-
self.api.loadPrepared(QgsApplication.pkgDataPath() + "/python/qsci_apis/pyqgis_master.pap")
243+
pap = os.path.join(QgsApplication.pkgDataPath(), "python", "qsci_apis", "pyqgis.pap")
244+
self.api.loadPrepared(pap)
244245
elif chekBoxPreparedAPI:
245246
self.api.loadPrepared(self.settings.value("pythonConsole/preparedAPIFile"))
246247
else:
@@ -655,23 +656,26 @@ def keyPressEvent(self, e):
655656
t = unicode(e.text())
656657
## Close bracket automatically
657658
if t in self.opening:
659+
self.beginUndoAction()
658660
i = self.opening.index(t)
659661
if self.hasSelectedText():
660-
self.beginUndoAction()
661662
selText = self.selectedText()
662663
self.removeSelectedText()
663664
if startLine == endLine:
664665
self.insert(self.opening[i] + selText + self.closing[i])
665666
self.setCursorPosition(endLine, endPos+2)
667+
self.endUndoAction()
666668
return
667669
elif startLine < endLine and self.opening[i] in ("'", '"'):
668670
self.insert("'''" + selText + "'''")
671+
self.setCursorPosition(endLine, endPos+3)
672+
self.endUndoAction()
669673
return
670674
else:
671675
self.insert(self.closing[i])
672-
self.endUndoAction()
673676
else:
674677
self.insert(self.closing[i])
678+
self.endUndoAction()
675679
## FIXES #8392 (automatically removes the redundant char
676680
## when autoclosing brackets option is enabled)
677681
if t in [')', ']', '}']:

‎python/plugins/processing/saga/SagaAlgorithmProvider.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,19 @@ def unload(self):
6767
ProcessingConfig.removeSetting(SagaUtils.SAGA_RESAMPLING_REGION_CELLSIZE)
6868
ProcessingConfig.removeSetting(SagaUtils.SAGA_LOG_CONSOLE)
6969
ProcessingConfig.removeSetting(SagaUtils.SAGA_LOG_COMMANDS)
70-
7170

72-
def _loadAlgorithms(self):
71+
72+
def _loadAlgorithms(self):
7373
self.algs = []
74-
saga208 = ProcessingConfig.getSetting(SagaUtils.SAGA_208)
74+
saga208 = ProcessingConfig.getSetting(SagaUtils.SAGA_208)
7575
folder = SagaUtils.sagaDescriptionPath()
7676
for descriptionFile in os.listdir(folder):
77-
if descriptionFile.endswith("txt"):
77+
if descriptionFile.endswith("txt"):
7878
if not saga208:
7979
if descriptionFile.startswith("2.0.8"):
8080
continue
8181
else:
82-
if descriptionFile.startswith("2.1"):
82+
if descriptionFile.startswith("2.1"):
8383
continue
8484
try:
8585
alg = SagaAlgorithm(os.path.join(folder, descriptionFile))

‎src/analysis/openstreetmap/qgsosmdatabase.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ void QgsOSMDatabase::exportSpatiaLiteNodes( const QString& tableName, const QStr
421421
sqlite3_bind_null( stmtInsert, ++col );
422422
}
423423

424-
sqlite3_bind_blob( stmtInsert, ++col, geom->asWkb(), (int) geom->wkbSize(), SQLITE_STATIC );
424+
sqlite3_bind_blob( stmtInsert, ++col, geom->asWkb(), ( int ) geom->wkbSize(), SQLITE_STATIC );
425425

426426
int insertRes = sqlite3_step( stmtInsert );
427427
if ( insertRes != SQLITE_DONE )
@@ -489,7 +489,7 @@ void QgsOSMDatabase::exportSpatiaLiteWays( bool closed, const QString& tableName
489489
sqlite3_bind_null( stmtInsert, ++col );
490490
}
491491

492-
sqlite3_bind_blob( stmtInsert, ++col, geom->asWkb(), (int) geom->wkbSize(), SQLITE_STATIC );
492+
sqlite3_bind_blob( stmtInsert, ++col, geom->asWkb(), ( int ) geom->wkbSize(), SQLITE_STATIC );
493493

494494
int insertRes = sqlite3_step( stmtInsert );
495495
if ( insertRes != SQLITE_DONE )

‎src/app/composer/qgscomposer.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
245245
layoutMenu->addAction( mActionLowerItems );
246246
layoutMenu->addAction( mActionMoveItemsToTop );
247247
layoutMenu->addAction( mActionMoveItemsToBottom );
248+
layoutMenu->addAction( mActionLockItems );
249+
layoutMenu->addAction( mActionUnlockAll );
248250

249251
#ifdef Q_WS_MAC
250252
// this doesn't work on Mac anymore: menuBar()->addMenu( mQgis->windowMenu() );
@@ -1645,6 +1647,22 @@ void QgsComposer::on_mActionUngroupItems_triggered()
16451647
}
16461648
}
16471649

1650+
void QgsComposer::on_mActionLockItems_triggered()
1651+
{
1652+
if ( mView )
1653+
{
1654+
mView->lockItems();
1655+
}
1656+
}
1657+
1658+
void QgsComposer::on_mActionUnlockAll_triggered()
1659+
{
1660+
if ( mView )
1661+
{
1662+
mView->unlockAllItems();
1663+
}
1664+
}
1665+
16481666
void QgsComposer::on_mActionRaiseItems_triggered()
16491667
{
16501668
if ( mComposition )

‎src/app/composer/qgscomposer.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,12 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
210210
//! Ungroup selected item group
211211
void on_mActionUngroupItems_triggered();
212212

213+
//! Lock selected items
214+
void on_mActionLockItems_triggered();
215+
216+
//! Unlock all items
217+
void on_mActionUnlockAll_triggered();
218+
213219
//! Move selected items one position up
214220
void on_mActionRaiseItems_triggered();
215221

‎src/app/main.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,15 @@ void qgisCrash( int signal )
253253
{
254254
// take full stacktrace using gdb
255255
// http://stackoverflow.com/questions/3151779/how-its-better-to-invoke-gdb-from-program-to-print-its-stacktrace
256+
// unfortunately, this is not so simple. the proper method is way more OS-specific
257+
// than this code would suggest, see http://stackoverflow.com/a/1024937
256258

257259
char exename[512];
260+
#if defined(__FreeBSD__)
261+
int len = readlink( "/proc/curproc/file", exename, sizeof( exename ) - 1 );
262+
#else
258263
int len = readlink( "/proc/self/exe", exename, sizeof( exename ) - 1 );
264+
#endif
259265
if ( len < 0 )
260266
{
261267
myPrint( "Could not read link (%d:%s)\n", errno, strerror( errno ) );
@@ -363,7 +369,9 @@ int main( int argc, char *argv[] )
363369
#endif // WIN32
364370

365371
// Set up the custom qWarning/qDebug custom handler
372+
#ifndef ANDROID
366373
qInstallMsgHandler( myMessageOutput );
374+
#endif
367375

368376
#if (defined(linux) && !defined(ANDROID)) || defined(__FreeBSD__)
369377
signal( SIGQUIT, qgisCrash );

‎src/core/composer/qgscomposeritem.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,11 @@ bool QgsComposerItem::_readXML( const QDomElement& itemElem, const QDomDocument&
265265
QString positionLock = itemElem.attribute( "positionLock" );
266266
if ( positionLock.compare( "true", Qt::CaseInsensitive ) == 0 )
267267
{
268-
mItemPositionLocked = true;
268+
setPositionLock( true );
269269
}
270270
else
271271
{
272-
mItemPositionLocked = false;
272+
setPositionLock( false );
273273
}
274274

275275
//position
@@ -802,6 +802,11 @@ void QgsComposerItem::drawFrame( QPainter* p )
802802
}
803803
}
804804

805+
void QgsComposerItem::setPositionLock( bool lock )
806+
{
807+
mItemPositionLocked = lock;
808+
}
809+
805810
void QgsComposerItem::move( double dx, double dy )
806811
{
807812
QTransform t = transform();

‎src/core/composer/qgscomposeritem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ class CORE_EXPORT QgsComposerItem: public QObject, public QGraphicsRectItem
281281

282282
/**Locks / unlocks the item position for mouse drags
283283
@note this method was added in version 1.2*/
284-
void setPositionLock( bool lock ) {mItemPositionLocked = lock;}
284+
void setPositionLock( bool lock );
285285

286286
/**Returns position lock for mouse drags (true means locked)
287287
@note this method was added in version 1.2*/

‎src/core/composer/qgscomposermap.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141

4242
QgsComposerMap::QgsComposerMap( QgsComposition *composition, int x, int y, int width, int height )
4343
: QgsComposerItem( x, y, width, height, composition ), mKeepLayerSet( false ),
44-
mOverviewFrameMapId( -1 ), mOverviewBlendMode( QPainter::CompositionMode_SourceOver ), mOverviewInverted( false ), mOverviewCentered( false ),
45-
mGridEnabled( false ), mGridStyle( Solid ),
44+
mOverviewFrameMapId( -1 ), mOverviewBlendMode( QPainter::CompositionMode_SourceOver ), mOverviewInverted( false ), mOverviewCentered( false ),
45+
mGridEnabled( false ), mGridStyle( Solid ),
4646
mGridIntervalX( 0.0 ), mGridIntervalY( 0.0 ), mGridOffsetX( 0.0 ), mGridOffsetY( 0.0 ), mGridAnnotationFontColor( QColor( 0, 0, 0 ) ),
4747
mGridAnnotationPrecision( 3 ), mShowGridAnnotation( false ), mGridBlendMode( QPainter::CompositionMode_SourceOver ),
4848
mLeftGridAnnotationPosition( OutsideMapFrame ), mRightGridAnnotationPosition( OutsideMapFrame ),
@@ -87,8 +87,8 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition, int x, int y, int w
8787

8888
QgsComposerMap::QgsComposerMap( QgsComposition *composition )
8989
: QgsComposerItem( 0, 0, 10, 10, composition ), mKeepLayerSet( false ), mOverviewFrameMapId( -1 ),
90-
mOverviewBlendMode( QPainter::CompositionMode_SourceOver ), mOverviewInverted( false ), mOverviewCentered( false ),
91-
mGridEnabled( false ), mGridStyle( Solid ),
90+
mOverviewBlendMode( QPainter::CompositionMode_SourceOver ), mOverviewInverted( false ), mOverviewCentered( false ),
91+
mGridEnabled( false ), mGridStyle( Solid ),
9292
mGridIntervalX( 0.0 ), mGridIntervalY( 0.0 ), mGridOffsetX( 0.0 ), mGridOffsetY( 0.0 ), mGridAnnotationFontColor( QColor( 0, 0, 0 ) ),
9393
mGridAnnotationPrecision( 3 ), mShowGridAnnotation( false ), mGridBlendMode( QPainter::CompositionMode_SourceOver ),
9494
mLeftGridAnnotationPosition( OutsideMapFrame ), mRightGridAnnotationPosition( OutsideMapFrame ),
@@ -121,19 +121,21 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition )
121121
void QgsComposerMap::extentCenteredOnOverview( QgsRectangle& extent ) const
122122
{
123123
extent = mExtent;
124-
if ( ! mOverviewCentered ) {
124+
if ( ! mOverviewCentered )
125+
{
125126
return;
126127
}
127128

128-
if ( mOverviewFrameMapId != -1 ) {
129+
if ( mOverviewFrameMapId != -1 )
130+
{
129131
const QgsComposerMap* overviewFrameMap = mComposition->getComposerMapById( mOverviewFrameMapId );
130132
QgsRectangle otherExtent = overviewFrameMap->extent();
131133

132134
QgsPoint center = otherExtent.center();
133135
QgsRectangle movedExtent( center.x() - mExtent.width() / 2,
134-
center.y() - mExtent.height() / 2,
135-
center.x() - mExtent.width() / 2 + mExtent.width(),
136-
center.y() - mExtent.height() / 2 + mExtent.height() );
136+
center.y() - mExtent.height() / 2,
137+
center.x() - mExtent.width() / 2 + mExtent.width(),
138+
center.y() - mExtent.height() / 2 + mExtent.height() );
137139
extent = movedExtent;
138140
}
139141
}

‎src/core/qgsvectorfilewriter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ OGRFeatureH QgsVectorFileWriter::createFeature( QgsFeature& feature )
669669
return 0;
670670
}
671671

672-
OGRErr err = OGR_G_ImportFromWkb( mGeom2, const_cast<unsigned char *>( geom->asWkb() ), (int) geom->wkbSize() );
672+
OGRErr err = OGR_G_ImportFromWkb( mGeom2, const_cast<unsigned char *>( geom->asWkb() ), ( int ) geom->wkbSize() );
673673
if ( err != OGRERR_NONE )
674674
{
675675
mErrorMessage = QObject::tr( "Feature geometry not imported (OGR error: %1)" )
@@ -685,7 +685,7 @@ OGRFeatureH QgsVectorFileWriter::createFeature( QgsFeature& feature )
685685
}
686686
else if ( geom )
687687
{
688-
OGRErr err = OGR_G_ImportFromWkb( mGeom, const_cast<unsigned char *>( geom->asWkb() ), (int) geom->wkbSize() );
688+
OGRErr err = OGR_G_ImportFromWkb( mGeom, const_cast<unsigned char *>( geom->asWkb() ), ( int ) geom->wkbSize() );
689689
if ( err != OGRERR_NONE )
690690
{
691691
mErrorMessage = QObject::tr( "Feature geometry not imported (OGR error: %1)" )

‎src/core/raster/qgsrasterblock.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ bool QgsRasterBlock::isNoData( size_t index )
324324
return false;
325325
}
326326
// TODO: optimize
327-
int row = (int) index / mWidth;
327+
int row = ( int ) index / mWidth;
328328
int column = index % mWidth;
329329
size_t byte = ( size_t )row * mNoDataBitmapWidth + column / 8 ;
330330
int bit = column % 8;
@@ -406,7 +406,7 @@ bool QgsRasterBlock::setIsNoData( size_t index )
406406
}
407407
}
408408
// TODO: optimize
409-
int row = (int) index / mWidth;
409+
int row = ( int ) index / mWidth;
410410
int column = index % mWidth;
411411
size_t byte = ( size_t )row * mNoDataBitmapWidth + column / 8;
412412
int bit = column % 8;

‎src/gui/qgscomposerview.cpp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,43 @@ void QgsComposerView::ungroupItems()
751751
}
752752
}
753753

754+
void QgsComposerView::lockItems()
755+
{
756+
if ( !composition() )
757+
{
758+
return;
759+
}
760+
761+
QList<QgsComposerItem*> selectionList = composition()->selectedComposerItems();
762+
QList<QgsComposerItem*>::iterator itemIter = selectionList.begin();
763+
for ( ; itemIter != selectionList.end(); ++itemIter )
764+
{
765+
( *itemIter )->setPositionLock( true );
766+
}
767+
768+
composition()->clearSelection();
769+
}
770+
771+
void QgsComposerView::unlockAllItems()
772+
{
773+
if ( !composition() )
774+
{
775+
return;
776+
}
777+
778+
//unlock all items in composer
779+
QList<QGraphicsItem *> itemList = composition()->items();
780+
QList<QGraphicsItem *>::iterator itemIt = itemList.begin();
781+
for ( ; itemIt != itemList.end(); ++itemIt )
782+
{
783+
QgsComposerItem* mypItem = dynamic_cast<QgsComposerItem *>( *itemIt );
784+
if ( mypItem )
785+
{
786+
mypItem->setPositionLock( false );
787+
}
788+
}
789+
}
790+
754791
QMainWindow* QgsComposerView::composerWindow()
755792
{
756793
QMainWindow* composerObject = 0;

‎src/gui/qgscomposerview.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ class GUI_EXPORT QgsComposerView: public QGraphicsView
7676
/**Ungroups the selected items*/
7777
void ungroupItems();
7878

79+
/**Lock the selected items*/
80+
void lockItems();
81+
82+
/**Unlock all items*/
83+
void unlockAllItems();
84+
7985
QgsComposerView::Tool currentTool() const {return mCurrentTool;}
8086
void setCurrentTool( QgsComposerView::Tool t ) {mCurrentTool = t;}
8187

‎src/plugins/grass/qtermwidget/BlockArray.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,10 @@ bool BlockArray::setHistorySize( size_t newsize )
211211
else
212212
{
213213
decreaseBuffer( newsize );
214-
( void ) ftruncate( ion, length*blocksize );
214+
if( ftruncate( ion, length*blocksize ) < 0 )
215+
{
216+
perror( "ftruncate" );
217+
}
215218
size = newsize;
216219

217220
return true;

‎src/plugins/grass/qtermwidget/k3process.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ K3Process::setupEnvironment()
151151
}
152152
if ( !d->wd.isEmpty() )
153153
{
154-
( void ) chdir( QFile::encodeName( d->wd ).data() );
154+
if( chdir( QFile::encodeName( d->wd ).data() ) < 0 )
155+
perror( "chdir" );
155156
}
156157
}
157158

@@ -334,13 +335,15 @@ bool K3Process::start( RunMode runmode, Communication comm )
334335

335336
if ( !runPrivileged() )
336337
{
337-
setgid( getgid() );
338+
if( setgid( getgid() ) < 0 )
339+
perror( "setgid" );
338340
#ifdef HAVE_INITGROUPS
339341
if ( pw )
340342
initgroups( pw->pw_name, pw->pw_gid );
341343
#endif
342344
if ( geteuid() != getuid() )
343-
setuid( getuid() );
345+
if( setuid( getuid() ) < 0 )
346+
perror( "setuid" );
344347
if ( geteuid() != getuid() )
345348
_exit( 1 );
346349
}
@@ -356,7 +359,8 @@ bool K3Process::start( RunMode runmode, Communication comm )
356359
execvp( executable, arglist );
357360

358361
char resultByte = 1;
359-
( void ) write( fd[1], &resultByte, 1 );
362+
if( write( fd[1], &resultByte, 1 ) < 0 )
363+
perror( "write" );
360364
_exit( -1 );
361365
}
362366
else if ( pid_ == -1 )

‎src/plugins/grass/qtermwidget/k3processcontroller.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ void K3ProcessController::theSigCHLDHandler( int arg )
209209
int saved_errno = errno;
210210

211211
char dummy = 0;
212-
( void ) ::write( instance()->d->fd[1], &dummy, 1 );
212+
if( ::write( instance()->d->fd[1], &dummy, 1 ) < 0 )
213+
perror( "write failed" );
213214

214215
#ifdef Q_OS_UNIX
215216
if ( Private::oldChildHandlerData.sa_handler != SIG_IGN &&
@@ -243,14 +244,16 @@ K3ProcessController::rescheduleCheck()
243244
{
244245
d->needcheck = false;
245246
char dummy = 0;
246-
( void ) ::write( d->fd[1], &dummy, 1 );
247+
if( ::write( d->fd[1], &dummy, 1 ) < 0 )
248+
perror( "write failed" );
247249
}
248250
}
249251

250252
void K3ProcessController::slotDoHousekeeping()
251253
{
252254
char dummy[16]; // somewhat bigger - just in case several have queued up
253-
( void ) ::read( d->fd[0], dummy, sizeof( dummy ) );
255+
if( ::read( d->fd[0], dummy, sizeof( dummy ) ) < 0 )
256+
perror( "read failed" );
254257

255258
int status;
256259
again:

‎src/plugins/grass/qtermwidget/kpty.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,10 @@ bool KPty::open()
303303
p = getgrnam( "wheel" );
304304
gid_t gid = p ? p->gr_gid : getgid();
305305

306-
( void ) chown( d->ttyName.data(), getuid(), gid );
307-
( void ) chmod( d->ttyName.data(), S_IRUSR | S_IWUSR | S_IWGRP );
306+
if( chown( d->ttyName.data(), getuid(), gid ) < 0 )
307+
perror( "chown" );
308+
if( chmod( d->ttyName.data(), S_IRUSR | S_IWUSR | S_IWGRP ) < 0 )
309+
perror( "chmod" );
308310
}
309311
goto gotpty;
310312
}
@@ -397,7 +399,8 @@ void KPty::close()
397399
struct stat st;
398400
if ( !stat( d->ttyName.data(), &st ) )
399401
{
400-
( void ) chown( d->ttyName.data(), 0, st.st_gid == getgid() ? 0 : -1 );
402+
if( chown( d->ttyName.data(), 0, st.st_gid == getgid() ? 0 : -1 ) < 0 )
403+
perror( "chown" );
401404
chmod( d->ttyName.data(), S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH );
402405
}
403406
}

‎src/providers/gpx/qgsgpxfeatureiterator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ QgsGeometry* QgsGPXFeatureIterator::readTrackGeometry( const QgsTrack& trk )
431431

432432
// A track consists of several segments. Add all those segments into one.
433433
int totalPoints = 0;;
434-
for ( std::vector<QgsTrackSegment>::size_type i = 0; i < trk.segments.size(); i ++ )
434+
for ( int i = 0; i < trk.segments.size(); i ++ )
435435
{
436436
totalPoints += trk.segments[i].points.size();
437437
}
@@ -452,7 +452,7 @@ QgsGeometry* QgsGPXFeatureIterator::readTrackGeometry( const QgsTrack& trk )
452452
std::memcpy( geo + 5, &totalPoints, 4 );
453453

454454
int thisPoint = 0;
455-
for ( std::vector<QgsTrackSegment>::size_type k = 0; k < trk.segments.size(); k++ )
455+
for ( int k = 0; k < trk.segments.size(); k++ )
456456
{
457457
int nPoints = trk.segments[k].points.size();
458458
for ( int i = 0; i < nPoints; ++i )

‎src/providers/postgres/qgspostgresconn.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ void QgsPostgresConn::addColumnInfo( QgsPostgresLayerProperty& layerProperty, co
277277
// could use array_agg() and count()
278278
// array output would look like this: "{One,tWo}"
279279
QString sql = QString( "SELECT attname, CASE WHEN typname = ANY(ARRAY['geometry','geography','topogeometry']) THEN 1 ELSE null END AS isSpatial FROM pg_attribute JOIN pg_type ON atttypid=pg_type.oid WHERE attrelid=regclass('%1.%2')" )
280-
.arg( quotedIdentifier( schemaName ) )
281-
.arg( quotedIdentifier( viewName ) );
280+
.arg( quotedIdentifier( schemaName ) )
281+
.arg( quotedIdentifier( viewName ) );
282282
QgsDebugMsg( sql );
283283
QgsPostgresResult colRes = PQexec( sql );
284284

@@ -288,12 +288,14 @@ void QgsPostgresConn::addColumnInfo( QgsPostgresLayerProperty& layerProperty, co
288288
{
289289
for ( int i = 0; i < colRes.PQntuples(); i++ )
290290
{
291-
if ( fetchPkCandidates ) {
291+
if ( fetchPkCandidates )
292+
{
292293
QgsDebugMsg( colRes.PQgetvalue( i, 0 ) );
293294
layerProperty.pkCols << colRes.PQgetvalue( i, 0 );
294295
}
295296

296-
if ( colRes.PQgetisnull( i, 1 ) == 0 ) {
297+
if ( colRes.PQgetisnull( i, 1 ) == 0 )
298+
{
297299
++layerProperty.nSpCols;
298300
}
299301
}

‎src/providers/postgres/qgspostgresconn.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ struct QgsPostgresLayerProperty
6060
// TODO: rename this !
6161
int size() const { Q_ASSERT( types.size() == srids.size() ); return types.size(); }
6262

63-
QString defaultName() const {
63+
QString defaultName() const
64+
{
6465
QString n = tableName;
6566
if ( nSpCols > 1 ) n += "." + geometryColName;
6667
return n;

‎src/providers/postgres/qgspostgresfeatureiterator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ bool QgsPostgresFeatureIterator::declareCursor( const QString& whereClause )
275275
query += QString( "%1(%2(%3%4),'%5')" )
276276
.arg( P->mConnectionRO->majorVersion() < 2 ? "asbinary" : "st_asbinary" )
277277
.arg( P->mConnectionRO->majorVersion() < 2 ? "force_2d"
278-
: P->mConnectionRO->majorVersion() > 2 || P->mConnectionRO->minorVersion() > 0 ? "ST_Force2D"
279-
: "st_force_2d" )
278+
: P->mConnectionRO->majorVersion() > 2 || P->mConnectionRO->minorVersion() > 0 ? "st_force2d"
279+
: "st_force_2d" )
280280
.arg( P->quotedIdentifier( P->mGeometryColumn ) )
281281
.arg( P->mSpatialColType == sctGeography ? "::geometry" : "" )
282282
.arg( P->endianString() );

‎src/ui/qgscomposerbase.ui

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@
100100
<addaction name="mActionMoveItemContent"/>
101101
<addaction name="mActionGroupItems"/>
102102
<addaction name="mActionUngroupItems"/>
103+
<addaction name="mActionLockItems"/>
104+
<addaction name="mActionUnlockAll"/>
103105
</widget>
104106
<widget class="QToolBar" name="mItemToolbar">
105107
<property name="windowTitle">
@@ -570,6 +572,27 @@
570572
<string>New from template</string>
571573
</property>
572574
</action>
575+
<action name="mActionLockItems">
576+
<property name="icon">
577+
<iconset resource="../../images/images.qrc">
578+
<normaloff>:/images/themes/default/locked.svg</normaloff>:/images/themes/default/locked.svg</iconset>
579+
</property>
580+
<property name="text">
581+
<string>Lock Selected Items</string>
582+
</property>
583+
</action>
584+
<action name="mActionUnlockAll">
585+
<property name="icon">
586+
<iconset resource="../../images/images.qrc">
587+
<normaloff>:/images/themes/default/unlocked.svg</normaloff>:/images/themes/default/unlocked.svg</iconset>
588+
</property>
589+
<property name="text">
590+
<string>Unlock All</string>
591+
</property>
592+
<property name="toolTip">
593+
<string>Unlock All Items</string>
594+
</property>
595+
</action>
573596
</widget>
574597
<resources>
575598
<include location="../../images/images.qrc"/>

‎src/ui/qgssponsorsbase.ui

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<x>0</x>
88
<y>0</y>
99
<width>640</width>
10-
<height>292</height>
10+
<height>453</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -34,7 +34,20 @@
3434
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
3535
p, li { white-space: pre-wrap; }
3636
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Cantarell'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
37-
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:10pt;&quot;&gt;We work really hard to make this nice software for you. See all the cool features it has? Get a warm fuzzy feeling when you use it? QGIS is a labour of love by a dedicated team of developers. We want you to copy &amp;amp; share it and put it in the hands of as many people as possible. If QGIS is saving you money or you like our work and have the financial ability to help, please consider sponsoring the development of QGIS. We use money from sponsors to pay for travel and costs related to our bi-annual hackfests, and to generally support the goals of our project. Please see the &lt;/span&gt;&lt;a href=&quot;http://qgis.org/en/sponsorship.html&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:10pt; text-decoration: underline; color:#0000ff;&quot;&gt;QGIS Sponsorship Web Page&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:10pt;&quot;&gt; for more details. In the &lt;/span&gt;&lt;a href=&quot;http://qgis.org/en/sponsorship/sponsors.html&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Sponsors page&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:10pt;&quot;&gt; you can see the fine people and companies that are helping us financially - a great big 'thank you' to you all!&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
37+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:10pt;&quot;&gt;We work really hard to make this nice software for you. See all the cool features it has? Get a warm fuzzy feeling when you use it? QGIS is a labour of love by a dedicated team of developers. We want you to copy &amp;amp; share it and put it in the hands of as many people as possible. If QGIS is saving you money or you like our work and have the financial ability to help, please consider sponsoring the development of QGIS. We use money from sponsors to pay for travel and costs related to our bi-annual hackfests, and to generally support the goals of our project. &lt;br /&gt;&lt;br /&gt;Please see the &lt;/span&gt;&lt;a href=&quot;http://qgis.org/en/sponsorship.html&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:10pt; text-decoration: underline; color:#0000ff;&quot;&gt;QGIS Sponsorship Web Page&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:10pt;&quot;&gt; for more details. In the &lt;/span&gt;&lt;a href=&quot;http://qgis.org/en/sponsorship/sponsors.html&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Sponsors page&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:10pt;&quot;&gt; you can see the fine people and companies that are helping us financially - a great big 'thank you' to you all!&lt;/span&gt;&lt;/p&gt;
38+
&lt;hr /&gt;
39+
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;img src=&quot;:/images/sponsors/sponsors/gold.png&quot; /&gt;&lt;/p&gt;
40+
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;img src=&quot;:/images/sponsors/sponsors/aas_300wide.png&quot; /&gt;&lt;/p&gt;
41+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
42+
&lt;hr /&gt;
43+
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;img src=&quot;:/images/sponsors/sponsors/silver.png&quot; /&gt;&lt;/p&gt;
44+
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;img src=&quot;:/images/sponsors/sponsors/vorarlberg.png&quot; /&gt; &lt;img src=&quot;:/images/sponsors/sponsors/gaia.png&quot; /&gt;&lt;/p&gt;
45+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
46+
&lt;hr /&gt;
47+
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;img src=&quot;:/images/sponsors/sponsors/bronze.png&quot; /&gt;&lt;/p&gt;
48+
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;img src=&quot;:/images/sponsors/sponsors/ibw.png&quot; /&gt; &lt;img src=&quot;:/images/sponsors/sponsors/geosynergy.png&quot; /&gt;&lt;/p&gt;
49+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
50+
&lt;hr /&gt;&lt;/body&gt;&lt;/html&gt;</string>
3851
</property>
3952
<property name="openExternalLinks">
4053
<bool>true</bool>
@@ -66,7 +79,9 @@ p, li { white-space: pre-wrap; }
6679
</item>
6780
</layout>
6881
</widget>
69-
<resources/>
82+
<resources>
83+
<include location="../../images/images.qrc"/>
84+
</resources>
7085
<connections>
7186
<connection>
7287
<sender>buttonBox</sender>

‎tests/src/app/testqgisappclipboard.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void TestQgisAppClipboard::copyPaste()
6969
{
7070
qDebug() << "TestQgisAppClipboard::copyPaste()";
7171

72-
QMap<QString,int> filesCounts;
72+
QMap<QString, int> filesCounts;
7373
filesCounts.insert( "points.shp", 17 );
7474
filesCounts.insert( "lines.shp", 6 );
7575
filesCounts.insert( "polys.shp", 10 );
@@ -79,7 +79,7 @@ void TestQgisAppClipboard::copyPaste()
7979
// add vector layer
8080
QString filePath = mTestDataDir + fileName;
8181
qDebug() << "add vector layer: " << filePath;
82-
QgsVectorLayer *inputLayer = mQgisApp->addVectorLayer ( filePath, fileName, "ogr" );
82+
QgsVectorLayer *inputLayer = mQgisApp->addVectorLayer( filePath, fileName, "ogr" );
8383
QVERIFY( inputLayer->isValid() );
8484

8585
// copy all features to clipboard
@@ -89,13 +89,13 @@ void TestQgisAppClipboard::copyPaste()
8989
QgsFeatureList features = mQgisApp->clipboard()->copyOf();
9090
qDebug() << features.size() << " features copied to clipboard";
9191

92-
QVERIFY( features.size() == filesCounts.value(fileName) );
92+
QVERIFY( features.size() == filesCounts.value( fileName ) );
9393

9494
QgsVectorLayer *pastedLayer = mQgisApp->pasteAsNewMemoryVector( "pasted" );
9595
QVERIFY( pastedLayer );
9696
QVERIFY( pastedLayer->isValid() );
9797
qDebug() << pastedLayer->featureCount() << " features in pasted layer";
98-
QVERIFY( pastedLayer->featureCount() == filesCounts.value(fileName) );
98+
QVERIFY( pastedLayer->featureCount() == filesCounts.value( fileName ) );
9999
}
100100
}
101101

0 commit comments

Comments
 (0)
Please sign in to comment.