@@ -568,8 +568,12 @@ void QgsSpit::import()
568
568
rel_exists1 = ( PQntuples ( res ) > 0 );
569
569
if ( PQresultStatus ( res ) != PGRES_TUPLES_OK )
570
570
{
571
- qWarning ( PQresultErrorMessage ( res ) );
572
- QMessageBox::warning ( &pro, tr (" Import Shapefiles" ), error );
571
+ QString err = PQresultErrorMessage ( res );
572
+ qWarning ( err );
573
+ QMessageBox::warning ( &pro, tr (" Import Shapefiles" ), error + " \n " +
574
+ " <p>Error while executing the SQL:</p><p>" +
575
+ query + " </p><p>The database said:" +
576
+ err + " </p>" );
573
577
pro.setValue ( pro.value () + tblShapefiles->item ( i, ColFEATURECOUNT )->text ().toInt () );
574
578
continue ;
575
579
}
@@ -585,8 +589,13 @@ void QgsSpit::import()
585
589
rel_exists2 = ( PQntuples ( res ) > 0 );
586
590
if ( PQresultStatus ( res ) != PGRES_TUPLES_OK )
587
591
{
588
- qWarning ( PQresultErrorMessage ( res ) );
589
- QMessageBox::warning ( &pro, tr (" Import Shapefiles" ), error );
592
+ QString err = PQresultErrorMessage ( res );
593
+ qWarning ( err );
594
+ QMessageBox::warning ( &pro, tr (" Import Shapefiles" ), error + " \n " +
595
+ " <p>Error while executing the SQL:</p><p>" +
596
+ query + " </p><p>The database said:" +
597
+ err + " </p>" );
598
+
590
599
pro.setValue ( pro.value () + tblShapefiles->item ( i, ColFEATURECOUNT )->text ().toInt () );
591
600
continue ;
592
601
}
@@ -600,8 +609,12 @@ void QgsSpit::import()
600
609
res = PQexec ( pd, query );
601
610
if ( PQresultStatus ( res ) != PGRES_COMMAND_OK )
602
611
{
603
- qWarning ( PQresultErrorMessage ( res ) );
604
- QMessageBox::warning ( &pro, tr (" Import Shapefiles" ), error );
612
+ QString err = PQresultErrorMessage ( res );
613
+ qWarning ( err );
614
+ QMessageBox::warning ( &pro, tr (" Import Shapefiles" ), error + " \n " +
615
+ " <p>Error while executing the SQL:</p><p>" +
616
+ query + " </p><p>The database said:" +
617
+ err + " </p>" );
605
618
pro.setValue ( pro.value () + tblShapefiles->item ( i, ColFEATURECOUNT )->text ().toInt () );
606
619
continue ;
607
620
}
@@ -619,9 +632,13 @@ void QgsSpit::import()
619
632
qWarning ( query );
620
633
if ( PQresultStatus ( res ) != PGRES_COMMAND_OK )
621
634
{
622
- qWarning ( PQresultErrorMessage ( res ) );
635
+ QString err = PQresultErrorMessage ( res );
636
+ qWarning ( err );
623
637
qWarning ( PQresStatus ( PQresultStatus ( res ) ) );
624
- QMessageBox::warning ( &pro, tr (" Import Shapefiles" ), error );
638
+ QMessageBox::warning ( &pro, tr (" Import Shapefiles" ), error + " \n " +
639
+ " <p>Error while executing the SQL:</p><p>" +
640
+ query + " </p><p>The database said:" +
641
+ err + " </p>" );
625
642
pro.setValue ( pro.value () + tblShapefiles->item ( i, ColFEATURECOUNT )->text ().toInt () );
626
643
continue ;
627
644
}
@@ -655,8 +672,12 @@ void QgsSpit::import()
655
672
res = PQexec ( pd, ( const char * ) query );
656
673
if ( PQresultStatus ( res ) != PGRES_COMMAND_OK )
657
674
{
658
- qWarning ( PQresultErrorMessage ( res ) );
659
- QMessageBox::warning ( &pro, tr (" Import Shapefiles" ), error );
675
+ QString err = PQresultErrorMessage ( res );
676
+ qWarning ( err );
677
+ QMessageBox::warning ( &pro, tr (" Import Shapefiles" ), error + " \n " +
678
+ " <p>Error while executing the SQL:</p><p>" +
679
+ query + " </p><p>The database said:" +
680
+ err + " </p>" );
660
681
pro.setValue ( pro.value () + tblShapefiles->item ( i, ColFEATURECOUNT )->text ().toInt () );
661
682
continue ;
662
683
}
@@ -676,8 +697,12 @@ void QgsSpit::import()
676
697
res = PQexec ( pd, ( const char * ) query );
677
698
if ( PQresultStatus ( res ) != PGRES_COMMAND_OK )
678
699
{
679
- qWarning ( PQresultErrorMessage ( res ) );
680
- QMessageBox::warning ( &pro, tr (" Import Shapefiles" ), error );
700
+ QString err = PQresultErrorMessage ( res );
701
+ qWarning ( err );
702
+ QMessageBox::warning ( &pro, tr (" Import Shapefiles" ), error + " \n " +
703
+ " <p>Error while executing the SQL:</p><p>" +
704
+ query + " </p><p>The database said:" +
705
+ err + " </p>" );
681
706
pro.setValue ( pro.value () + tblShapefiles->item ( i, ColFEATURECOUNT )->text ().toInt () );
682
707
continue ;
683
708
}
@@ -693,8 +718,12 @@ void QgsSpit::import()
693
718
res = PQexec ( pd, query );
694
719
if ( PQresultStatus ( res ) != PGRES_COMMAND_OK )
695
720
{
696
- qWarning ( PQresultErrorMessage ( res ) );
697
- QMessageBox::warning ( &pro, tr (" Import Shapefiles" ), error );
721
+ QString err = PQresultErrorMessage ( res );
722
+ qWarning ( err );
723
+ QMessageBox::warning ( &pro, tr (" Import Shapefiles" ), error + " \n " +
724
+ " <p>Error while executing the SQL:</p><p>" +
725
+ query + " </p><p>The database said:" +
726
+ err + " </p>" );
698
727
}
699
728
else
700
729
{
@@ -715,8 +744,12 @@ void QgsSpit::import()
715
744
res = PQexec ( pd, query );
716
745
if ( PQresultStatus ( res ) != PGRES_COMMAND_OK )
717
746
{
718
- qWarning ( PQresultErrorMessage ( res ) );
719
- QMessageBox::warning ( &pro, tr (" Import Shapefiles" ), error );
747
+ QString err = PQresultErrorMessage ( res );
748
+ qWarning ( err );
749
+ QMessageBox::warning ( &pro, tr (" Import Shapefiles" ), error + " \n " +
750
+ " <p>Error while executing the SQL:</p><p>" +
751
+ query + " </p><p>The database said:" +
752
+ err + " </p>" );
720
753
continue ;
721
754
}
722
755
else
@@ -745,8 +778,12 @@ void QgsSpit::import()
745
778
res = PQexec ( pd, query );
746
779
if ( PQresultStatus ( res ) != PGRES_COMMAND_OK )
747
780
{
748
- qWarning ( PQresultErrorMessage ( res ) );
749
- QMessageBox::warning ( &pro, tr (" Import Shapefiles" ), error );
781
+ QString err = PQresultErrorMessage ( res );
782
+ qWarning ( err );
783
+ QMessageBox::warning ( &pro, tr (" Import Shapefiles" ), error + " \n " +
784
+ " <p>Error while executing the SQL:</p><p>" +
785
+ query + " </p><p>The database said:" +
786
+ err + " </p>" );
750
787
}
751
788
else
752
789
{
0 commit comments