mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
indentation update
This commit is contained in:
parent
f6dbc22feb
commit
0b6da7e8ad
@ -479,8 +479,8 @@ void QgsLabelingGui::changePreviewBackground()
|
||||
|
||||
mPreviewBackgroundBtn->setColor( color );
|
||||
scrollArea_mPreview->widget()->setStyleSheet( QString( "background: rgb(%1, %2, %3);" ).arg( QString::number( color.red() ),
|
||||
QString::number( color.green() ),
|
||||
QString::number( color.blue() ) ) );
|
||||
QString::number( color.green() ),
|
||||
QString::number( color.blue() ) ) );
|
||||
}
|
||||
|
||||
void QgsLabelingGui::changeTextColor()
|
||||
@ -546,12 +546,12 @@ void QgsLabelingGui::updatePreview()
|
||||
lblFontPreview->setFont( previewFont );
|
||||
|
||||
QColor prevColor = btnTextColor->color();
|
||||
prevColor.setAlphaF( ( 100.0 - (double)(mFontTranspSpinBox->value()) ) / 100.0 );
|
||||
prevColor.setAlphaF(( 100.0 - ( double )( mFontTranspSpinBox->value() ) ) / 100.0 );
|
||||
lblFontPreview->setTextColor( prevColor );
|
||||
if ( chkBuffer->isChecked() )
|
||||
{
|
||||
QColor buffColor = btnBufferColor->color();
|
||||
buffColor.setAlphaF( ( 100.0 - (double)(mBufferTranspSpinBox->value()) ) / 100.0 );
|
||||
buffColor.setAlphaF(( 100.0 - ( double )( mBufferTranspSpinBox->value() ) ) / 100.0 );
|
||||
lblFontPreview->setBuffer( spinBufferSize->value(), buffColor );
|
||||
}
|
||||
else
|
||||
|
@ -53,8 +53,8 @@ class QgsLabelingGui : public QWidget, private Ui::QgsLabelingGuiBase
|
||||
void on_mFontSizeSpinBox_valueChanged( double d );
|
||||
void on_mFontSizeUnitComboBox_currentIndexChanged( int index );
|
||||
void on_mFontTranspSpinBox_valueChanged( int i );
|
||||
void on_mFontWordSpacingSpinBox_valueChanged(double spacing );
|
||||
void on_mFontLetterSpacingSpinBox_valueChanged(double spacing );
|
||||
void on_mFontWordSpacingSpinBox_valueChanged( double spacing );
|
||||
void on_mFontLetterSpacingSpinBox_valueChanged( double spacing );
|
||||
void on_mBufferTranspSpinBox_valueChanged( int i );
|
||||
void on_mXCoordinateComboBox_currentIndexChanged( const QString & text );
|
||||
void on_mYCoordinateComboBox_currentIndexChanged( const QString & text );
|
||||
|
@ -248,7 +248,7 @@ void QgsLabelPropertyDialog::on_mMinScaleSpinBox_valueChanged( int i )
|
||||
insertChangedValue( QgsPalLayerSettings::MinScale, i );
|
||||
}
|
||||
|
||||
void QgsLabelPropertyDialog::on_mMaxScaleSpinBox_valueChanged(int i )
|
||||
void QgsLabelPropertyDialog::on_mMaxScaleSpinBox_valueChanged( int i )
|
||||
{
|
||||
insertChangedValue( QgsPalLayerSettings::MaxScale, i );
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ class QgsLabelPropertyDialog: public QDialog, private Ui::QgsLabelPropertyDialog
|
||||
|
||||
private slots:
|
||||
void on_mShowLabelChkbx_toggled( bool chkd );
|
||||
void on_mMinScaleSpinBox_valueChanged(int i );
|
||||
void on_mMinScaleSpinBox_valueChanged( int i );
|
||||
void on_mMaxScaleSpinBox_valueChanged( int i );
|
||||
void on_mLabelDistanceSpinBox_valueChanged( double d );
|
||||
void on_mXCoordSpinBox_valueChanged( double d );
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
|
||||
QgsAddRemoveMultiFrameCommand::QgsAddRemoveMultiFrameCommand( State s, QgsComposerMultiFrame* multiFrame, QgsComposition* c, const QString& text, QUndoCommand* parent ):
|
||||
QUndoCommand( text, parent ), mMultiFrame( multiFrame ), mComposition( c ), mState(s), mFirstRun( true )
|
||||
QUndoCommand( text, parent ), mMultiFrame( multiFrame ), mComposition( c ), mState( s ), mFirstRun( true )
|
||||
{
|
||||
}
|
||||
|
||||
@ -31,56 +31,56 @@ QgsAddRemoveMultiFrameCommand::QgsAddRemoveMultiFrameCommand(): mMultiFrame( 0 )
|
||||
|
||||
QgsAddRemoveMultiFrameCommand::~QgsAddRemoveMultiFrameCommand()
|
||||
{
|
||||
if( mState == Removed )
|
||||
{
|
||||
delete mMultiFrame;
|
||||
}
|
||||
if ( mState == Removed )
|
||||
{
|
||||
delete mMultiFrame;
|
||||
}
|
||||
}
|
||||
|
||||
void QgsAddRemoveMultiFrameCommand::redo()
|
||||
{
|
||||
if( checkFirstRun() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
switchState();
|
||||
if ( checkFirstRun() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
switchState();
|
||||
}
|
||||
|
||||
void QgsAddRemoveMultiFrameCommand::undo()
|
||||
{
|
||||
if( checkFirstRun() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
switchState();
|
||||
if ( checkFirstRun() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
switchState();
|
||||
}
|
||||
|
||||
void QgsAddRemoveMultiFrameCommand::switchState()
|
||||
{
|
||||
if( mComposition )
|
||||
if ( mComposition )
|
||||
{
|
||||
if ( mState == Added )
|
||||
{
|
||||
if( mState == Added )
|
||||
{
|
||||
mComposition->removeMultiFrame( mMultiFrame );
|
||||
mState = Removed;
|
||||
}
|
||||
else
|
||||
{
|
||||
mComposition->addMultiFrame( mMultiFrame );
|
||||
mState = Added;
|
||||
}
|
||||
mComposition->removeMultiFrame( mMultiFrame );
|
||||
mState = Removed;
|
||||
}
|
||||
else
|
||||
{
|
||||
mComposition->addMultiFrame( mMultiFrame );
|
||||
mState = Added;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool QgsAddRemoveMultiFrameCommand::checkFirstRun()
|
||||
{
|
||||
if( mFirstRun )
|
||||
{
|
||||
mFirstRun = false;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ( mFirstRun )
|
||||
{
|
||||
mFirstRun = false;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ class QgsComposition;
|
||||
|
||||
class CORE_EXPORT QgsAddRemoveMultiFrameCommand: public QUndoCommand
|
||||
{
|
||||
public:
|
||||
public:
|
||||
|
||||
enum State
|
||||
{
|
||||
@ -33,22 +33,22 @@ class CORE_EXPORT QgsAddRemoveMultiFrameCommand: public QUndoCommand
|
||||
Removed
|
||||
};
|
||||
|
||||
QgsAddRemoveMultiFrameCommand( State s, QgsComposerMultiFrame* multiFrame, QgsComposition* c, const QString& text, QUndoCommand* parent = 0 );
|
||||
~QgsAddRemoveMultiFrameCommand();
|
||||
void redo();
|
||||
void undo();
|
||||
QgsAddRemoveMultiFrameCommand( State s, QgsComposerMultiFrame* multiFrame, QgsComposition* c, const QString& text, QUndoCommand* parent = 0 );
|
||||
~QgsAddRemoveMultiFrameCommand();
|
||||
void redo();
|
||||
void undo();
|
||||
|
||||
private:
|
||||
QgsAddRemoveMultiFrameCommand();
|
||||
private:
|
||||
QgsAddRemoveMultiFrameCommand();
|
||||
|
||||
//changes between added / removed state
|
||||
void switchState();
|
||||
bool checkFirstRun();
|
||||
//changes between added / removed state
|
||||
void switchState();
|
||||
bool checkFirstRun();
|
||||
|
||||
QgsComposerMultiFrame* mMultiFrame;
|
||||
QgsComposition* mComposition;
|
||||
State mState;
|
||||
bool mFirstRun;
|
||||
QgsComposerMultiFrame* mMultiFrame;
|
||||
QgsComposition* mComposition;
|
||||
State mState;
|
||||
bool mFirstRun;
|
||||
};
|
||||
|
||||
#endif // QGSADDREMOVEMULTIFRAMECOMMAND_H
|
||||
|
@ -17,14 +17,14 @@
|
||||
#include "qgscomposermultiframe.h"
|
||||
|
||||
QgsComposerFrame::QgsComposerFrame( QgsComposition* c, QgsComposerMultiFrame* mf, qreal x, qreal y, qreal width, qreal height )
|
||||
: QgsComposerItem( x, y, width, height, c )
|
||||
, mMultiFrame( mf )
|
||||
: QgsComposerItem( x, y, width, height, c )
|
||||
, mMultiFrame( mf )
|
||||
{
|
||||
}
|
||||
|
||||
QgsComposerFrame::QgsComposerFrame()
|
||||
: QgsComposerItem( 0, 0, 0, 0, 0 )
|
||||
, mMultiFrame( 0 )
|
||||
: QgsComposerItem( 0, 0, 0, 0, 0 )
|
||||
, mMultiFrame( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -1592,11 +1592,11 @@ bool QgsCoordinateReferenceSystem::loadIDs( QHash<int, QString> &wkts )
|
||||
continue;
|
||||
|
||||
// some CRS are known to fail (see http://trac.osgeo.org/gdal/ticket/2900)
|
||||
if( epsg==2218 || epsg==2221 || epsg==2296 || epsg==2297 || epsg==2298 || epsg==2299 || epsg==2300 || epsg==2301 || epsg==2302 ||
|
||||
epsg==2303 || epsg==2304 || epsg==2305 || epsg==2306 || epsg==2307 || epsg==2963 || epsg==2985 || epsg==2986 || epsg==3052 ||
|
||||
epsg==3053 || epsg==3139 || epsg==3144 || epsg==3145 || epsg==3173 || epsg==3295 || epsg==3993 || epsg==4087 || epsg==4088 ||
|
||||
epsg==5017 || epsg==5221 || epsg==5224 || epsg==5225 || epsg==5514 || epsg==5515 || epsg==5516 || epsg==5819 || epsg==5820 ||
|
||||
epsg==5821 || epsg==32600 || epsg==32663 || epsg==32700 )
|
||||
if ( epsg == 2218 || epsg == 2221 || epsg == 2296 || epsg == 2297 || epsg == 2298 || epsg == 2299 || epsg == 2300 || epsg == 2301 || epsg == 2302 ||
|
||||
epsg == 2303 || epsg == 2304 || epsg == 2305 || epsg == 2306 || epsg == 2307 || epsg == 2963 || epsg == 2985 || epsg == 2986 || epsg == 3052 ||
|
||||
epsg == 3053 || epsg == 3139 || epsg == 3144 || epsg == 3145 || epsg == 3173 || epsg == 3295 || epsg == 3993 || epsg == 4087 || epsg == 4088 ||
|
||||
epsg == 5017 || epsg == 5221 || epsg == 5224 || epsg == 5225 || epsg == 5514 || epsg == 5515 || epsg == 5516 || epsg == 5819 || epsg == 5820 ||
|
||||
epsg == 5821 || epsg == 32600 || epsg == 32663 || epsg == 32700 )
|
||||
continue;
|
||||
|
||||
if ( OSRImportFromEPSG( crs, epsg ) != OGRERR_NONE )
|
||||
|
@ -508,7 +508,7 @@ void QgsPalLayerSettings::registerFeature( QgsVectorLayer* layer, QgsFeature& f
|
||||
bool conversionOk;
|
||||
int minScale = minScaleValue.toInt( &conversionOk );
|
||||
// TODO: occasional floating point issues?
|
||||
if ( conversionOk && int( context.rendererScale() ) < minScale )
|
||||
if ( conversionOk && int( context.rendererScale() ) < minScale )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -1266,7 +1266,7 @@ void QgsPalLabeling::drawLabeling( QgsRenderContext& context )
|
||||
fontTransp = ft;
|
||||
}
|
||||
}
|
||||
fontColor.setAlphaF( ( 100.0 - (double)(fontTransp) ) / 100.0 );
|
||||
fontColor.setAlphaF(( 100.0 - ( double )( fontTransp ) ) / 100.0 );
|
||||
|
||||
//font bold
|
||||
QVariant dataDefinedBold = palGeometry->dataDefinedValues().value( QgsPalLayerSettings::Bold );
|
||||
@ -1326,7 +1326,7 @@ void QgsPalLabeling::drawLabeling( QgsRenderContext& context )
|
||||
bufferTransp = bt;
|
||||
}
|
||||
}
|
||||
bufferColor.setAlphaF( ( 100.0 - (double)(bufferTransp) ) / 100.0 );
|
||||
bufferColor.setAlphaF(( 100.0 - ( double )( bufferTransp ) ) / 100.0 );
|
||||
|
||||
if ( lyr.bufferSize != 0 )
|
||||
drawLabel( *it, painter, fontForLabel, fontColor, xform, bufferSize, bufferColor, true );
|
||||
|
@ -806,12 +806,12 @@ QStringList QgsSvgMarkerSymbolLayerV2::listSvgFilesAt( QString directory )
|
||||
for ( int i = 0; i < svgPaths.size(); i++ )
|
||||
{
|
||||
QDir dir( svgPaths[i] );
|
||||
foreach( QString item, dir.entryList( QDir::Dirs | QDir::NoDotAndDotDot ) )
|
||||
foreach ( QString item, dir.entryList( QDir::Dirs | QDir::NoDotAndDotDot ) )
|
||||
{
|
||||
svgPaths.insert( i + 1, dir.path() + "/" + item );
|
||||
}
|
||||
|
||||
foreach( QString item, dir.entryList( QStringList( "*.svg" ), QDir::Files ) )
|
||||
foreach ( QString item, dir.entryList( QStringList( "*.svg" ), QDir::Files ) )
|
||||
{
|
||||
list.append( dir.path() + "/" + item );
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ bool QgsStyleV2::saveSymbol( QString name, QgsSymbolV2* symbol, int groupid, QSt
|
||||
symEl.save( stream, 4 );
|
||||
QByteArray nameArray = name.toUtf8();
|
||||
char *query = sqlite3_mprintf( "INSERT INTO symbol VALUES (NULL, '%q', '%q', %d);",
|
||||
nameArray.constData(), xmlArray->constData(), groupid );
|
||||
nameArray.constData(), xmlArray->constData(), groupid );
|
||||
|
||||
if ( !runEmptyQuery( query ) )
|
||||
{
|
||||
@ -204,7 +204,7 @@ bool QgsStyleV2::saveColorRamp( QString name, QgsVectorColorRampV2* ramp, int gr
|
||||
rampEl.save( stream, 4 );
|
||||
QByteArray nameArray = name.toUtf8();
|
||||
char *query = sqlite3_mprintf( "INSERT INTO colorramp VALUES (NULL, '%q', '%q', %d);",
|
||||
nameArray.constData(), xmlArray->constData(), groupid );
|
||||
nameArray.constData(), xmlArray->constData(), groupid );
|
||||
|
||||
if ( !runEmptyQuery( query ) )
|
||||
{
|
||||
@ -311,7 +311,7 @@ bool QgsStyleV2::load( QString filename )
|
||||
QDomDocument doc;
|
||||
QString ramp_name = QString( reinterpret_cast<const char*>( sqlite3_column_text( ppStmt, ColorrampName ) ) );
|
||||
QString xmlstring = QString( reinterpret_cast<const char*>( sqlite3_column_text( ppStmt, ColorrampXML ) ) );
|
||||
if( !doc.setContent( xmlstring ) )
|
||||
if ( !doc.setContent( xmlstring ) )
|
||||
{
|
||||
QgsDebugMsg( "Cannot open symbol" + ramp_name );
|
||||
continue;
|
||||
@ -437,7 +437,7 @@ QStringList QgsStyleV2::groupNames()
|
||||
QgsSymbolGroupMap QgsStyleV2::childGroupNames( QString parent )
|
||||
{
|
||||
// get the name list from the sqlite database and return as a QStringList
|
||||
if( mCurrentDB == NULL )
|
||||
if ( mCurrentDB == NULL )
|
||||
{
|
||||
QgsDebugMsg( "Cannot open database for listing groups" );
|
||||
return QgsSymbolGroupMap();
|
||||
@ -478,7 +478,7 @@ QgsSymbolGroupMap QgsStyleV2::childGroupNames( QString parent )
|
||||
|
||||
QStringList QgsStyleV2::symbolsOfGroup( StyleEntity type, int groupid )
|
||||
{
|
||||
if( mCurrentDB == NULL )
|
||||
if ( mCurrentDB == NULL )
|
||||
{
|
||||
QgsDebugMsg( "Cannot Open database for getting group symbols of groupid: " + groupid );
|
||||
return QStringList();
|
||||
@ -490,12 +490,12 @@ QStringList QgsStyleV2::symbolsOfGroup( StyleEntity type, int groupid )
|
||||
if ( type == SymbolEntity )
|
||||
{
|
||||
query = groupid ? sqlite3_mprintf( "SELECT name FROM symbol WHERE groupid=%d;", groupid ) :
|
||||
sqlite3_mprintf( "SELECT name FROM symbol WHERE groupid IS NULL;");
|
||||
sqlite3_mprintf( "SELECT name FROM symbol WHERE groupid IS NULL;" );
|
||||
}
|
||||
else if ( type == ColorrampEntity )
|
||||
{
|
||||
query = groupid ? sqlite3_mprintf( "SELECT name FROM colorramp WHERE groupid=%d;", groupid ) :
|
||||
sqlite3_mprintf( "SELECT name FROM colorramp WHERE groupid IS NULL;");
|
||||
sqlite3_mprintf( "SELECT name FROM colorramp WHERE groupid IS NULL;" );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -587,7 +587,7 @@ int QgsStyleV2::addGroup( QString groupName, int parentid )
|
||||
sqlite3_step( ppStmt );
|
||||
sqlite3_finalize( ppStmt );
|
||||
|
||||
return (int)sqlite3_last_insert_rowid( mCurrentDB );
|
||||
return ( int )sqlite3_last_insert_rowid( mCurrentDB );
|
||||
}
|
||||
|
||||
int QgsStyleV2::addTag( QString tagname )
|
||||
@ -603,7 +603,7 @@ int QgsStyleV2::addTag( QString tagname )
|
||||
sqlite3_step( ppStmt );
|
||||
sqlite3_finalize( ppStmt );
|
||||
|
||||
return (int)sqlite3_last_insert_rowid( mCurrentDB );
|
||||
return ( int )sqlite3_last_insert_rowid( mCurrentDB );
|
||||
}
|
||||
|
||||
void QgsStyleV2::rename( StyleEntity type, int id, QString newName )
|
||||
@ -613,17 +613,17 @@ void QgsStyleV2::rename( StyleEntity type, int id, QString newName )
|
||||
switch ( type )
|
||||
{
|
||||
case SymbolEntity : query = sqlite3_mprintf( "UPDATE symbol SET name='%q' WHERE id=%d;", nameArray.constData(), id );
|
||||
break;
|
||||
break;
|
||||
case GroupEntity : query = sqlite3_mprintf( "UPDATE symgroup SET name='%q' WHERE id=%d;", nameArray.constData(), id );
|
||||
break;
|
||||
break;
|
||||
case TagEntity : query = sqlite3_mprintf( "UPDATE tag SET name='%q' WHERE id=%d;", nameArray.constData(), id );
|
||||
break;
|
||||
break;
|
||||
case ColorrampEntity : query = sqlite3_mprintf( "UPDATE colorramp SET name='%q' WHERE id=%d;", nameArray.constData(), id );
|
||||
break;
|
||||
break;
|
||||
case SmartgroupEntity : query = sqlite3_mprintf( "UPDATE smartgroup SET name='%q' WHERE id=%d;", nameArray.constData(), id );
|
||||
break;
|
||||
break;
|
||||
default : QgsDebugMsg( "Invalid Style Entity indicated" );
|
||||
return;
|
||||
return;
|
||||
}
|
||||
if ( !runEmptyQuery( query ) )
|
||||
mErrorString = "Could not rename!";
|
||||
@ -641,14 +641,14 @@ char* QgsStyleV2::getGroupRemoveQuery( int id )
|
||||
if ( parentid )
|
||||
{
|
||||
query = sqlite3_mprintf( "UPDATE symbol SET groupid=%d WHERE groupid=%d;"
|
||||
"UPDATE symgroup SET parent=%d WHERE parent=%d;"
|
||||
"DELETE FROM symgroup WHERE id=%d;", parentid, id, parentid, id, id );
|
||||
"UPDATE symgroup SET parent=%d WHERE parent=%d;"
|
||||
"DELETE FROM symgroup WHERE id=%d;", parentid, id, parentid, id, id );
|
||||
}
|
||||
else
|
||||
{
|
||||
query = sqlite3_mprintf( "UPDATE symbol SET groupid=NULL WHERE groupid=%d;"
|
||||
"UPDATE symgroup SET parent=NULL WHERE parent=%d;"
|
||||
"DELETE FROM symgroup WHERE id=%d;", id, id, id );
|
||||
"UPDATE symgroup SET parent=NULL WHERE parent=%d;"
|
||||
"DELETE FROM symgroup WHERE id=%d;", id, id, id );
|
||||
}
|
||||
return query;
|
||||
}
|
||||
@ -659,17 +659,17 @@ void QgsStyleV2::remove( StyleEntity type, int id )
|
||||
switch ( type )
|
||||
{
|
||||
case SymbolEntity : query = sqlite3_mprintf( "DELETE FROM symbol WHERE id=%d; DELETE FROM tagmap WHERE symbol_id=%d;", id, id );
|
||||
break;
|
||||
break;
|
||||
case GroupEntity : query = getGroupRemoveQuery( id );
|
||||
break;
|
||||
break;
|
||||
case TagEntity : query = sqlite3_mprintf( "DELETE FROM tag WHERE id=%d; DELETE FROM tagmap WHERE tag_id=%d;", id, id );
|
||||
break;
|
||||
break;
|
||||
case ColorrampEntity : query = sqlite3_mprintf( "DELETE FROM colorramp WHERE id=%d;", id );
|
||||
break;
|
||||
break;
|
||||
case SmartgroupEntity : query = sqlite3_mprintf( "DELETE FROM smartgroup WHERE id=%d;", id );
|
||||
break;
|
||||
break;
|
||||
default : QgsDebugMsg( "Invalid Style Entity indicated" );
|
||||
return;
|
||||
return;
|
||||
}
|
||||
if ( !runEmptyQuery( query ) )
|
||||
QgsDebugMsg( "Could not delete entity!" );
|
||||
@ -698,14 +698,14 @@ bool QgsStyleV2::group( StyleEntity type, QString name, int groupid )
|
||||
switch ( type )
|
||||
{
|
||||
case SymbolEntity : query = groupid ? sqlite3_mprintf( "UPDATE symbol SET groupid=%d WHERE name='%q';", groupid, array.constData() ) : sqlite3_mprintf( "UPDATE symbol SET groupid=NULL WHERE name='%q';", array.constData() );
|
||||
break;
|
||||
break;
|
||||
case ColorrampEntity : query = groupid ? sqlite3_mprintf( "UPDATE colorramp SET groupid=%d WHERE name='%q';", groupid, array.constData() ) : sqlite3_mprintf( "UPDATE colorramp SET groupid=NULL WHERE name='%q';", array.constData() );
|
||||
break;
|
||||
break;
|
||||
default : QgsDebugMsg( "Wrong entity value. cannot apply group" );
|
||||
break;
|
||||
break;
|
||||
|
||||
}
|
||||
return runEmptyQuery( query );
|
||||
return runEmptyQuery( query );
|
||||
}
|
||||
|
||||
QStringList QgsStyleV2::findSymbols( QString qword )
|
||||
@ -822,7 +822,7 @@ bool QgsStyleV2::detagSymbol( StyleEntity type, QString symbol, QStringList tags
|
||||
QgsDebugMsg( "Sorry! Cannot open database for detgging." );
|
||||
return false;
|
||||
}
|
||||
query = ( type == SymbolEntity) ? sqlite3_mprintf( "SELECT id FROM symbol WHERE name='%q';", array.constData() ) : sqlite3_mprintf( "SELECT id FROM colorramp WHERE name='%q';", array.constData() );
|
||||
query = ( type == SymbolEntity ) ? sqlite3_mprintf( "SELECT id FROM symbol WHERE name='%q';", array.constData() ) : sqlite3_mprintf( "SELECT id FROM colorramp WHERE name='%q';", array.constData() );
|
||||
sqlite3_stmt *ppStmt;
|
||||
int nErr = sqlite3_prepare_v2( mCurrentDB, query, -1, &ppStmt, NULL );
|
||||
if ( nErr == SQLITE_OK && sqlite3_step( ppStmt ) == SQLITE_ROW )
|
||||
@ -852,7 +852,7 @@ bool QgsStyleV2::detagSymbol( StyleEntity type, QString symbol, QStringList tags
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Perform tag cleanup
|
||||
// TODO Perform tag cleanup
|
||||
// check the number of entries for a given tag in the tagmap
|
||||
// if the count is 0, then remove( TagEntity, tagid )
|
||||
return true;
|
||||
@ -955,7 +955,7 @@ int QgsStyleV2::addSmartgroup( QString name, QString op, QgsSmartConditionMap co
|
||||
foreach ( const QString ¶m, parameters )
|
||||
{
|
||||
QDomElement condEl = doc.createElement( "condition" );
|
||||
condEl.setAttribute( "constraint", constraint);
|
||||
condEl.setAttribute( "constraint", constraint );
|
||||
condEl.setAttribute( "param", param );
|
||||
smartEl.appendChild( condEl );
|
||||
}
|
||||
@ -966,7 +966,7 @@ int QgsStyleV2::addSmartgroup( QString name, QString op, QgsSmartConditionMap co
|
||||
smartEl.save( stream, 4 );
|
||||
QByteArray nameArray = name.toUtf8();
|
||||
char *query = sqlite3_mprintf( "INSERT INTO smartgroup VALUES (NULL, '%q', '%q');",
|
||||
nameArray.constData(), xmlArray->constData() );
|
||||
nameArray.constData(), xmlArray->constData() );
|
||||
|
||||
if ( !runEmptyQuery( query ) )
|
||||
{
|
||||
@ -974,14 +974,14 @@ int QgsStyleV2::addSmartgroup( QString name, QString op, QgsSmartConditionMap co
|
||||
}
|
||||
else
|
||||
{
|
||||
sgId = (int)sqlite3_last_insert_rowid( mCurrentDB );
|
||||
sgId = ( int )sqlite3_last_insert_rowid( mCurrentDB );
|
||||
}
|
||||
return sgId;
|
||||
}
|
||||
|
||||
QgsSymbolGroupMap QgsStyleV2::smartgroupsListMap()
|
||||
{
|
||||
if( mCurrentDB == NULL )
|
||||
if ( mCurrentDB == NULL )
|
||||
{
|
||||
QgsDebugMsg( "Cannot open database for listing groups" );
|
||||
return QgsSymbolGroupMap();
|
||||
@ -1008,7 +1008,7 @@ QStringList QgsStyleV2::smartgroupNames()
|
||||
{
|
||||
QStringList groups;
|
||||
|
||||
if( mCurrentDB == NULL )
|
||||
if ( mCurrentDB == NULL )
|
||||
{
|
||||
QgsDebugMsg( "Cannot open database for listing groups" );
|
||||
return QStringList();
|
||||
@ -1088,7 +1088,7 @@ QStringList QgsStyleV2::symbolsOfSmartgroup( StyleEntity type, int id )
|
||||
{
|
||||
resultNames = ( type == SymbolEntity ) ? symbolNames() : colorRampNames();
|
||||
QStringList unwanted = symbolsWithTag( type, tagId( param ) );
|
||||
foreach( QString name, unwanted )
|
||||
foreach ( QString name, unwanted )
|
||||
{
|
||||
resultNames.removeAll( name );
|
||||
}
|
||||
@ -1097,7 +1097,7 @@ QStringList QgsStyleV2::symbolsOfSmartgroup( StyleEntity type, int id )
|
||||
{
|
||||
resultNames = ( type == SymbolEntity ) ? symbolNames() : colorRampNames();
|
||||
QStringList unwanted = symbolsOfGroup( type, groupId( param ) );
|
||||
foreach( QString name, unwanted )
|
||||
foreach ( QString name, unwanted )
|
||||
{
|
||||
resultNames.removeAll( name );
|
||||
}
|
||||
@ -1143,7 +1143,7 @@ QStringList QgsStyleV2::symbolsOfSmartgroup( StyleEntity type, int id )
|
||||
|
||||
QgsSmartConditionMap QgsStyleV2::smartgroup( int id )
|
||||
{
|
||||
if( mCurrentDB == NULL )
|
||||
if ( mCurrentDB == NULL )
|
||||
{
|
||||
QgsDebugMsg( "Cannot open database for listing groups" );
|
||||
return QgsSmartConditionMap();
|
||||
@ -1184,7 +1184,7 @@ QgsSmartConditionMap QgsStyleV2::smartgroup( int id )
|
||||
|
||||
QString QgsStyleV2::smartgroupOperator( int id )
|
||||
{
|
||||
if( mCurrentDB == NULL )
|
||||
if ( mCurrentDB == NULL )
|
||||
{
|
||||
QgsDebugMsg( "Cannot open database for listing groups" );
|
||||
return QString();
|
||||
@ -1242,7 +1242,7 @@ bool QgsStyleV2::exportXML( QString filename )
|
||||
root.appendChild( symbolsElem );
|
||||
root.appendChild( rampsElem );
|
||||
|
||||
// save
|
||||
// save
|
||||
QFile f( filename );
|
||||
if ( !f.open( QFile::WriteOnly ) )
|
||||
{
|
||||
@ -1266,11 +1266,11 @@ bool QgsStyleV2::importXML( QString filename )
|
||||
if ( !f.open( QFile::ReadOnly ) )
|
||||
{
|
||||
mErrorString = "Unable to open the specified file";
|
||||
QgsDebugMsg( "Error opening the style XML file.");
|
||||
QgsDebugMsg( "Error opening the style XML file." );
|
||||
return false;
|
||||
}
|
||||
|
||||
if( !doc.setContent( &f ) )
|
||||
if ( !doc.setContent( &f ) )
|
||||
{
|
||||
mErrorString = QString( "Unable to understand the style file: %1" ).arg( filename );
|
||||
QgsDebugMsg( "XML Parsing error" );
|
||||
|
@ -78,7 +78,7 @@ static void _initWidgetFunctions()
|
||||
|
||||
|
||||
QgsLayerPropertiesWidget::QgsLayerPropertiesWidget( QgsSymbolLayerV2* layer, const QgsSymbolV2* symbol, const QgsVectorLayer* vl, QWidget* parent )
|
||||
: QWidget( parent )
|
||||
: QWidget( parent )
|
||||
{
|
||||
|
||||
mLayer = layer;
|
||||
|
@ -77,7 +77,7 @@ void QgsSmartGroupCondition::hideRemoveButton( bool hide )
|
||||
// Editor Dialog Functions //
|
||||
// ------------------------ //
|
||||
QgsSmartGroupEditorDialog::QgsSmartGroupEditorDialog( QgsStyleV2* style, QWidget* parent )
|
||||
: QDialog( parent ), mStyle( style )
|
||||
: QDialog( parent ), mStyle( style )
|
||||
{
|
||||
setupUi( this );
|
||||
|
||||
@ -128,7 +128,7 @@ void QgsSmartGroupEditorDialog::removeCondition( int id )
|
||||
// hide the remove button of the last condition when 2nd last is removed
|
||||
if ( mConditionMap.count() == 2 )
|
||||
{
|
||||
foreach( QgsSmartGroupCondition* condition, mConditionMap.values() )
|
||||
foreach ( QgsSmartGroupCondition* condition, mConditionMap.values() )
|
||||
{
|
||||
condition->hideRemoveButton( true );
|
||||
}
|
||||
@ -142,7 +142,7 @@ QgsSmartConditionMap QgsSmartGroupEditorDialog::conditionMap()
|
||||
{
|
||||
QgsSmartConditionMap conditions;
|
||||
|
||||
foreach( QgsSmartGroupCondition* condition, mConditionMap.values() )
|
||||
foreach ( QgsSmartGroupCondition* condition, mConditionMap.values() )
|
||||
{
|
||||
conditions.insert( condition->constraint(), condition->parameter() );
|
||||
}
|
||||
@ -161,7 +161,7 @@ void QgsSmartGroupEditorDialog::setConditionMap( QgsSmartConditionMap map )
|
||||
constraints << "tag" << "group" << "name" << "!tag" << "!group" << "!name" ;
|
||||
|
||||
// clear any defaults
|
||||
foreach( int id, mConditionMap.keys() )
|
||||
foreach ( int id, mConditionMap.keys() )
|
||||
{
|
||||
QgsSmartGroupCondition *cond = mConditionMap.take( id );
|
||||
delete cond;
|
||||
|
@ -107,7 +107,7 @@ class GUI_EXPORT QgsSmartGroupEditorDialog : public QDialog, private Ui::QgsSmar
|
||||
// counter for the number of conditions
|
||||
int mCondCount;
|
||||
// map tracking the condition widget and the ids
|
||||
QMap<int,QgsSmartGroupCondition*> mConditionMap;
|
||||
QMap<int, QgsSmartGroupCondition*> mConditionMap;
|
||||
};
|
||||
|
||||
#endif // QGSSMARTGROUPEDITORDIALOG_H
|
||||
|
@ -222,14 +222,14 @@ void QgsStyleV2ExportImportDialog::moveStyles( QModelIndexList* selection, QgsSt
|
||||
while ( nameInvalid )
|
||||
{
|
||||
bool ok;
|
||||
name = QInputDialog::getText( this, tr( "Group Name"),
|
||||
tr( "Please enter a name for new group:" ),
|
||||
QLineEdit::Normal,
|
||||
tr( "imported" ),
|
||||
&ok );
|
||||
name = QInputDialog::getText( this, tr( "Group Name" ),
|
||||
tr( "Please enter a name for new group:" ),
|
||||
QLineEdit::Normal,
|
||||
tr( "imported" ),
|
||||
&ok );
|
||||
if ( !ok )
|
||||
{
|
||||
QMessageBox::warning( this, tr( "New Group"),
|
||||
QMessageBox::warning( this, tr( "New Group" ),
|
||||
tr( "New group cannot be without a name. Kindly enter a name." ) );
|
||||
continue;
|
||||
}
|
||||
@ -237,7 +237,7 @@ void QgsStyleV2ExportImportDialog::moveStyles( QModelIndexList* selection, QgsSt
|
||||
if ( name.isEmpty() )
|
||||
{
|
||||
QMessageBox::warning( this, tr( "New group" ),
|
||||
tr( "Cannot create a group without name. Enter a name." ) );
|
||||
tr( "Cannot create a group without name. Enter a name." ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -410,7 +410,7 @@ void QgsStyleV2ExportImportDialog::browse()
|
||||
if ( type == "file" )
|
||||
{
|
||||
mFileName = QFileDialog::getOpenFileName( this, tr( "Load styles" ), ".",
|
||||
tr( "XML files (*.xml *XML)" ) );
|
||||
tr( "XML files (*.xml *XML)" ) );
|
||||
if ( mFileName.isEmpty() )
|
||||
{
|
||||
return;
|
||||
@ -434,8 +434,8 @@ void QgsStyleV2ExportImportDialog::browse()
|
||||
|
||||
void QgsStyleV2ExportImportDialog::downloadStyleXML( QUrl url )
|
||||
{
|
||||
// XXX Try to move this code to some core Network interface,
|
||||
// HTTP downloading is a generic functionality that might be used elsewhere
|
||||
// XXX Try to move this code to some core Network interface,
|
||||
// HTTP downloading is a generic functionality that might be used elsewhere
|
||||
|
||||
mTempFile = new QTemporaryFile();
|
||||
if ( mTempFile->open() )
|
||||
@ -477,7 +477,7 @@ void QgsStyleV2ExportImportDialog::httpFinished()
|
||||
mFileName = "";
|
||||
mProgressDlg->hide();
|
||||
QMessageBox::information( this, tr( "HTTP Error!" ),
|
||||
tr( "Download failed: %1." ).arg( mNetReply->errorString() ) );
|
||||
tr( "Download failed: %1." ).arg( mNetReply->errorString() ) );
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
@ -83,7 +83,7 @@ QgsStyleV2ManagerDialog::QgsStyleV2ManagerDialog( QgsStyleV2* style, QWidget* pa
|
||||
|
||||
connect( model, SIGNAL( itemChanged( QStandardItem* ) ), this, SLOT( itemChanged( QStandardItem* ) ) );
|
||||
connect( listItems->selectionModel(), SIGNAL( currentChanged( const QModelIndex&, const QModelIndex& ) ),
|
||||
this, SLOT( symbolSelected( const QModelIndex& ) ) );
|
||||
this, SLOT( symbolSelected( const QModelIndex& ) ) );
|
||||
|
||||
populateTypes();
|
||||
|
||||
@ -92,9 +92,9 @@ QgsStyleV2ManagerDialog::QgsStyleV2ManagerDialog( QgsStyleV2* style, QWidget* pa
|
||||
groupTree->setHeaderHidden( true );
|
||||
populateGroups();
|
||||
connect( groupTree->selectionModel(), SIGNAL( currentChanged( const QModelIndex&, const QModelIndex& ) ),
|
||||
this, SLOT( groupChanged( const QModelIndex& ) ) );
|
||||
this, SLOT( groupChanged( const QModelIndex& ) ) );
|
||||
connect( groupModel, SIGNAL( itemChanged( QStandardItem* ) ),
|
||||
this, SLOT( groupRenamed( QStandardItem* ) ) );
|
||||
this, SLOT( groupRenamed( QStandardItem* ) ) );
|
||||
|
||||
QMenu *groupMenu = new QMenu( "Group Actions", this );
|
||||
QAction *groupSymbols = groupMenu->addAction( "Group Symbols" );
|
||||
@ -116,12 +116,12 @@ QgsStyleV2ManagerDialog::QgsStyleV2ManagerDialog( QgsStyleV2* style, QWidget* pa
|
||||
// Context menu for groupTree
|
||||
groupTree->setContextMenuPolicy( Qt::CustomContextMenu );
|
||||
connect( groupTree, SIGNAL( customContextMenuRequested( const QPoint& ) ),
|
||||
this, SLOT( grouptreeContextMenu( const QPoint& ) ) );
|
||||
this, SLOT( grouptreeContextMenu( const QPoint& ) ) );
|
||||
|
||||
// Context menu for listItems
|
||||
listItems->setContextMenuPolicy( Qt::CustomContextMenu );
|
||||
connect( listItems, SIGNAL( customContextMenuRequested( const QPoint& ) ),
|
||||
this, SLOT( listitemsContextMenu( const QPoint& ) ) );
|
||||
this, SLOT( listitemsContextMenu( const QPoint& ) ) );
|
||||
|
||||
}
|
||||
|
||||
@ -311,7 +311,7 @@ bool QgsStyleV2ManagerDialog::addSymbol()
|
||||
while ( nameInvalid )
|
||||
{
|
||||
bool ok;
|
||||
name = QInputDialog::getText( this, tr( "Symbol Name"),
|
||||
name = QInputDialog::getText( this, tr( "Symbol Name" ),
|
||||
tr( "Please enter a name for new symbol:" ),
|
||||
QLineEdit::Normal,
|
||||
tr( "new symbol" ),
|
||||
@ -330,9 +330,9 @@ bool QgsStyleV2ManagerDialog::addSymbol()
|
||||
else if ( mStyle->symbolNames().contains( name ) )
|
||||
{
|
||||
int res = QMessageBox::warning( this, tr( "Save symbol" ),
|
||||
tr( "Symbol with name '%1' already exists. Overwrite?" )
|
||||
.arg( name ),
|
||||
QMessageBox::Yes | QMessageBox::No );
|
||||
tr( "Symbol with name '%1' already exists. Overwrite?" )
|
||||
.arg( name ),
|
||||
QMessageBox::Yes | QMessageBox::No );
|
||||
if ( res == QMessageBox::Yes )
|
||||
{
|
||||
nameInvalid = false;
|
||||
@ -699,7 +699,7 @@ void QgsStyleV2ManagerDialog::buildGroupTree( QStandardItem* &parent )
|
||||
}
|
||||
}
|
||||
|
||||
void QgsStyleV2ManagerDialog::groupChanged( const QModelIndex& index )
|
||||
void QgsStyleV2ManagerDialog::groupChanged( const QModelIndex& index )
|
||||
{
|
||||
QStringList symbolNames;
|
||||
QStringList groupSymbols;
|
||||
@ -721,7 +721,7 @@ void QgsStyleV2ManagerDialog::groupChanged( const QModelIndex& index )
|
||||
}
|
||||
symbolNames = currentItemType() < 3 ? mStyle->symbolNames() : mStyle->colorRampNames();
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
//determine groups and tags
|
||||
if ( index.parent().data( Qt::UserRole + 1 ) == "smartgroups" )
|
||||
@ -734,7 +734,7 @@ void QgsStyleV2ManagerDialog::groupChanged( const QModelIndex& index )
|
||||
}
|
||||
else // then it must be a group
|
||||
{
|
||||
if ( ( !index.data( Qt::UserRole + 1 ).toInt() && ( index.data() == "Ungrouped" ) ) || mGrouppingMode )
|
||||
if (( !index.data( Qt::UserRole + 1 ).toInt() && ( index.data() == "Ungrouped" ) ) || mGrouppingMode )
|
||||
enableGroupInputs( false );
|
||||
else
|
||||
enableGroupInputs( true );
|
||||
@ -756,7 +756,7 @@ void QgsStyleV2ManagerDialog::groupChanged( const QModelIndex& index )
|
||||
{
|
||||
populateColorRamps( symbolNames, mGrouppingMode );
|
||||
}
|
||||
if( mGrouppingMode )
|
||||
if ( mGrouppingMode )
|
||||
setSymbolsChecked( groupSymbols );
|
||||
}
|
||||
|
||||
@ -770,8 +770,8 @@ void QgsStyleV2ManagerDialog::addGroup()
|
||||
if ( parentData == "all" || ( parentIndex.data() == "Ungrouped" && parentData == "0" ) )
|
||||
{
|
||||
int err = QMessageBox::critical( this, tr( "Invalid Selection" ),
|
||||
tr( "The parent group you have selected is not user editable.\n"
|
||||
"Kindly select a user defined Group."));
|
||||
tr( "The parent group you have selected is not user editable.\n"
|
||||
"Kindly select a user defined Group." ) );
|
||||
if ( err )
|
||||
return;
|
||||
}
|
||||
@ -780,8 +780,8 @@ void QgsStyleV2ManagerDialog::addGroup()
|
||||
if ( parentIndex.parent().data( Qt::UserRole + 1 ).toString() == "smartgroups" )
|
||||
{
|
||||
int err = QMessageBox::critical( this, tr( "Operation Not Allowed" ),
|
||||
tr( "Creation of nested Smart Groups are not allowed\n"
|
||||
"Select the 'Smart Group' to create a new group." ) );
|
||||
tr( "Creation of nested Smart Groups are not allowed\n"
|
||||
"Select the 'Smart Group' to create a new group." ) );
|
||||
if ( err )
|
||||
return;
|
||||
}
|
||||
@ -832,8 +832,8 @@ void QgsStyleV2ManagerDialog::removeGroup()
|
||||
if ( data == "all" || data == "groups" || data == "smartgroups" || index.data() == "Ungrouped" )
|
||||
{
|
||||
int err = QMessageBox::critical( this, tr( "Invalid slection" ),
|
||||
tr( "Cannot delete system defined categories.\n"
|
||||
"Kindly select a group or smart group you might want to delete."));
|
||||
tr( "Cannot delete system defined categories.\n"
|
||||
"Kindly select a group or smart group you might want to delete." ) );
|
||||
if ( err )
|
||||
return;
|
||||
}
|
||||
@ -850,7 +850,7 @@ void QgsStyleV2ManagerDialog::removeGroup()
|
||||
if ( item->hasChildren() )
|
||||
{
|
||||
QStandardItem *parent = item->parent();
|
||||
for( int i = 0; i < item->rowCount(); i++ )
|
||||
for ( int i = 0; i < item->rowCount(); i++ )
|
||||
{
|
||||
parent->appendRow( item->takeChild( i ) );
|
||||
}
|
||||
@ -878,8 +878,8 @@ void QgsStyleV2ManagerDialog::groupRenamed( QStandardItem * item )
|
||||
if ( !id )
|
||||
{
|
||||
QMessageBox::critical( this, tr( "Error!" ),
|
||||
tr( "New group could not be created.\n"
|
||||
"There was a problem with your symbol database." ) );
|
||||
tr( "New group could not be created.\n"
|
||||
"There was a problem with your symbol database." ) );
|
||||
item->parent()->removeRow( item->row() );
|
||||
return;
|
||||
}
|
||||
@ -915,18 +915,18 @@ void QgsStyleV2ManagerDialog::groupSymbolsAction()
|
||||
mGrouppingMode = false;
|
||||
senderAction->setText( "Group Symbols" );
|
||||
// disconnect slot which handles regrouping
|
||||
disconnect( model, SIGNAL( itemChanged( QStandardItem* )),
|
||||
this, SLOT( regrouped( QStandardItem* ) ) );
|
||||
disconnect( model, SIGNAL( itemChanged( QStandardItem* ) ),
|
||||
this, SLOT( regrouped( QStandardItem* ) ) );
|
||||
|
||||
// disabel all items except groups in groupTree
|
||||
enableItemsForGroupingMode( true );
|
||||
groupChanged( groupTree->currentIndex() );
|
||||
|
||||
// Finally: Reconnect all Symbol editing functionalities
|
||||
// Finally: Reconnect all Symbol editing functionalities
|
||||
connect( treeModel, SIGNAL( itemChanged( QStandardItem* ) ),
|
||||
this, SLOT( groupRenamed( QStandardItem* ) ) );
|
||||
this, SLOT( groupRenamed( QStandardItem* ) ) );
|
||||
connect( model, SIGNAL( itemChanged( QStandardItem* ) ),
|
||||
this, SLOT( itemChanged( QStandardItem* ) ) );
|
||||
this, SLOT( itemChanged( QStandardItem* ) ) );
|
||||
// Reset the selection mode
|
||||
listItems->setSelectionMode( QAbstractItemView::ExtendedSelection );
|
||||
}
|
||||
@ -935,7 +935,7 @@ void QgsStyleV2ManagerDialog::groupSymbolsAction()
|
||||
bool validGroup = false;
|
||||
// determine whether it is a valid group
|
||||
QModelIndex present = groupTree->currentIndex();
|
||||
while( present.parent().isValid() )
|
||||
while ( present.parent().isValid() )
|
||||
{
|
||||
if ( present.parent().data() == "Groups" )
|
||||
{
|
||||
@ -953,9 +953,9 @@ void QgsStyleV2ManagerDialog::groupSymbolsAction()
|
||||
senderAction->setText( "Finish Grouping" );
|
||||
// Remove all Symbol editing functionalities
|
||||
disconnect( treeModel, SIGNAL( itemChanged( QStandardItem* ) ),
|
||||
this, SLOT( groupRenamed( QStandardItem* ) ) );
|
||||
this, SLOT( groupRenamed( QStandardItem* ) ) );
|
||||
disconnect( model, SIGNAL( itemChanged( QStandardItem* ) ),
|
||||
this, SLOT( itemChanged( QStandardItem* ) ) );
|
||||
this, SLOT( itemChanged( QStandardItem* ) ) );
|
||||
|
||||
// disabel all items except groups in groupTree
|
||||
enableItemsForGroupingMode( false );
|
||||
@ -964,8 +964,8 @@ void QgsStyleV2ManagerDialog::groupSymbolsAction()
|
||||
|
||||
|
||||
// Connect to slot which handles regrouping
|
||||
connect( model, SIGNAL( itemChanged( QStandardItem* )),
|
||||
this, SLOT( regrouped( QStandardItem* ) ) );
|
||||
connect( model, SIGNAL( itemChanged( QStandardItem* ) ),
|
||||
this, SLOT( regrouped( QStandardItem* ) ) );
|
||||
|
||||
// No selection should be possible
|
||||
listItems->setSelectionMode( QAbstractItemView::NoSelection );
|
||||
@ -989,8 +989,8 @@ void QgsStyleV2ManagerDialog::regrouped( QStandardItem *item )
|
||||
regrouped = mStyle->group( type, symbolName, 0 );
|
||||
if ( !regrouped )
|
||||
{
|
||||
int er = QMessageBox::critical( this, tr( "Database Error"),
|
||||
tr( "There was a problem with the Symbols database while regrouping." ) );
|
||||
int er = QMessageBox::critical( this, tr( "Database Error" ),
|
||||
tr( "There was a problem with the Symbols database while regrouping." ) );
|
||||
// call the slot again to get back to normal
|
||||
if ( er )
|
||||
groupSymbolsAction();
|
||||
@ -1000,10 +1000,10 @@ void QgsStyleV2ManagerDialog::regrouped( QStandardItem *item )
|
||||
void QgsStyleV2ManagerDialog::setSymbolsChecked( QStringList symbols )
|
||||
{
|
||||
QStandardItemModel *model = qobject_cast<QStandardItemModel*>( listItems->model() );
|
||||
foreach( const QString symbol, symbols )
|
||||
foreach ( const QString symbol, symbols )
|
||||
{
|
||||
QList<QStandardItem*> items = model->findItems( symbol );
|
||||
foreach( QStandardItem* item, items )
|
||||
foreach ( QStandardItem* item, items )
|
||||
item->setCheckState( Qt::Checked );
|
||||
}
|
||||
}
|
||||
@ -1038,27 +1038,27 @@ void QgsStyleV2ManagerDialog::tagsChanged()
|
||||
return;
|
||||
}
|
||||
// compare old with new to find removed tags
|
||||
foreach( const QString &tag, oldtags )
|
||||
foreach ( const QString &tag, oldtags )
|
||||
{
|
||||
if ( !newtags.contains( tag ) )
|
||||
removetags.append( tag );
|
||||
}
|
||||
if ( removetags.size() > 0 )
|
||||
{
|
||||
foreach( QModelIndex index, indexes )
|
||||
foreach ( QModelIndex index, indexes )
|
||||
{
|
||||
mStyle->detagSymbol( type, index.data().toString(), removetags );
|
||||
}
|
||||
}
|
||||
// compare new with old to find added tags
|
||||
foreach( const QString &tag, newtags )
|
||||
foreach ( const QString &tag, newtags )
|
||||
{
|
||||
if( !oldtags.contains( tag ) )
|
||||
if ( !oldtags.contains( tag ) )
|
||||
addtags.append( tag );
|
||||
}
|
||||
if ( addtags.size() > 0 )
|
||||
{
|
||||
foreach( QModelIndex index, indexes )
|
||||
foreach ( QModelIndex index, indexes )
|
||||
{
|
||||
mStyle->tagSymbol( type, index.data().toString(), addtags );
|
||||
}
|
||||
@ -1095,7 +1095,7 @@ void QgsStyleV2ManagerDialog::enableGroupInputs( bool enable )
|
||||
void QgsStyleV2ManagerDialog::enableItemsForGroupingMode( bool enable )
|
||||
{
|
||||
QStandardItemModel *treeModel = qobject_cast<QStandardItemModel*>( groupTree->model() );
|
||||
for( int i = 0; i < treeModel->rowCount(); i++ )
|
||||
for ( int i = 0; i < treeModel->rowCount(); i++ )
|
||||
{
|
||||
if ( treeModel->item( i )->data() != "groups" )
|
||||
{
|
||||
@ -1110,9 +1110,9 @@ void QgsStyleV2ManagerDialog::enableItemsForGroupingMode( bool enable )
|
||||
treeModel->item( i )->child( k )->setEnabled( enable );
|
||||
}
|
||||
}
|
||||
if( treeModel->item( i )->data() == "smartgroups" )
|
||||
if ( treeModel->item( i )->data() == "smartgroups" )
|
||||
{
|
||||
for( int j = 0; j < treeModel->item( i )->rowCount(); j++ )
|
||||
for ( int j = 0; j < treeModel->item( i )->rowCount(); j++ )
|
||||
{
|
||||
treeModel->item( i )->child( j )->setEnabled( enable );
|
||||
}
|
||||
@ -1177,7 +1177,7 @@ void QgsStyleV2ManagerDialog::listitemsContextMenu( const QPoint& point )
|
||||
groupList->setTitle( "Apply Group" );
|
||||
|
||||
QStringList groups = mStyle->groupNames();
|
||||
foreach( QString group, groups )
|
||||
foreach ( QString group, groups )
|
||||
{
|
||||
groupList->addAction( group );
|
||||
}
|
||||
@ -1200,7 +1200,7 @@ void QgsStyleV2ManagerDialog::listitemsContextMenu( const QPoint& point )
|
||||
groupId = mStyle->groupId( selectedItem->text() );
|
||||
}
|
||||
QModelIndexList indexes = listItems->selectionModel()->selection().indexes();
|
||||
foreach( QModelIndex index, indexes )
|
||||
foreach ( QModelIndex index, indexes )
|
||||
{
|
||||
mStyle->group( type, index.data().toString(), groupId );
|
||||
}
|
||||
@ -1219,7 +1219,7 @@ void QgsStyleV2ManagerDialog::editSmartgroupAction()
|
||||
if ( present.parent().data( Qt::UserRole + 1 ) != "smartgroups" )
|
||||
{
|
||||
QMessageBox::critical( this, tr( "Invalid Selection" ),
|
||||
tr( "You have not selected a Smart Group. Kindly select a Smart Group to edit." ) );
|
||||
tr( "You have not selected a Smart Group. Kindly select a Smart Group to edit." ) );
|
||||
return;
|
||||
}
|
||||
QStandardItem* item = treeModel->itemFromIndex( present );
|
||||
@ -1237,8 +1237,8 @@ void QgsStyleV2ManagerDialog::editSmartgroupAction()
|
||||
int id = mStyle->addSmartgroup( dlg.smartgroupName(), dlg.conditionOperator(), dlg.conditionMap() );
|
||||
if ( !id )
|
||||
{
|
||||
QMessageBox::critical( this, tr( "Database Error!"),
|
||||
tr( "There was some error in editing the smart group." ) );
|
||||
QMessageBox::critical( this, tr( "Database Error!" ),
|
||||
tr( "There was some error in editing the smart group." ) );
|
||||
return;
|
||||
}
|
||||
item->setText( dlg.smartgroupName() );
|
||||
@ -1250,7 +1250,7 @@ void QgsStyleV2ManagerDialog::editSmartgroupAction()
|
||||
bool QgsStyleV2ManagerDialog::eventFilter( QObject *obj, QEvent *event )
|
||||
{
|
||||
|
||||
if ( ( obj == tagsLineEdit ) && ( event->type() == QEvent::FocusOut ) )
|
||||
if (( obj == tagsLineEdit ) && ( event->type() == QEvent::FocusOut ) )
|
||||
{
|
||||
tagsChanged();
|
||||
return true;
|
||||
|
@ -64,7 +64,7 @@ class GUI_EXPORT QgsStyleV2ManagerDialog : public QDialog, private Ui::QgsStyleV
|
||||
//! edit the selected smart group
|
||||
void editSmartgroupAction();
|
||||
|
||||
//! symbol changed from one group
|
||||
//! symbol changed from one group
|
||||
void regrouped( QStandardItem* );
|
||||
|
||||
//! filter the symbols based on input search term
|
||||
|
@ -614,7 +614,7 @@ class QgsSvgGroupsModel : public QStandardItemModel
|
||||
void createTree( QStandardItem* &parentGroup )
|
||||
{
|
||||
QDir parentDir( parentGroup->data().toString() );
|
||||
foreach( QString item, parentDir.entryList( QDir::Dirs | QDir::NoDotAndDotDot ) )
|
||||
foreach ( QString item, parentDir.entryList( QDir::Dirs | QDir::NoDotAndDotDot ) )
|
||||
{
|
||||
QStandardItem* group = new QStandardItem( item );
|
||||
group->setData( QVariant( parentDir.path() + "/" + item ) );
|
||||
|
@ -115,7 +115,7 @@ class SymbolLayerItem : public QStandardItem
|
||||
return QgsSymbolLayerV2Registry::instance()->symbolLayerMetadata( mLayer->layerType() )->visibleName();
|
||||
else
|
||||
{
|
||||
switch( mSymbol->type() )
|
||||
switch ( mSymbol->type() )
|
||||
{
|
||||
case QgsSymbolV2::Marker : return "Symbol: Marker";
|
||||
case QgsSymbolV2::Fill : return "Symbol: Fill";
|
||||
@ -230,7 +230,7 @@ void QgsSymbolV2SelectorDialog::loadSymbol( QgsSymbolV2* symbol, SymbolLayerItem
|
||||
loadSymbol( symbol->symbolLayer( i )->subSymbol(), layerItem );
|
||||
}
|
||||
}
|
||||
layersTree->setExpanded( symbolItem->index(), true);
|
||||
layersTree->setExpanded( symbolItem->index(), true );
|
||||
}
|
||||
|
||||
|
||||
@ -254,7 +254,7 @@ void QgsSymbolV2SelectorDialog::updateUi()
|
||||
btnRemoveLayer->setEnabled( false );
|
||||
btnLock->setEnabled( false );
|
||||
btnAddLayer->setEnabled( true );
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
int rowCount = item->parent()->rowCount();
|
||||
@ -322,7 +322,7 @@ void QgsSymbolV2SelectorDialog::layerChanged()
|
||||
if ( currentItem->isLayer() )
|
||||
{
|
||||
SymbolLayerItem *parent = static_cast<SymbolLayerItem*>( currentItem->parent() );
|
||||
QWidget *layerProp = new QgsLayerPropertiesWidget( currentItem->layer(), parent->symbol(), mVectorLayer);
|
||||
QWidget *layerProp = new QgsLayerPropertiesWidget( currentItem->layer(), parent->symbol(), mVectorLayer );
|
||||
setWidget( layerProp );
|
||||
connect( layerProp, SIGNAL( changed() ), this, SLOT( updateLayerPreview() ) );
|
||||
// This connection when layer type is changed
|
||||
@ -330,7 +330,7 @@ void QgsSymbolV2SelectorDialog::layerChanged()
|
||||
}
|
||||
else
|
||||
{
|
||||
// then it must be a symbol
|
||||
// then it must be a symbol
|
||||
// Now populate symbols of that type using the symbols list widget:
|
||||
QWidget *symbolsList = new QgsSymbolsListWidget( currentItem->symbol(), mStyle, mAdvancedMenu );
|
||||
setWidget( symbolsList );
|
||||
@ -398,7 +398,7 @@ void QgsSymbolV2SelectorDialog::addLayer()
|
||||
SymbolLayerItem *item = static_cast<SymbolLayerItem*>( model->itemFromIndex( idx ) );
|
||||
if ( item->isLayer() )
|
||||
{
|
||||
QMessageBox::critical( this, tr( "Invalid Selection!" ), tr( "Kindly select a symbol to add layer.") );
|
||||
QMessageBox::critical( this, tr( "Invalid Selection!" ), tr( "Kindly select a symbol to add layer." ) );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -450,7 +450,7 @@ void QgsSymbolV2SelectorDialog::moveLayerUp()
|
||||
void QgsSymbolV2SelectorDialog::moveLayerByOffset( int offset )
|
||||
{
|
||||
SymbolLayerItem *item = currentLayerItem();
|
||||
if( item == NULL )
|
||||
if ( item == NULL )
|
||||
return;
|
||||
int row = item->row();
|
||||
|
||||
|
@ -162,7 +162,7 @@ void QgsWmsProvider::parseUri( QString uriString )
|
||||
if ( uri.hasParam( "tileDimensions" ) )
|
||||
{
|
||||
mTiled = true;
|
||||
foreach( QString param, uri.params( "tileDimensions" ) )
|
||||
foreach ( QString param, uri.params( "tileDimensions" ) )
|
||||
{
|
||||
QStringList kv = param.split( "=" );
|
||||
if ( kv.size() == 1 )
|
||||
@ -344,7 +344,7 @@ void QgsWmsProvider::addLayers( QStringList const &layers,
|
||||
mActiveSubStyles += styles;
|
||||
|
||||
// Set the visibility of these new layers on by default
|
||||
foreach( const QString &layer, layers )
|
||||
foreach ( const QString &layer, layers )
|
||||
{
|
||||
mActiveSubLayerVisibility[ layer ] = true;
|
||||
QgsDebugMsg( "set visibility of layer '" + layer + "' to true." );
|
||||
@ -465,7 +465,7 @@ void QgsWmsProvider::setImageCrs( QString const & crs )
|
||||
mTileMatrixSet = &mTileMatrixSets[ mTileMatrixSetId ];
|
||||
QList<double> keys = mTileMatrixSet->tileMatrices.keys();
|
||||
qSort( keys );
|
||||
foreach( double key, keys )
|
||||
foreach ( double key, keys )
|
||||
{
|
||||
resolutions << key;
|
||||
}
|
||||
@ -953,7 +953,7 @@ void QgsWmsProvider::tileReplyFinished()
|
||||
#endif
|
||||
#if defined(QGISDEBUG) && (QT_VERSION >= 0x40700)
|
||||
QgsDebugMsgLevel( "raw headers:", 3 );
|
||||
foreach( const QNetworkReply::RawHeaderPair &pair, reply->rawHeaderPairs() )
|
||||
foreach ( const QNetworkReply::RawHeaderPair &pair, reply->rawHeaderPairs() )
|
||||
{
|
||||
QgsDebugMsgLevel( QString( " %1:%2" )
|
||||
.arg( QString::fromUtf8( pair.first ) )
|
||||
@ -964,7 +964,7 @@ void QgsWmsProvider::tileReplyFinished()
|
||||
QNetworkCacheMetaData cmd = QgsNetworkAccessManager::instance()->cache()->metaData( reply->request().url() );
|
||||
|
||||
QNetworkCacheMetaData::RawHeaderList hl;
|
||||
foreach( const QNetworkCacheMetaData::RawHeader &h, cmd.rawHeaders() )
|
||||
foreach ( const QNetworkCacheMetaData::RawHeader &h, cmd.rawHeaders() )
|
||||
{
|
||||
if ( h.first != "Cache-Control" )
|
||||
hl.append( h );
|
||||
@ -2132,7 +2132,7 @@ void QgsWmsProvider::parseLayer( QDomElement const & e, QgsWmsLayerProperty& lay
|
||||
{
|
||||
// CRS can contain several definitions separated by whitespace
|
||||
// though this was deprecated in WMS 1.1.1
|
||||
foreach( QString srs, e1.text().split( QRegExp( "\\s+" ) ) )
|
||||
foreach ( QString srs, e1.text().split( QRegExp( "\\s+" ) ) )
|
||||
{
|
||||
layerProperty.crs.push_back( srs );
|
||||
}
|
||||
@ -2423,7 +2423,7 @@ void QgsWmsProvider::parseTileSetProfile( QDomElement const &e )
|
||||
m.topLeft = QgsPoint( l.boundingBox.box.xMinimum(), l.boundingBox.box.yMaximum() );
|
||||
|
||||
int i = 0;
|
||||
foreach( QString rS, resolutions )
|
||||
foreach ( QString rS, resolutions )
|
||||
{
|
||||
double r = rS.toDouble();
|
||||
m.identifier = QString::number( i );
|
||||
@ -2712,7 +2712,7 @@ void QgsWmsProvider::parseWMTSContents( QDomElement const &e )
|
||||
|
||||
bool isValid = false;
|
||||
int matrixWidth = -1, matrixHeight = -1;
|
||||
foreach( const QgsWmtsTileMatrix &m, tms.tileMatrices )
|
||||
foreach ( const QgsWmtsTileMatrix &m, tms.tileMatrices )
|
||||
{
|
||||
isValid = m.identifier == id;
|
||||
if ( isValid )
|
||||
@ -3145,7 +3145,7 @@ int QgsWmsProvider::capabilities() const
|
||||
|
||||
if ( canIdentify )
|
||||
{
|
||||
foreach( QString f, mCapabilities.capability.request.getFeatureInfo.format )
|
||||
foreach ( QString f, mCapabilities.capability.request.getFeatureInfo.format )
|
||||
{
|
||||
if ( mSupportedGetFeatureFormats.contains( f ) )
|
||||
{
|
||||
@ -3586,7 +3586,7 @@ QString QgsWmsProvider::metadata()
|
||||
metadata += "<tr><td>";
|
||||
metadata += "<table width=\"100%\">";
|
||||
|
||||
foreach( const QgsWmtsTileLayer &l, mTileLayersSupported )
|
||||
foreach ( const QgsWmtsTileLayer &l, mTileLayersSupported )
|
||||
{
|
||||
metadata += "<tr><td colspan=\"2\">";
|
||||
metadata += l.identifier;
|
||||
@ -3629,7 +3629,7 @@ QString QgsWmsProvider::metadata()
|
||||
metadata += "</td>";
|
||||
metadata += "<td class=\"glossy\">";
|
||||
QStringList styles;
|
||||
foreach( const QgsWmtsStyle &style, l.styles )
|
||||
foreach ( const QgsWmtsStyle &style, l.styles )
|
||||
{
|
||||
styles << style.identifier;
|
||||
}
|
||||
@ -3655,7 +3655,7 @@ QString QgsWmsProvider::metadata()
|
||||
metadata += tr( "Available Tilesets" );
|
||||
metadata += "</td><td class=\"glossy\">";
|
||||
|
||||
foreach( const QgsWmtsTileMatrixSetLink &setLink, l.setLinks )
|
||||
foreach ( const QgsWmtsTileMatrixSetLink &setLink, l.setLinks )
|
||||
{
|
||||
metadata += setLink.tileMatrixSet + "<br>";
|
||||
}
|
||||
@ -3838,7 +3838,7 @@ QString QgsWmsProvider::identifyAsHtml( const QgsPoint &point )
|
||||
{
|
||||
QString format;
|
||||
|
||||
foreach( QString f, mSupportedGetFeatureFormats )
|
||||
foreach ( QString f, mSupportedGetFeatureFormats )
|
||||
{
|
||||
if ( mCapabilities.capability.request.getFeatureInfo.format.contains( f ) )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user