Skip to content
Permalink
Browse files

indentation update

  • Loading branch information
jef-n committed Sep 5, 2015
1 parent 2b0225b commit 53c84915e97d1efeea432e7ed3972f3ff44459ea
@@ -517,8 +517,8 @@ def dropMimeData(self, data, action, row, column, parent):

# vectors/tables to be imported must be dropped on connected db, schema or table
canImportLayer = self.isImportVectorAvail and parent.isValid() and \
( isinstance(parent.internalPointer(), (SchemaItem, TableItem)) or \
( isinstance(parent.internalPointer(), ConnectionItem) and parent.internalPointer().populated ) )
(isinstance(parent.internalPointer(), (SchemaItem, TableItem)) or
(isinstance(parent.internalPointer(), ConnectionItem) and parent.internalPointer().populated))

added = 0

@@ -165,7 +165,7 @@ def databasesFactory(self, connection, uri):

@classmethod
def addConnectionActionSlot(self, item, action, parent):
raise NotImplemented
raise NotImplemented

def removeActionSlot(self, item, action, parent):
QApplication.restoreOverrideCursor()
@@ -87,7 +87,6 @@ def addConnection(self, conn_name, uri):
settings.setValue("sqlitepath", uri.database())
return True


@classmethod
def addConnectionActionSlot(self, item, action, parent, index):
QApplication.restoreOverrideCursor()
@@ -105,7 +104,6 @@ def addConnectionActionSlot(self, item, action, parent, index):
index.internalPointer().emit(SIGNAL('itemChanged'), index.internalPointer())



class SLDatabase(Database):

def __init__(self, connection, uri):
@@ -178,4 +178,3 @@ def reconnect(self):
db = self.currentDatabase()
if db is not None:
self.mainWindow.invokeCallback(db.reconnectActionSlot)

@@ -76,7 +76,7 @@ class APP_EXPORT QgsOptions : public QgsOptionsDialogBase, private Ui::QgsOption

void iconSizeChanged( const QString &iconSize );

void uiThemeChanged(const QString &theme );
void uiThemeChanged( const QString &theme );

/** Slot to handle when type of project to open after launch is changed
*/
@@ -95,13 +95,13 @@ class CORE_EXPORT QgsGeometryUtils
static QDomElement pointsToGML3( const QList<QgsPointV2>& points, QDomDocument &doc, int precision, const QString& ns, bool is3D );
/** Returns a geoJSON coordinates string */
static QString pointsToJSON( const QList<QgsPointV2>& points, int precision );
/**Calculates direction of line (clockwise from north direction) in radians*/
/** Calculates direction of line (clockwise from north direction) in radians*/
static double lineAngle( double x1, double y1, double x2, double y2 );
/**Calculates angle perpendicular to line*/
/** Calculates angle perpendicular to line*/
static double linePerpendicularAngle( double x1, double y1, double x2, double y2 );
/**Angle between two linear segments*/
/** Angle between two linear segments*/
static double averageAngle( double x1, double y1, double x2, double y2, double x3, double y3 );
/**Averages two angles*/
/** Averages two angles*/
static double averageAngle( double a1, double a2 );


@@ -428,7 +428,7 @@ void QgsApplication::setUITheme( const QString &themeName )
// Loop all style sheets, find matching name, load it.
QHash<QString, QString> themes = QgsApplication::uiThemes();
QString themename = themeName;
if (!themes.contains(themename))
if ( !themes.contains( themename ) )
themename = "default";

QString path = themes[themename];
@@ -516,7 +516,7 @@ QgsRuleBasedRendererV2::Rule::RenderResult QgsRuleBasedRendererV2::Rule::renderF
if ( mSymbol && mIsActive )
{
// add job to the queue: each symbol's zLevel must be added
Q_FOREACH( int normZLevel, mSymbolNormZLevels )
Q_FOREACH ( int normZLevel, mSymbolNormZLevels )
{
//QgsDebugMsg(QString("add job at level %1").arg(normZLevel));
renderQueue[normZLevel].jobs.append( new RenderJob( featToRender, mSymbol ) );
@@ -527,7 +527,7 @@ QgsRuleBasedRendererV2::Rule::RenderResult QgsRuleBasedRendererV2::Rule::renderF
bool willrendersomething = false;

// process children
Q_FOREACH( Rule* rule, mChildren )
Q_FOREACH ( Rule* rule, mChildren )
{
// Don't process else rules yet
if ( !rule->isElse() )
@@ -26,7 +26,7 @@
QgsRendererV2Widget::QgsRendererV2Widget( QgsVectorLayer* layer, QgsStyleV2* style )
: QWidget(), mLayer( layer ), mStyle( style )
{
contextMenu = new QMenu( tr("Renderer Options"), this );
contextMenu = new QMenu( tr( "Renderer Options" ), this );

mCopyAction = contextMenu->addAction( tr( "Copy" ), this, SLOT( copy() ) );
mCopyAction->setShortcut( QKeySequence( QKeySequence::Copy ) );
@@ -1554,47 +1554,47 @@ class QgsSvgListModel : public QAbstractListModel
{
Q_UNUSED( parent );
return mSvgFiles.count();
}
}

QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const override
{
QString entry = mSvgFiles.at( index.row() );

if ( role == Qt::DecorationRole ) // icon
{
QPixmap pixmap;
if ( !QPixmapCache::find( entry, pixmap ) )
{
// render SVG file
QColor fill, outline;
double outlineWidth;
bool fillParam, outlineParam, outlineWidthParam;
QgsSvgCache::instance()->containsParams( entry, fillParam, fill, outlineParam, outline, outlineWidthParam, outlineWidth );

bool fitsInCache; // should always fit in cache at these sizes (i.e. under 559 px ^ 2, or half cache size)
const QImage& img = QgsSvgCache::instance()->svgAsImage( entry, 30.0, fill, outline, outlineWidth, 3.5 /*appr. 88 dpi*/, 1.0, fitsInCache );
pixmap = QPixmap::fromImage( img );
QPixmapCache::insert( entry, pixmap );
QPixmap pixmap;
if ( !QPixmapCache::find( entry, pixmap ) )
{
// render SVG file
QColor fill, outline;
double outlineWidth;
bool fillParam, outlineParam, outlineWidthParam;
QgsSvgCache::instance()->containsParams( entry, fillParam, fill, outlineParam, outline, outlineWidthParam, outlineWidth );

bool fitsInCache; // should always fit in cache at these sizes (i.e. under 559 px ^ 2, or half cache size)
const QImage& img = QgsSvgCache::instance()->svgAsImage( entry, 30.0, fill, outline, outlineWidth, 3.5 /*appr. 88 dpi*/, 1.0, fitsInCache );
pixmap = QPixmap::fromImage( img );
QPixmapCache::insert( entry, pixmap );
}

return pixmap;
}
else if ( role == Qt::UserRole || role == Qt::ToolTipRole )
{
return entry;
}

return pixmap;
return QVariant();
}
else if ( role == Qt::UserRole || role == Qt::ToolTipRole )
{
return entry;
}

return QVariant();
}

protected:
QStringList mSvgFiles;
protected:
QStringList mSvgFiles;
};

class QgsSvgGroupsModel : public QStandardItemModel
{
public:
QgsSvgGroupsModel( QObject* parent ) : QStandardItemModel( parent )
public:
QgsSvgGroupsModel( QObject* parent ) : QStandardItemModel( parent )
{
QStringList svgPaths = QgsApplication::svgPaths();
QStandardItem *parentItem = invisibleRootItem();
@@ -183,12 +183,12 @@ QgsSpatiaLiteProvider::createEmptyLayer(
}
else
{
// if the pk field's type is bigint, use the autoincremental
// integer type instead
if ( primaryKeyType == "BIGINT" )
{
primaryKeyType = "INTEGER";
}
// if the pk field's type is bigint, use the autoincremental
// integer type instead
if ( primaryKeyType == "BIGINT" )
{
primaryKeyType = "INTEGER";
}
}

try

0 comments on commit 53c8491

Please sign in to comment.
You can’t perform that action at this time.