Skip to content
Permalink
Browse files

Rename "Db"/"DB" in API to "Database"

Motivations:
- consistency - we generally use expanded names, and this also
matches Qt API which uses Database instead of Db
- avoids unpredictable capitalization throughout API (mix of "Db"
and "DB")
  • Loading branch information
nyalldawson committed Feb 6, 2017
1 parent 64748aa commit d47d31d13cec0b631b20ddae183670abac5f25ef
Showing with 350 additions and 295 deletions.
  1. +36 −0 doc/api_break.dox
  2. +2 −2 python/analysis/openstreetmap/qgsosmimport.sip
  3. +9 −9 python/core/auth/qgsauthmanager.sip
  4. +6 −6 python/core/qgsapplication.sip
  5. +3 −3 python/core/qgscoordinatereferencesystem.sip
  6. +3 −3 python/core/qgsdbfilterproxymodel.sip
  7. +1 −1 python/core/qgsmaplayer.sip
  8. +2 −2 python/core/qgsvectordataprovider.sip
  9. +3 −3 python/core/symbology-ng/qgsstyle.sip
  10. +11 −2 src/analysis/openstreetmap/qgsosmimport.h
  11. +1 −1 src/app/main.cpp
  12. +2 −2 src/app/openstreetmap/qgsosmimportdialog.cpp
  13. +2 −2 src/app/qgisapp.cpp
  14. +2 −2 src/app/qgsbookmarks.cpp
  15. +9 −9 src/app/qgscustomprojectiondialog.cpp
  16. +1 −1 src/app/qgsloadstylefromdbdialog.cpp
  17. +1 −1 src/app/qgsprojectproperties.cpp
  18. +3 −3 src/app/qgsvectorlayerproperties.cpp
  19. +101 −101 src/core/auth/qgsauthmanager.cpp
  20. +10 −10 src/core/auth/qgsauthmanager.h
  21. +12 −12 src/core/qgsapplication.cpp
  22. +6 −6 src/core/qgsapplication.h
  23. +30 −30 src/core/qgscoordinatereferencesystem.cpp
  24. +5 −5 src/core/qgscoordinatereferencesystem.h
  25. +2 −2 src/core/qgscoordinatetransform.cpp
  26. +1 −1 src/core/qgscoordinatetransform_p.h
  27. +4 −4 src/core/qgsdbfilterproxymodel.cpp
  28. +14 −4 src/core/qgsdbfilterproxymodel.h
  29. +1 −1 src/core/qgsdistancearea.cpp
  30. +4 −4 src/core/qgsmaplayer.cpp
  31. +1 −1 src/core/qgsmaplayer.h
  32. +2 −2 src/core/qgsvectordataprovider.cpp
  33. +2 −2 src/core/qgsvectordataprovider.h
  34. +1 −1 src/core/qgsvectorlayer.cpp
  35. +7 −7 src/core/symbology-ng/qgsstyle.cpp
  36. +3 −3 src/core/symbology-ng/qgsstyle.h
  37. +1 −1 src/crssync/main.cpp
  38. +2 −2 src/gui/auth/qgsauthconfigeditor.cpp
  39. +2 −2 src/gui/auth/qgsauthguiutils.cpp
  40. +1 −1 src/gui/qgscredentialdialog.cpp
  41. +2 −2 src/gui/qgsmaplayerstylemanagerwidget.cpp
  42. +5 −5 src/gui/qgsprojectionselector.cpp
  43. +1 −1 src/gui/symbology-ng/qgsstyleexportimportdialog.cpp
  44. +1 −1 src/providers/db2/qgsdb2sourceselect.h
  45. +1 −1 src/providers/mssql/qgsmssqlprovider.h
  46. +1 −1 src/providers/mssql/qgsmssqlsourceselect.h
  47. +1 −1 src/providers/ogr/qgsogrprovider.cpp
  48. +1 −1 src/providers/ogr/qgsogrprovider.h
  49. +1 −1 src/providers/postgres/qgspgsourceselect.h
  50. +2 −2 src/providers/postgres/qgspostgresprovider.h
  51. +1 −1 src/providers/spatialite/qgsspatialiteprovider.h
  52. +1 −1 src/providers/spatialite/qgsspatialitesourceselect.h
  53. +1 −1 src/server/qgsconfigparserutils.cpp
  54. +3 −3 src/server/qgsserver.cpp
  55. +2 −2 tests/src/core/testqgsauthmanager.cpp
  56. +1 −1 tests/src/core/testqgsexpression.cpp
  57. +1 −1 tests/src/core/testqgspointlocator.cpp
  58. +1 −1 tests/src/core/testqgssnappingutils.cpp
  59. +2 −2 tests/src/core/testqgsstyle.cpp
  60. +1 −1 tests/src/core/testqgssymbol.cpp
  61. +2 −2 tests/src/python/test_provider_ogr_gpkg.py
  62. +2 −2 tests/src/python/test_provider_postgres.py
  63. +7 −7 tests/src/python/test_qgsauthsystem.py
@@ -83,6 +83,7 @@ Renamed Classes {#qgis_api_break_3_0_renamed_classes}
<tr><td>QgsCptCityColorRampV2DialogBase<td>QgsCptCityColorRampDialogBase
<tr><td>QgsCurvePolygonV2<td>QgsCurvePolygon
<tr><td>QgsCurveV2<td>QgsCurve
<tr><td>QgsDbFilterProxyModel<td>QgsDatabaseFilterProxyModel
<tr><td>QgsDiagramRendererV2<td>QgsDiagramRenderer
<tr><td>QgsEditorWidgetV2<td>QgsEditorWidget
<tr><td>QgsEllipseSymbolLayerV2<td>QgsEllipseSymbolLayer
@@ -399,6 +400,17 @@ QgsAdvancedDigitizingDockWidget {#qgis_api_break_3_0_QgsAdvancedDigitizin
- canvasReleaseEvent takes now QgsAdvancedDigitizingDockWidget::CaptureMode as second argument.


QgsApplication {#qgis_api_break_3_0_QgsApplication}
--------------

- qgisMasterDbFilePath() was renamed to qgisMasterDatabaseFilePath()
- qgisMasterDatabaseFilePath() was renamed to qgisUserDatabaseFilePath()
- qgisAuthDbFilePath() was renamed to qgisAuthDatabaseFilePath()
- srsDbFilePath() was renamed to srsDatabaseFilePath()
- setAuthDbDirPath() was renamed to setAuthDatabaseDirPath()
- createDB() was renamed to createDatabase()


QgsAtlasComposition {#qgis_api_break_3_0_QgsAtlasComposition}
-------------------

@@ -437,6 +449,19 @@ QgsAuthConfigUriEdit {#qgis_api_break_3_0_QgsAuthConfigUriEdit}
- hasConfigID() has been renamed to hasConfigId()


QgsAuthManager {#qgis_api_break_3_0_QgsAuthManager}
--------------

- authDbConnection() was renamed to authDatabaseConnection()
- authDbConfigTable() was renamed to authDatabaseConfigTable()
- authDbServersTable() was renamed to authDatabaseServersTable()
- authenticationDbPath() was renamed to authenticationDatabasePath()
- masterPasswordHashInDb() was renamed to masterPasswordHashInDatabase()
- scheduledAuthDbErase() was renamed to scheduledAuthDatabaseErase()
- setScheduledAuthDbErase() was renamed to setScheduledAuthDatabaseErase()
- setScheduledAuthDbEraseRequestEmitted() was renamed to setScheduledAuthDatabaseEraseRequestEmitted()


QgsAuthMethod {#qgis_api_break_3_0_QgsAuthMethod}
-------------

@@ -699,6 +724,7 @@ called if changes are made to the CRS database.
- geographicCRSAuthId() has been renamed to geographicCrsAuthId()
- geographicFlag() was renamed to isGeographic()
- axisInverted() was renamed to hasAxisInverted()
- syncDb() was renamed to syncDatabase()


QgsCoordinateTransform {#qgis_api_break_3_0_QgsCoordinateTransform}
@@ -1316,6 +1342,8 @@ screenUpdateRequested() were removed. These members have had no effect for a num
- writeLayerXML() was renamed to writeLayerXml()
- capitaliseLayerName() was renamed to capitalizeLayerName() <!--#spellok-->
- asLayerDefinition(), fromLayerDefinition(), fromLayerDefinitionFile() were moved to QgsLayerDefinition class and renamed to exportLayerDefinitionLayers() resp. loadLayerDefinitionLayers()
- loadNamedStyleFromDb() was renamed to loadNamedStyleFromDatabase()



QgsMapLayerRegistry {#qgis_api_break_3_0_QgsMapLayerRegistry}
@@ -1430,6 +1458,13 @@ QgsOSMElement {#qgis_api_break_3_0_QgsOSMElement}
- elemID() has been renamed to elemId()


QgsOSMXmlImport {#qgis_api_break_3_0_QgsOSMXmlImport}
-------------

- setOutputDbFileName() and outputDbFileName() have been renamed to setOutputDatabaseFileName()
and outputDatabaseFileName()


QgsOwsConnection {#qgis_api_break_3_0_QgsOwsConnection}
----------------

@@ -1906,6 +1941,7 @@ capabilities have been removed, as they were unused and had no effect.
clause fragment which must be evaluated by the provider in order to calculate the default value. In
QGIS 3.0 defaultValue() only returns literal, constant defaultValues. A new method defaultValueClause
has been added which returns the SQL clause fragments which must be evaluated by the provider itself.
- isSaveAndLoadStyleToDBSupported() was renamed to isSaveAndLoadStyleToDatabaseSupported()


QgsVectorJoinInfo {#qgis_api_break_3_0_QgsVectorJoinInfo}
@@ -19,8 +19,8 @@ class QgsOSMXmlImport : public QObject
void setInputXmlFileName( const QString& xmlFileName );
QString inputXmlFileName() const;

void setOutputDbFileName( const QString& dbFileName );
QString outputDbFileName() const;
void setOutputDatabaseFileName( const QString& fileName );
QString outputDatabaseFileName() const;

/**
* Run import. This will parse the XML file and store the data in a SQLite database.
@@ -27,13 +27,13 @@ class QgsAuthManager : QObject
~QgsAuthManager();

/** Set up the application instance of the authentication database connection */
QSqlDatabase authDbConnection() const;
QSqlDatabase authDatabaseConnection() const;

/** Name of the authentication database table that stores configs */
const QString authDbConfigTable() const;
const QString authDatabaseConfigTable() const;

/** Name of the authentication database table that stores server exceptions/configs */
const QString authDbServersTable() const;
const QString authDatabaseServersTable() const;

/** Initialize QCA, prioritize qca-ossl plugin and optionally set up the authentication database */
bool init( const QString& pluginPath = QString::null );
@@ -45,9 +45,9 @@ class QgsAuthManager : QObject
const QString disabledMessage() const;

/** The standard authentication database file in ~/.qgis3/ or defined location
* @see QgsApplication::qgisAuthDbFilePath
* @see QgsApplication::qgisAuthDatabaseFilePath
*/
const QString authenticationDbPath() const;
const QString authenticationDatabasePath() const;

/** Main call to initially set or continually check master password is set
* @note If it is not set, the user is asked for its input
@@ -72,7 +72,7 @@ class QgsAuthManager : QObject
bool masterPasswordIsSet() const;

/** Verify a password hash existing in authentication database */
bool masterPasswordHashInDb() const;
bool masterPasswordHashInDatabase() const;

/** Clear supplied master password
* @note This will not necessarily clear authenticated connections cached in network connection managers
@@ -95,7 +95,7 @@ class QgsAuthManager : QObject

/** Whether there is a scheduled opitonal erase of authentication database.
*/
bool scheduledAuthDbErase();
bool scheduledAuthDatabaseErase();

/** Schedule an optional erase of authentication database, starting when mutex is lockable.
* @note When an erase is scheduled, any attempt to set the master password,
@@ -107,7 +107,7 @@ class QgsAuthManager : QObject
* through the given application, to prompt the erase operation (e.g. via a dialog);
* if no access to user interaction occurs wihtin 90 seconds, it cancels the schedule.
*/
void setScheduledAuthDbErase( bool scheduleErase );
void setScheduledAuthDatabaseErase( bool scheduleErase );

/** Re-emit a signal to schedule an optional erase of authentication database.
* @note This can be called from the slot connected to a previously emitted scheduling signal,
@@ -116,7 +116,7 @@ class QgsAuthManager : QObject
* @param emitted Setting to false will cause signal to be emitted by the schedule timer.
* Setting to true will stop any emitting, but will not stop the schedule timer.
*/
void setScheduledAuthDbEraseRequestEmitted( bool emitted );
void setScheduledAuthDatabaseEraseRequestEmitted( bool emitted );

/** Simple text tag describing authentication system for message logs */
QString authManTag() const;
@@ -168,16 +168,16 @@ static void qtgui_UpdatePyArgv(PyObject *argvlist, int argc, char **argv)
static QString i18nPath();

//! Returns the path to the master qgis.db file.
static QString qgisMasterDbFilePath();
static QString qgisMasterDatabaseFilePath();

//! Returns the path to the settings directory in user's home dir
static QString qgisSettingsDirPath();

//! Returns the path to the user qgis.db file.
static QString qgisUserDbFilePath();
static QString qgisUserDatabaseFilePath();

//! Returns the path to the user authentication database file: qgis-auth.db.
static QString qgisAuthDbFilePath();
static QString qgisAuthDatabaseFilePath();

//! Returns the path to the splash screen image directory.
static QString splashPath();
@@ -186,7 +186,7 @@ static void qtgui_UpdatePyArgv(PyObject *argvlist, int argc, char **argv)
static QString iconsPath();

//! Returns the path to the srs.db file.
static QString srsDbFilePath();
static QString srsDatabaseFilePath();

//! Returns the paths to svg directories.
static QStringList svgPaths();
@@ -287,13 +287,13 @@ static void qtgui_UpdatePyArgv(PyObject *argvlist, int argc, char **argv)
static void setDefaultSvgPaths( const QStringList& pathList );

//! Alters authentication data base directory path - used by 3rd party apps
static void setAuthDbDirPath( const QString& theAuthDbDirPath );
static void setAuthDatabaseDirPath( const QString& theAuthDbDirPath );

//! loads providers
static void initQgis();

//! initialize qgis.db
static bool createDB( QString* errorMessage = 0 );
static bool createDatabase( QString* errorMessage = 0 );

//! Create the users theme folder
static bool createThemeFolder();
@@ -87,13 +87,13 @@
* CRS Database and Custom CRS
* ===========================
*
* The database of CRS shipped with QGIS is stored in a SQLite database (see QgsApplication::srsDbFilePath())
* The database of CRS shipped with QGIS is stored in a SQLite database (see QgsApplication::srsDatabaseFilePath())
* and it is based on the data files maintained by GDAL project (a variety of .csv and .wkt files).
*
* Sometimes it happens that users need to use a CRS definition that is not well known
* or that has been only created with a specific purpose (and thus its definition is not
* available in our database of CRS). Whenever a new CRS definition is seen, it will
* be added to the local databse (in user's home directory, see QgsApplication::qgisUserDbFilePath()).
* be added to the local databse (in user's home directory, see QgsApplication::qgisUserDatabaseFilePath()).
* QGIS also features a GUI for management of local custom CRS definitions.
*
* There are therefore two databases: one for shipped CRS definitions and one for custom CRS definitions.
@@ -496,7 +496,7 @@ class QgsCoordinateReferenceSystem
* negative number of failed updates in case of errors.
* @note This is used internally and should not be necessary to call in client code
*/
static int syncDb();
static int syncDatabase();


/** Save the proj4-string as a custom CRS
@@ -1,11 +1,11 @@
class QgsDbFilterProxyModel: QSortFilterProxyModel
class QgsDatabaseFilterProxyModel: QSortFilterProxyModel
{
%TypeHeaderCode
#include <qgsdbfilterproxymodel.h>
%End
public:
QgsDbFilterProxyModel( QObject* parent /TransferThis/ = 0 );
~QgsDbFilterProxyModel();
QgsDatabaseFilterProxyModel( QObject* parent /TransferThis/ = 0 );
~QgsDatabaseFilterProxyModel();
/** Calls QSortFilterProxyModel::setFilterWildcard and triggers update*/
void _setFilterWildcard( const QString& pattern );
/** Calls QSortFilterProxyModel::setFilterRegExp and triggers update*/
@@ -425,7 +425,7 @@ class QgsMapLayer : QObject
* @param qml will be set to QML style content from database
* @returns true if style was successfully loaded
*/
virtual bool loadNamedStyleFromDb( const QString &db, const QString &uri, QString &qml /Out/ );
virtual bool loadNamedStyleFromDatabase( const QString &db, const QString &uri, QString &qml /Out/ );

/**
* Import the properties of this layer from a QDomDocument
@@ -405,15 +405,15 @@ class QgsVectorDataProvider : QgsDataProvider
* It returns false by default.
* Must be implemented by providers that support saving and loading styles to db returning true
*/
virtual bool isSaveAndLoadStyleToDBSupported() const;
virtual bool isSaveAndLoadStyleToDatabaseSupported() const;

/**
* Checks if the provider supports style removal
* Must be implemented by providers that support delete styles from db returning true
* @note added in QGIS 3.0
* @return true if delete operation is supported by the provider
*/
virtual bool isDeleteStyleFromDbSupported() const;
virtual bool isDeleteStyleFromDatabaseSupported() const;

static QVariant convertValue( QVariant::Type type, const QString& value );

@@ -215,7 +215,7 @@ class QgsStyle : QObject
* \note added in QGIS 3.0
* \see createMemoryDb()
*/
bool createDb( const QString& filename );
bool createDatabase( const QString& filename );

/** Creates a temporary memory database
*
@@ -224,7 +224,7 @@ class QgsStyle : QObject
* \note added in QGIS 3.0
* \see createDb()
*/
bool createMemoryDb();
bool createMemoryDatabase();

/** Creates tables structure for new database
*
@@ -305,7 +305,7 @@ class QgsStyle : QObject

protected:
//! Convenience function to open the DB and return a sqlite3 object
bool openDB( const QString& filename );
bool openDatabase( const QString& filename );

/** Convenience function that would run queries which don't generate return values
* \param query query to run
@@ -42,8 +42,17 @@ class ANALYSIS_EXPORT QgsOSMXmlImport : public QObject
void setInputXmlFileName( const QString& xmlFileName ) { mXmlFileName = xmlFileName; }
QString inputXmlFileName() const { return mXmlFileName; }

void setOutputDbFileName( const QString& dbFileName ) { mDbFileName = dbFileName; }
QString outputDbFileName() const { return mDbFileName; }
/**
* Sets the filename for the output database.
* @see outputDatabaseFileName()
*/
void setOutputDatabaseFileName( const QString& fileName ) { mDbFileName = fileName; }

/**
* Returns the filename for the output database.
* @see setOutputDatabaseFileName()
*/
QString outputDatabaseFileName() const { return mDbFileName; }

/**
* Run import. This will parse the XML file and store the data in a SQLite database.
@@ -1040,7 +1040,7 @@ int main( int argc, char *argv[] )
// set authentication database directory
if ( !authdbdirectory.isEmpty() )
{
QgsApplication::setAuthDbDirPath( authdbdirectory );
QgsApplication::setAuthDatabaseDirPath( authdbdirectory );
}

//set up splash screen
@@ -92,7 +92,7 @@ void QgsOSMImportDialog::onOK()
}

mImport->setInputXmlFileName( editXmlFileName->text() );
mImport->setOutputDbFileName( editDbFileName->text() );
mImport->setOutputDatabaseFileName( editDbFileName->text() );

buttonBox->setEnabled( false );
QApplication::setOverrideCursor( Qt::WaitCursor );
@@ -114,7 +114,7 @@ void QgsOSMImportDialog::onOK()
{
// create connection - this is a bit hacky, sorry for that.
QSettings settings;
settings.setValue( QStringLiteral( "/SpatiaLite/connections/%1/sqlitepath" ).arg( editConnName->text() ), mImport->outputDbFileName() );
settings.setValue( QStringLiteral( "/SpatiaLite/connections/%1/sqlitepath" ).arg( editConnName->text() ), mImport->outputDatabaseFileName() );
}

QMessageBox::information( this, tr( "OpenStreetMap import" ), tr( "Import has been successful." ) );
@@ -634,7 +634,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
qApp->processEvents();
// Do this early on before anyone else opens it and prevents us copying it
QString dbError;
if ( !QgsApplication::createDB( &dbError ) )
if ( !QgsApplication::createDatabase( &dbError ) )
{
QMessageBox::critical( this, tr( "Private qgis.db" ), dbError );
}
@@ -11916,7 +11916,7 @@ void QgisApp::eraseAuthenticationDatabase()
if ( layertree && layertree->customProperty( QStringLiteral( "loading" ) ).toBool() )
{
QgsDebugMsg( "Project loading, skipping auth db erase" );
QgsAuthManager::instance()->setScheduledAuthDbEraseRequestEmitted( false );
QgsAuthManager::instance()->setScheduledAuthDatabaseEraseRequestEmitted( false );
return;
}
}
@@ -69,12 +69,12 @@ QgsBookmarks::QgsBookmarks( QWidget *parent )

// open the database
QSqlDatabase db = QSqlDatabase::addDatabase( QStringLiteral( "QSQLITE" ), QStringLiteral( "bookmarks" ) );
db.setDatabaseName( QgsApplication::qgisUserDbFilePath() );
db.setDatabaseName( QgsApplication::qgisUserDatabaseFilePath() );
if ( !db.open() )
{
QMessageBox::warning( this, tr( "Error" ),
tr( "Unable to open bookmarks database.\nDatabase: %1\nDriver: %2\nDatabase: %3" )
.arg( QgsApplication::qgisUserDbFilePath(),
.arg( QgsApplication::qgisUserDatabaseFilePath(),
db.lastError().driverText(),
db.lastError().databaseText() )
);

0 comments on commit d47d31d

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