Skip to content

Commit

Permalink
[FEATURE] Load and Save SLD & QML styles to DB
Browse files Browse the repository at this point in the history
Work done for ARPA Piemonte - Dipartimento Tematico Geologia e Dissesto
  • Loading branch information
Emilio Loi committed Apr 26, 2013
1 parent 49f1b53 commit 280922a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions doc/INSTALL.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Quantum GIS (QGIS)</TITLE>

<!-- Included /home/el1073/Faunalia/Quantum-GIS-master/doc/style.css -->
<!-- Included /home/el1073/Faunalia/Quantum-GIS/doc/style.css -->
<STYLE TYPE="text/css">
body{ background: white;
color: black;
Expand Down Expand Up @@ -3188,5 +3188,5 @@ <H1>9. Authors and Acknowledgments</H1>

</DIV>
<!-- html code generated by txt2tags 2.6 (http://txt2tags.org) -->
<!-- cmdline: txt2tags -o/home/el1073/Faunalia/Quantum-GIS-master/doc/INSTALL.html -t html /home/el1073/Faunalia/Quantum-GIS-master/doc/INSTALL.t2t -->
<!-- cmdline: txt2tags -o/home/el1073/Faunalia/Quantum-GIS/doc/INSTALL.html -t html /home/el1073/Faunalia/Quantum-GIS/doc/INSTALL.t2t -->
</BODY></HTML>
4 changes: 2 additions & 2 deletions doc/news.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Quantum GIS (QGIS) News</TITLE>

<!-- Included /home/el1073/Faunalia/Quantum-GIS-master/doc/style.css -->
<!-- Included /home/el1073/Faunalia/Quantum-GIS/doc/style.css -->
<STYLE TYPE="text/css">
body{ background: white;
color: black;
Expand Down Expand Up @@ -2613,5 +2613,5 @@ <H1>18. 0.5</H1>
</DIV>

<!-- html code generated by txt2tags 2.6 (http://txt2tags.org) -->
<!-- cmdline: txt2tags -o/home/el1073/Faunalia/Quantum-GIS-master/doc/news.html -t html /home/el1073/Faunalia/Quantum-GIS-master/doc/news.t2t -->
<!-- cmdline: txt2tags -o/home/el1073/Faunalia/Quantum-GIS/doc/news.html -t html /home/el1073/Faunalia/Quantum-GIS/doc/news.t2t -->
</BODY></HTML>
5 changes: 2 additions & 3 deletions src/providers/postgres/qgspostgresprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3307,15 +3307,14 @@ QGISEXTERN bool saveStyle( const QString& uri, const QString& qmlStyle, const QS
result = conn->PQexec( checkQuery );
if( PQntuples( result ) > 0 )
{
sql = QObject::tr( "UPDATE %1 SET useAsDefault=%2, styleQML=XMLPARSE(DOCUMENT %3), styleSLD=XMLPARSE(DOCUMENT %4), description=%5, owner=%6, ui=XMLPARSE(DOCUMENT %7) WHERE f_table_catalog=%8 AND f_table_schema=%9 AND f_table_name=%10 AND f_geometry_column=%11 AND styleName=%12")
sql = QObject::tr( "UPDATE %1 SET useAsDefault=%2, styleQML=XMLPARSE(DOCUMENT %3), styleSLD=XMLPARSE(DOCUMENT %4), description=%5, owner=%6 WHERE f_table_catalog=%7 AND f_table_schema=%8 AND f_table_name=%9 AND f_geometry_column=%10 AND styleName=%11;")
.arg( styleTableName )
.arg( isdef )
.arg( QgsPostgresConn::quotedValue( qmlStyle
) )
.arg( QgsPostgresConn::quotedValue( sldStyle ) )
.arg( QgsPostgresConn::quotedValue( desc ) )
.arg( QgsPostgresConn::quotedValue( owner ) )
.arg( QgsPostgresConn::quotedValue( uiFileContent ) )
.arg( QgsPostgresConn::quotedValue( f_table_catalog ) )
.arg( QgsPostgresConn::quotedValue( f_table_schema ) )
.arg( QgsPostgresConn::quotedValue( f_table_name ) )
Expand Down Expand Up @@ -3401,7 +3400,7 @@ QGISEXTERN int listStyles( const QString& uri, QVector<QString> &ids, QVector<Q
f_geometry_column = dsUri.geometryColumn();

// ORDER BY (CASE WHEN useAsDefault THEN 1 ELSE 2 END), update_time DESC;")
QString selectRelatedQuery = QObject::tr( "SELECT id, styleName, description FROM %1 WHERE f_table_catalog=%2 AND f_table_schema=%3 AND f_table_name=%4 AND f_geometry_column=%5 AND useAsDefault=true;" )
QString selectRelatedQuery = QObject::tr( "SELECT id, styleName, description FROM %1 WHERE f_table_catalog=%2 AND f_table_schema=%3 AND f_table_name=%4 AND f_geometry_column=%5;" )
.arg( styleTableName )
.arg( QgsPostgresConn::quotedValue( f_table_catalog ) )
.arg( QgsPostgresConn::quotedValue( f_table_schema ) )
Expand Down

0 comments on commit 280922a

Please sign in to comment.