mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
identation update
This commit is contained in:
parent
3d91663353
commit
df4360b0c8
@ -32,7 +32,7 @@ class QgsFieldComboBox : QComboBox
|
||||
public slots:
|
||||
//! set the layer of which the fields are listed
|
||||
void setLayer( QgsVectorLayer* layer );
|
||||
|
||||
|
||||
//! convenience slot to connect QgsMapLayerComboBox layer signal
|
||||
void setLayer( QgsMapLayer* layer );
|
||||
|
||||
|
@ -27,16 +27,16 @@ class QgsFieldExpressionWidget : QWidget
|
||||
QgsVectorLayer* layer();
|
||||
|
||||
signals:
|
||||
//! the signal is emitted when the currently selected field changes
|
||||
void fieldChanged( QString fieldName );
|
||||
|
||||
//! the signal is emitted when the currently selected field changes
|
||||
void fieldChanged( QString fieldName );
|
||||
|
||||
//! fieldChanged signal with indication of the validity of the expression
|
||||
void fieldChanged( QString fieldName, bool isValid );
|
||||
|
||||
public slots:
|
||||
//! set the layer used to display the fields and expression
|
||||
void setLayer( QgsVectorLayer* layer );
|
||||
|
||||
|
||||
//! convenience slot to connect QgsMapLayerComboBox layer signal
|
||||
void setLayer( QgsMapLayer* layer );
|
||||
|
||||
|
@ -28,7 +28,7 @@ class QgsFieldModel : QAbstractItemModel
|
||||
|
||||
//! return the index corresponding to a given fieldName
|
||||
QModelIndex indexFromName( QString fieldName );
|
||||
|
||||
|
||||
//! returns the currently used layer
|
||||
void setAllowExpression( bool allowExpression );
|
||||
bool allowExpression();
|
||||
@ -38,7 +38,7 @@ class QgsFieldModel : QAbstractItemModel
|
||||
* @return the model index of the newly added expression
|
||||
*/
|
||||
QModelIndex setExpression( QString expression );
|
||||
|
||||
|
||||
//! remove expressions from the model
|
||||
void removeExpression();
|
||||
|
||||
@ -48,10 +48,10 @@ class QgsFieldModel : QAbstractItemModel
|
||||
public slots:
|
||||
//! set the layer of whch fields are displayed
|
||||
void setLayer( QgsVectorLayer *layer );
|
||||
|
||||
|
||||
protected slots:
|
||||
virtual void updateModel();
|
||||
|
||||
|
||||
// QAbstractItemModel interface
|
||||
public:
|
||||
QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const;
|
||||
|
@ -354,7 +354,7 @@ class QgsMapCanvas : QGraphicsView
|
||||
|
||||
//! Emit map tool changed event
|
||||
void mapToolSet( QgsMapTool *tool );
|
||||
|
||||
|
||||
//! Emit map tool changed with the old tool
|
||||
//! @note added in 2.3
|
||||
void mapToolSet( QgsMapTool *newTool, QgsMapTool* oldTool );
|
||||
|
@ -105,7 +105,7 @@ class QgsMapTool : QObject
|
||||
|
||||
//! returns pointer to the tool's map canvas
|
||||
QgsMapCanvas* canvas();
|
||||
|
||||
|
||||
/** return the tool name
|
||||
* @note added in 2.3
|
||||
*/
|
||||
|
@ -142,10 +142,10 @@ class ProcessingConfig:
|
||||
|
||||
|
||||
@staticmethod
|
||||
def readSettings():
|
||||
def readSettings():
|
||||
for setting in ProcessingConfig.settings.values():
|
||||
setting.read()
|
||||
|
||||
|
||||
|
||||
@staticmethod
|
||||
def getSetting(name):
|
||||
@ -177,15 +177,15 @@ class Setting:
|
||||
self.value = default
|
||||
self.hidden = hidden
|
||||
self.valuetype = valuetype
|
||||
|
||||
|
||||
def read(self):
|
||||
qsettings = QSettings()
|
||||
qsettings = QSettings()
|
||||
value = qsettings.value(self.qname, None)
|
||||
if value is not None:
|
||||
if isinstance(self.value, bool):
|
||||
value = str(value).lower() == str(True).lower()
|
||||
self.value = value
|
||||
|
||||
|
||||
def save(self):
|
||||
QSettings().setValue(self.qname, self.value)
|
||||
|
||||
|
@ -52,7 +52,7 @@ class ScriptEditorDialog(QDialog, Ui_DlgScriptEditor):
|
||||
|
||||
SCRIPT_PYTHON = 0
|
||||
SCRIPT_R = 1
|
||||
|
||||
|
||||
hasChanged = False
|
||||
|
||||
def __init__(self, algType, alg):
|
||||
@ -101,7 +101,7 @@ class ScriptEditorDialog(QDialog, Ui_DlgScriptEditor):
|
||||
|
||||
self.update = False
|
||||
self.help = None
|
||||
|
||||
|
||||
self.setHasChanged(False)
|
||||
|
||||
self.editor.setLexerType(self.algType)
|
||||
@ -177,7 +177,7 @@ class ScriptEditorDialog(QDialog, Ui_DlgScriptEditor):
|
||||
def setHasChanged(self, hasChanged):
|
||||
self.hasChanged = hasChanged
|
||||
self.btnSave.setEnabled(hasChanged)
|
||||
|
||||
|
||||
def runAlgorithm(self):
|
||||
if self.algType == self.SCRIPT_PYTHON:
|
||||
alg = ScriptAlgorithm(None, unicode(self.editor.text()))
|
||||
|
@ -41,7 +41,7 @@ class AddModelFromFileAction(ToolboxAction):
|
||||
|
||||
def getIcon(self):
|
||||
return QtGui.QIcon(os.path.dirname(__file__) + '/../images/model.png')
|
||||
|
||||
|
||||
def execute(self):
|
||||
filename = QtGui.QFileDialog.getOpenFileName(self.toolbox, 'model files', None,
|
||||
'*.model')
|
||||
|
@ -40,7 +40,7 @@ class AddScriptFromFileAction(ToolboxAction):
|
||||
|
||||
def getIcon(self):
|
||||
return QtGui.QIcon(':/processing/images/script.png')
|
||||
|
||||
|
||||
def execute(self):
|
||||
filename = QtGui.QFileDialog.getOpenFileName(self.toolbox, 'Script files', None,
|
||||
'*.py')
|
||||
|
@ -10,24 +10,24 @@ from PyQt4.QtCore import *
|
||||
from processing.core.VectorWriter import VectorWriter
|
||||
|
||||
|
||||
def create_points(feat):
|
||||
geom = feat.geometry()
|
||||
def create_points(feat):
|
||||
geom = feat.geometry()
|
||||
length = geom.length()
|
||||
currentdistance = 0
|
||||
|
||||
if endpoint > 0:
|
||||
length = endpoint
|
||||
|
||||
|
||||
out = QgsFeature()
|
||||
|
||||
while startpoint + currentdistance <= length:
|
||||
point = geom.interpolate(startpoint + currentdistance)
|
||||
while startpoint + currentdistance <= length:
|
||||
point = geom.interpolate(startpoint + currentdistance)
|
||||
currentdistance = currentdistance + distance
|
||||
out.setGeometry(point)
|
||||
attrs = feat.attributes()
|
||||
attrs.append(currentdistance)
|
||||
out.setGeometry(point)
|
||||
attrs = feat.attributes()
|
||||
attrs.append(currentdistance)
|
||||
out.setAttributes(attrs)
|
||||
writer.addFeature(out)
|
||||
writer.addFeature(out)
|
||||
|
||||
|
||||
layer = processing.getObject(lines)
|
||||
@ -39,7 +39,7 @@ writer = VectorWriter(output, None, fields, QGis.WKBPoint,
|
||||
feats = processing.features(layer)
|
||||
nFeat = len(feats)
|
||||
for i, feat in enumerate(feats):
|
||||
progress.setPercentage(int(100 * i / nFeat))
|
||||
progress.setPercentage(int(100 * i / nFeat))
|
||||
create_points(feat)
|
||||
|
||||
del writer
|
||||
|
@ -28,7 +28,7 @@ for i in xrange(1, bands + 1):
|
||||
|
||||
# create dictionary for unique values count
|
||||
count = {}
|
||||
|
||||
|
||||
# count unique values for the given band
|
||||
for col in range( xsize ):
|
||||
for row in range( ysize ):
|
||||
@ -37,7 +37,7 @@ for i in xrange(1, bands + 1):
|
||||
# check if cell_value is NaN
|
||||
if math.isnan(cell_value):
|
||||
cell_value = 'Null'
|
||||
|
||||
|
||||
# round floats if needed
|
||||
elif round_values_to_ndigits:
|
||||
try:
|
||||
@ -51,12 +51,11 @@ for i in xrange(1, bands + 1):
|
||||
except:
|
||||
count[cell_value] = 1
|
||||
|
||||
# print results sorted by cell_value
|
||||
# print results sorted by cell_value
|
||||
for key in sorted(count.iterkeys()):
|
||||
line = "<TD>%s</TD> <TD>%s</TD> <TD>%s</TD>" %(i, key, count[key])
|
||||
f.write('<TR>'+ line + '</TR>' + '\n')
|
||||
|
||||
|
||||
f.write('</TABLE>')
|
||||
f.close
|
||||
|
||||
|
@ -284,9 +284,10 @@ void QgsComposerManager::openLocalDirectory( const QString& localDirPath )
|
||||
}
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
void QgsComposerManager::showEvent(QShowEvent* event)
|
||||
void QgsComposerManager::showEvent( QShowEvent* event )
|
||||
{
|
||||
if(!event->spontaneous()) {
|
||||
if ( !event->spontaneous() )
|
||||
{
|
||||
QgisApp::instance()->addWindow( mWindowAction );
|
||||
}
|
||||
}
|
||||
|
@ -54,8 +54,8 @@ class QgsComposerManager: public QDialog, private Ui::QgsComposerManagerBase
|
||||
QString mUserTemplatesDir;
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
void showEvent(QShowEvent *event);
|
||||
void changeEvent(QEvent *);
|
||||
void showEvent( QShowEvent *event );
|
||||
void changeEvent( QEvent * );
|
||||
|
||||
QAction* mWindowAction;
|
||||
#endif
|
||||
|
@ -1229,7 +1229,7 @@ void QgisApp::showPythonDialog()
|
||||
{
|
||||
QString className, text;
|
||||
mPythonUtils->getError( className, text );
|
||||
messageBar()->pushMessage( tr( "Error" ), tr( "Failed to open Python console:" ) + "\n" + className + ": " + text, QgsMessageBar::WARNING);
|
||||
messageBar()->pushMessage( tr( "Error" ), tr( "Failed to open Python console:" ) + "\n" + className + ": " + text, QgsMessageBar::WARNING );
|
||||
}
|
||||
#ifdef Q_WS_MAC
|
||||
else
|
||||
|
@ -1101,7 +1101,7 @@ void QgsIdentifyResultsDialog::handleCurrentItemChanged( QTreeWidgetItem *curren
|
||||
mOpenFormButton->setEnabled( featItem && featItem->feature().isValid() );
|
||||
|
||||
QgsVectorLayer *vlayer = vectorLayer( current );
|
||||
if( vlayer )
|
||||
if ( vlayer )
|
||||
{
|
||||
mOpenFormButton->setToolTip( vlayer->isEditable() ? tr( "Edit feature form" ) : tr( "View feature form" ) );
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ void QgsMapTool::deactivate()
|
||||
|
||||
void QgsMapTool::setAction( QAction* action )
|
||||
{
|
||||
if( mAction )
|
||||
if ( mAction )
|
||||
disconnect( mAction, SIGNAL( destroyed() ), this, SLOT( actionDestroyed() ) );
|
||||
mAction = action;
|
||||
connect( mAction, SIGNAL( destroyed() ), this, SLOT( actionDestroyed() ) );
|
||||
@ -106,7 +106,7 @@ void QgsMapTool::setAction( QAction* action )
|
||||
|
||||
void QgsMapTool::actionDestroyed()
|
||||
{
|
||||
if( mAction == sender() )
|
||||
if ( mAction == sender() )
|
||||
mAction = 0;
|
||||
}
|
||||
|
||||
|
@ -7,8 +7,8 @@
|
||||
#include <QPushButton>
|
||||
|
||||
QgsDataDefinedSymbolDialog::QgsDataDefinedSymbolDialog( const QList< DataDefinedSymbolEntry >& entries, const QgsVectorLayer* vl, QWidget * parent, Qt::WindowFlags f )
|
||||
: QDialog( parent, f )
|
||||
, mVectorLayer( vl )
|
||||
: QDialog( parent, f )
|
||||
, mVectorLayer( vl )
|
||||
{
|
||||
setupUi( this );
|
||||
|
||||
@ -159,7 +159,7 @@ int QgsDataDefinedSymbolDialog::comboIndexForExpressionString( const QString& ex
|
||||
{
|
||||
QString attributeString = expr.trimmed();
|
||||
int comboIndex = cb->findText( attributeString );
|
||||
if ( comboIndex == -1 && attributeString.startsWith( '"' ) && attributeString.endsWith( '"') )
|
||||
if ( comboIndex == -1 && attributeString.startsWith( '"' ) && attributeString.endsWith( '"' ) )
|
||||
{
|
||||
attributeString.remove( 0, 1 ).chop( 1 );
|
||||
comboIndex = cb->findText( attributeString );
|
||||
|
Loading…
x
Reference in New Issue
Block a user