9 changes: 6 additions & 3 deletions src/plugins/grass/qtermwidget/k3processcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ void K3ProcessController::theSigCHLDHandler( int arg )
int saved_errno = errno;

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

#ifdef Q_OS_UNIX
if ( Private::oldChildHandlerData.sa_handler != SIG_IGN &&
Expand Down Expand Up @@ -243,14 +244,16 @@ K3ProcessController::rescheduleCheck()
{
d->needcheck = false;
char dummy = 0;
( void ) ::write( d->fd[1], &dummy, 1 );
if( ::write( d->fd[1], &dummy, 1 ) < 0 )
perror( "write failed" );
}
}

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

int status;
again:
Expand Down
9 changes: 6 additions & 3 deletions src/plugins/grass/qtermwidget/kpty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,10 @@ bool KPty::open()
p = getgrnam( "wheel" );
gid_t gid = p ? p->gr_gid : getgid();

( void ) chown( d->ttyName.data(), getuid(), gid );
( void ) chmod( d->ttyName.data(), S_IRUSR | S_IWUSR | S_IWGRP );
if( chown( d->ttyName.data(), getuid(), gid ) < 0 )
perror( "chown" );
if( chmod( d->ttyName.data(), S_IRUSR | S_IWUSR | S_IWGRP ) < 0 )
perror( "chmod" );
}
goto gotpty;
}
Expand Down Expand Up @@ -397,7 +399,8 @@ void KPty::close()
struct stat st;
if ( !stat( d->ttyName.data(), &st ) )
{
( void ) chown( d->ttyName.data(), 0, st.st_gid == getgid() ? 0 : -1 );
if( chown( d->ttyName.data(), 0, st.st_gid == getgid() ? 0 : -1 ) < 0 )
perror( "chown" );
chmod( d->ttyName.data(), S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH );
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/providers/gpx/qgsgpxfeatureiterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ QgsGeometry* QgsGPXFeatureIterator::readTrackGeometry( const QgsTrack& trk )

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

int thisPoint = 0;
for ( std::vector<QgsTrackSegment>::size_type k = 0; k < trk.segments.size(); k++ )
for ( int k = 0; k < trk.segments.size(); k++ )
{
int nPoints = trk.segments[k].points.size();
for ( int i = 0; i < nPoints; ++i )
Expand Down
10 changes: 6 additions & 4 deletions src/providers/postgres/qgspostgresconn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ void QgsPostgresConn::addColumnInfo( QgsPostgresLayerProperty& layerProperty, co
// could use array_agg() and count()
// array output would look like this: "{One,tWo}"
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')" )
.arg( quotedIdentifier( schemaName ) )
.arg( quotedIdentifier( viewName ) );
.arg( quotedIdentifier( schemaName ) )
.arg( quotedIdentifier( viewName ) );
QgsDebugMsg( sql );
QgsPostgresResult colRes = PQexec( sql );

Expand All @@ -288,12 +288,14 @@ void QgsPostgresConn::addColumnInfo( QgsPostgresLayerProperty& layerProperty, co
{
for ( int i = 0; i < colRes.PQntuples(); i++ )
{
if ( fetchPkCandidates ) {
if ( fetchPkCandidates )
{
QgsDebugMsg( colRes.PQgetvalue( i, 0 ) );
layerProperty.pkCols << colRes.PQgetvalue( i, 0 );
}

if ( colRes.PQgetisnull( i, 1 ) == 0 ) {
if ( colRes.PQgetisnull( i, 1 ) == 0 )
{
++layerProperty.nSpCols;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/providers/postgres/qgspostgresconn.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ struct QgsPostgresLayerProperty
// TODO: rename this !
int size() const { Q_ASSERT( types.size() == srids.size() ); return types.size(); }

QString defaultName() const {
QString defaultName() const
{
QString n = tableName;
if ( nSpCols > 1 ) n += "." + geometryColName;
return n;
Expand Down
4 changes: 2 additions & 2 deletions src/providers/postgres/qgspostgresfeatureiterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ bool QgsPostgresFeatureIterator::declareCursor( const QString& whereClause )
query += QString( "%1(%2(%3%4),'%5')" )
.arg( P->mConnectionRO->majorVersion() < 2 ? "asbinary" : "st_asbinary" )
.arg( P->mConnectionRO->majorVersion() < 2 ? "force_2d"
: P->mConnectionRO->majorVersion() > 2 || P->mConnectionRO->minorVersion() > 0 ? "ST_Force2D"
: "st_force_2d" )
: P->mConnectionRO->majorVersion() > 2 || P->mConnectionRO->minorVersion() > 0 ? "st_force2d"
: "st_force_2d" )
.arg( P->quotedIdentifier( P->mGeometryColumn ) )
.arg( P->mSpatialColType == sctGeography ? "::geometry" : "" )
.arg( P->endianString() );
Expand Down
23 changes: 23 additions & 0 deletions src/ui/qgscomposerbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
<addaction name="mActionMoveItemContent"/>
<addaction name="mActionGroupItems"/>
<addaction name="mActionUngroupItems"/>
<addaction name="mActionLockItems"/>
<addaction name="mActionUnlockAll"/>
</widget>
<widget class="QToolBar" name="mItemToolbar">
<property name="windowTitle">
Expand Down Expand Up @@ -570,6 +572,27 @@
<string>New from template</string>
</property>
</action>
<action name="mActionLockItems">
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/locked.svg</normaloff>:/images/themes/default/locked.svg</iconset>
</property>
<property name="text">
<string>Lock Selected Items</string>
</property>
</action>
<action name="mActionUnlockAll">
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/unlocked.svg</normaloff>:/images/themes/default/unlocked.svg</iconset>
</property>
<property name="text">
<string>Unlock All</string>
</property>
<property name="toolTip">
<string>Unlock All Items</string>
</property>
</action>
</widget>
<resources>
<include location="../../images/images.qrc"/>
Expand Down
21 changes: 18 additions & 3 deletions src/ui/qgssponsorsbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>640</width>
<height>292</height>
<height>453</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -34,7 +34,20 @@
&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;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Cantarell'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&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>
&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;
&lt;hr /&gt;
&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;
&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;
&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;
&lt;hr /&gt;
&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;
&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;
&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;
&lt;hr /&gt;
&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;
&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;
&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;
&lt;hr /&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
Expand Down Expand Up @@ -66,7 +79,9 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</widget>
<resources/>
<resources>
<include location="../../images/images.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
Expand Down
8 changes: 4 additions & 4 deletions tests/src/app/testqgisappclipboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void TestQgisAppClipboard::copyPaste()
{
qDebug() << "TestQgisAppClipboard::copyPaste()";

QMap<QString,int> filesCounts;
QMap<QString, int> filesCounts;
filesCounts.insert( "points.shp", 17 );
filesCounts.insert( "lines.shp", 6 );
filesCounts.insert( "polys.shp", 10 );
Expand All @@ -79,7 +79,7 @@ void TestQgisAppClipboard::copyPaste()
// add vector layer
QString filePath = mTestDataDir + fileName;
qDebug() << "add vector layer: " << filePath;
QgsVectorLayer *inputLayer = mQgisApp->addVectorLayer ( filePath, fileName, "ogr" );
QgsVectorLayer *inputLayer = mQgisApp->addVectorLayer( filePath, fileName, "ogr" );
QVERIFY( inputLayer->isValid() );

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

QVERIFY( features.size() == filesCounts.value(fileName) );
QVERIFY( features.size() == filesCounts.value( fileName ) );

QgsVectorLayer *pastedLayer = mQgisApp->pasteAsNewMemoryVector( "pasted" );
QVERIFY( pastedLayer );
QVERIFY( pastedLayer->isValid() );
qDebug() << pastedLayer->featureCount() << " features in pasted layer";
QVERIFY( pastedLayer->featureCount() == filesCounts.value(fileName) );
QVERIFY( pastedLayer->featureCount() == filesCounts.value( fileName ) );
}
}

Expand Down