Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'upstream/master'
  • Loading branch information
luipir committed Sep 9, 2013
2 parents 3216390 + c705034 commit 4200046
Show file tree
Hide file tree
Showing 37 changed files with 644 additions and 493 deletions.
891 changes: 451 additions & 440 deletions images/images.qrc

Large diffs are not rendered by default.

Binary file modified images/splash/splash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/splash/splash.xcf.bz2
Binary file not shown.
Binary file added images/sponsors/aas_300wide.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/sponsors/bronze.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/sponsors/buttons.xcf
Binary file not shown.
Binary file added images/sponsors/gaia.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/sponsors/geosynergy.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/sponsors/gold.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/sponsors/ibw.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/sponsors/platinum.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/sponsors/silver.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/sponsors/vorarlberg.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions python/console/console_editor.py
Expand Up @@ -240,7 +240,8 @@ def setLexers(self):
chekBoxAPI = self.settings.value("pythonConsole/preloadAPI", True, type=bool)
chekBoxPreparedAPI = self.settings.value("pythonConsole/usePreparedAPIFile", False, type=bool)
if chekBoxAPI:
self.api.loadPrepared(QgsApplication.pkgDataPath() + "/python/qsci_apis/pyqgis_master.pap")
pap = os.path.join(QgsApplication.pkgDataPath(), "python", "qsci_apis", "pyqgis.pap")
self.api.loadPrepared(pap)
elif chekBoxPreparedAPI:
self.api.loadPrepared(self.settings.value("pythonConsole/preparedAPIFile"))
else:
Expand Down Expand Up @@ -655,23 +656,26 @@ def keyPressEvent(self, e):
t = unicode(e.text())
## Close bracket automatically
if t in self.opening:
self.beginUndoAction()
i = self.opening.index(t)
if self.hasSelectedText():
self.beginUndoAction()
selText = self.selectedText()
self.removeSelectedText()
if startLine == endLine:
self.insert(self.opening[i] + selText + self.closing[i])
self.setCursorPosition(endLine, endPos+2)
self.endUndoAction()
return
elif startLine < endLine and self.opening[i] in ("'", '"'):
self.insert("'''" + selText + "'''")
self.setCursorPosition(endLine, endPos+3)
self.endUndoAction()
return
else:
self.insert(self.closing[i])
self.endUndoAction()
else:
self.insert(self.closing[i])
self.endUndoAction()
## FIXES #8392 (automatically removes the redundant char
## when autoclosing brackets option is enabled)
if t in [')', ']', '}']:
Expand Down
10 changes: 5 additions & 5 deletions python/plugins/processing/saga/SagaAlgorithmProvider.py
Expand Up @@ -67,19 +67,19 @@ def unload(self):
ProcessingConfig.removeSetting(SagaUtils.SAGA_RESAMPLING_REGION_CELLSIZE)
ProcessingConfig.removeSetting(SagaUtils.SAGA_LOG_CONSOLE)
ProcessingConfig.removeSetting(SagaUtils.SAGA_LOG_COMMANDS)


def _loadAlgorithms(self):

def _loadAlgorithms(self):
self.algs = []
saga208 = ProcessingConfig.getSetting(SagaUtils.SAGA_208)
saga208 = ProcessingConfig.getSetting(SagaUtils.SAGA_208)
folder = SagaUtils.sagaDescriptionPath()
for descriptionFile in os.listdir(folder):
if descriptionFile.endswith("txt"):
if descriptionFile.endswith("txt"):
if not saga208:
if descriptionFile.startswith("2.0.8"):
continue
else:
if descriptionFile.startswith("2.1"):
if descriptionFile.startswith("2.1"):
continue
try:
alg = SagaAlgorithm(os.path.join(folder, descriptionFile))
Expand Down
4 changes: 2 additions & 2 deletions src/analysis/openstreetmap/qgsosmdatabase.cpp
Expand Up @@ -421,7 +421,7 @@ void QgsOSMDatabase::exportSpatiaLiteNodes( const QString& tableName, const QStr
sqlite3_bind_null( stmtInsert, ++col );
}

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

int insertRes = sqlite3_step( stmtInsert );
if ( insertRes != SQLITE_DONE )
Expand Down Expand Up @@ -489,7 +489,7 @@ void QgsOSMDatabase::exportSpatiaLiteWays( bool closed, const QString& tableName
sqlite3_bind_null( stmtInsert, ++col );
}

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

int insertRes = sqlite3_step( stmtInsert );
if ( insertRes != SQLITE_DONE )
Expand Down
18 changes: 18 additions & 0 deletions src/app/composer/qgscomposer.cpp
Expand Up @@ -245,6 +245,8 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
layoutMenu->addAction( mActionLowerItems );
layoutMenu->addAction( mActionMoveItemsToTop );
layoutMenu->addAction( mActionMoveItemsToBottom );
layoutMenu->addAction( mActionLockItems );
layoutMenu->addAction( mActionUnlockAll );

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

void QgsComposer::on_mActionLockItems_triggered()
{
if ( mView )
{
mView->lockItems();
}
}

void QgsComposer::on_mActionUnlockAll_triggered()
{
if ( mView )
{
mView->unlockAllItems();
}
}

void QgsComposer::on_mActionRaiseItems_triggered()
{
if ( mComposition )
Expand Down
6 changes: 6 additions & 0 deletions src/app/composer/qgscomposer.h
Expand Up @@ -210,6 +210,12 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
//! Ungroup selected item group
void on_mActionUngroupItems_triggered();

//! Lock selected items
void on_mActionLockItems_triggered();

//! Unlock all items
void on_mActionUnlockAll_triggered();

//! Move selected items one position up
void on_mActionRaiseItems_triggered();

Expand Down
8 changes: 8 additions & 0 deletions src/app/main.cpp
Expand Up @@ -253,9 +253,15 @@ void qgisCrash( int signal )
{
// take full stacktrace using gdb
// http://stackoverflow.com/questions/3151779/how-its-better-to-invoke-gdb-from-program-to-print-its-stacktrace
// unfortunately, this is not so simple. the proper method is way more OS-specific
// than this code would suggest, see http://stackoverflow.com/a/1024937

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

// Set up the custom qWarning/qDebug custom handler
#ifndef ANDROID
qInstallMsgHandler( myMessageOutput );
#endif

#if (defined(linux) && !defined(ANDROID)) || defined(__FreeBSD__)
signal( SIGQUIT, qgisCrash );
Expand Down
9 changes: 7 additions & 2 deletions src/core/composer/qgscomposeritem.cpp
Expand Up @@ -265,11 +265,11 @@ bool QgsComposerItem::_readXML( const QDomElement& itemElem, const QDomDocument&
QString positionLock = itemElem.attribute( "positionLock" );
if ( positionLock.compare( "true", Qt::CaseInsensitive ) == 0 )
{
mItemPositionLocked = true;
setPositionLock( true );
}
else
{
mItemPositionLocked = false;
setPositionLock( false );
}

//position
Expand Down Expand Up @@ -802,6 +802,11 @@ void QgsComposerItem::drawFrame( QPainter* p )
}
}

void QgsComposerItem::setPositionLock( bool lock )
{
mItemPositionLocked = lock;
}

void QgsComposerItem::move( double dx, double dy )
{
QTransform t = transform();
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposeritem.h
Expand Up @@ -281,7 +281,7 @@ class CORE_EXPORT QgsComposerItem: public QObject, public QGraphicsRectItem

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

/**Returns position lock for mouse drags (true means locked)
@note this method was added in version 1.2*/
Expand Down
20 changes: 11 additions & 9 deletions src/core/composer/qgscomposermap.cpp
Expand Up @@ -41,8 +41,8 @@

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

QgsComposerMap::QgsComposerMap( QgsComposition *composition )
: QgsComposerItem( 0, 0, 10, 10, composition ), mKeepLayerSet( false ), mOverviewFrameMapId( -1 ),
mOverviewBlendMode( QPainter::CompositionMode_SourceOver ), mOverviewInverted( false ), mOverviewCentered( false ),
mGridEnabled( false ), mGridStyle( Solid ),
mOverviewBlendMode( QPainter::CompositionMode_SourceOver ), mOverviewInverted( false ), mOverviewCentered( false ),
mGridEnabled( false ), mGridStyle( Solid ),
mGridIntervalX( 0.0 ), mGridIntervalY( 0.0 ), mGridOffsetX( 0.0 ), mGridOffsetY( 0.0 ), mGridAnnotationFontColor( QColor( 0, 0, 0 ) ),
mGridAnnotationPrecision( 3 ), mShowGridAnnotation( false ), mGridBlendMode( QPainter::CompositionMode_SourceOver ),
mLeftGridAnnotationPosition( OutsideMapFrame ), mRightGridAnnotationPosition( OutsideMapFrame ),
Expand Down Expand Up @@ -121,19 +121,21 @@ QgsComposerMap::QgsComposerMap( QgsComposition *composition )
void QgsComposerMap::extentCenteredOnOverview( QgsRectangle& extent ) const
{
extent = mExtent;
if ( ! mOverviewCentered ) {
if ( ! mOverviewCentered )
{
return;
}

if ( mOverviewFrameMapId != -1 ) {
if ( mOverviewFrameMapId != -1 )
{
const QgsComposerMap* overviewFrameMap = mComposition->getComposerMapById( mOverviewFrameMapId );
QgsRectangle otherExtent = overviewFrameMap->extent();

QgsPoint center = otherExtent.center();
QgsRectangle movedExtent( center.x() - mExtent.width() / 2,
center.y() - mExtent.height() / 2,
center.x() - mExtent.width() / 2 + mExtent.width(),
center.y() - mExtent.height() / 2 + mExtent.height() );
center.y() - mExtent.height() / 2,
center.x() - mExtent.width() / 2 + mExtent.width(),
center.y() - mExtent.height() / 2 + mExtent.height() );
extent = movedExtent;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsvectorfilewriter.cpp
Expand Up @@ -669,7 +669,7 @@ OGRFeatureH QgsVectorFileWriter::createFeature( QgsFeature& feature )
return 0;
}

OGRErr err = OGR_G_ImportFromWkb( mGeom2, const_cast<unsigned char *>( geom->asWkb() ), (int) geom->wkbSize() );
OGRErr err = OGR_G_ImportFromWkb( mGeom2, const_cast<unsigned char *>( geom->asWkb() ), ( int ) geom->wkbSize() );
if ( err != OGRERR_NONE )
{
mErrorMessage = QObject::tr( "Feature geometry not imported (OGR error: %1)" )
Expand All @@ -685,7 +685,7 @@ OGRFeatureH QgsVectorFileWriter::createFeature( QgsFeature& feature )
}
else if ( geom )
{
OGRErr err = OGR_G_ImportFromWkb( mGeom, const_cast<unsigned char *>( geom->asWkb() ), (int) geom->wkbSize() );
OGRErr err = OGR_G_ImportFromWkb( mGeom, const_cast<unsigned char *>( geom->asWkb() ), ( int ) geom->wkbSize() );
if ( err != OGRERR_NONE )
{
mErrorMessage = QObject::tr( "Feature geometry not imported (OGR error: %1)" )
Expand Down
4 changes: 2 additions & 2 deletions src/core/raster/qgsrasterblock.cpp
Expand Up @@ -324,7 +324,7 @@ bool QgsRasterBlock::isNoData( size_t index )
return false;
}
// TODO: optimize
int row = (int) index / mWidth;
int row = ( int ) index / mWidth;
int column = index % mWidth;
size_t byte = ( size_t )row * mNoDataBitmapWidth + column / 8 ;
int bit = column % 8;
Expand Down Expand Up @@ -406,7 +406,7 @@ bool QgsRasterBlock::setIsNoData( size_t index )
}
}
// TODO: optimize
int row = (int) index / mWidth;
int row = ( int ) index / mWidth;
int column = index % mWidth;
size_t byte = ( size_t )row * mNoDataBitmapWidth + column / 8;
int bit = column % 8;
Expand Down
37 changes: 37 additions & 0 deletions src/gui/qgscomposerview.cpp
Expand Up @@ -751,6 +751,43 @@ void QgsComposerView::ungroupItems()
}
}

void QgsComposerView::lockItems()
{
if ( !composition() )
{
return;
}

QList<QgsComposerItem*> selectionList = composition()->selectedComposerItems();
QList<QgsComposerItem*>::iterator itemIter = selectionList.begin();
for ( ; itemIter != selectionList.end(); ++itemIter )
{
( *itemIter )->setPositionLock( true );
}

composition()->clearSelection();
}

void QgsComposerView::unlockAllItems()
{
if ( !composition() )
{
return;
}

//unlock all items in composer
QList<QGraphicsItem *> itemList = composition()->items();
QList<QGraphicsItem *>::iterator itemIt = itemList.begin();
for ( ; itemIt != itemList.end(); ++itemIt )
{
QgsComposerItem* mypItem = dynamic_cast<QgsComposerItem *>( *itemIt );
if ( mypItem )
{
mypItem->setPositionLock( false );
}
}
}

QMainWindow* QgsComposerView::composerWindow()
{
QMainWindow* composerObject = 0;
Expand Down
6 changes: 6 additions & 0 deletions src/gui/qgscomposerview.h
Expand Up @@ -76,6 +76,12 @@ class GUI_EXPORT QgsComposerView: public QGraphicsView
/**Ungroups the selected items*/
void ungroupItems();

/**Lock the selected items*/
void lockItems();

/**Unlock all items*/
void unlockAllItems();

QgsComposerView::Tool currentTool() const {return mCurrentTool;}
void setCurrentTool( QgsComposerView::Tool t ) {mCurrentTool = t;}

Expand Down
5 changes: 4 additions & 1 deletion src/plugins/grass/qtermwidget/BlockArray.cpp
Expand Up @@ -211,7 +211,10 @@ bool BlockArray::setHistorySize( size_t newsize )
else
{
decreaseBuffer( newsize );
( void ) ftruncate( ion, length*blocksize );
if( ftruncate( ion, length*blocksize ) < 0 )
{
perror( "ftruncate" );
}
size = newsize;

return true;
Expand Down
12 changes: 8 additions & 4 deletions src/plugins/grass/qtermwidget/k3process.cpp
Expand Up @@ -151,7 +151,8 @@ K3Process::setupEnvironment()
}
if ( !d->wd.isEmpty() )
{
( void ) chdir( QFile::encodeName( d->wd ).data() );
if( chdir( QFile::encodeName( d->wd ).data() ) < 0 )
perror( "chdir" );
}
}

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

if ( !runPrivileged() )
{
setgid( getgid() );
if( setgid( getgid() ) < 0 )
perror( "setgid" );
#ifdef HAVE_INITGROUPS
if ( pw )
initgroups( pw->pw_name, pw->pw_gid );
#endif
if ( geteuid() != getuid() )
setuid( getuid() );
if( setuid( getuid() ) < 0 )
perror( "setuid" );
if ( geteuid() != getuid() )
_exit( 1 );
}
Expand All @@ -356,7 +359,8 @@ bool K3Process::start( RunMode runmode, Communication comm )
execvp( executable, arglist );

char resultByte = 1;
( void ) write( fd[1], &resultByte, 1 );
if( write( fd[1], &resultByte, 1 ) < 0 )
perror( "write" );
_exit( -1 );
}
else if ( pid_ == -1 )
Expand Down

0 comments on commit 4200046

Please sign in to comment.