4 changes: 2 additions & 2 deletions python/plugins/processing/otb/OTBUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
(C) 2013 by CS Systemes d'information (CS SI)
Email : volayaf at gmail dot com
otb at c-s dot fr (CS SI)
Contributors : Victor Olaya
Contributors : Victor Olaya
Julien Malik, Oscar Picas (CS SI) - add functions to manage xml tree
Alexia Mondot (CS SI) - add a trick for OTBApplication SplitImages
***************************************************************************
Expand Down Expand Up @@ -136,7 +136,7 @@ def executeOtb(commands, progress):
else:
loglines.append(line)
progress.setConsoleInfo(line)

ProcessingLog.addToLog(ProcessingLog.LOG_INFO, loglines)


Expand Down
24 changes: 12 additions & 12 deletions python/plugins/processing/otb/maintenance/OTBHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,16 +233,16 @@ def get_param_descriptor(appkey, app_instance, our_descriptor, root):
our_type = parameters[app_instance.GetParameterType(our_descriptor)]

#get the list of mapped parameters (otb/processing)
inverted_parameters = get_inverted_parameters()
inverted_parameters = get_inverted_parameters()

mapped_parameter = inverted_parameters[our_type]

file_parameter = retrieve_module_name(mapped_parameter)

if not file_parameter:
logger.info("Type %s is not handled yet. (%s, %s)" % (our_type, appkey, our_descriptor))
return

param = ET.SubElement(root, 'parameter')
attrs = {'source_parameter_type' : parameters[app_instance.GetParameterType(our_descriptor)]}
if appkey == "Segmentation" :
Expand All @@ -254,7 +254,7 @@ def get_param_descriptor(appkey, app_instance, our_descriptor, root):
if appkey == "SplitImage" :
if parameters[app_instance.GetParameterType(our_descriptor)] == "ParameterType_OutputImage" :
attrs = {'source_parameter_type' : 'ParameterType_OutputFilename'}

param_type = ET.SubElement(param, 'parameter_type', attrib = attrs)

param_type.text = inverted_parameters[parameters[app_instance.GetParameterType(our_descriptor)]]
Expand All @@ -267,7 +267,7 @@ def get_param_descriptor(appkey, app_instance, our_descriptor, root):
if appkey == "SplitImage" :
if parameters[app_instance.GetParameterType(our_descriptor)] == "ParameterType_OutputImage" :
param_type.text = "OutputFile"

the_params = get_constructor_parameters_from_filename(file_parameter)
if len(the_params) == 0:
if 'Output' in file_parameter:
Expand All @@ -276,12 +276,12 @@ def get_param_descriptor(appkey, app_instance, our_descriptor, root):
if 'Parameter' in file_parameter:
file_path = os.path.join(os.path.dirname(file_parameter), 'Parameter.py')
the_params = (file_path)

if "self" in the_params:
the_params = the_params[1:]
else:
raise Exception("Unexpected constructor parameters")

key = ET.SubElement(param, 'key')
key.text = our_descriptor
is_choice_type = False
Expand Down Expand Up @@ -448,7 +448,7 @@ def describe_app(app_instance):
with tag('h2', result):
result.append('Example of use')
result.append(app_instance.GetHtmlExample())
if app_instance.GetName() == "HaralickTextureExtraction" :
if app_instance.GetName() == "HaralickTextureExtraction" :
index = result.index("<b>[param] -parameters</b> &lt;string&gt; ")
del result[index +2]
del result[index +1]
Expand Down Expand Up @@ -528,7 +528,7 @@ def get_automatic_ut_from_xml_description(the_root):

if not cliName.startswith("otbcli_"):
raise Exception('Wrong client executable')

rebu = get_list_from_node(dom_model, appkey)
the_result = map(adapt_list_to_string,rebu)
ut_command = cliName + " " + " ".join(the_result)
Expand Down Expand Up @@ -582,7 +582,7 @@ def create_xml_descriptors():
logger.error("Unit test for command %s must be fixed: %s" % (available_app , traceback.format_exc()))
else:
logger.warning("%s is not in white list." % available_app)

else:
if available_app in white_list and not available_app in black_list:
logger.warning("There is no adaptor for %s, check white list and versions" % available_app)
Expand All @@ -595,10 +595,10 @@ def create_xml_descriptors():
ut_command = get_automatic_ut_from_xml_description(the_root)
except:
logger.error("Unit test for command %s must be fixed: %s" % (available_app , traceback.format_exc()))

except Exception, e:
logger.error(traceback.format_exc())

for available_app in otbApplication.Registry.GetAvailableApplications():
try:
fh = open("description/doc/%s.html" % available_app, "w")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Copyright : (C) 2013 by CS Systemes d'information (CS SI)
Email : otb at c-s dot fr (CS SI)
Contributors : Julien Malik (CS SI) - creation of otbspecific
Oscar Picas (CS SI) -
Oscar Picas (CS SI) -
Alexia Mondot (CS SI) - split otbspecific into 2 files
add functions
***************************************************************************
Expand Down Expand Up @@ -45,10 +45,10 @@
from processing.core.ProcessingLog import ProcessingLog
from processing.core.ProcessingConfig import ProcessingConfig

from processing.otb.OTBUtils import (renameValueField,
remove_dependant_choices,
remove_other_choices,
remove_parameter_by_key,
from processing.otb.OTBUtils import (renameValueField,
remove_dependant_choices,
remove_other_choices,
remove_parameter_by_key,
defaultSplit,
split_by_choice,
defaultWrite,
Expand All @@ -58,7 +58,7 @@

def getBinaryMorphologicalOperation(available_app, original_dom_document):
"""
Let ball as only available structype.
Let ball as only available structype.
Split the application according to its filter dilate, erode, opening, closing.
"""
the_root = original_dom_document
Expand All @@ -75,7 +75,7 @@ def getBinaryMorphologicalOperation(available_app, original_dom_document):

def getEdgeExtraction(available_app, original_dom_document):
"""
Let ball as only available filter (not an oval).
Let ball as only available filter (not an oval).
Split the application according to its filter gradient, sobel, touzi.
"""
the_root = original_dom_document
Expand All @@ -92,7 +92,7 @@ def getEdgeExtraction(available_app, original_dom_document):

def getGrayScaleMorphologicalOperation(available_app, original_dom_document):
"""
Let ball as only available structype.
Let ball as only available structype.
Split the application according to its filter dilate, erode, opening, closing.
"""
the_root = original_dom_document
Expand All @@ -108,7 +108,7 @@ def getGrayScaleMorphologicalOperation(available_app, original_dom_document):

def getOrthoRectification(available_app, original_dom_document):
"""
Let only mode auto.
Let only mode auto.
Remove all parameters which should be updated once the input file given.
Split by SRS : EPSG, fit to ortho, lambert-wgs84 and UTM.
Each of these SRS have their own parameters modified in this fonction.
Expand Down Expand Up @@ -382,8 +382,8 @@ def getSarRadiometricCalibration(available_app, original_dom_document):
the_root = original_dom_document
defaultWrite(available_app, the_root)
return [the_root]


def getSmoothing(available_app, original_dom_document):
"""
Split by type (anidif, gaussian, mean)
Expand Down
12 changes: 6 additions & 6 deletions python/plugins/processing/otb/maintenance/OTBTester.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
---------------------
Copyright : (C) 2013 by CS Systemes d'information (CS SI)
Email : otb at c-s dot fr (CS SI)
Contributors : Julien Malik (CS SI)
Contributors : Julien Malik (CS SI)
Oscar Picas (CS SI)
***************************************************************************
* *
Expand Down Expand Up @@ -86,7 +86,7 @@ def mini_clean(item):
return item

the_sets = {key : mini_clean(the_sets[key]) for key in the_sets}

def templatize(item):
if "$" in item:
return Template(item)
Expand Down Expand Up @@ -153,7 +153,7 @@ def mini_clean(item):
key = stringcommand.body[-1].contents
ct = stringcommand.body[-2].contents
ct = mini_clean(ct.lower())

if "$" in ct:
values = LowerTemplate(ct)
else:
Expand Down Expand Up @@ -322,10 +322,10 @@ def test_algos(self):
for intermediate_makefile in resolve_algos[makefile]:
last_context = self.add_make(last_context, intermediate_makefile)
dict_for_algo[makefile] = last_context

for makefile in makefiles:
appz = self.get_apps_with_context(makefile, dict_for_algo[makefile])

for app, context in appz:
if len(context) == 0:
import copy
Expand All @@ -340,7 +340,7 @@ def test_algos(self):
if '$' in test_line or '$' in command_line:
if '$' in command_line:
self.logger.error(command_line)
if '$' in test_line:
if '$' in test_line:
self.logger.warning(test_line)
else:
tests[name_line] = (command_line, test_line)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class AlgoTestCase(unittest.TestCase):
def setUp(self):
self.logger = get_OTB_log()
self.the_files = [os.path.join(os.path.join(os.path.abspath(os.curdir), 'description'),each) for each in os.listdir(os.path.join(os.path.abspath(os.curdir), 'description')) if '.xml' in each]

def tearDown(self):
self.logger = None

Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/parameters/ParameterFactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
(C) 2013 by CS Systemes d'information (CS SI)
Email : volayaf at gmail dot com
otb at c-s dot fr (CS SI)
Contributors : Victor Olaya
Contributors : Victor Olaya
Alexia Mondot (CS SI) - managing the new parameter ParameterMultipleExternalInput
***************************************************************************
* *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def getSafeExportedLayers(self):
layers = self.value.split(";")
if layers == None or len(layers) == 0:
return self.value

return layers


Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/script/ScriptAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def processParameterLine(self, line):
param = ParameterString(tokens[0], desc, default)
elif tokens[1].lower().strip().startswith('longstring'):
default = tokens[1].strip()[len('longstring') + 1:]
param = ParameterString(tokens[0], desc, default, multiline = True)
param = ParameterString(tokens[0], desc, default, multiline = True)
elif tokens[1].lower().strip().startswith('crs'):
default = tokens[1].strip()[len('crs') + 1:]
if not default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
output = r.sub(v, output)
else:
progress.setText('ERROR - Replace dict does not represent a dictionnary. String not changed !' )

if verbose:
progress.setText('OUTPUT = \n%s\n' % output)
progress.setText('OUTPUT = \n%s\n' % output)
125 changes: 63 additions & 62 deletions src/app/pluginmanager/qgspluginmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ QgsPluginManager::QgsPluginManager( QWidget * parent, bool pluginsAreEnabled, Qt

// Preset widgets
leFilter->setFocus( Qt::MouseFocusReason );
wvDetails->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
wvDetails->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );

// Don't restore the last used tab from QSettings
mOptionsListWidget->setCurrentRow( 0 );
Expand Down Expand Up @@ -618,59 +618,59 @@ void QgsPluginManager::showPluginDetails( QStandardItem * item )
if ( ! metadata->value( "plugin_id" ).isEmpty() )
{
html += QString(
"<style>"
" div#stars_bg {"
" background-image: url('file:///home/borys/Pobrane/stars_empty.png');"
" width:92px;"
" height:16px;"
" }"
" div#stars {"
" background-image: url('file:///home/borys/Pobrane/stars_full.png');"
" width:%1px;"
" height:16px;"
" }"
"</style>").arg( metadata->value( "average_vote" ).toFloat() / 5 * 92 );
"<style>"
" div#stars_bg {"
" background-image: url('file:///home/borys/Pobrane/stars_empty.png');"
" width:92px;"
" height:16px;"
" }"
" div#stars {"
" background-image: url('file:///home/borys/Pobrane/stars_full.png');"
" width:%1px;"
" height:16px;"
" }"
"</style>" ).arg( metadata->value( "average_vote" ).toFloat() / 5 * 92 );
html += QString(
"<script>"
" var plugin_id=%1;"
" var vote=0;"
" function ready()"
" {"
" document.getElementById('stars_bg').onmouseover=save_vote;"
" document.getElementById('stars_bg').onmouseout=restore_vote;"
" document.getElementById('stars_bg').onmousemove=change_vote;"
" document.getElementById('stars_bg').onclick=send_vote;"
" };"
" "
" function save_vote(e)"
" {"
" vote = document.getElementById('stars').style.width"
" }"
" "
" function restore_vote(e)"
" {"
" document.getElementById('stars').style.width = vote;"
" }"
" "
" function change_vote(e)"
" {"
" var length = e.x - document.getElementById('stars').getBoundingClientRect().left;"
" max = document.getElementById('stars_bg').getBoundingClientRect().right;"
" if ( length <= max ) document.getElementById('stars').style.width = length + 'px';"
" }"
" "
" function send_vote(e)"
" {"
" save_vote();"
" result = Number(vote.replace('px',''));"
" if (!result) return;"
" result = Math.floor(result/92*5)+1;"
" document.getElementById('send_vote_trigger').href='rpc2://plugin.vote/'+plugin_id+'/'+result;"
" ev=document.createEvent('MouseEvents');"
" ev.initEvent('click', false, true);"
" document.getElementById('send_vote_trigger').dispatchEvent(ev);"
" }"
"</script>").arg( metadata->value( "plugin_id" ) );
"<script>"
" var plugin_id=%1;"
" var vote=0;"
" function ready()"
" {"
" document.getElementById('stars_bg').onmouseover=save_vote;"
" document.getElementById('stars_bg').onmouseout=restore_vote;"
" document.getElementById('stars_bg').onmousemove=change_vote;"
" document.getElementById('stars_bg').onclick=send_vote;"
" };"
" "
" function save_vote(e)"
" {"
" vote = document.getElementById('stars').style.width"
" }"
" "
" function restore_vote(e)"
" {"
" document.getElementById('stars').style.width = vote;"
" }"
" "
" function change_vote(e)"
" {"
" var length = e.x - document.getElementById('stars').getBoundingClientRect().left;"
" max = document.getElementById('stars_bg').getBoundingClientRect().right;"
" if ( length <= max ) document.getElementById('stars').style.width = length + 'px';"
" }"
" "
" function send_vote(e)"
" {"
" save_vote();"
" result = Number(vote.replace('px',''));"
" if (!result) return;"
" result = Math.floor(result/92*5)+1;"
" document.getElementById('send_vote_trigger').href='rpc2://plugin.vote/'+plugin_id+'/'+result;"
" ev=document.createEvent('MouseEvents');"
" ev.initEvent('click', false, true);"
" document.getElementById('send_vote_trigger').dispatchEvent(ev);"
" }"
"</script>" ).arg( metadata->value( "plugin_id" ) );
}

html += "<body onload='ready()'>";
Expand Down Expand Up @@ -764,7 +764,7 @@ void QgsPluginManager::showPluginDetails( QStandardItem * item )
{
html += tr( "%1 rating vote(s)" ).arg( metadata->value( "rating_votes" ) );
}
if ( ! ( metadata->value( "rating_votes" ).isEmpty() || metadata->value( "downloads" ).isEmpty() ) )
if ( !( metadata->value( "rating_votes" ).isEmpty() || metadata->value( "downloads" ).isEmpty() ) )
{
html += ", ";
}
Expand Down Expand Up @@ -1074,12 +1074,12 @@ void QgsPluginManager::setCurrentTab( int idx )
if ( it != mTabDescriptions.end() )
{
tabInfoHTML += "<style>"
"body, table {"
"margin:4px;"
"font-family:verdana;"
"font-size: 12px;"
"}"
"</style>";
"body, table {"
"margin:4px;"
"font-family:verdana;"
"font-size: 12px;"
"}"
"</style>";
// tabInfoHTML += "<style>" + QgsApplication::reportStyleSheet() + "</style>";
tabInfoHTML += it.value();
}
Expand Down Expand Up @@ -1159,8 +1159,9 @@ void QgsPluginManager::on_wvDetails_linkClicked( const QUrl & url )
{
QString params = url.path();
QString response;
QgsPythonRunner::eval( QString( "pyplugin_installer.instance().sendVote('%1', '%2')" ).arg( params.split( "/" )[1] )
.arg( params.split( "/" )[2] ), response );
QgsPythonRunner::eval( QString( "pyplugin_installer.instance().sendVote('%1', '%2')" )
.arg( params.split( "/" )[1] )
.arg( params.split( "/" )[2] ), response );
if ( response == "True" )
{
pushMessage( tr( "Vote sent successfully" ), QgsMessageBar::INFO );
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
void destinationCrsChanged();
// void debugHook();
//! Add a Layer Definition file
void addLayerDefinition ();
void addLayerDefinition();
//! Add a vector layer to the map
void addVectorLayer();
//! Exit Qgis
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolcapture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void QgsMapToolCapture::canvasMoveEvent( QMouseEvent * e )
mSnappingMarker->setIconType( QgsVertexMarker::ICON_CROSS );
mSnappingMarker->setColor( Qt::magenta );
mSnappingMarker->setPenWidth( 3 );
mSnappingMarker->setCenter( snapPointFromResults(snapResults,e->pos()) );
mSnappingMarker->setCenter( snapPointFromResults( snapResults, e->pos() ) );


if ( mCaptureMode != CapturePoint && mTempRubberBand && mCapturing )
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolidentifyaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void QgsMapToolIdentifyAction::canvasReleaseEvent( QMouseEvent *e )
{
// Show the dialog before items are inserted so that items can resize themselves
// according to dialog size also the first time, see also #9377
if( results.size() != 1 || !QSettings().value( "/Map/identifyAutoFeatureForm", false ).toBool() )
if ( results.size() != 1 || !QSettings().value( "/Map/identifyAutoFeatureForm", false ).toBool() )
resultsDialog()->QDialog::show();

QList<IdentifyResult>::const_iterator result;
Expand Down
4 changes: 2 additions & 2 deletions src/core/dxf/qgsdxfpallabeling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
using namespace pal;

QgsDxfPalLabeling::QgsDxfPalLabeling( QgsDxfExport* dxf, const QgsRectangle& bbox, double scale, QGis::UnitType mapUnits )
: QgsPalLabeling()
, mDxfExport( dxf )
: QgsPalLabeling()
, mDxfExport( dxf )
{
QgsMapSettings settings;
settings.setExtent( bbox );
Expand Down
8 changes: 4 additions & 4 deletions src/core/qgscoordinatetransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,10 @@ void QgsCoordinateTransform::transformInPlace(
void QgsCoordinateTransform::transformInPlace( qreal& x, qreal& y, double& z,
TransformDirection direction ) const
{
double xd = (double) x, yd = (double) y;
transformInPlace(xd, yd, z, direction);
x=xd;
y=yd;
double xd = ( double ) x, yd = ( double ) y;
transformInPlace( xd, yd, z, direction );
x = xd;
y = yd;
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmaprenderercache.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* the cache listens to repaintRequested() signals from layer. If triggered, the cache
* removes the rendered image (and disconnects from the layer).
*
* The class is thread-safe (multiple classes can access the same instance safely).
* The class is thread-safe (multiple classes can access the same instance safely).
*
* @note added in 2.4
*/
Expand Down
16 changes: 8 additions & 8 deletions src/core/qgsnetworkaccessmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,25 +279,25 @@ void QgsNetworkAccessManager::setupDefaultProxyAndCache()
{
if ( proxyTypeString == "Socks5Proxy" )
{
proxyType = QNetworkProxy::Socks5Proxy;
proxyType = QNetworkProxy::Socks5Proxy;
}
else if ( proxyTypeString == "HttpProxy" )
{
proxyType = QNetworkProxy::HttpProxy;
proxyType = QNetworkProxy::HttpProxy;
}
else if ( proxyTypeString == "HttpCachingProxy" )
{
proxyType = QNetworkProxy::HttpCachingProxy;
proxyType = QNetworkProxy::HttpCachingProxy;
}
else if ( proxyTypeString == "FtpCachingProxy" )
{
proxyType = QNetworkProxy::FtpCachingProxy;
proxyType = QNetworkProxy::FtpCachingProxy;
}
QgsDebugMsg( QString( "setting proxy %1 %2:%3 %4/%5" )
.arg( proxyType )
.arg( proxyHost ).arg( proxyPort )
.arg( proxyUser ).arg( proxyPassword )
);
.arg( proxyType )
.arg( proxyHost ).arg( proxyPort )
.arg( proxyUser ).arg( proxyPassword )
);
proxy = QNetworkProxy( proxyType, proxyHost, proxyPort, proxyUser, proxyPassword );
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer

struct RangeData
{
RangeData() { mMin = QVariant(0); mMax = QVariant(5); mStep = QVariant(1);}
RangeData() { mMin = QVariant( 0 ); mMax = QVariant( 5 ); mStep = QVariant( 1 );}
RangeData( QVariant theMin, QVariant theMax, QVariant theStep )
: mMin( theMin ), mMax( theMax ), mStep( theStep ) {}

Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgssymbollayerv2utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2778,7 +2778,7 @@ void QgsSymbolLayerV2Utils::blurImageInPlace( QImage& image, const QRect& rect,
}
}

void QgsSymbolLayerV2Utils::premultiplyColor(QColor &rgb, int alpha)
void QgsSymbolLayerV2Utils::premultiplyColor( QColor &rgb, int alpha )
{
int r = 0, g = 0, b = 0;
double alphaFactor = 1.0;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsextentgroupbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "qgsrasterblock.h"

QgsExtentGroupBox::QgsExtentGroupBox( QWidget* parent )
: QgsCollapsibleGroupBox( parent )
: QgsCollapsibleGroupBox( parent )
{
setupUi( this );

Expand Down
6 changes: 3 additions & 3 deletions src/providers/mssql/qgsmssqlfeatureiterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class QgsMssqlFeatureSource : public QgsAbstractFeatureSource

QString mGeometryColName;
QString mGeometryColType;

// current layer name
QString mSchemaName;
QString mTableName;
Expand Down Expand Up @@ -79,10 +79,10 @@ class QgsMssqlFeatureIterator : public QgsAbstractFeatureIteratorFromSource<QgsM
virtual bool close();

protected:

void BuildStatement( const QgsFeatureRequest& request );

QSqlDatabase GetDatabase(QString driver, QString host, QString database, QString username, QString password);
QSqlDatabase GetDatabase( QString driver, QString host, QString database, QString username, QString password );

private:
//! fetch next feature, return true on success
Expand Down
10 changes: 5 additions & 5 deletions src/providers/mssql/qgsmssqlprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ QgsMssqlProvider::QgsMssqlProvider( QString uri )

mSqlWhereClause = anUri.sql();

mDatabase = QgsMssqlProvider::GetDatabase(mDriver, mHost, mDatabaseName, mUserName, mPassword);
mDatabase = QgsMssqlProvider::GetDatabase( mDriver, mHost, mDatabaseName, mUserName, mPassword );

if ( !OpenDatabase( mDatabase ) )
{
Expand Down Expand Up @@ -167,8 +167,8 @@ QgsMssqlProvider::QgsMssqlProvider( QString uri )

QgsMssqlProvider::~QgsMssqlProvider()
{
if (mDatabase.isOpen())
mDatabase.close();
if ( mDatabase.isOpen() )
mDatabase.close();
}

QgsAbstractFeatureSource* QgsMssqlProvider::featureSource() const
Expand Down Expand Up @@ -199,14 +199,14 @@ bool QgsMssqlProvider::OpenDatabase( QSqlDatabase db )
return true;
}

QSqlDatabase QgsMssqlProvider::GetDatabase(QString driver, QString host, QString database, QString username, QString password)
QSqlDatabase QgsMssqlProvider::GetDatabase( QString driver, QString host, QString database, QString username, QString password )
{
QSqlDatabase db;
QString connectionName;

// create a separate database connection for each feature source
QgsDebugMsg( "Creating a separate database connection" );

if ( driver.isEmpty() )
{
if ( host.isEmpty() )
Expand Down
4 changes: 2 additions & 2 deletions src/providers/postgres/qgspostgresconn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -772,8 +772,8 @@ QString QgsPostgresConn::quotedValue( QVariant value )
case QVariant::String:
QString v = value.toString();
v.replace( "'", "''" );
if( v.contains( "\\" ) )
return v.replace( "\\", "\\\\" ).prepend("E'").append("'");
if ( v.contains( "\\" ) )
return v.replace( "\\", "\\\\" ).prepend( "E'" ).append( "'" );
else
return v.prepend( "'" ).append( "'" );
}
Expand Down
2 changes: 1 addition & 1 deletion src/providers/spatialite/qgsspatialiteconnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class QgsSqliteHandle
//
public:
QgsSqliteHandle( sqlite3 * handle, const QString& dbPath, bool shared )
: ref( shared ? 1 : -1 ), sqlite_handle( handle ), mDbPath( dbPath )
: ref( shared ? 1 : -1 ), sqlite_handle( handle ), mDbPath( dbPath )
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/src/python/test_qgspallabeling_canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def setUp(self):
"""Run before each test."""
super(TestCanvasPoint, self).setUp()
self.configTest('pal_canvas', 'sp')


if __name__ == '__main__':
# NOTE: unless PAL_SUITE env var is set all test class methods will be run
Expand Down